Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/cmd/guru: add type position to 'describe' output #27308

Closed
hummerd opened this issue Aug 28, 2018 · 8 comments
Closed

x/tools/cmd/guru: add type position to 'describe' output #27308

hummerd opened this issue Aug 28, 2018 · 8 comments
Labels
FrozenDueToAge Proposal Proposal-Accepted Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@hummerd
Copy link

hummerd commented Aug 28, 2018

It would be nice to have command like 'Go to type definition' in code editors. To help implement this we need to know where type of current (under cursor) identifier is defined.

So proposal is to add "typepos" to json output of describe identifier.

{
	"desc": "identifier",
	"pos": "testdata/src/describe-json/main.go:16:8",
	"detail": "value",
	"value": {
		"type": "I",
		"typepos": "testdata/src/describe-json/main.go:21:6",
		"objpos": "testdata/src/describe-json/main.go:12:6"
	}
}

P.S. I am ready to create PR just wanted to discuss this before

@gopherbot gopherbot added this to the Proposal milestone Aug 28, 2018
@ianlancetaylor
Copy link
Contributor

CC @alandonovan

@myitcv
Copy link
Member

myitcv commented Sep 7, 2018

Also cc @ianthehat

@rsc
Copy link
Contributor

rsc commented Sep 19, 2018

Ping @alandonovan and @ianthehat. If you decide this is OK or decide what you want instead, it sounds like @hummerd has an implementation.

@rsc
Copy link
Contributor

rsc commented Oct 3, 2018

Ping @alandonovan and @ianthehat.

@alandonovan
Copy link
Contributor

Yes, it seems like a reasonable feature. If you send me the CL I will review it. Thank you.

BTW, longer term, the Go team at Google will maintain a canonical LSP (language server protocol) implementation, which will subsume most of the features of Guru. In hindsight some of its features such as pointer analysis-based callgraph alias queries do not carry their weight (performance, implementation complexity) and should be dropped or replaced by simpler approximations. I expect that the feature described in this issue is part of the core LSP feature set.

@shankaryoga21
Copy link

I am not understand, I go google or Microsoft ??

@hummerd
Copy link
Author

hummerd commented Oct 7, 2018

Great news about LSP!
Here is CL https://go-review.googlesource.com/c/tools/+/140379

@rsc rsc changed the title proposal: Add type position to guru describe output x/tools/cmd/guru: add type position to describe output Oct 10, 2018
@rsc rsc changed the title x/tools/cmd/guru: add type position to describe output x/tools/cmd/guru: add type position to 'describe' output Oct 10, 2018
@rsc rsc modified the milestones: Proposal, Unreleased Oct 10, 2018
gopherbot pushed a commit to golang/tools that referenced this issue Nov 20, 2018
Add typepos field to json output of describe command. This field shows where
type of current (under cursor) identifier is defined. This will help code editors
implement command 'Go to type definition'.

Implements [#27308](golang/go#27308)

Change-Id: I4e02ddbdc03fecec98135b8996f9562a88a9cfb8
GitHub-Last-Rev: be47e39
GitHub-Pull-Request: #50
Reviewed-on: https://go-review.googlesource.com/c/140379
Reviewed-by: Alan Donovan <adonovan@google.com>
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Sep 12, 2019
@dmitshur
Copy link
Contributor

It looks like this was implemented in CL 140379, closing.

@golang golang locked and limited conversation to collaborators Feb 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge Proposal Proposal-Accepted Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

8 participants