Skip to content

Commit 9ff8bb9

Browse files
committed
[CodeCompletion] Disable module system headers validation
This validation may call many `stat(2)`. Since we don't expect system files are edited. Disable it for code completion, even if they are edited, they are validated when the user manually build the project. rdar://problem/58550697 (cherry picked from commit ec70a40)
1 parent 3cec742 commit 9ff8bb9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/IDE/CompletionInstance.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,11 @@ bool swift::ide::CompletionInstance::performOperation(
293293
// source text. That breaks an invariant of syntax tree building.
294294
Invocation.getLangOptions().BuildSyntaxTree = false;
295295

296+
// This validation may call stat(2) many times. Disable it to prevent
297+
// performance regression.
298+
Invocation.getSearchPathOptions().DisableModulesValidateSystemDependencies =
299+
true;
300+
296301
// FIXME: ASTScopeLookup doesn't support code completion yet.
297302
Invocation.disableASTScopeLookup();
298303

0 commit comments

Comments
 (0)