Skip to content

Commit 108b9c3

Browse files
committed
[CodeCompletion] Open virtual file for fast completion buffers
This improves diangostics message for completion traces
1 parent 8f38105 commit 108b9c3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/IDE/CompletionInstance.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,9 @@ bool CompletionInstance::performCachedOperaitonIfPossible(
234234

235235
auto newBufferID =
236236
SM.addMemBufferCopy(sourceText, completionBuffer->getBufferIdentifier());
237+
SM.openVirtualFile(SM.getLocForBufferStart(newBufferID),
238+
tmpSM.getDisplayNameForLoc(startLoc),
239+
tmpSM.getLineAndColumn(startLoc).first - 1);
237240
SM.setCodeCompletionPoint(newBufferID, newOffset);
238241

239242
// Construct dummy scopes. We don't need to restore the original scope

0 commit comments

Comments
 (0)