mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[SourceKit] Add a global-configuration request to control SourceKit's behavior around .swiftsourceinfo files
SwiftSourceInfo files provide source location information for decls coming from loaded modules. For most IDE use cases it either has an undesirable impact on performance with no benefit (code completion), results in stale locations being used instead of more up-to-date indexer locations (cursor info), or has no observable effect (live diagnostics, which are filtered to just those with a location in the primary file). For non-IDE clients of SourceKit though, cursor info providing declaration locations for symbols from other modules is useful, so add a global configuration option (and a new request to set it) to control whether .swiftsourceinfo files are loaded or not based on use case (they are loaded by default).
This commit is contained in:
@@ -263,8 +263,9 @@ SwiftLangSupport::SwiftLangSupport(SourceKit::Context &SKCtx)
|
||||
|
||||
Stats = std::make_shared<SwiftStatistics>();
|
||||
EditorDocuments = std::make_shared<SwiftEditorDocumentFileMap>();
|
||||
ASTMgr = std::make_shared<SwiftASTManager>(EditorDocuments, Stats,
|
||||
RuntimeResourcePath);
|
||||
ASTMgr = std::make_shared<SwiftASTManager>(EditorDocuments,
|
||||
SKCtx.getGlobalConfiguration(),
|
||||
Stats, RuntimeResourcePath);
|
||||
// By default, just use the in-memory cache.
|
||||
CCCache->inMemory = llvm::make_unique<ide::CodeCompletionCache>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user