Skip to content

Commit c8375d7

Browse files
committed
all: add InsertTextFormat prefix to InsertTextFormat enum
1 parent 72847d4 commit c8375d7

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

language.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,24 +75,24 @@ type CompletionList struct {
7575
type InsertTextFormat float64
7676

7777
const (
78-
// TextFormatPlainText is the primary text to be inserted is treated as a plain string.
79-
TextFormatPlainText InsertTextFormat = 1
78+
// InsertTextFormatPlainText is the primary text to be inserted is treated as a plain string.
79+
InsertTextFormatPlainText InsertTextFormat = 1
8080

81-
// TextFormatSnippet is the primary text to be inserted is treated as a snippet.
81+
// InsertTextFormatSnippet is the primary text to be inserted is treated as a snippet.
8282
//
8383
// A snippet can define tab stops and placeholders with `$1`, `$2`
8484
// and `${3:foo}`. `$0` defines the final tab stop, it defaults to
8585
// the end of the snippet. Placeholders with equal identifiers are linked,
8686
// that is typing in one will update others too.
87-
TextFormatSnippet InsertTextFormat = 2
87+
InsertTextFormatSnippet InsertTextFormat = 2
8888
)
8989

9090
// String implements fmt.Stringer.
9191
func (tf InsertTextFormat) String() string {
9292
switch tf {
93-
case TextFormatPlainText:
93+
case InsertTextFormatPlainText:
9494
return "PlainText"
95-
case TextFormatSnippet:
95+
case InsertTextFormatSnippet:
9696
return "Snippet"
9797
default:
9898
return strconv.FormatFloat(float64(tf), 'f', -10, 64)

language_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ func testCompletionList(t *testing.T, marshal marshalFunc, unmarshal unmarshalFu
289289
Documentation: "Detail a human-readable string with additional information about this item, like type or symbol information.",
290290
FilterText: "Detail",
291291
InsertText: "",
292-
InsertTextFormat: TextFormatSnippet,
292+
InsertTextFormat: InsertTextFormatSnippet,
293293
Kind: FieldCompletion,
294294
Label: "Detail",
295295
Preselect: true,
@@ -400,12 +400,12 @@ func TestInsertTextFormat_String(t *testing.T) {
400400
}{
401401
{
402402
name: "PlainText",
403-
k: TextFormatPlainText,
403+
k: InsertTextFormatPlainText,
404404
want: "PlainText",
405405
},
406406
{
407407
name: "Snippet",
408-
k: TextFormatSnippet,
408+
k: InsertTextFormatSnippet,
409409
want: "Snippet",
410410
},
411411
{
@@ -592,7 +592,7 @@ func testCompletionItem(t *testing.T, marshal marshalFunc, unmarshal unmarshalFu
592592
Documentation: "Detail a human-readable string with additional information about this item, like type or symbol information.",
593593
FilterText: "Detail",
594594
InsertText: "testInsert",
595-
InsertTextFormat: TextFormatSnippet,
595+
InsertTextFormat: InsertTextFormatSnippet,
596596
InsertTextMode: InsertTextModeAsIs,
597597
Kind: FieldCompletion,
598598
Label: "Detail",

0 commit comments

Comments
 (0)