golang/go

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

Aperta

#40.871 aperta il 18 ago 2020

 (15 commenti) (25 reazioni) (0 assegnatari)Go (19.008 fork)batch import
FeatureRequestToolsgoplshelp wanted

Metriche repository

Star
 (133.883 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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

Guida contributor