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 functionality to show the type hierarchy #133

Closed
devoncarew opened this issue Aug 27, 2016 · 11 comments · Fixed by #190
Closed

add functionality to show the type hierarchy #133

devoncarew opened this issue Aug 27, 2016 · 11 comments · Fixed by #190
Labels
blocked on vs code / lsp / dap Requires a change in VS Code to progress is enhancement
Milestone

Comments

@devoncarew
Copy link
Contributor

In other tools, this is hooked up to something like F4. Those tools are able to show a tree view of the type hierarchy (superclasses and subclasses). We may have to expose this info in a vscode selection list (https://code.visualstudio.com/docs/extensionAPI/vscode-api#_window), so would need to flatten it somehow.

@DanTup
Copy link
Member

DanTup commented Aug 27, 2016

Seems like a good idea; presumably will look similar to the document symbol list.

If it's just inheritance, won't this already be a flat list? Or are mixins/interfaces included too?

@DanTup DanTup added this to the v1.0 milestone Aug 27, 2016
@devoncarew
Copy link
Contributor Author

It could be a flat list going up, if you omit interfaces and such. Going down it'd be more difficult - easy to show children, harder to organize the grandchildren -

@DanTup
Copy link
Member

DanTup commented Aug 27, 2016

Ah, of course; didn't think about children!

I presume this is the sort of thing you mean?

Type hierarchy

@DanTup DanTup modified the milestones: 0.10, v1.0 Aug 27, 2016
@devoncarew
Copy link
Contributor Author

devoncarew commented Aug 27, 2016

Yup; we'll need to flatten it somehow. That may be some creative naming of
items, or choosing to omit some levels of the tree.

@DanTup
Copy link
Member

DanTup commented Aug 28, 2016

Had a quick look at this... Seems we can't use spaces to indent, not have multiple spaces together, they get stripped (including literal non-breaking spaces). Any character I use to try and force the indent looks lame:

Dummy quickpick list

Ideally, we'd have real indenting and be able to add icons and such, so it looks similar to the document symbol list:

Document symbols

Not sure how well we'll be able to do this. I've added an additional comment to #133 asking if they do it, could they consider use for this as well as just a view of symbols in the current document.

@DanTup
Copy link
Member

DanTup commented Aug 28, 2016

I pushed the branch that has a command wired up to F4 and renders these dummy values to safe some time if you wish to have a play around:

https://github.com/Dart-Code/Dart-Code/tree/type-hierarchy

@DanTup DanTup modified the milestones: 0.10, 0.11 Aug 31, 2016
@DanTup DanTup removed this from the 0.11 milestone Sep 8, 2016
@DanTup DanTup added the blocked on vs code / lsp / dap Requires a change in VS Code to progress label Oct 7, 2016
@DanTup
Copy link
Member

DanTup commented Oct 7, 2016

I don't think we can reasonably implement this without changes in Code. There's some discussion about this here but it looks like it's some way off (if it'll ever be added) :(

@DanTup
Copy link
Member

DanTup commented Oct 18, 2016

@devoncarew Since I hadn't had much time to do anything more, I've pushed out an update with this in.

@DanTup
Copy link
Member

DanTup commented Jan 6, 2017

I've opened #243 to investigate if we can improve this with a new API from Code.

@dupuchba
Copy link

hey @DanTup , does it mean that type hierarchy is only available for newer version of the dart sdk ?

@DanTup
Copy link
Member

DanTup commented Oct 20, 2022

@dupuchba I'm not sure I completely understand the question (or at least as it relates to this issue). This issue was about an old type hierarchy that does not work for LSP (which is what most users are using).

I've recently been working on supported the new native Type Hierarchy support in VS Code as you noted in #4226. That support will only be available in new SDKs (currently it's only in dev/master versions, but it should be included in a future stable release of Dart/Flutter SDKs).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked on vs code / lsp / dap Requires a change in VS Code to progress is enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants