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

Fix symbol highlight when hovering function name #1890

Merged
merged 5 commits into from
Aug 15, 2022

Conversation

fflaten
Copy link
Contributor

@fflaten fflaten commented Aug 14, 2022

PR Summary

Fixes:

  • Hovering a function name does not work properly when function is indented
  • Highlight-range when hovering function name. Currently includes the scriptblock when it's not supposed to.

PR Context

Fix #1887
Fix #1888

@fflaten fflaten requested a review from a team August 14, 2022 17:45
@fflaten
Copy link
Contributor Author

fflaten commented Aug 14, 2022

Should we extend the tests to check end of symbol? Yes

Edit: Also, in case someone was wondering: test were extended to search for function name in definitions as they are different AST type than references -> use different code.

Copy link
Member

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

Nice work, thank you! Just made some inline changes to correct an existing spelling error.

@andyleejordan andyleejordan enabled auto-merge (squash) August 15, 2022 20:55
@andyleejordan andyleejordan merged commit 87cd721 into PowerShell:main Aug 15, 2022
@fflaten fflaten deleted the function-highlight branch August 15, 2022 21:43
@fflaten
Copy link
Contributor Author

fflaten commented Aug 15, 2022

🎉 Btw. just realized that I didn't add test for SymbolService.FindFunctionDefinitionAtLocation() which use the includeFunctionDefinitions: true behavior.

The old extent was very wrong (endline, but endcolumn=startcolumn + name length). 95% sure it didn't break anything, but just letting you know in case you have a list of known missing regression tests :)

@andyleejordan
Copy link
Member

I do indeed have that 😅

@andyleejordan andyleejordan mentioned this pull request Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Hovering function name highlights definition Hovering function name doesn't work when function is indented
2 participants