summaryrefslogtreecommitdiffstats
path: root/source/slang/slang.cpp
diff options
context:
space:
mode:
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++)
{