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

Integrating class symbol support #1984

Merged
merged 80 commits into from
Feb 2, 2023
Merged

Conversation

andyleejordan
Copy link
Member

This is the full (admittedly still a bit of a work-in-progress PR) that integrates #1886 into main.

@andyleejordan andyleejordan requested a review from a team January 12, 2023 19:37
@andyleejordan andyleejordan force-pushed the andschwa/better-symbols branch 2 times, most recently from 82ec11f to 604d6a7 Compare January 20, 2023 22:12
Copy link
Member Author

@andyleejordan andyleejordan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some quick comments but there's more, I just need to eat lunch.

@fflaten
Copy link
Contributor

fflaten commented Jan 21, 2023

This is coming along very well! I'll try to consolidate my thoughts in this PR 🙂

  • Need to filter on symboltype when searching symbols. Function name and and class name match, Go to definition on [type] shows constructors etc. Related comment Integrating class symbol support fflaten/PowerShellEditorServices#16 (comment)
    image

    • Note: Example below will need special handling like type vs class/enum for EnumMember definition vs Property reference (or replace EnumMember with Property for simplicity).
      image
  • Consider matching [classname]::new() with classname() constructors? Same as Integrating class symbol support fflaten/PowerShellEditorServices#16 (comment)

  • Missing method overload in outline and workspace symbol search
    image

  • Hide variable symbols in outline+workspace for method parameters in definitions (image above)

  • Remove variable symbols for parameters in function/cmdlet calls
    image

  • Only show variable assignment symbols for top-level assignments like stable? To remove noise in outline and workspace symbols - at least until we're able to handle scopes better. Related discussion Integrating class symbol support fflaten/PowerShellEditorServices#16 (comment)

    • Also for go to definition? Will currently list reassignment inside of out-of-scope functions
  • Outline, workspace symbol search and go to definition jumps to function-keyword and not name (using scriptrange atm?).
    Currently undoes fix for Outline, symbol search and go to definition should jump to symbol name #1905 in original PR.

  • Struggles with large files. Outline, workspace symbols and hover works. Codelens shows "no command", go to definition doesn't work, highlight on click etc. (anything searching for specific symbol?) fails. Try Pester.psm1 (17k lines).
    Update 24/1: Fixed in latest commits 🎉

  • New 24/1: Hovering a function name should only highlight the name. Currently highlights full definition and full invocation/call
    image
    image

This PR would also fix #1889 and #1904 🎉
image

@fflaten
Copy link
Contributor

fflaten commented Jan 24, 2023

Latest commit fixed the reference-issue with large files 🎉 I've updated the previous post

Copy link
Collaborator

@SeeminglyScience SeeminglyScience left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm probably about 2/3's done reviewin' but here's what I got so far. Very exciting changes though! ❤️

Co-authored-by: Patrick Meinecke <SeeminglyScience@users.noreply.github.com>
@@ -89,7 +89,7 @@ private static ParameterInformation CreateParameterInfo(ParameterInfo parameterI
return new ParameterInformation
{
Label = parameterInfo.Name,
Documentation = string.Empty
Documentation = parameterInfo.HelpMessage
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SeeminglyScience Not a whole lot comes from this it seems.

src/PowerShellEditorServices/Utility/Extensions.cs Outdated Show resolved Hide resolved
src/PowerShellEditorServices/Utility/VisitorUtils.cs Outdated Show resolved Hide resolved
So that we rely on the dictionary to sort our symbols into the equivalent
types instead of having to perform a filter.
I think there's a cleaner way to do this, but this works.
Against the full name and not just the identifier, since it's
what's displayed in the search menu.

Now you can search methods by their parameters' names.
@andyleejordan
Copy link
Member Author

Thanks @fflaten and @SeeminglyScience, resolved those things!

Copy link
Collaborator

@SeeminglyScience SeeminglyScience left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! These changes are awesome. Huge thank you @fflaten (and ofc @andschwa) ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Symbols and References Issue-Enhancement A feature request (enhancement).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants