Skip to content

Commit

Permalink
Fix invalid version hash for vendored packages
Browse files Browse the repository at this point in the history
Signed-off-by: Tobias Guggenmos <[email protected]>
  • Loading branch information
slrtbtfs committed Jan 24, 2020
1 parent 52ee212 commit f273bfa
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion vendored/go-tools.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
I418463feb3e2dded191b6f1770dd7b9e44c2deca
1b668f2091859760ba5554bd33f4af390d29ee8b
10 changes: 7 additions & 3 deletions vendored/go-tools/lsp/completion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@ func (r *runner) Completion(t *testing.T, src span.Span, test tests.Completion,
got := r.callCompletion(t, src, func(opts *source.Options) {
opts.DeepCompletion = false
opts.Matcher = source.CaseInsensitive
opts.Literal = strings.Contains(string(src.URI()), "literal")
opts.UnimportedCompletion = false
opts.InsertTextFormat = protocol.PlainTextTextFormat
// Only enable literal completions if in the completion literals tests.
// TODO(rstambler): Separate out literal completion tests.
if strings.Contains(string(src.URI()), "literal") {
opts.InsertTextFormat = protocol.SnippetTextFormat
}

})
if !strings.Contains(string(src.URI()), "builtins") {
got = tests.FilterBuiltins(got)
Expand All @@ -31,7 +37,6 @@ func (r *runner) CompletionSnippet(t *testing.T, src span.Span, expected tests.C
opts.Placeholders = placeholders
opts.DeepCompletion = true
opts.Matcher = source.Fuzzy
opts.Literal = true
opts.UnimportedCompletion = false
})
got := tests.FindItem(list, *items[expected.CompletionItem])
Expand Down Expand Up @@ -103,7 +108,6 @@ func (r *runner) RankCompletion(t *testing.T, src span.Span, test tests.Completi
got := r.callCompletion(t, src, func(opts *source.Options) {
opts.DeepCompletion = true
opts.Matcher = source.Fuzzy
opts.Literal = true
opts.UnimportedCompletion = false
})
want := expected(t, test, items)
Expand Down
2 changes: 1 addition & 1 deletion vendored/go-tools/lsp/source/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ func Completion(ctx context.Context, snapshot Snapshot, fh FileHandle, pos proto
documentation: opts.CompletionDocumentation,
fullDocumentation: opts.HoverKind == FullDocumentation,
placeholders: opts.Placeholders,
literal: opts.Literal,
literal: opts.InsertTextFormat == protocol.SnippetTextFormat,
budget: opts.CompletionBudget,
},
// default to a matcher that always matches
Expand Down
4 changes: 0 additions & 4 deletions vendored/go-tools/lsp/source/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ var (
DeepCompletion: true,
UnimportedCompletion: true,
CompletionDocumentation: true,
Literal: true,
}
DefaultHooks = Hooks{
ComputeEdits: myers.ComputeEdits,
Expand Down Expand Up @@ -159,9 +158,6 @@ type UserOptions struct {
// Placeholders adds placeholders to parameters and structs in completion
// results.
Placeholders bool

// Literal enables completion for map, slice, and function literals.
Literal bool
}

type completionOptions struct {
Expand Down
9 changes: 6 additions & 3 deletions vendored/go-tools/lsp/source/source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,14 @@ func (r *runner) Completion(t *testing.T, src span.Span, test tests.Completion,
}
_, got := r.callCompletion(t, src, func(opts *source.Options) {
opts.Matcher = source.CaseInsensitive
opts.Literal = strings.Contains(string(src.URI()), "literal")
opts.DeepCompletion = false
opts.UnimportedCompletion = false
opts.InsertTextFormat = protocol.PlainTextTextFormat
// Only enable literal completions if in the completion literals tests.
// TODO(rstambler): Separate out literal completion tests.
if strings.Contains(string(src.URI()), "literal") {
opts.InsertTextFormat = protocol.SnippetTextFormat
}
})
if !strings.Contains(string(src.URI()), "builtins") {
got = tests.FilterBuiltins(got)
Expand All @@ -122,7 +127,6 @@ func (r *runner) CompletionSnippet(t *testing.T, src span.Span, expected tests.C
_, list := r.callCompletion(t, src, func(opts *source.Options) {
opts.Placeholders = placeholders
opts.DeepCompletion = true
opts.Literal = true
})
got := tests.FindItem(list, *items[expected.CompletionItem])
want := expected.PlainSnippet
Expand Down Expand Up @@ -217,7 +221,6 @@ func (r *runner) RankCompletion(t *testing.T, src span.Span, test tests.Completi
_, got := r.callCompletion(t, src, func(opts *source.Options) {
opts.DeepCompletion = true
opts.Matcher = source.Fuzzy
opts.Literal = true
})
if msg := tests.CheckCompletionOrder(want, got, true); msg != "" {
t.Errorf("%s: %s", src, msg)
Expand Down

0 comments on commit f273bfa

Please sign in to comment.