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

Improve outline view #25

Closed
mads-hartmann opened this issue Apr 7, 2018 · 4 comments
Closed

Improve outline view #25

mads-hartmann opened this issue Apr 7, 2018 · 4 comments
Labels
enhancement New feature or request

Comments

@mads-hartmann
Copy link
Collaborator

Currently the outline view simply shows a flat list of all symbols in the file. I believe that you can get a hierarchical view if you return a bit more information (I think it's the name of the parent)

@mads-hartmann mads-hartmann added the enhancement New feature or request label Apr 7, 2018
@rcjsuen
Copy link
Contributor

rcjsuen commented Apr 7, 2018

This isn't really supported in the current specification. Also see microsoft/language-server-protocol#327 and its many referenced issues and so on.

/**
 * The name of the symbol containing this symbol. This information is for
 * user interface purposes (e.g. to render a qualifier in the user interface
 * if necessary). It can't be used to re-infer a hierarchy for the document
 * symbols.
 */
containerName?: string;

@laughedelic
Copy link

laughedelic commented Apr 8, 2018

Notice that the parent name is not enough. See discussion in facebookarchive/atom-ide-ui#121 and facebookarchive/atom-ide-ui#121 (comment) in particular for the summary.

TL;DR: LSP doesn't allow you to rely on containerName for the hierarchy. But you can use nested location ranges to nest the tree nodes. It works in Atom IDE UI and it works with the VS Code outline extension.

@mads-hartmann
Copy link
Collaborator Author

@laughedelic Thanks a lot, that was super helpful 👍 I've opened a PR #31 now which seems to do the trick in both Atom and Code. I will probably merge if early next week and cut a release with some other new features as well :)

@mads-hartmann
Copy link
Collaborator Author

We won't improve the outline view further until it's a proper part of the LSP definition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants