1
0
mirror of https://github.com/golang/go synced 2024-10-01 03:28:32 -06:00
go/internal/lsp/source
Heschi Kreinick 50c778fb86 internal/imports: redesign scan API
We have multiple use cases for scanning: goimports, import completion,
and unimported completions. All three need slightly different features,
and the latter have very different performance considerations. Scanning
everything all at once and returning it was not good enough for them.

Instead, design the API as a series of callbacks for each
directory/package: first we discover its existence, then we load its
package name, then we load its exports. At each step the caller can
choose whether to proceed with the package. Import completion can stop
before loading exports, goimports can apply its directory name
heuristics, and in the future we'll be able to stop the scan short once
we've found all the results we want for completions.

I don't intend any significant changes here but there may be some little
ones around the edges.

Change-Id: I39c3aa08cc0e4793c280242c342770f62e101364
Reviewed-on: https://go-review.googlesource.com/c/tools/+/212631
Run-TryBot: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-12-30 21:10:22 +00:00
..
comment_test.go internal/lsp: convert comments to markdown before sending to client 2019-10-04 18:35:38 +00:00
comment.go internal/lsp: convert comments to markdown before sending to client 2019-10-04 18:35:38 +00:00
completion_format.go internal/lsp: trim address operator from completion filterText 2019-12-24 05:57:32 +00:00
completion_keywords.go internal/lsp: suggest "fallthrough" only inside switches 2019-12-10 22:10:49 +00:00
completion_labels.go internal/lsp/source: move some data onto "candidate" struct 2019-12-23 22:26:30 +00:00
completion_literal.go internal/lsp: support taking address for completion candidates 2019-12-23 23:54:10 +00:00
completion_snippet.go internal/lsp: reorganize and refactor code 2019-11-21 02:33:28 +00:00
completion.go internal/imports: redesign scan API 2019-12-30 21:10:22 +00:00
deep_completion.go internal/lsp: support taking address for completion candidates 2019-12-23 23:54:10 +00:00
diagnostics.go internal/lsp: eliminate source.File type and move GetFile to snapshot 2019-12-19 20:51:25 +00:00
errors.go internal/lsp: use the -modfile flag to update a different go.mod file 2019-12-17 22:15:16 +00:00
folding_range.go internal/lsp: eliminate source.File type and move GetFile to snapshot 2019-12-19 20:51:25 +00:00
format.go internal/imports: redesign scan API 2019-12-30 21:10:22 +00:00
highlight.go internal/lsp: eliminate source.File type and move GetFile to snapshot 2019-12-19 20:51:25 +00:00
hover.go internal/lsp: show comments for grouped variable declarations 2019-12-18 20:39:36 +00:00
identifier.go all: remove many cases of space-space 2019-12-30 19:07:42 +00:00
implementation.go internal/lsp: load metadata for a single package ID, when needed 2019-12-30 21:09:35 +00:00
options.go internal/lsp: refactor and document options 2019-12-27 05:17:27 +00:00
references.go internal/lsp: respect References.IncludeDeclaration setting 2019-12-06 20:05:57 +00:00
rename_check.go internal/lsp: improve literal func completion candidates 2019-11-07 21:18:00 +00:00
rename.go internal/lsp: eliminate source.File type and move GetFile to snapshot 2019-12-19 20:51:25 +00:00
signature_help.go internal/lsp: eliminate source.File type and move GetFile to snapshot 2019-12-19 20:51:25 +00:00
source_test.go internal/lsp: support taking address for completion candidates 2019-12-23 23:54:10 +00:00
suggested_fix.go internal/lsp: move error range computations into cache package 2019-10-21 22:12:58 +00:00
symbols.go internal/lsp: eliminate source.File type and move GetFile to snapshot 2019-12-19 20:51:25 +00:00
tidy.go internal/lsp: use the -modfile flag to update a different go.mod file 2019-12-17 22:15:16 +00:00
util.go internal/lsp: support taking address for completion candidates 2019-12-23 23:54:10 +00:00
view.go internal/lsp: load metadata for a single package ID, when needed 2019-12-30 21:09:35 +00:00