1
0
mirror of https://github.com/golang/go synced 2024-11-18 16:14:46 -07:00
go/internal/lsp
Muir Manders dd2b5c81c5 internal/lsp: simplify snippet config/generation
I moved the "usePlaceholders" config field on to CompletionOptions.
This way the completion code generates a single snippet with a little
conditional logic based on the "WantPlaceholders" option instead of
juggling the generation of two almost identical "plain" and
"placeholder" snippets at the same time. It also reduces the work done
generating completion candidates a little.

I also made a minor tweak to the snippet builder where empty
placeholders are now always represented as e.g "${1:}" instead of
"${1}" or "${1:}", depending on if you passed a callback to
WritePlaceholder() or not.

Change-Id: Ib84cc0cd729a11b9e13ad3ac4b6fd2d82460acd5
Reviewed-on: https://go-review.googlesource.com/c/tools/+/193697
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-09-10 04:45:52 +00:00
..
browser internal/lsp: add version and bug commands 2019-05-11 04:16:02 +00:00
cache internal/lsp: enable suggested fixes by default 2019-09-09 19:40:07 +00:00
cmd internal/lsp: enable suggested fixes by default 2019-09-09 19:40:07 +00:00
debug internal/telemetry: add the ability to flush telemetry data 2019-08-21 16:29:56 +00:00
diff internal/lsp/diff: rewrite ApplyEdits to work with sub-line diffs 2019-09-09 18:07:23 +00:00
fuzzy internal/lsp: add fuzzy completion matching 2019-08-14 16:13:50 +00:00
protocol x/tools/gopls: convert to the august, 2019 version of the LSP protocol 2019-09-08 13:59:31 +00:00
snippet internal/lsp: simplify snippet config/generation 2019-09-10 04:45:52 +00:00
source internal/lsp: simplify snippet config/generation 2019-09-10 04:45:52 +00:00
telemetry internal/lsp/cache: add additional spans for tracing 2019-09-05 21:33:45 +00:00
testdata internal/lsp: simplify snippet config/generation 2019-09-10 04:45:52 +00:00
tests internal/lsp: add more flexible completion tests 2019-09-10 04:40:04 +00:00
code_action.go internal/lsp: enable suggested fixes by default 2019-09-09 19:40:07 +00:00
completion.go internal/lsp: simplify snippet config/generation 2019-09-10 04:45:52 +00:00
definition.go x/tools/gopls: convert to the august, 2019 version of the LSP protocol 2019-09-08 13:59:31 +00:00
diagnostics.go internal/lsp: move configuration options to structs 2019-09-06 17:30:54 +00:00
folding_range.go internal/lsp: switch folding range to protocol ranges 2019-09-06 18:26:38 +00:00
format.go internal/lsp: change to protocol.TextEdit for formatting 2019-09-06 17:54:09 +00:00
general.go internal/lsp: simplify snippet config/generation 2019-09-10 04:45:52 +00:00
highlight.go x/tools/gopls: convert to the august, 2019 version of the LSP protocol 2019-09-08 13:59:31 +00:00
hover.go x/tools/gopls: convert to the august, 2019 version of the LSP protocol 2019-09-08 13:59:31 +00:00
link.go internal/lsp: remove the GetToken and GetAST functions 2019-09-09 18:10:35 +00:00
lsp_test.go internal/lsp: simplify snippet config/generation 2019-09-10 04:45:52 +00:00
references.go internal/lsp: remove the GetToken and GetAST functions 2019-09-09 18:10:35 +00:00
rename.go x/tools/gopls: convert to the august, 2019 version of the LSP protocol 2019-09-08 13:59:31 +00:00
reset_golden.sh internal/lsp: fix definition tests to use golden files 2019-05-10 21:06:55 +00:00
server.go x/tools/gopls: convert to the august, 2019 version of the LSP protocol 2019-09-08 13:59:31 +00:00
signature_help.go x/tools/gopls: convert to the august, 2019 version of the LSP protocol 2019-09-08 13:59:31 +00:00
symbols.go internal/lsp: switch to using protocol positions for document symbols 2019-09-06 18:11:17 +00:00
text_synchronization.go internal/lsp: move configuration options to structs 2019-09-06 17:30:54 +00:00
util.go internal/lsp: use protocol.TextEdits in suggested fixes 2019-09-07 02:01:28 +00:00
watched_files.go internal/lsp: move configuration options to structs 2019-09-06 17:30:54 +00:00
workspace.go internal/lsp: move configuration options to structs 2019-09-06 17:30:54 +00:00