golang/go

x/tools/gopls: Completion: add insert-replace support (insertReplaceEdit)

Offen

#40.871 geöffnet am 18.08.2020

 (15 Kommentare) (25 Reaktionen) (0 zugewiesene Personen)Go (19.008 Forks)batch import
FeatureRequestToolsgoplshelp wanted

Repository-Metriken

Stars
 (133.883 Sterne)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Currently gopls is overwriting the surrounding suffix (in addition to prefix) when inserting candidates:

// completing to "food" currently results in "food" instead of "foodoo"
f<>oo

I think it's from https://go-review.googlesource.com/c/tools/+/208501 changing the surrounding's range from [ident.Pos(), c.pos] to [ident.Pos(), ident.End()].

/cc @heschik

Contributor Guide