1
0
mirror of https://github.com/golang/go synced 2024-11-05 14:56:10 -07:00
go/internal/lsp/source
Heschi Kreinick 412b8bda49 internal/lsp/cache: ref-count snapshots
To manually collect cache entries, we need to know when a snapshot is
idle. Add a reference count in the form of a WaitGroup and keep track of
its uses. The pattern is that any time a snapshot is returned, it comes
with a release function that decrements the ref count.

Almost all uses of a snapshot originate in a user-facing request,
handled in beginFileRequest. There it's mostly an exercise in passing
Snapshots around instead of Views.

In the other places I took the path of least resistance. For file
modifications I tried to minimize the amount of code that needed to deal
with snapshots. For diagnostics I just acquired the snapshot at the
diagnostics call.

Change-Id: Id48a2df3acdd97f27d905e2c2be23072f28f196b
Reviewed-on: https://go-review.googlesource.com/c/tools/+/241837
Run-TryBot: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2020-08-03 22:08:54 +00:00
..
code_lens.go internal/lsp: fix a few staticcheck suggestions, some cleanup 2020-07-29 17:11:59 +00:00
command.go internal/lsp/source: move initial extract function logic to lsp/command 2020-07-29 16:09:07 +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: fix errors found by staticcheck 2020-03-19 19:20:54 +00:00
completion_builtin.go internal/lsp: remove Ignore feature 2020-06-11 22:55:14 +00:00
completion_format.go internal/lsp: replace ParseGoHandle with concrete data 2020-07-28 17:35:11 +00:00
completion_keywords.go internal/lsp/source: offer loop keyword completions in range stmt 2020-03-12 04:57:24 +00:00
completion_labels.go internal/lsp: use one context throughout completion 2020-04-06 16:51:37 +00:00
completion_literal.go internal/telemetry: renaming to internal/event 2020-04-23 17:20:48 +00:00
completion_snippet.go internal/lsp: merge completion options into source.Options 2020-01-13 20:09:44 +00:00
completion_statements.go internal/lsp/source: offer smart "append()" completions 2020-05-20 22:05:37 +00:00
completion.go internal/lsp: remove PackageHandle 2020-07-28 17:35:25 +00:00
deep_completion.go internal/lsp: use one context throughout completion 2020-04-06 16:51:37 +00:00
diagnostics.go internal/lsp/cache: ref-count snapshots 2020-08-03 22:08:54 +00:00
extract.go internal/lsp/source: move initial extract function logic to lsp/command 2020-07-29 16:09:07 +00:00
folding_range.go internal/lsp: add folding range for select case statements 2020-07-30 18:32:39 +00:00
format_test.go internal/lsp: handle bad formatting with CRLF line endings 2020-07-28 16:05:17 +00:00
format.go internal/lsp: replace ParseGoHandle with concrete data 2020-07-28 17:35:11 +00:00
gc_annotations.go internal/lsp: fix a few staticcheck suggestions, some cleanup 2020-07-29 17:11:59 +00:00
highlight.go internal/lsp: remove PackageHandle 2020-07-28 17:35:25 +00:00
hover.go internal/lsp: properly check for nil on i.enclosing 2020-07-29 16:35:35 +00:00
identifier_test.go internal/lsp/source: add a unit test for searchForEnclosing 2020-07-28 18:51:24 +00:00
identifier.go internal/lsp: properly check for nil on i.enclosing 2020-07-29 16:35:35 +00:00
implementation.go internal/lsp: remove PackageHandle 2020-07-28 17:35:25 +00:00
options.go internal/lsp/cache: ref-count snapshots 2020-08-03 22:08:54 +00:00
references.go internal/lsp: remove PackageHandle 2020-07-28 17:35:25 +00:00
rename_check.go internal/lsp: add changeMethods logic to rename check 2020-07-13 19:50:33 +00:00
rename.go internal/lsp: add changeMethods logic to rename check 2020-07-13 19:50:33 +00:00
signature_help.go internal/lsp: remove PackageHandle 2020-07-28 17:35:25 +00:00
source_test.go internal/lsp/cache: ref-count snapshots 2020-08-03 22:08:54 +00:00
symbols.go internal/lsp: remove PackageHandle 2020-07-28 17:35:25 +00:00
types_format.go internal/lsp: replace ParseGoHandle with concrete data 2020-07-28 17:35:11 +00:00
util.go internal/lsp: remove PackageHandle 2020-07-28 17:35:25 +00:00
view.go internal/lsp/cache: ref-count snapshots 2020-08-03 22:08:54 +00:00
workspace_symbol.go internal/lsp/cache: ref-count snapshots 2020-08-03 22:08:54 +00:00