Closed rafaelrenanpacheco closed 4 years ago
Technically, issue seems to be "trailing property" vs "non-trailing property", but I agree - we should not distinguish between properties here, there is a fairly small gain to do that. I can see the current syntax being useful, for example, if you want to differentiate the last property in the chain.
This seems to be a legacy change that was copied from an another repository and has been around for a long time. Hopefully, no one relies on this difference in scopes.
I will open a pull request to update the scope, thanks.
Description
I'm trying to clone IntelliJ's Darcula theme, and there's an issue when trying to set the
variable.other.object.property.java
foreground color. In IntelliJ fields have different colors, and this is good because it allow us to avoid thethis
keyword and still be easy to identify fields inside a method. In VS Code this wasn't possible to do because a field without thethis
keyword receives thevariable.other.object.java
pattern, which conflicts with objects defined inside the method. If thethis
keyword is used, the field receives thevariable.other.object.property.java
pattern, which defines a field inside a method body.I think this is a grammar bug because in both cases we are talking about the same object, so with or without the
this
keyword it should be avariable.other.object.property.java
.Steps to Reproduce
Token identification without
this
keyword:Token identification with
this
keyword:Expected behavior:
Both cases (with and without
this
) be recognized asvariable.other.object.property.java
.Actual behavior:
Field without
this
receivesvariable.other.object.java
Field with
this
receivesvariable.other.object.property.java
Reproduces how often:
Always.
Versions
VS Code: 1.43.2 OS: Linux x64 5.4.28-1-MANJARO
Additional Information
I saw a grammar bug report on VS Code repository being transferred to this repository, so I opened this issue here as well.
Also when creating a code snippet for this issue, I saw that when using the field without method invocation still results in different patterns with and without the
this
keyword: