Skip to content

Commit ec70a40

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
1 parent 70ad17a commit ec70a40

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/IDE/CompletionInstance.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,11 @@ bool swift::ide::CompletionInstance::performOperation(
324324
// source text. That breaks an invariant of syntax tree building.
325325
Invocation.getLangOptions().BuildSyntaxTree = false;
326326

327+
// This validation may call stat(2) many times. Disable it to prevent
328+
// performance regression.
329+
Invocation.getSearchPathOptions().DisableModulesValidateSystemDependencies =
330+
true;
331+
327332
// FIXME: ASTScopeLookup doesn't support code completion yet.
328333
Invocation.disableASTScopeLookup();
329334

0 commit comments

Comments
 (0)