golang/go

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

オープン

#40,871 opened on 2020/08/18

 (15 件のコメント) (25 件のリアクション) (0 人の担当者)Go (19,008 件のフォーク)batch import
FeatureRequestToolsgoplshelp wanted

Repository metrics

Stars
 (133,883 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

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

コントリビューターガイド