1
0
mirror of https://github.com/golang/go synced 2024-10-01 10:28:31 -06:00
go/internal/lsp/testdata
Muir Manders 9d59f9e855 internal/lsp: improve completion support for untyped constants
Add some extra smarts when evaluating untyped constants as completion
candidates. Previously we called types.Default() on the expected type
and candidate type, but this loses the untypedness of an untyped
constant which prevents it from being assignable to any type or named
type other than the untyped constant's default type.

Note that the added logic does not take into account the untyped
constant's value, so you will still get some false positive
completions (e.g. suggesting an untyped negative integer constant when
only a uint would do). Unfortunately go/types doesn't provide a way of
answering the question "is this *types.Const assignable to this
types.Type" since types.AssignableTo only considers a constant's type,
not its value.

Change-Id: If7075642e928f712b127256ae7706a5190e2f42c
GitHub-Last-Rev: 124d2f05b0aec09c9d7004d9da0d900524185b92
GitHub-Pull-Request: golang/tools#128
Reviewed-on: https://go-review.googlesource.com/c/tools/+/184477
Reviewed-by: Suzy Mueller <suzmue@golang.org>
2019-07-03 16:30:32 +00:00
..
analyzer internal/lsp: fix badly formatted error messages from go vet 2019-04-16 19:41:54 +00:00
anon internal/lsp: add additional tests for completion 2018-12-19 22:27:14 +00:00
bad internal/lsp: adding the test suite to the source package 2019-05-10 20:20:41 +00:00
badstmt internal/lsp: handle completion after defer, go statements 2019-04-24 22:01:01 +00:00
bar internal/lsp: fix composite literal completion 2019-05-13 22:24:33 +00:00
basiclit internal/lsp: suppress more completions in comments and literals 2019-04-24 20:52:08 +00:00
baz internal/lsp: suppress more completions in comments and literals 2019-04-24 20:52:08 +00:00
builtins internal/lsp: support builtin types without hardcoding 2019-05-01 04:50:30 +00:00
cast internal/lsp: add more testdata for completion and diagnostics 2018-11-20 06:06:34 +00:00
channel internal/lsp: apply type modifiers to completion candidate 2019-06-19 20:27:14 +00:00
comments internal/lsp: suppress more completions in comments and literals 2019-04-24 20:52:08 +00:00
complit internal/lsp: fix composite literal completion 2019-05-13 22:24:33 +00:00
constant internal/lsp: remove constant value from label and add tests 2019-05-15 19:19:14 +00:00
deepcomplete internal/lsp: provide deep completion candidates 2019-06-27 18:58:03 +00:00
errors internal/lsp: match completions case-insensitively 2019-06-28 03:43:36 +00:00
foo internal/lsp: add find all references 2019-06-10 19:06:22 +00:00
format internal/lsp: switch golden files to use txtar 2019-05-08 14:59:27 +00:00
func_rank internal/lsp: handle more expected type cases 2019-05-16 16:26:11 +00:00
funcvalue internal/lsp: fix function value completions 2019-06-20 15:43:39 +00:00
godef internal/lsp: fix references for type switch vars 2019-06-19 18:18:01 +00:00
good internal/lsp: improve completion support for type assertions 2019-06-26 23:33:08 +00:00
highlights internal/lsp: add support for document highlight 2019-03-26 19:08:20 +00:00
importedcomplit internal/lsp: fix composite literal completion 2019-05-13 22:24:33 +00:00
imports internal/lsp: add some basic tests for imports 2019-06-03 23:13:51 +00:00
index internal/lsp: handle more expected type cases 2019-05-16 16:26:11 +00:00
interfacerank internal/lsp: apply type modifiers to completion candidate 2019-06-19 20:27:14 +00:00
links internal/lsp: add document link handling for import paths to godoc 2019-05-03 18:56:57 +00:00
nested_complit internal/lsp: improve composite literal completion 2019-04-23 22:28:03 +00:00
nodisk internal/lsp: a cleaner way of doing overlays 2019-04-17 21:35:05 +00:00
noparse internal/lsp: connect basic analysis functionality 2019-02-06 21:48:25 +00:00
noparse_format internal/lsp: switch golden files to use txtar 2019-05-08 14:59:27 +00:00
rank internal/lsp: improve completion support for untyped constants 2019-07-03 16:30:32 +00:00
rename/a internal/lsp: support renaming import specs 2019-07-02 14:51:11 +00:00
selector internal/lsp: add more testdata for completion and diagnostics 2018-11-20 06:06:34 +00:00
signature internal/lsp: hide signature help in function literals 2019-07-02 15:22:45 +00:00
snippets internal/lsp: fix completion insertion 2019-05-17 18:32:58 +00:00
symbols internal/lsp: make interface methods children of the interface symbol 2019-04-24 02:46:01 +00:00
testy internal/lsp: find references in test packages 2019-07-01 19:17:42 +00:00
typeassert internal/lsp: improve completion support for type assertions 2019-06-26 23:33:08 +00:00
types internal/lsp: add more testdata for completion and diagnostics 2018-11-20 06:06:34 +00:00
unresolved internal/lsp: fix function value completions 2019-06-20 15:43:39 +00:00
unsafe internal/lsp: fix type checking for unsafe package 2019-06-11 19:41:53 +00:00