1
0
mirror of https://github.com/golang/go synced 2024-11-18 21:34:46 -07:00
go/internal/lsp/testdata
Muir Manders 7e40e1726e internal/lsp: improve signatureHelp in various cases
- show signature for function calls whose function expression is not
  an object (e.g. the second call in foo()()). since the function name
  is not available, we use the generic "func"
- only provide signature help when the position is on or within the
  call expression parens. this is consistent with the one other lsp
  server i tried (java). this improves the gopls experience in emacs
  where lsp-mode is constantly calling "hover" and
  "signatureHelp" ("hover" should be preferred unless you are inside
  the function params list)
- use the entire signature type string as the label since that includes
  the return values, which are useful to see
- don't qualify the function name with its package. it looks funny to
  see "bytes.Cap()" as the help when you are in a call
  to (*bytes.Buffer).Cap(). it could be useful to include invocant
  type info, but leave it out for now since signature help is meant to
  focus on the function parameters.
- don't turn variadic args "foo ...int" into "foo []int" for the
  parameter information (i.e. maintain it as "foo ...int")
- when determining active parameter, count the space before a
  parameter name as being part of that parameter (e.g. the space
  before "b" in "func(a int, b int)")
- handle variadic params when determining the active param (i.e.
  highlight "foo(a int, *b ...string*)" on signature help for final
  param in `foo(123, "a", "b", "c")`
- don't generate an extra space in formatParams() for unnamed
  arguments

I also tweaked the signatureHelp server log message to include the
error message itself, and populated the server's logger in lsp_test.go
to aid in development.

Fixes golang/go#31448

Change-Id: Iefe0e1e3c531d17197c0fa997b949174475a276c
GitHub-Last-Rev: 5c0b8ebd87a8c05d5d8f519ea096f94e89c77e2c
GitHub-Pull-Request: golang/tools#82
Reviewed-on: https://go-review.googlesource.com/c/tools/+/172439
Run-TryBot: Ian Cottrell <iancottrell@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-04-17 18:10:49 +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: connect basic analysis functionality 2019-02-06 21:48:25 +00:00
bar internal/lsp: fix a bug stopped package names from being printed 2018-11-20 23:48:46 +00:00
baz internal/lsp: implement type definitions 2018-12-04 18:51:09 +00:00
builtins internal/lsp: add a test for completion of builtin types and functions 2019-01-16 00:24:28 +00:00
cast internal/lsp: add more testdata for completion and diagnostics 2018-11-20 06:06:34 +00:00
complit internal/lsp: add additional tests for completion 2018-12-19 22:27:14 +00:00
errors internal/lsp: add additional tests for completion 2018-12-19 22:27:14 +00:00
foo internal/lsp: do not complete inside comments in functions 2019-01-22 18:08:10 +00:00
format internal/lsp/diff: fix bug that adds extra line to files on format 2019-02-13 04:28:36 +00:00
func_rank internal/lsp: rank types higher when completing in return of a function 2019-02-02 23:51:57 +00:00
godef internal/lsp: handle definitions for variables with error types 2019-04-15 20:59:51 +00:00
good internal/lsp: connect basic analysis functionality 2019-02-06 21:48:25 +00:00
highlights internal/lsp: add support for document highlight 2019-03-26 19:08:20 +00:00
nodisk go/packages: add support for entire packages defined in overlays 2019-04-17 17:55:51 +00:00
noparse internal/lsp: connect basic analysis functionality 2019-02-06 21:48:25 +00:00
noparse_format internal/lsp: connect basic analysis functionality 2019-02-06 21:48:25 +00:00
rank internal/lsp: add additional tests for completion 2018-12-19 22:27:14 +00:00
selector internal/lsp: add more testdata for completion and diagnostics 2018-11-20 06:06:34 +00:00
signature internal/lsp: improve signatureHelp in various cases 2019-04-17 18:10:49 +00:00
stringlit cmd/lsp: skip completion in string literals 2019-03-15 16:51:35 +00:00
symbols internal/lsp: make the symbols tests use the enum names rather than hard coding the values 2019-04-17 00:57:54 +00:00
testy internal/lsp: connect basic analysis functionality 2019-02-06 21:48:25 +00:00
types internal/lsp: add more testdata for completion and diagnostics 2018-11-20 06:06:34 +00:00