mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[IDE] Implement completion-like cursor info for ValueDecls
This brings up the ability to compute cursor info results using the completion-like type checking paradigm, which an reuse ASTContexts and doesn’t need to type check the entire file. For now, the new implementation only supports cursor info on `ValueDecl`s (not on references) because they were easiest to implement. More cursor info kinds are coming soon. At the moment, we only run the new implementation in a verification mode: It is only invoked in assert toolchains and when run, we check that the results are equivalent to the old implementation. Once more cursor info kinds are implemented and if the SourceKit stress tester doesn’t find any verification issues, we can enable the new implementation, falling back to the old implementation if the new one didn’t produce any results.
This commit is contained in:
@@ -652,7 +652,8 @@ std::unique_ptr<llvm::MemoryBuffer> SwiftASTManager::getMemoryBuffer(
|
||||
StringRef Filename,
|
||||
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> FileSystem,
|
||||
std::string &Error) {
|
||||
return Impl.getMemoryBuffer(Filename, FileSystem, Error);
|
||||
return Impl.getFileContent(Filename, /*IsPrimary=*/false, FileSystem, Error)
|
||||
.Buffer;
|
||||
}
|
||||
|
||||
static FrontendInputsAndOutputs
|
||||
|
||||
Reference in New Issue
Block a user