summaryrefslogtreecommitdiffstats
path: root/source/slang/slang.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-07-08 19:33:51 -0700
committerGitHub <noreply@github.com>2024-07-08 19:33:51 -0700
commita453fadfb373499f08779dd7df8f2347d292fd91 (patch)
tree6fa9ad6f395e68b5dd8eb84f67dd8b992dabae3f /source/slang/slang.cpp
parent4a49769c5b6b351b3c1c9a9968b3926839504606 (diff)
Language server performance and document symbol fix. (#4561)
Diffstat (limited to 'source/slang/slang.cpp')
-rw-r--r--source/slang/slang.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp
index 67492d9b2..adfa031f5 100644
--- a/source/slang/slang.cpp
+++ b/source/slang/slang.cpp
@@ -3669,8 +3669,14 @@ RefPtr<Module> Linkage::findOrImportModule(
// Look for a precompiled module first, if not exist, load from source.
- for (int checkBinaryModule = 1; checkBinaryModule >= 0; checkBinaryModule--)
+ bool shouldCheckBinaryModuleSettings[2] = { true, false };
+
+ for (auto checkBinaryModule : shouldCheckBinaryModuleSettings)
{
+ // When in language server, we always prefer to use source module if it is available.
+ if (isInLanguageServer())
+ checkBinaryModule = !checkBinaryModule;
+
// Try without translating `_` to `-` first, if that fails, try translating.
for (int translateUnderScore = 0; translateUnderScore <= 1; translateUnderScore++)
{