[CodeCompletion] Provide known module source file information

* 'CodeCompletionContext' now has 'requiresSourceFileInfo()' flag
* When 'true', 'SourceFiles' is populated.
* 'SourceFiles' is a list of pairs of a known module source
  file path and its up-to-date-ness
* Clients (i.e. 'CodeCompletionConsumer') can retrieve it from
  'CodeCompletionContext' in 'handleResults'
* Each completion item now has 'SourceFilePath' property
* C-APIs to get those informations
This commit is contained in:
Rintaro Ishizaki
2021-02-16 15:27:11 -08:00
parent d6eec880cb
commit f8751d466e
14 changed files with 386 additions and 62 deletions

View File

@@ -1169,9 +1169,10 @@ Completion *CompletionBuilder::finish() {
base = SwiftResult(
semanticContext, flair, current.getNumBytesToErase(), completionString,
current.getAssociatedDeclKind(), current.isSystem(),
current.getModuleName(), current.getNotRecommendedReason(),
current.getBriefDocComment(), current.getAssociatedUSRs(),
current.getDeclKeywords(), typeRelation, opKind);
current.getModuleName(), current.getSourceFilePath(),
current.getNotRecommendedReason(), current.getBriefDocComment(),
current.getAssociatedUSRs(), current.getDeclKeywords(), typeRelation,
opKind);
} else {
base = SwiftResult(current.getKind(), semanticContext, flair,
current.getNumBytesToErase(), completionString,