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

Add support for the comma-separated scope list synatx in sublime-syntax files #307

Closed
anima-libera opened this issue Sep 25, 2020 · 3 comments
Labels
Milestone

Comments

@anima-libera
Copy link

It is possible to define multiples scopes in a scope: field by separating them with commas like in

scope: meta.interface.xxx, entity.name.xxx, etc.xxx

however the syntax of sublime-syntax files doesn't really handle that correctly (only the first comma seems handled and the auto-completion breaks on the next capture for example).
This is not a big issue, but resolving it may add a + to the SS++++ ranking of this extremely good package ^^.

@keith-hall
Copy link
Member

keith-hall commented Sep 26, 2020

Are you sure the commas don't become part of the scope? (I'm not at a computer to check - the show_scope_name command on a token you've scoped with commas should reveal it... I guess if it did, it would be impossible to select them as comma is an operator in scope selectors. ) Typically scopes are stacked just with a space, no need for commas.

@anima-libera
Copy link
Author

Oh, my bad, scopes are space-separated... I couldn't find this anywhere, I only found an answer on the Sublime Text forum that says that scopes are comma-separated. Commas on comma-separated lists of scopes do show up when using the show_scope_name command, but everything else seems to work fine just as if they where space-separated.
Sorry for this non-issue then.
But still: when using the comma-separated syntax in a sublime-syntax file, the first comma is given the scopes

source.yaml.sublime.syntax meta.block.contexts.sublime-syntax

and the second one is given the scopes

source.yaml.sublime.syntax meta.block.contexts.sublime-syntax string.unquoted.plain.out.yaml

as if commas were only partly supported (or maybe they have an other use that I am not aware of, since documentation on the sublime-syntax syntax is rare on the Internet ><).

@FichteFoll FichteFoll added this to the 3.3.0 milestone Oct 7, 2020
@FichteFoll
Copy link
Member

The first comma should definitely be part of a string scope, so I fixed that for the next release. However, commas and other special characters in scope names aren't really expected or supported. I haven't experimented with what characters are allowed, but you would certainly be unable to match a literal comma with a scope selector, since the comma is an operator there.

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