Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default scope for class names? #445

Closed
jcberquist opened this issue Jun 1, 2016 · 4 comments
Closed

Default scope for class names? #445

jcberquist opened this issue Jun 1, 2016 · 4 comments
Labels

Comments

@jcberquist
Copy link
Contributor

The discussion here wesbos/cobalt2#104 led me to this wesbos/cobalt2#103 regarding ES6 class highlighting in JavaScript.

Examining the scope name used by a handful of the default syntaxes for class names it looks like they are split between entity.name.class.xxx (e.g. C++ and PHP) and entity.name.type.class.xxx (e.g. JavaScript, Java, Python). Is there a reason for this difference? If not, perhaps it would be a good idea to standardize on one scope name or the other?

@wbond
Copy link
Member

wbond commented Jun 1, 2016

My intent is to standardize on entity.name.class. I guess I missed Python, and JavaScript was early on before I started a lot of the standardization work.

In general, my recommendation will be to have color schemes highlight the following selectors:

  • entity.name (this will include .constant, .namespace, .macro, .function, .class, .struct, .union, .impl, .trait, .interface, .enum, .type, .val, .package etc)
  • entity.name.tag (HTML and XML tags, various markup syntaxes)
  • entity.name.label (Various syntaxes)
  • entity.name.section (LaTeX, Markdown)

There is one instance of entity.name.other in YAML that could perhaps be something like entity.name.section or entity.name.label.

To keep more strict adherence with old syntaxes and color schemes we could put everything from entity.name other than entity.name.function as a sub-scope of entity.name.type, but I don't think that is all that accurate, especially with things like .constant, .namespace and .package.

@wbond wbond added the question label Jun 1, 2016
@FichteFoll
Copy link
Collaborator

FichteFoll commented Jun 1, 2016

Out of curiosity, is there any non-entity.name entity scope?

Edit: there's entity.other.inherited-class and entity.other.attribute-name, and some other exotics.

@jcberquist
Copy link
Contributor Author

@wbond: Thanks for the information. I prefer entity.name.class myself, so I would be happy with the official syntaxes going in that direction (though of course just standardizing on one or the other seems more important). And I don't really like the idea of putting everything in entity.name other than function under .type.

From the list @FichteFoll provided it looks like in the color schemes he checked entity.name.class is targeted twice as often as entity.name.type.class is as well.

@wbond
Copy link
Member

wbond commented Jun 2, 2016

This has been resolved for all of the syntaxes we've worked on rewriting recently. Work will continue on others and I will document entity.name.class as the standard in the official docs once I get to that.

@wbond wbond closed this as completed Jun 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants