-
Notifications
You must be signed in to change notification settings - Fork 512
Syntax highlighting is different than other editors. #233
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
Hi @Allieway, this is mostly due to how the current shared PowerShell syntax highlighting definition works. @gravejester has been working on a refactored version but we had to pull it recently because it had an issue. The main difference between the ISE's highlighting and what you see in the other editors is that the ISE leverages PowerShell's parser to extract the correct token types for all the code in the file. In the other editors we're relying on regular expression based parsing and also the TextMate grammar format. Despite the limitations of that format, we'll try to make it colorize more reliably compared to other languages so that you won't need to tweak your themes that much. Our effort to improve the syntax definition can be found at the PowerShell/EditorSyntax repo. |
I may head over and see if I can contribute at all. The issue seems to be that it would be a joint effort of both the themes and the editor syntax. Would it be better to use the incorrect scope names for the syntax to make it look standard on all themes instead of using the correct scope names and having the themes that aren't setup for powershell to look off? I did see several comments that were doing just this as an attempt to colorize correctly with the default theme(in the atom powershell language), but it ended up making the highlighting even further from ISE than if the correct capture was set. I guess the hope is once the syntax is closer to correct things like themes and colors will follow suite. |
That'd be great, thanks! Yeah, it seems we'd need to make the scope names conform to what the editors' themes are using, otherwise the themes would need to change to conform to us (not so likely 😄). It'll probably take a more focused effort to make a scope-conformant tmLanguage and then compare it's colorization results to what the ISE puts out. We need to do some work to enable regression testing of the tmLanguage so it might also be worth extending that to make the highlighting seem closer to what we get from the ISE while still showing up correctly in VS Code/Atom/Sublime. |
For anyone that want to contribute regarding scope names and such, I have started this discussion for this: PowerShell/EditorSyntax#8 |
When using the same theme for vscode as Powershell ISE or Vistual Studio 2015 the way syntax highlighting is done is completely different. This happens in Atom, vscode, and sublime text.
Below are pictures of what I mean.
I understand that themes will not have powershell specific support, but it seems as though every theme I try is completely different to Powershell ISE, which is what I am used to. I have started creating my own theme but it seems like there are limitations I am running into. I was mainly just wondering if anyone else is experiencing the same thing or they actually prefer it this way? And also if there is a faster way to make it look the same as ISE without creating a whole custom theme which would have to be made to have a ton of powershell specific options to not mess up other languages.
VS Code

PowerShell ISE

The text was updated successfully, but these errors were encountered: