-
Notifications
You must be signed in to change notification settings - Fork 40
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
clear_scopes behaves differently with push/set #2530
Comments
I was working on addressing this. After changes and running the tests on the default packages, all 193 assertion failures are from rules written by you @deathaxe 😃. |
Propably yes, as I tried to work around or work with this behavior to avoid overlapping meta scopes. I'd be keen enough to have a look at those when the time has come ;-) |
I guess Erlang contains some of the 193 failures? Example:
With (the second) |
Yes, I was mostly just amused that the only situations where this bug would have been hit (in the default packages) were written by you, and you submitted the issue. Clearly it is mostly just a style of how you approach transitioning between contexts, and there certainly isn't anything wrong with that. It is definitely something that should be fixed, IMO, while we are in the process of making breaking changes. |
A similar pattern is used in Python but without |
This has been fixed in build 4075, but only for |
This issue may already be part of #2326 - not sure, but it adds a minimal test case to illustrate how
clear_scopes: 1
behaves differently when usingpush
orset
. The attached test file fails at exactly one position.The example scopes a function definition in two different ways. Functions starting with
@
push
the context to scope the parameter list to the stack while functions starting with$
set
the context to stack to do the same.As each function does only have one parameter list, using
set
makes somehow more sense as we want to pop off theparam-...
context as soon as the closing)
is matched and continue with the next one (which ismeta
in the example but could be an arbitrary list of contexts in real world).Actual Behavior
clear_scope: 1
does not clear themeta.function.test
scope from the opening(
. Hence it contains bothmeta.function.test
andmeta.function.parameters.test
.The
meta.function.test
is already cleared from the closing)
for bothpush
andset
.Expected Behavior
clear_scope: 1
should clear themeta.function.test
scope from the opening(
so it contains onlymeta.function.parameters.test
. This is the behavior when usingpush
already. Bothset
andpush
should have the same result.ClearScope.sublime-syntax
Syntax Test
Console
The text was updated successfully, but these errors were encountered: