Skip to content

Commit f273bfa

Browse files
committed
Fix invalid version hash for vendored packages
Signed-off-by: Tobias Guggenmos <[email protected]>
1 parent 52ee212 commit f273bfa

File tree

5 files changed

+15
-12
lines changed

5 files changed

+15
-12
lines changed

Diff for: vendored/go-tools.version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
I418463feb3e2dded191b6f1770dd7b9e44c2deca
1+
1b668f2091859760ba5554bd33f4af390d29ee8b

Diff for: vendored/go-tools/lsp/completion_test.go

+7-3
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,14 @@ func (r *runner) Completion(t *testing.T, src span.Span, test tests.Completion,
1414
got := r.callCompletion(t, src, func(opts *source.Options) {
1515
opts.DeepCompletion = false
1616
opts.Matcher = source.CaseInsensitive
17-
opts.Literal = strings.Contains(string(src.URI()), "literal")
1817
opts.UnimportedCompletion = false
18+
opts.InsertTextFormat = protocol.PlainTextTextFormat
19+
// Only enable literal completions if in the completion literals tests.
20+
// TODO(rstambler): Separate out literal completion tests.
21+
if strings.Contains(string(src.URI()), "literal") {
22+
opts.InsertTextFormat = protocol.SnippetTextFormat
23+
}
24+
1925
})
2026
if !strings.Contains(string(src.URI()), "builtins") {
2127
got = tests.FilterBuiltins(got)
@@ -31,7 +37,6 @@ func (r *runner) CompletionSnippet(t *testing.T, src span.Span, expected tests.C
3137
opts.Placeholders = placeholders
3238
opts.DeepCompletion = true
3339
opts.Matcher = source.Fuzzy
34-
opts.Literal = true
3540
opts.UnimportedCompletion = false
3641
})
3742
got := tests.FindItem(list, *items[expected.CompletionItem])
@@ -103,7 +108,6 @@ func (r *runner) RankCompletion(t *testing.T, src span.Span, test tests.Completi
103108
got := r.callCompletion(t, src, func(opts *source.Options) {
104109
opts.DeepCompletion = true
105110
opts.Matcher = source.Fuzzy
106-
opts.Literal = true
107111
opts.UnimportedCompletion = false
108112
})
109113
want := expected(t, test, items)

Diff for: vendored/go-tools/lsp/source/completion.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ func Completion(ctx context.Context, snapshot Snapshot, fh FileHandle, pos proto
466466
documentation: opts.CompletionDocumentation,
467467
fullDocumentation: opts.HoverKind == FullDocumentation,
468468
placeholders: opts.Placeholders,
469-
literal: opts.Literal,
469+
literal: opts.InsertTextFormat == protocol.SnippetTextFormat,
470470
budget: opts.CompletionBudget,
471471
},
472472
// default to a matcher that always matches

Diff for: vendored/go-tools/lsp/source/options.go

-4
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ var (
8181
DeepCompletion: true,
8282
UnimportedCompletion: true,
8383
CompletionDocumentation: true,
84-
Literal: true,
8584
}
8685
DefaultHooks = Hooks{
8786
ComputeEdits: myers.ComputeEdits,
@@ -159,9 +158,6 @@ type UserOptions struct {
159158
// Placeholders adds placeholders to parameters and structs in completion
160159
// results.
161160
Placeholders bool
162-
163-
// Literal enables completion for map, slice, and function literals.
164-
Literal bool
165161
}
166162

167163
type completionOptions struct {

Diff for: vendored/go-tools/lsp/source/source_test.go

+6-3
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,14 @@ func (r *runner) Completion(t *testing.T, src span.Span, test tests.Completion,
106106
}
107107
_, got := r.callCompletion(t, src, func(opts *source.Options) {
108108
opts.Matcher = source.CaseInsensitive
109-
opts.Literal = strings.Contains(string(src.URI()), "literal")
110109
opts.DeepCompletion = false
111110
opts.UnimportedCompletion = false
111+
opts.InsertTextFormat = protocol.PlainTextTextFormat
112+
// Only enable literal completions if in the completion literals tests.
113+
// TODO(rstambler): Separate out literal completion tests.
114+
if strings.Contains(string(src.URI()), "literal") {
115+
opts.InsertTextFormat = protocol.SnippetTextFormat
116+
}
112117
})
113118
if !strings.Contains(string(src.URI()), "builtins") {
114119
got = tests.FilterBuiltins(got)
@@ -122,7 +127,6 @@ func (r *runner) CompletionSnippet(t *testing.T, src span.Span, expected tests.C
122127
_, list := r.callCompletion(t, src, func(opts *source.Options) {
123128
opts.Placeholders = placeholders
124129
opts.DeepCompletion = true
125-
opts.Literal = true
126130
})
127131
got := tests.FindItem(list, *items[expected.CompletionItem])
128132
want := expected.PlainSnippet
@@ -217,7 +221,6 @@ func (r *runner) RankCompletion(t *testing.T, src span.Span, test tests.Completi
217221
_, got := r.callCompletion(t, src, func(opts *source.Options) {
218222
opts.DeepCompletion = true
219223
opts.Matcher = source.Fuzzy
220-
opts.Literal = true
221224
})
222225
if msg := tests.CheckCompletionOrder(want, got, true); msg != "" {
223226
t.Errorf("%s: %s", src, msg)

0 commit comments

Comments
 (0)