Giter Site home page Giter Site logo

Comments (10)

AdjectiveAllison avatar AdjectiveAllison commented on July 4, 2024 1

Making all of those changes(still don't know how to edit the brackets) makes the following difference.

Current syntax in VSCode
default

Powershell ISE highlighting
powershell-ise

Proposed changes in VScode
monokai-edited

As you can see it looks much much better. I have tried it in several different themes and compared with similar results.

from editorsyntax.

daviwil avatar daviwil commented on July 4, 2024

This is a great start! Curious to see what feedback @aeschli might have.

from editorsyntax.

gravejester avatar gravejester commented on July 4, 2024

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.

vors avatar vors commented on July 4, 2024

What are good sources for existing scope names?

from editorsyntax.

gravejester avatar gravejester commented on July 4, 2024

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.

aeschli avatar aeschli commented on July 4, 2024

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.

gravejester avatar gravejester commented on July 4, 2024

@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.

AdjectiveAllison avatar AdjectiveAllison commented on July 4, 2024

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 $_.muffins ${global:muffins} $false
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.

Satak avatar Satak commented on July 4, 2024

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.

omniomi avatar omniomi commented on July 4, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.