golang/go

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

Ouverte

#40 871 ouverte le 18 août 2020

 (15 commentaires) (25 réactions) (0 personne assignée)Go (19 008 forks)batch import
FeatureRequestToolsgoplshelp wanted

Métriques du dépôt

Stars
 (133 883 étoiles)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

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

Guide contributeur