EditorSyntax icon indicating copy to clipboard operation
EditorSyntax copied to clipboard

The "scope" named "variable.other.member" includes the dot separator

Open Jaykul opened this issue 7 years ago • 2 comments
trafficstars

First off: I think we should be lexing a property and a method rather than the generic member -- however, this bug is simply against the fact that the separator dot is being included in the scope.

I'm using VS Code 1.26.0-insider

For repro sake, I added this to my preference:

    "editor.tokenColorCustomizations": {
        "textMateRules": [
            {
                "scope": "variable.other.member",
                "settings": {
                    "foreground": "#e23de2"
                }
            },
        ]
    },

And got this:

image

I expected only the words to be pink, i.e. only "Length" not ".Length" in:

$file.Length

I also did not expect it to affect the color of the method Delete() in

$file.Delete()

Jaykul avatar Aug 13 '18 23:08 Jaykul

Good catch. The separator actually has its own scope that it should use (punctuation.separator...,) I must have missed that.

The property vs method question is interesting and variable.function does exist for methods.

https://www.sublimetext.com/docs/3/scope_naming.html#variable

omniomi avatar Aug 14 '18 00:08 omniomi

for reference, the scope of the . was also mentioned at https://github.com/PowerShell/EditorSyntax/issues/107#issuecomment-393640603

keith-hall avatar Aug 23 '18 11:08 keith-hall