Skip to content

Add TextMate scopes for variable.other.object.method and support.variable.method (instead of property) #700

@saoudrizwan

Description

@saoudrizwan

I'm trying to modify the syntax color for method/functions that are members of a variable, no matter if they are being invoked or referenced.

Here's what I have so far:

{
	"scope": [
		"meta.method.declaration support.function",
		"meta.method.declaration entity.name.function",
		"meta.definition.method support.function",
		"meta.definition.method entity.name.function",
		"meta.definition.property support.function",
		"meta.definition.property entity.name.function",
		"meta.function.declaration support.function",
		"meta.function.declaration entity.name.function",
		"meta.definition.function support.function",
		"meta.definition.function entity.name.function",
		"meta.definition.property support.function",
		"meta.definition.property entity.name.function"
	],
	"settings": {
		"foreground": "#fff"
	}
},
{
	"scope": [
		"meta.function-call support.function",
		"meta.function-call entity.name.function",
		"meta.method.declaration meta.function-call support.function",
		"meta.method.declaration meta.function-call entity.name.function"
	],
	"settings": {
		"foreground": "#8182F8"
	}
},

example

In this example, I'd like to be able to have fref() and completion() be white instead of purple, but that's not an option because they have the exact same scope as .listen(.

As of now, VSCode exposes variable.other.object.property and support.variable.property, so I can make fref white and app purple, since app is a property of a variable and not a local variable. I'd like to be able to do something similar with functions that are specifically members of a variable or class.
variable.other.object.method and support.variable.method

Update
I believe variable.function is the scope I was looking for, however it doesn't seem to be supported by VSCode. It is supported in other editors!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions