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

Open
hummerd opened this issue Aug 28, 2018 · 7 comments
Open

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

hummerd opened this issue Aug 28, 2018 · 7 comments

Comments

@hummerd
Copy link

@hummerd 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
@gopherbot gopherbot added the Proposal label Aug 28, 2018
@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Aug 28, 2018

@myitcv

This comment has been minimized.

Copy link
Member

@myitcv myitcv commented Sep 7, 2018

Also cc @ianthehat

@rsc

This comment has been minimized.

Copy link
Contributor

@rsc 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

This comment has been minimized.

Copy link
Contributor

@rsc rsc commented Oct 3, 2018

@alandonovan

This comment has been minimized.

Copy link
Contributor

@alandonovan alandonovan commented Oct 5, 2018

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

This comment has been minimized.

Copy link

@shankaryoga21 shankaryoga21 commented Oct 5, 2018

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

@hummerd

This comment has been minimized.

Copy link
Author

@hummerd 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 label Sep 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.