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

Include regions in symbol list/outline/breadcrumbs #3210

Closed
theaquamarine opened this issue Feb 26, 2021 · 6 comments
Closed

Include regions in symbol list/outline/breadcrumbs #3210

theaquamarine opened this issue Feb 26, 2021 · 6 comments
Labels
Area-UI Issue-Enhancement A feature request (enhancement). Up for Grabs Will shepherd PRs.

Comments

@theaquamarine
Copy link

Summary of the new feature

It'd be helpful for navigating large scripts that don't make heavy use of functions if #regions were available for navigation on the go to symbol menu, outline, or breadcrumbs like functions etc are now.

@ghost ghost added the Needs: Triage Maintainer attention needed! label Feb 26, 2021
@rjmholt rjmholt added Area-UI Issue-Enhancement A feature request (enhancement). labels Feb 26, 2021
@SydneyhSmith SydneyhSmith added Up for Grabs Will shepherd PRs. and removed Needs: Triage Maintainer attention needed! labels Mar 2, 2021
@fflaten
Copy link
Contributor

fflaten commented Feb 7, 2023

Outline is being worked on in PowerShell/PowerShellEditorServices#1911 for quick navigation 👍

Go to symbol: Out of scope in the current PR. Does it make sense to see ex. hundreds of "#region helperfunctions" because you have them in every file?

Breadcrumbs: Out of scope in the current PR. It causes trouble with outline-hierarchy because endregion could be inside ex a function, breaking the hierarchy/nesting in outline. Maybe possible after we move to newer API (DocumentSymbol), can't test yet.

Any other languages that have these symbols-features for regions? Haven't seen any myself.

@andyleejordan
Copy link
Member

Maybe possible after we move to newer API (DocumentSymbol).

I think we gotta prioritize doing this. I don't like using a deprecated API, but damn, keeping track of parent/child relationships when building the symbol tables doesn't seem like it'll be easy to get right.

Go to symbol

This should "just work" unless you explicitly skip them in that logic, no?

@fflaten
Copy link
Contributor

fflaten commented Feb 7, 2023

I think we gotta prioritize doing this.

👍

keeping track of parent/child relationships when building the symbol tables doesn't seem like it'll be easy to get right.

Tracking parent should be easy. Efficiently building the symbol-tree from Parent-reference might be a bit harder. Unless we just store a list of children per symbol also. Feels redundant, but at the same time, we clear and rescan every symbol on file change so should always be in sync. (Should move this to own issue)

Go to symbol

This should "just work" unless you explicitly skip them in that logic, no?

Yes. Intentionally ignored in PR because it felt noisy. That's why I was hoping for feedback here. Maybe it's just me. 🙂

@andyleejordan
Copy link
Member

Go to symbol: Out of scope in the current PR. Does it make sense to see ex. hundreds of "#region helperfunctions" because you have them in every file?

There is actually "Go to Symbol In Editor" which means only the current file (and I think it's fed via Occurrences in PSES) so we can do this.

@fflaten
Copy link
Contributor

fflaten commented Feb 24, 2023

There is actually "Go to Symbol In Editor" which means only the current file (and I think it's fed via Occurrences in PSES) so we can do this.

Good catch! We got that included for free with DocumentSymbolHandler 👍

@andyleejordan
Copy link
Member

Resolved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-UI Issue-Enhancement A feature request (enhancement). Up for Grabs Will shepherd PRs.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants