-
Notifications
You must be signed in to change notification settings - Fork 117
TextMate scope selectors: scope exclusion is not implemented #52
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
Comments
just to make sure it's captured, the descendant scope selectors such as |
This is really lacking. Also, scope exclusion should not be limited to parent scopes but should be similar to the CSS |
As an example of the inconvenience not having descendant selectors causes, in my personal theme, instead of the scope
|
Add support for expression-bodied property and event accessors
Only the main scope is applied. E.g. |
+1 for exclusions please! |
Are you sure about that? I just tried using a scope exclusion in |
In my testing, it appears I can get effects similar to "exclusions" simply by specifying a very narrow scope. Ex: "scope": "comment.block.documentation.cpp variable.parameter.cpp" Full context: "textMateRules": [
{
"name": "Doxygen variable names",
// This works! YOU **MUST** put the wider scope FIRST, and then the narrower scope after!
"scope": [
"comment.block.documentation.cpp variable.parameter.cpp",
"comment.line.double-slash.documentation.cpp variable.parameter.cpp",
],
"settings": {
"foreground": "#a6a292",
},
},
{
"name": "Doxygen keywords, such as 'param' and 'brief'",
"scope": "storage.type.class.doxygen.cpp",
"settings": {
"foreground": "#7C8E9C",
}
},
] See this in my tutorial here, including screenshots and explanations: How to customize colors in VSCode by using the built-in "Scope inspector" tool. |
It appears that TextMate also had a bunch of other operators not documented in the manual. Sublime Text also supports these This is detailed in this StackOverflow answer and links to a bunch of blog posts and mailing list posts by Alan Odgaard explaining them. It also lists other operators Sublime Text doesn't support, though my suspicion is these operators were added in TextMate 2.0. It would be really helpful if VSCode could support all of the TextMate 1.x operators, i.e. the operators Sublime Text supports, both because they're really useful and because they're found in existing Sublime Text grammars. Personally, I would find the |
Looking at the actual source of this repo, it looks like it's actually trying to support Given that, I'm not sure what's going on here. Even trivial grouping doesn't work in my experiments (in |
|
Good and bad news - I implemented the
Here's the files:
The parser is not Typescript and I'd appreciate help making it type-sensitive! |
@kevinsawicki @GlenCFL @50Wliu are any of you able to assist in translating your previous work to TypeScript, mainly the |
Sorry - I don't have much context here. Is the issue that VS Code doesn't support exclusions or "spaces", but Atom does? |
|
Unfortunately the performance of the Peg.js parser is rather slow on lower-end CPUs due to the insane amounts of recursion here: I am hoping there is a way to get those running in WASM and I'll be looking into it this weekend. EDIT: My laptop broke which takes me out of commission for 2 weeks minimum. I don't expect myself to solve this feature soon |
Instead of WASM we can add caching logic to ScopeSelector class for match results, and this will work at 75% of the speed of the existing VS Code matchers! I will open a pull request for this soonish |
From @monk-time on September 4, 2017 14:51
Also the same result with today's VS Code Insiders build.
According to the documentation for TextMate scope selectors, VSCode supports the syntax for excluding matching scopes:
This functionality is used in at least one built-in theme that I could find:
https://github.com/Microsoft/vscode/blob/c00bdb74ee665cccfc5c4e41520893bb19ef61e5/extensions/theme-monokai/themes/monokai-color-theme.json#L316
But it seems that this syntax makes the selector with
-
in it invalid, and VSCode doesn't apply the given rule to anything at all.Steps to Reproduce:
"scope": "comment - source.js",
Expected result: comments that changed their color after step 1 remain yellow in all files except in
.js
.Actual result: all comments reset to a color defined by the current theme.
Reproduces without extensions: Yes
Copied from original issue: microsoft/vscode#33802
The text was updated successfully, but these errors were encountered: