Sublime Forum

Entity.name.constant not showing up in symbol list

#1

So the new scope naming guidelines suggest using entity.name.constant for constants to get included in the symbol list. I tried it on my sublime-syntax definition but it’s not showing up. I’m using 3118. I also tried variable.other.constant but that didn’t work either.

Also what are examples of using each one?

For a Java example:

public static final Car DEFAULT_CAR = new Car();

Should DEFAULT_CAR in this case be an entity or a variable.other.constant?

0 Likes

#2

entity.name is for declarations, variable.other.constant is for uses. So in your case DEFAULT_CAR should be an entity. (Uses can’t always be detected vs. a regular variable, unless the language forces uppercase constant names for example, so sometimes uses will have a different variable. scope.)

As for symbol indexing, it is controlled by a .tmPreferences file. entity.name.constant seems to be missing from the Java metadata file: https://github.com/sublimehq/Packages/commit/382cd7d21c0cc0fc0ba0f86e841a25fbb16675ed
I think it is just an ommision rather than deliberate.

1 Like

#3

woot, that fixed it thanks! I’ll send a PR to add it.

0 Likes