Skip to content

Include regions in symbol list/outline/breadcrumbs #3210

Closed

Description

@theaquamarine

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.

Activity

  1. ghost added
    Needs: Triage
    on Feb 26, 2021
  2. added
    Issue-Enhancement
    on Feb 26, 2021
  3. added
    Up for Grabs
    and removed
    Needs: Triage
    on Mar 2, 2021
  4. fflaten commented on Feb 7, 2023

    @fflaten
    Contributor

    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.

  5. andyleejordan commented on Feb 7, 2023

    @andyleejordan
    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?

  6. fflaten commented on Feb 7, 2023

    @fflaten
    Contributor

    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. 🙂

  7. andyleejordan commented on Feb 23, 2023

    @andyleejordan
    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.

  8. fflaten commented on Feb 24, 2023

    @fflaten
    Contributor

    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 👍

  9. andyleejordan commented on Feb 28, 2023

    @andyleejordan
    Member

    Resolved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-UIIssue-EnhancementUp for Grabs

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions