-
Notifications
You must be signed in to change notification settings - Fork 81
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 missing scopes for correct symbol navigation #189
Add missing scopes for correct symbol navigation #189
Conversation
This enables Sublime Text to correctly find references to functions being called, at least for functions written according to the recommended style.
Static and instance methods are now identified as functions. F12 and shift+F12 can now correctly find definitions and references of class methods.
@deathaxe thank you for your feedback. Is the C syntax file a good start to learn how to properly apply scopes to functions? |
C also requires some refactoring to make use of latest best practices. Better use Java or PHP. Maybe Batch or ShellScript may also provide some inspiration as they are of same language family. I haven't analyzed PowerShell syntax too much, but my hunch is it possibly still requiring significant work to get to Bash/Zsh quality of parsing/scoping expressions. Especially its support of C# blocks may provide some extra challenges to not run into issues with exotic scripts. |
I see. Would you still be comfortable merging in these changes once I fix the tests, at least to provide basic working support for symbol search and navigation? |
Anything which improves this syntax is welcome. A major overhaul like for Bash etc. may not take place in the near future. |
Note: You proabably want/need to merge master branch into your PR to receive latest CI syntax test fixes. |
* master: Fix syntax test action (SublimeText#190) (Re-)add PowerShell 6+ number suffixes
@deathaxe sure! In this case, the CI complains about the missing definitions of commands like "Invoke-Something" and "Test-Path". Should I write dummy definitions like function Invoke-Something {} Or should I leave those tests be? |
@matteocoder if you're still looking for flaws to correct, some missing functionality is mentioned in various posts on #165 |
@michaelblyons thank you for pointing me to thee issue. I want to thank you all for the remarkable job you did with the syntax. Having it rewritten in YAML and become more tightly integrated with the plugin gave me the confidence to start contributing. |
I added a
meta.function-call
scope to the command context, so that references to commands written in the recommended PowerShell style can be found by using shift+F12I also added a new syntax context for class methods, so that instance and static method definitions are marked as functions. Similarly, this change allows F12 and shift+F12 to work correctly for methods.