1
0
mirror of https://github.com/golang/go synced 2024-11-05 15:06:09 -07:00
go/internal/lsp/cmd/test
Danish Dua b793a1359e internal/lsp: add outgoing calls call hierarchy
* Adds outgoing calls call hierarchy for function declarations to gopls. Returns all call ranges and call items for functions/literals being called.
* Adds tests for outgoing call.
* Updates cmd to account for call ranges and call items being in different files for outgoing calls.
* Updates prepare call hierarchy to return declaration as root instead of cursor position.

Example:
Example shows https://github.com/golang/tools/blob/master/internal/lsp/source/call_hierarchy.go

Show Call Hierarchy View: https://imgur.com/a/DA5vc6l
Peek Call Hierarchy View: https://imgur.com/a/fuiG0Be

Note:
* While incoming calls for a function defined in an interface return references to that function, outgoing calls don't return anything since we don't know what implementation to return outgoing calls for.* Outgoing calls to function literals show as variable name used to define the literal, compared to <scope>.func() for incoming calls.

Change-Id: Ib8afbd8617675d12952db0b80170ada5988e90ab
Reviewed-on: https://go-review.googlesource.com/c/tools/+/248537
Run-TryBot: Danish Dua <danishdua@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2020-08-20 01:08:01 +00:00
..
call_hierarchy.go internal/lsp: add outgoing calls call hierarchy 2020-08-20 01:08:01 +00:00
check.go internal/lsp: add type error fixes to existing diagnostics 2020-04-08 01:45:16 +00:00
cmdtest.go internal/lsp: support extract function 2020-07-20 18:55:41 +00:00
definition.go internal/lsp/cmd: fix the command line query for definition 2020-04-27 20:15:23 +00:00
folding_range.go internal/lsp: fix a race in the command line tests 2019-11-22 16:15:56 +00:00
format.go internal/lsp: fix a race in the command line tests 2019-11-22 16:15:56 +00:00
highlight.go tools/gopls: add cmd support for highlight 2019-11-26 20:36:08 +00:00
implementation.go internal/lsp: store workspace package IDs with package paths 2020-01-09 22:04:34 +00:00
imports.go internal/lsp: fix imports issue with duplicate package decl 2020-04-16 06:17:24 +00:00
links.go internal/lsp: fix a race in the command line tests 2019-11-22 16:15:56 +00:00
prepare_rename.go internal/lsp/protocol: unmarshal to pointers when dispatching requests 2020-03-05 22:45:36 +00:00
references.go internal/lsp: add tests for references includeDeclaration setting 2020-01-23 01:39:50 +00:00
rename.go internal/lsp: fix a race in the command line tests 2019-11-22 16:15:56 +00:00
signature.go internal/lsp: remove unnecessary source.SignatureInformation type 2020-02-06 19:05:38 +00:00
suggested_fix.go internal/lsp: move undeclaredname suggested fix out of analysis 2020-07-23 23:54:27 +00:00
symbols.go internal/lsp: fix a race in the command line tests 2019-11-22 16:15:56 +00:00
workspace_symbol.go tools/gopls: add cmd support for workspace_symbol 2020-03-26 19:59:04 +00:00