Skip to content

Commit 3561bf2

Browse files
authored
LSP skip completions on options (#4145)
1 parent 84e2968 commit 3561bf2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

private/buf/buflsp/completion.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,12 @@ func completionItemsForDef(ctx context.Context, file *file, declPath []ast.DeclA
344344
slog.String("kind", parentDef.Classify().String()),
345345
)
346346

347+
if offsetInSpan(def.Options().Span(), offset) {
348+
// TODO: Handle option completions within options block.
349+
file.lsp.logger.DebugContext(ctx, "completion: ignoring options block completion")
350+
return nil
351+
}
352+
347353
// Limit completions based on the following heuristic:
348354
// - Show keywords for the first values
349355
// - Show types if no type declaration and at first, or second position with field modifier.

0 commit comments

Comments
 (0)