summaryrefslogtreecommitdiffstats
path: root/source/core
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-12-05 10:06:19 -0800
committerGitHub <noreply@github.com>2023-12-05 10:06:19 -0800
commit1050e0eb96d6c8e7a6cfb253458155e1014625c3 (patch)
treece6c3cbde591759fa2fe2aeb05cb132e50a9a419 /source/core
parent4fb3b10b81cf8c976ebd1ebb7fcde7708f022957 (diff)
Support `include` for pulling file into the current module. (#3377)
* Support `include` for pulling file into the current module. * Add auto-completion, hover info and goto-def support. * Disable warning for missing `module` declaration for now. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/core')
-rw-r--r--source/core/slang-io.cpp11
-rw-r--r--source/core/slang-io.h2
2 files changed, 13 insertions, 0 deletions
diff --git a/source/core/slang-io.cpp b/source/core/slang-io.cpp
index 4ef5ecc2d..c546dd059 100644
--- a/source/core/slang-io.cpp
+++ b/source/core/slang-io.cpp
@@ -794,6 +794,17 @@ namespace Slang
}
#endif
+ bool Path::equals(String path1, String path2)
+ {
+ Path::getCanonical(path1, path1);
+ Path::getCanonical(path2, path2);
+#if SLANG_WINDOWS_FAMILY
+ return path1.getUnownedSlice().caseInsensitiveEquals(path2.getUnownedSlice());
+#else
+ return path1 == path2;
+#endif
+ }
+
/// Gets the path to the executable that was invoked that led to the current threads execution
/// If run from a shared library/dll will be the path of the executable that loaded said library
/// @param outPath Pointer to buffer to hold the path.
diff --git a/source/core/slang-io.h b/source/core/slang-io.h
index 30c477730..125ac135c 100644
--- a/source/core/slang-io.h
+++ b/source/core/slang-io.h
@@ -211,6 +211,8 @@ namespace Slang
/// @param path
/// @return SLANG_OK if file or directory is removed
static SlangResult remove(const String& path);
+
+ static bool equals(String path1, String path2);
};
struct URI