-
Notifications
You must be signed in to change notification settings - Fork 588
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
[JavaScript] Don't try to scope entire call paths #3830
[JavaScript] Don't try to scope entire call paths #3830
Conversation
Fixed the related failure in the PHP syntax test. |
The current way of applying bar (baz),
// ^^^ meta.function-call
// ^ - meta.function-call
// ^^^^^ meta.function-call.arguments |
Yeah, I was wondering if anyone would notice or care. I'll count that as a “yes”. 😉 I also found a really minor bug. In |
Should be all good now. The part that gets the whitespace after a variable name is a bit of a kludge, but it was either that or do something with the arrow function detection code, and nah. |
This required me to update my downstream QML syntax once again. Which is fine in itself. But I do wonder how to keep CI green when it's running against multiple versions of Sublime Text, so obviously packages are going to be mix-versioned? For now I removed JS-specific scopes from the tests, but ideally it would be good to have them in-place as well. |
In case core syntax changes effect inheriting 3rd-party packages those need to ship ST build specific releases by either leave older package versions alone or maintain multiple branches in parallel. Less, Liquid and other packages are doing so, already. They maintain tags such as |
Fix #3790.
The scope naming guidelines recommend giving e.g. all of
foo.bar.baz()
the scopemeta.function-call
. For reasons discussed in #3790 and in #2575, this is quite difficult to implement in a reliable manner. Currently, the JavaScript syntax definition tries to do this using lookaheads, but it is far from reliable, leading to observable highlighting bugs such as #3790.This PR rips out the existing code scoping function call paths and instead just scopes the function/method identifier and arguments. This should be sufficient for any of the actual use cases discussed in the linked issues while also being much more reliable. Notes:
meta.function-call.method
. This is not in the guidelines and no other core syntax did this, so I removed it for simplicity.meta.function-call.arguments
, which is widely done, so I added that in.