Comments (10)
Making all of those changes(still don't know how to edit the brackets) makes the following difference.
As you can see it looks much much better. I have tried it in several different themes and compared with similar results.
from editorsyntax.
This is a great start! Curious to see what feedback @aeschli might have.
from editorsyntax.
Yeah, I have started by just filling out the scope names as I have used them. Hopefully we get some feedback from others in the community so we can decide/make changes as we agree on them :)
from editorsyntax.
What are good sources for existing scope names?
from editorsyntax.
Language files for other languages I guess. I tried looking at the built-in for c# that came with Sublime Text. That one was horrible :(
from editorsyntax.
https://manual.macromates.com/en/language_grammars is the textmate spec. I also found http://www.apeth.com/nonblog/stories/textmatebundle.html useful.
from editorsyntax.
@aeschli I looked at the TextMate documentation, but it's not always easy to figure out what scope name to use, so it would be good to have a discussion to come to some kind of agreement, regarding PowerShell as a language.
from editorsyntax.
NOTE: This is attempting to colorize powershell syntax correctly and is not attempting to assign the technically correct scopes at all.
These are the main issues that I ran into that I think should be changed:
Variable - $ keyword.other '$' in $variable
Variable - ${..} keyword.other '${' and '}' in ${variable}
Variable - automatic constant.language $_ & $error
Variable - scope storage.modifier.scope 'script' in $script:variable
Variable - name variable.other.readwrite 'variable' in $script:variable
Having all of these as different scopes causes a huge amount of variation between themes that I tested vs powershell ISE. From what I can tell the color of variable.other.readwrite is the color that powershell ISE uses for all of the above variables in every theme that I found. That would mean changing all of the above to variable.other.whatever would be a great way to keep coloring consistent across all themes and editors.
Examples:
$script:muffins
All of these would be colored correctly with the above changes.
Keyword.other.* and keyword.operator.* :
Most of the time these are using the default text color in Powershell ISE(read as every theme I tested). If the editor theme includes keyword.operator or keyword.other specifically it sets the color to the default text color. The issue is when many themes do not have these specified, and you end up with tons of operators being the colors of the keywords, which in ISE this color is mainly just used for keyword.control. This was rather frustrating as I could not find a consistent way to represent these as just the simple text color across multiple themes, is there anything they could be set to that would consistently set them to the default text color? If not this might be something that requires updating themes instead of updating scopes.
Examples: any operator is affected "+ - = == =+ * / | - -match -replace -le ++ etc."
items labeled as other that were not asked to be changed to variable above already "@() () "
Things I know are wrong but don't know how to fix yet:
[string] $muffins[0] "[ and ]" I am not exactly sure what brackets are being classified as but they are not working well with themes. They are the same as the operators above where they are always the default text color in ISE, but often cause a ton of color contrast for no reason with the other editors.
from editorsyntax.
Very good demonstration Allieway! My number one reason that I'm not using the VSCode for Powershell projects is the confusing and distracting highlighting. It really should be consistent with ISE.
from editorsyntax.
We need to reopen this discussion. In my recent changes I followed https://www.sublimetext.com/docs/3/scope_naming.html and compared to some other language syntaxes.
Should we continue here or start fresh?
from editorsyntax.
Related Issues (20)
- its possible to implement empty coallesing operator HOT 3
- Comment Based Help Keywords and Their Parameters Not Highlighting Correctly HOT 2
- FTLOG Don't use light gray on a white background
- Powershell syntax highlighting disrupted by single quotes in HTML
- Function without arguments not colorized HOT 2
- foreach not scoped correctly after curly brace
- Asterisk is not recognized as valid function/cmdlet name character HOT 1
- Export-Member color coding issue
- Parameters are shown using variables-color HOT 7
- Version v2021.5.1 Semantic Textmate Scope is incorrect for negative numeric literals, when used as a parameter HOT 4
- No Syntax Highlighting for `enum` declarations HOT 2
- #Requires syntax highlighting bug HOT 2
- Syntax Highlighting doesn't recognize ? as part of a variable name
- Generic method type parameter support
- Syntax Highlighting: region incorrectly highlighted when defined as part of a hashtable
- Function name not recognized in definition when on different line
- word_wrap settings does not obey the global settings in sublime text HOT 1
- Attributes not attached to parameters aren't recognized as attributes but as a generic type
- Code thinks ArgumentCompleter attribute on parameter is the parameter's type
- Variables that are built-in constants are not highlighted, like `$Error` and `$PSVersionTable`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from editorsyntax.