Awesome
PowerShell Syntax Definition for Editors
This project establishes the central development and maintenance of syntax definition files for the PowerShell language used by editors that leverage the XML version of the TextMate language grammar format.
Currently this syntax definition is used in the following editors and extensions:
- Visual Studio Code by Microsoft
- PowerShell Package for Sublime Text by Guillermo López-Anglada
- language-powershell for Atom by James Sconfitto
In the future we may find a more common syntax that allows us to generate syntax definitions for editors that don't leverage the TextMate format.
Status
We are starting with the current state of the TextMate grammar that is being used in both VS Code and Sublime Text. There are a number of existing issues with the grammar that we need to track down and fix. Please see issue #1 for more details.
Build and Import (VS Code)
NOTE: You can grab a build of the current definitions as they exist in Github from Appveyor and skip ahead to step 3 below.
Prerequisites
- Node.JS, >= 8.9.1
Build
-
Navigate via command line to the
./tools/
directory and install dependencies:npm install
-
Run the
build-grammar
script to generate the json file.npm run build-grammar
-
The .json file will be generated in
./syntaxes/
at the root of the project. You will need to copy it in to VS Code manually.-
Locate the VS Code installation directory and navigate to to
resources/app/extensions/powershell/syntaxes
-
Rename
powershell.tmLanguage.json
topowershell.tmLanguage.json_default
-
Copy
powershell.tmLanguage.json
from./syntaxes/
within the project folder to where you just renamed the file under VS Code's path.
-
-
If VS Code is already running you will need to run "Reload Window" from the command pallete.
Contributing
We would love to have community contributions to this project to make PowerShell syntax highlighting great in as many editors as we can. Please feel free to file issues or send pull requests if you'd like to contribute.
Maintainers
License
This extension is licensed under the MIT License. Please see the third-party notices file for details on the original source of the TextMate definition that we use.