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

vscode.executeDocumentSymbolProvider command only returns SymbolInformation[] rather than DocumentSymbol[] #57984

Closed
eamodio opened this issue Sep 5, 2018 · 6 comments
Assignees
Labels
api bug Issue identified by VS Code Team member as probable bug editor-symbols definitions, declarations, references under-discussion Issue is under discussion for relevance, priority, approach verified Verification succeeded

Comments

@eamodio
Copy link
Contributor

eamodio commented Sep 5, 2018

Currently the vscode.executeDocumentSymbolProvider returns instances of SymbolInformation rather than the newer DocumentSymbol. I'm sure this was done for backward compatibility. Can a flag be added to vscode.executeDocumentSymbolProvider to allow it to return DocumentSymbol? Or maybe a new complex command to access the DocumentSymbols?

I would really like for GitLens to be able to have access to the better range information contained in the DocumentSymbols.

Also if there is consensus on the direction of this, I can provide a PR.

/cc @jrieken

@jrieken jrieken added api under-discussion Issue is under discussion for relevance, priority, approach editor-symbols definitions, declarations, references labels Sep 6, 2018
@jrieken
Copy link
Member

jrieken commented Sep 6, 2018

Yeah, we weren't sure yet how to do that... It is for backwards compatibility and this command is very frequently used. I can check if that's still the case

@eamodio
Copy link
Contributor Author

eamodio commented Sep 6, 2018

Maybe vscode.executeDocumentSymbolProvider.v2 or something along those lines (that could be used for any complex command)

@jrieken
Copy link
Member

jrieken commented Sep 10, 2018

Yeah, not sure yet. We always wanted to be more relaxed with those commands and have the freedom to kinda break them. Tho this is a special case since there is many user of that command. I am thinking of some kind of merged type ala vscode.DocumentSymbol & vscode.SymbolInformation. That should be the best of both worlds...

@jrieken jrieken added the bug Issue identified by VS Code Team member as probable bug label Sep 10, 2018
@jrieken jrieken added this to the September 2018 milestone Sep 10, 2018
@eamodio
Copy link
Contributor Author

eamodio commented Sep 10, 2018

Somewhat related (especially with a merged type), I see internally DocumentSymbol has containerName just like SymbolInformation, why is that not exposed on the vscode.d.ts version of DocumentSymbol?

@jrieken
Copy link
Member

jrieken commented Sep 10, 2018

why is that not exposed on the vscode.d.ts version of DocumentSymbol?

It was always meant to be the parent of a symbol and now that there is parent info it's not really used anymore...

@eamodio
Copy link
Contributor Author

eamodio commented Sep 10, 2018

How do you get the parent info? Isn't there only children access?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api bug Issue identified by VS Code Team member as probable bug editor-symbols definitions, declarations, references under-discussion Issue is under discussion for relevance, priority, approach verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants