-
Notifications
You must be signed in to change notification settings - Fork 46
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
Synxtax color entity.name.type not validated for [type] over storage.type scope #179
Comments
I'm just wondering why storage.type.powershell overrides meta.function.powershell on the "function" keyword. I see that javascript does the same thing, but why does storage.type take precedence over meta.function? Meta.function is more specific and allows for the function keyword to be colorized separate from the generic storage.type. EDIT: It's because meta is a special keyword that doesn't get a precedence, and refers to the entire function block, not the function keyword itself. |
Also entity.name.type refers to the name of the function, e.g. function MyFunction, not the "function" keyword itself. I'm working on a grammar injection extension that will add a more specific "storage.type.function.powershell" to the function keyword, so you can theme it appropriately, until such time the new and improved grammar shown in a pull request becomes the primary option. |
@JustinGrote, in PowerShell, functions are really static methods (which also get the scope Somewhere people thought that I have spent a bunch of time addressing this in my own theme, specifically capturing the javascript and typescript scopes and forcing them to the same color as C# scopes. If This is all just food for thought. |
@msftrncs I think you got my response confused with @PhilipHaglund. @PhilipHaglund is saying that the function keyword should be I agree with you that it should not, it should be @PhilipHaglund I have made a vscode extension that addresses this issue and properly formats the function so that you can theme it appropriately. It's an effective workaround until the EditorSyntax file gets revamped (looks like work has stalled on that front for now) |
Thanks @JustinGrote will check that out! :) |
There is no reason to continue to support Furthermore, its surprising, as many times as I have looked at the Sublime document, I never noticed the abundant suggestion to use multiple scope selections, while the Atom editor's theme system doesn't support it. Themes in Atom have to match the entire selector (which they cannot do, because the space is a separator character in the selector expression). Its this reason that probably prevents grammars such as JS/TS from adopting the recommendation correctly. |
Environment
Editor and Version:
Visual Studio Code
Version: 1.35.0 (system setup)
Commit: 553cfb2c2205db5f15f3ee8395bbd5cf066d357d
Date: 2019-06-04T01:18:19.664Z
Electron: 3.1.8
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Windows_NT ia32 10.0.17763
Your primary theme: PowerShell ISE
Issue Description
The entity.name.type is not validated over storage.type when defined in settings.json nor in theme.json.
When defining a type, i.e. [string], and using a statement, i.e. function, they both use the same syntax color from the storage.type scope.
Is the entity.name.type scope not defined for types?
Screenshots
Example code. Pasted the tokenColorCustomization from Settings.json in the same file for example purposes.
[string] type
function statement
Expected Behavior
In PowerShell ISE the statements uses the Keyword token with color '#00008b' and the types uses the Type token with color '#008080'. Is there another way to distinguish these scopes or tokens that I've missed or is the powershell.tmLanguage.json missing something?
The text was updated successfully, but these errors were encountered: