Skip to content

Commit 355a02f

Browse files
Skip adding import for symbols in same file (#4127)
1 parent 5401b58 commit 355a02f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

private/buf/buflsp/completion.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ func typeReferencesToCompletionItems(
680680
symbolFile := symbol.ir.File().Path()
681681
_, hasImport := currentImportPaths[symbolFile]
682682
var additionalTextEdits []protocol.TextEdit
683-
if !hasImport {
683+
if !hasImport && symbolFile != current.ir.Path() {
684684
additionalTextEdits = append(additionalTextEdits, protocol.TextEdit{
685685
NewText: "import " + `"` + symbolFile + `";` + "\n",
686686
Range: protocol.Range{

0 commit comments

Comments
 (0)