Packages icon indicating copy to clipboard operation
Packages copied to clipboard

[Meta] Scope names

Open ngc92 opened this issue 3 years ago • 2 comments

What happened?

In order to look more into how scopes are named in different languages, I wrote a script that extracts all scopes from all the syntaxes here, removing language-specific suffixes. While looking over the results (not in detail -- there are too many scopes to do this quickly), I noticed the following things:

Typos:

entity.name.function.prepocessor   {'.ruby', '.perl'}

Potential inconsistencies in naming:

invalid.illegal.expect-separator   {'.erlang'}
invalid.illegal.expected-mapping-separator   {'.json'}
invalid.illegal.separator-expected 
invalid.illegal.hash-expected   {'.git.rebase'}

invalid.illegal.identifier   {'.css', '.perl', '.groovy', '.java', '.js'}
invalid.illegal.illegal-identifier   {'.js'}

invalid.illegal.stray-brace   {'.python'}
invalid.illegal.stray.brace.curly   {'.python'}

keyword.control.conditional.else   {'.matlab', '.dosbatch', '.haskell', '.perl', '.tex', '.python', '.shell.bash', '.r', '.cs', '.php', '.java', '.js'}
keyword.control.else   {'.applescript'}

keyword.control.assert   {'.groovy'}
keyword.control.flow.assert   {'.python', '.java'}
keyword.other.assert   {'.d'}
meta.declaration.assertion   {'.groovy'}

keyword.control.loop.for   {'.matlab', '.dosbatch', '.perl', '.python', '.shell.bash', '.r', '.cs', '.php', '.java', '.ruby', '.js'}
keyword.control.for-loop   {'.ocaml'}
meta.do-while   {'.js'}

keyword.control.loop.repeat   {'.r'}
keyword.control.repeat   {'.applescript'}

keyword.control.return   {'.lua'}
keyword.control.flow.return   {'.matlab', '.dosbatch', '.perl', '.c++', '.python', '.shell.bash', '.r', '.cs', '.php', '.c', '.java', '.ruby', '.js'}

keyword.declaration.import   {'.java', '.scala', '.haskell'}
keyword.control.import   {'.objc', '.c++', '.objc++', '.python', '.git.config', '.ocaml', '.cs', '.makefile', '.c', '.ruby', '.d'}
keyword.import   {'.js'}
keyword.other.import   {'.go', '.groovy'}

meta.enum   {'.objc', '.c++', '.objc++', '.cs', '.php', '.c', '.java', '.ts', '.d', '.rust'}
meta.enumeration   {'.matlab'}

meta.paren-group   {'.ocamllex', '.ocaml'}
meta.paren.group   {'.ocaml'}

ngc92 avatar Dec 06 '22 19:12 ngc92

invalid.illegal scopes are not further standardized, thus may use many different names in various syntaxes.

Most other inconsistencies are a result of some syntaxes in that repo not being actively maintained and thus have fallen behind with regards to scope names. Some obvious things have been updated to try to keep the inline with reasonable effort, but that's not perfect for sure.

deathaxe avatar Dec 07 '22 18:12 deathaxe

Feel free to create PRs for things you find ;-)

deathaxe avatar Dec 07 '22 18:12 deathaxe