1
0
mirror of https://github.com/golang/go synced 2024-11-18 16:14:46 -07:00
go/internal/lsp/source
Rob Findley e7a7e3a8a0 internal/lsp/source: add a unit test for searchForEnclosing
The logic to resolve the enclosing type for an identifier is somewhat
tricky. Add a unit test to exercise a few edge cases.

This would probably be easier to read and write using a hybrid approach
that extracts markers from the source.

This test uncovered a bug, that on the SelectorExpr branch we were
accidentally returning a nil *Named types.Type, rather than a nil
types.Type.

Change-Id: I43e096f51999b2a6e109c09d3805ad70a4780398
Reviewed-on: https://go-review.googlesource.com/c/tools/+/244841
Reviewed-by: Heschi Kreinick <heschi@google.com>
2020-07-28 18:51:24 +00:00
..
code_lens.go internal/lsp: remove PackageHandle 2020-07-28 17:35:25 +00:00
command.go internal/lsp: remove PackageHandle 2020-07-28 17:35:25 +00:00
comment_test.go
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
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: remove PackageHandle 2020-07-28 17:35:25 +00:00
extract.go internal/lsp: support return statements in extract function 2020-07-28 16:04:03 +00:00
folding_range.go internal/lsp: replace ParseGoHandle with concrete data 2020-07-28 17:35:11 +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
highlight.go internal/lsp: remove PackageHandle 2020-07-28 17:35:25 +00:00
hover.go internal/lsp: replace ParseGoHandle with concrete data 2020-07-28 17:35:11 +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/source: add a unit test for searchForEnclosing 2020-07-28 18:51:24 +00:00
implementation.go internal/lsp: remove PackageHandle 2020-07-28 17:35:25 +00:00
options.go internal/lsp: support refactor.extract through commands 2020-07-27 19:25:51 +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: remove PackageHandle 2020-07-28 17:35:25 +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: remove PackageHandle 2020-07-28 17:35:25 +00:00
workspace_symbol.go internal/lsp: remove PackageHandle 2020-07-28 17:35:25 +00:00