-
Notifications
You must be signed in to change notification settings - Fork 340
implement a document symbol provider #45
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
Conversation
|
It's ~equivalent to the outline view in other tools, but w/o the UI being persistent (I'm used to using an outline view as an always open bit of UI on the right side of the editor). |
src/dart_document_symbol_provider.ts
Outdated
| subscriptions: { 'OUTLINE': [file] } | ||
| }); | ||
|
|
||
| // TODO: Improve the presentation to make the file structure clearer? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this relate to; all seems fine to me (I think)!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not 100% clear from looking at the list when a member is contained in a class. It's a note to myself - we could remove it as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see, I thought you meant the code presentation. Couldn't we prefix with the class name? Or isn't that what the containerName is supposed to do; does it not get rendered?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this TODO: - looking at this, I think we're returning the right info from the POV of vscode; we'll rely on them to present things well so that user's can easily navigate the file.
|
@devoncarew Looks good! I made a comment about parameters which I think would make it better? Also - the mapping you moved to |
|
I'll take another spin through this tomorrow - |
|
I took a look at the mapping - I updated one mapping for an enum_value from a constant to an enum. I'm not sure what a |
|
updated - |
|
|
||
| let name = element.name; | ||
| if (element.parameters) | ||
| name = `${name}()`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I meant here was, can't we do name = ${name}${parameters}`` (depending on TS handling of undef/null, it might not even need the if?). This way the results will show the parameters of the method too!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The names might get a little long, but it'd be worth experimenting with, to see how it looked. You may also want to see what other language integrations do here -
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah; I'll both compare with TS and see how it looks (and also review the workspace one for consistency, I don't think I added parens or anything there).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I've done in full outline views in the past (where I was concerned about horizontal scrolling), was:
fooBar(a field or getter)fooBar()(a method w/o args)fooBar(...)(a method w/ args; the ellipsis is used to save space but indicate that there are params there)
But probably we should just aim for consistency w/ other language integrations into vscode -
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, the parens help me know when something's a method vs a field - I guess I'd want to keep those.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good w/ either (the ellipsis or the full params). The full params are useful, if a bit busy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, let's go with the full params (I guess it's most accurate, even if lack of overloads make it less confusing) and we'll see how it goes. You're likely to use it more/on bigger files than me in the short-term so if you decide it's bad, do shout (or just change).
|
I can't merge this inline due to conflicts, will do when at PC tonight. I don't mind testing the params change to see how it looks if I get to it before you. |
|
Merged to master - |
|
I think AppVeyor got an ISE from GitHub downloading the TS defs! There's nothing like a reliable build system! Forcing a rebuild.. |
|
(Currently the only thing it's doing is running the TS compiler, though seeing if I can run automated tests there is on my list; though I'm concerned I might not be able to Code there... we'll see). Unsurprisingly passes this time. Thanks! |



Implement a document symbol provider based on the outline view notification. This is the 'go to symbol' command.