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

Add support for Goto Declaration #62483

Closed
dbaeumer opened this issue Nov 2, 2018 · 6 comments
Closed

Add support for Goto Declaration #62483

dbaeumer opened this issue Nov 2, 2018 · 6 comments
Assignees
Labels
api api-finalization api-proposal editor-contrib Editor collection of extras feature-request Request for new features or functionality on-testplan release-notes Release notes issues
Milestone

Comments

@dbaeumer
Copy link
Member

dbaeumer commented Nov 2, 2018

VS Code currently only supports Goto Defintition inside the editor. However there are languages like C++ that distinguish between declarations and definitions. We should add official support to have Goto Declaration in the UI and a corresponding provider in the API.

This should also include a corresponding complex command to invoke the request.

@jrieken
Copy link
Member

jrieken commented Nov 12, 2018

All pretty straight forward: https://github.com/Microsoft/vscode/blob/f6bf792deab85e59e971096dc58a502d24cedaf9/src/vs/vscode.proposed.d.ts#L25-L50

The only weird thing is that the return type is Definition | DefinitionLink[]... We could alias the type, esp DefinitionLink as SymbolLink or leave it as it. @mjbvz @dbaeumer ideas?

@dbaeumer
Copy link
Member Author

What about aliasing it to Declaration and DeclarationLink. From all the discussions I had in LSP so far I try to avoid talking about a Symbol since users tend to associate it with symbols in compilers / type checkers. And for us it is simply a range(s) in a document.

@jrieken
Copy link
Member

jrieken commented Nov 13, 2018

Yeah, DefinitionLink wasn't a good choice maybe. I have the following ideas, feedback welcome

  • We rename DefinitionLink to LocationLink
  • Since step 1 was breaking, we create an alias type DefinitionLink for LocationLink
  • We declare yet another alias Declaration as type Declaration = Location | Location[] | LocationLink[]

@jrieken
Copy link
Member

jrieken commented Nov 16, 2018

This is now in latest insiders

@joaomoreno
Copy link
Member

@jrieken Fixed the smoketest.

@dbaeumer
Copy link
Member Author

@jrieken thanks

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api api-finalization api-proposal editor-contrib Editor collection of extras feature-request Request for new features or functionality on-testplan release-notes Release notes issues
Projects
None yet
Development

No branches or pull requests

3 participants