mirror of
https://github.com/golang/go
synced 2024-10-01 04:08:32 -06:00
02335f11d5
Previously we unconditionally qualified literal candidate types with their package. For example: var buf *bytes.Buffer buf = &bytes.Bu<> would complete to: buf = &bytes.bytes.Buffer{} Now we don't qualify the type if the cursor position is in the selector of an *ast.SelectorExpr. We only generate literal candidates for type names, so if we are in a selector then we can assume it is a package qualified type (as opposed to an object field). We also handle the insertion of "&" for literal pointers better. If you are in the selector of an *ast.SelectorExpr, we prepend the "&" to the beginning of the expression rather than the selector. For example, you will end up with "&bytes.Buffer{}" instead of "bytes.&Buffer{}". Updates golang/go#34872. Change-Id: I812aa809cd4e649a429853386789f80033412814 Reviewed-on: https://go-review.googlesource.com/c/tools/+/201200 Run-TryBot: Rebecca Stambler <rstambler@golang.org> Reviewed-by: Rebecca Stambler <rstambler@golang.org> |
||
---|---|---|
.. | ||
comment_test.go | ||
comment.go | ||
completion_format.go | ||
completion_labels.go | ||
completion_literal.go | ||
completion_snippet.go | ||
completion.go | ||
deep_completion.go | ||
diagnostics_test.go | ||
diagnostics.go | ||
errors.go | ||
folding_range.go | ||
format.go | ||
highlight.go | ||
hover.go | ||
identifier.go | ||
imports_test.go | ||
imports.go | ||
options.go | ||
references.go | ||
rename_check.go | ||
rename.go | ||
signature_help.go | ||
source_test.go | ||
suggested_fix.go | ||
symbols.go | ||
tidy.go | ||
util.go | ||
view.go |