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

Adopt new DocumentSymbol API #2230

Closed
jrieken opened this issue Jul 6, 2018 · 26 comments
Closed

Adopt new DocumentSymbol API #2230

jrieken opened this issue Jul 6, 2018 · 26 comments
Assignees
Labels
Feature Request fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Milestone

Comments

@jrieken
Copy link
Member

jrieken commented Jul 6, 2018

With the 1.25 release we have finalised the API for the outline tree. A DocumentSymbolProvider should now return document symbols which can represent a hierarchy and that can differentiate between the full range of a symbol and the selection range, e.g. the name of a function.

Note that we synthesise trees using range-containment when a provider returns SymbolInformation-objects and that that isn't perfect. Adopting the new API makes the outline more robust and support features like follow-cursor and diagnostics association.

Let me know if need more information is needed. Happy Coding!

@jrieken
Copy link
Member Author

jrieken commented Jul 6, 2018

This depends on microsoft/language-server-protocol#327

@bobbrow
Copy link
Member

bobbrow commented Jul 6, 2018

What are the rules to update the outline view? I turned it on for a bit and it seemed to be stale as I added new code items to the file. We currently only update our document symbols list when the file is saved, but the outline didn't update when I saved the file.

EDIT:
Ah, I get it now. We use the LSP to communicate with VS Code, so we're using the SymbolInformation stuff you mentioned above. I'm not sure if/when the vscode-languageclient module will support this. Is it on Dirk's backlog to add this?

@jrieken
Copy link
Member Author

jrieken commented Jul 9, 2018

Yeah, Dirk is on it. I hope the LSP updates soon

@go2sh
Copy link

go2sh commented Sep 7, 2018

microsoft/language-server-protocol#327 is fixed. This feature would rock the world. Especially for editing large files and classes.

@micmelesse
Copy link

micmelesse commented Nov 2, 2018

Where should I start if I wanted to help with this? This feature would be very useful for me.

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Nov 2, 2018

@micmelesse It requires changes to our closed source code, so unfortunately you can't help unless you work for Microsoft. We sometimes mark bugs that could be fixed with our open source typescript with "help wanted".

@lijh8
Copy link

lijh8 commented Nov 20, 2018

Source Insight* provides two outline views, one for symbols inside file, another for project wide.
It seems it takes you forever to implement the outline / symbol view in your code project.
What is your plan to implement on this?

With this feature, your code project is a source code editor.
Without it, your code is just another text editor.

@bobbrow
Copy link
Member

bobbrow commented Nov 20, 2018

We prioritize features based on the number of upvotes. Please add your +1 to the original post to voice your support for this feature.

@runelabs
Copy link

runelabs commented Jan 5, 2019

@bobbrow this issue is currently placed at #12 in terms of 👍. Does that mean that it is finally being considered now?

The issues ahead of this one have been around for 2+ years, so I don't understand how the prioritization process actually is supposed to work though... You guys use some weighting and dependencies as well, right? Perhaps milestone-labeling could be helpful for clarifying - so that so it doesn't start to seem like this is just an issue graveyard/gulag.

@sean-mcmanus sean-mcmanus added this to the On Deck milestone Jan 7, 2019
@sean-mcmanus
Copy link
Contributor

@runelabs Being number 12 means there are 11 features with higher priority (along with feedback received from our survey). But this issue might be quick to fix compared to the others so that makes it more likely to get finished sooner. I don't know enough about out schedule to put it on a milestone date yet, but we will add it once we figure out our plan for the next few months.

@VinayGupta23
Copy link

VinayGupta23 commented Apr 7, 2019

If fixing this solves #2556 and #2401, then I am up-voting this. I intend to use VS Code as a full-time editor for my C/C++ code base, but lack of this feature makes it really hard to navigate the code :(

@sean-mcmanus
Copy link
Contributor

@VinayGupta23 Yeah, those issues should be fixed via this issue.

@goretkin
Copy link

goretkin commented Jun 3, 2019

@micmelesse It requires changes to our closed source code, so unfortunately you can't help unless you work for Microsoft. We sometimes mark bugs that could be fixed with our open source typescript with "help wanted".

Could you clarify which part is closed source?

@sean-mcmanus
Copy link
Contributor

@goretkin The code that is in Microsoft.VSCode.CPP.Extension.* and Microsoft.VSCode.CPP.IntelliSense.Msvc.*.

@CelticMinstrel
Copy link

It's not entirely clear from the opening post, but this issue is about making the outline hierarchical, right?

@sean-mcmanus
Copy link
Contributor

@CelticMinstrel Hierarchical is one aspect, but other issues would be fixed as well via switching to the newer API that returns more info about symbol ranges, such as breadcrumbs.

@CelticMinstrel
Copy link

Oh yeah, I noticed when the new breadcrumbs showed up that it doesn't tell me which function I'm in.

@Jasdriel Jasdriel self-assigned this Aug 28, 2019
@sean-mcmanus sean-mcmanus modified the milestones: On Deck, 0.26.0 Aug 28, 2019
@Jasdriel Jasdriel added the fixed Check the Milestone for the release in which the fix is or will be available. label Sep 13, 2019
@HasanChoton
Copy link

Please support

@lmlong
Copy link

lmlong commented Sep 27, 2019

the outline should not be plain, it shall be a tree like view that have the member/methods unders the class name . Currently I cannot find a specified method through the outline as many similar classes are in one big cpp file

@bobbrow
Copy link
Member

bobbrow commented Sep 30, 2019

The fix for this will be in 0.26.0.

@sean-mcmanus
Copy link
Contributor

@sean-mcmanus
Copy link
Contributor

Improved document symbols are available with 0.26.0.

@psclkhoury
Copy link

@sean-mcmanus I am using 0.26.0 but the Follow Cursor option in the outline is not working.

@awmorgan
Copy link

awmorgan commented Oct 16, 2019

This 0.26.0 removed Alt+N C/C++ Navigate...

Is there the new way to do what the 0.25.1 Alt+N keyboard shortcut did?

Ctrl+Shift+O is close to previous functionality, but it seems to have dropped the declaration qualifier that was so you can see the difference between declaration and definition in the symbol list.

@bobbrow
Copy link
Member

bobbrow commented Oct 17, 2019

@psclkhoury can you open a new issue with more information about your problem? We've tested out the Follow Cursor feature in the Outline view and it is working for us. There may be something special about your code that we're not handling well.
image

@awmorgan, there is a command "Focus Breadcrumbs" that you can use in place of the old Navigate command. The default key combo is CTL+SHIFT+., but you can map that to ALT+N if you prefer that key combo instead.

@psclkhoury
Copy link

@bobbrow I realized that it is only not working in some files, I will try to see what is causing it and then open a new issue. Thanks

@github-actions github-actions bot locked and limited conversation to collaborators Oct 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Feature Request fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Projects
None yet
Development

No branches or pull requests