Skip to content

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

Closed

Description

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!

Activity

  1. mjbvz commented on Dec 28, 2018

    @mjbvz

    Moving upstream to get more feedback. However some parts of this sound like they would require semantic colorization which textmate grammars do not support

  2. removed their assignment
    on Dec 28, 2018
  3. sheetalkamat commented on Mar 20, 2019

    @sheetalkamat
    Member

    The only way to syntactically detect function at its reference location is function invocation so that part is out of scope for this repo. The other part of detecting function as variable.function was something we reverted as part of #443 where we concluded that entity.name.function is more widely used and hence we would use that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions