go/internal/lsp
Muir Manders e0b9cf74f6 lsp/completion: support completing to Elem() types
For array, slice, maps and chan candidates, we now support
transforming them to their element type in completions. For example:

    var m map[string]int
    var _ int = m<>

At <> we complete to "m[]" because we see that the map value type
matches our expected type.

Fixes golang/go#46045.

Change-Id: Ibee088550193a53744f93217cc365f67f301ae90
Reviewed-on: https://go-review.googlesource.com/c/tools/+/323451
Run-TryBot: Muir Manders <muir@mnd.rs>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Cherry Mui <cherryyz@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
2021-06-09 15:58:30 +00:00
..
analysis internal/lsp: add support for extracting non-nested returns 2021-04-27 20:37:52 +00:00
browser all: replace all usages of os/exec with golang.org/x/sys/execabs 2021-01-19 22:25:03 +00:00
cache internal/lsp: memoize allKnownSubdirs instead of recomputing 2021-06-04 20:34:05 +00:00
cmd internal/lsp: add list_known_packages and add_import commands 2021-05-23 03:57:00 +00:00
command internal/lsp: add list_known_packages and add_import commands 2021-05-23 03:57:00 +00:00
debug internal/lsp/source/completion: avoid a panic in package completion 2021-05-10 23:22:37 +00:00
diff all: add copyright notices to files that are missing them 2021-01-06 17:23:47 +00:00
fake Revert "internal/lsp/cache: don't delete metadata until it's reloaded" 2021-06-02 19:45:53 +00:00
fuzzy internal/lsp/fuzzy: fix return value on no match 2020-08-28 15:37:48 +00:00
helper internal/lsp/protocol: latest version of LSP 2021-04-20 19:23:16 +00:00
lsprpc internal/lsp/lsprpc: implement cancellation using jsonrpc2_v2 2021-05-19 14:12:35 +00:00
mod internal/lsp: fix mod file codelens 2021-05-24 20:38:17 +00:00
protocol internal/lsp/protocol: update code generated for LSP 2021-05-24 18:03:47 +00:00
regtest gopls/internal/regtest: clean up TestFillReturnsPanic 2021-06-03 18:03:08 +00:00
snippet internal/lsp/source/completion: add postfix snippet completions 2021-03-29 17:27:46 +00:00
source lsp/completion: support completing to Elem() types 2021-06-09 15:58:30 +00:00
template internal/lsp: handle out of range panic in template parsing 2021-06-08 16:06:52 +00:00
testdata lsp/completion: support completing to Elem() types 2021-06-09 15:58:30 +00:00
tests internal/lsp: add list_known_packages and add_import commands 2021-05-23 03:57:00 +00:00
README.md internal/lsp: add READMEs that describe tests, how to run tests 2020-12-03 17:03:53 +00:00
call_hierarchy.go internal/lsp: release resources for call hierarchy file requests 2020-08-07 21:04:51 +00:00
code_action.go internal/lsp: support template files 2021-05-05 01:45:45 +00:00
code_lens.go internal/lsp: switch to the new command API 2021-02-09 22:09:28 +00:00
command.go internal/lsp: add list_known_packages and add_import commands 2021-05-23 03:57:00 +00:00
completion.go internal/lsp: support template files 2021-05-05 01:45:45 +00:00
completion_test.go internal/lsp/completion: move postfix completions behind option 2021-03-29 18:55:49 +00:00
debounce.go internal/lsp: add experimental support for multi-phase diagnostics 2020-10-02 14:12:12 +00:00
debounce_test.go internal/lsp: delay longer in TestDebouncer 2020-10-30 20:03:00 +00:00
definition.go internal/lsp: fix no definition when importShortcut is link 2021-05-10 21:56:33 +00:00
diagnostics.go internal/lsp: correct typo in orphaned file error message 2021-05-20 18:25:17 +00:00
folding_range.go all: add copyright notices to files that are missing them 2021-01-06 17:23:47 +00:00
format.go internal/lsp/cache: ref-count snapshots 2020-08-03 22:08:54 +00:00
general.go internal/lsp: report used semantic token order in registerCapability 2021-05-19 16:08:23 +00:00
highlight.go internal/lsp: support template files 2021-05-05 01:45:45 +00:00
hover.go internal/lsp: support template files 2021-05-05 01:45:45 +00:00
implementation.go internal/lsp/cache: ref-count snapshots 2020-08-03 22:08:54 +00:00
link.go internal/lsp: add ?utm_source=gopls to links to pkg.go.dev 2020-11-16 00:15:58 +00:00
lsp_test.go internal/lsp: add list_known_packages and add_import commands 2021-05-23 03:57:00 +00:00
progress.go internal/lsp: update to latest version of LSP protocol 2021-02-02 11:32:59 +00:00
progress_test.go internal/lsp: improvements for command messages 2020-08-21 20:07:30 +00:00
references.go internal/lsp: support template files 2021-05-05 01:45:45 +00:00
rename.go internal/lsp/source: make it an error to rename embedded fields 2021-01-26 13:52:46 +00:00
reset_golden.sh internal/lsp: fix regeneration of golden files 2019-09-25 13:16:59 +00:00
semantic.go internal/lsp: don't crash on an empty import path 2021-05-24 21:23:15 +00:00
server.go internal/lsp/lsprpc: partial integration of the jsonrpc_v2 library 2021-05-19 14:12:23 +00:00
server_gen.go internal/lsp: make ShowDocument RPC available to gopls 2021-05-03 16:38:18 +00:00
signature_help.go internal/lsp: update to latest version of LSP protocol 2021-02-02 11:32:59 +00:00
symbols.go internal/lsp: support template files 2021-05-05 01:45:45 +00:00
text_synchronization.go internal/lsp: update to latest version of LSP protocol 2021-02-02 11:32:59 +00:00
workspace.go internal/lsp: report used semantic token order in registerCapability 2021-05-19 16:08:23 +00:00
workspace_symbol.go internal/lsp/source: add a new symbolStyle configuration option 2020-06-26 17:13:37 +00:00

README.md

lsp

internal/lsp provides much of the Language Server Protocol (lsp) implementation for gopls.

Documentation for users and contributors can be found in the gopls/doc directory.