diff --git a/.gitignore b/.gitignore index 015536f..2952651 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,7 @@ *.sublime-project dist/ MANIFEST + +# Ignore YAML syntax file: +# plist is a master file for syntax. +Support/PowershellSyntax.YAML-tmLanguage diff --git a/README.md b/README.md index 502ef3f..0f7a878 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,22 @@ PowerShell ========== Support for the MS PowerShell programming language. + +# Install +1. Install [package control](https://sublime.wbond.net/installation) for Sublime Text. +1. Install package **PowerShell** (`Ctrl + Shift + P` + `install` + `powershell`) + +# Development +1. Open sublime packages folder (`Ctrl + Shift + P` + `browse packages`) +1. Clone [this repo](https://github.com/SublimeText/PowerShell) to packages folder. +Now your local version of package is available in sublime. + +## Syntax +Plist file [PowershellSyntax.tmLanguage](Support/PowershellSyntax.tmLanguage) is the master file for syntax. +But the [recommended way](http://sublime-text-unofficial-documentation.readthedocs.org/en/latest/extensibility/syntaxdefs.html) to develop syntax is YAML. + +1. Install `AAAPackageDev` package. +1. Open **PowershellSyntax.tmLanguage** +1. Call `Ctrl + Shift + P` + `convert to Yaml and Rearrange`. You will get new file **Support/PowershellSyntax.YAML-tmLanguage**. +1. Make your changes in YAML file. +1. Call `Ctrl + Shift + P` + `convert (YAML, JSON, Plist) to`. You will get updated version of plist file. diff --git a/Support/PowershellSyntax.YAML-tmLanguage b/Support/PowershellSyntax.YAML-tmLanguage deleted file mode 100644 index bb2c2d8..0000000 --- a/Support/PowershellSyntax.YAML-tmLanguage +++ /dev/null @@ -1,350 +0,0 @@ -# [PackageDev] target_format: plist, ext: tmLanguage ---- -name: PowerShell -scopeName: source.powershell -fileTypes: [ps1, psm1, psd1] -uuid: f8f5ffb0-503e-11df-9879-0800200c9a66 - -patterns: - -## First match comments -- name: comment.block.powershell - begin: <# - beginCaptures: - '0': {name: punctuation.start.definition.comment.block.powershell} - end: '#>' - endCaptures: - '0': {name: punctuation.end.definition.comment.block.powershell} - patterns: - - {include: '#commentEmbeddedDocs'} - -- name: comment.line.number-sign.powershell - match: (?&1|>>|>|<<|<|>|>\||[1-6]>|[1-6]>>' -- name: keyword.other.statement-separator.powershell - match: '\|{2}|&{2}|;' -- name: keyword.operator.other.powershell - match: '&|(?PowerShell patterns + + comment + First match comments + begin <# @@ -56,6 +60,10 @@ + + comment + Then match top-level script content + include #commands @@ -801,6 +809,10 @@ match (\$)(?i:(ConfirmPreference|DebugPreference|ErrorActionPreference|ErrorView|FormatEnumerationLimit|MaximumAliasCount|MaximumDriveCount|MaximumErrorCount|MaximumFunctionCount|MaximumHistoryCount|MaximumVariableCount|OFS|OutputEncoding|ProgressPreference|PsCulture|PSDebugContext|PSDefaultParameterValues|PSEmailServer|PSItem|PSModuleAutoloadingPreference|PSSenderInfo|PSSessionApplicationName|PSSessionConfigurationName|PSSessionOption|VerbosePreference|WarningPreference|WhatIfPreference))((?:\.(?:\p{L}|\d|_)+)*\b)?\b + + comment + then, there are four variations on variables, in general: with and without scope, and with and without curly braces + captures @@ -1016,6 +1028,10 @@ match (\$)(?i:(ConfirmPreference|DebugPreference|ErrorActionPreference|ErrorView|FormatEnumerationLimit|MaximumAliasCount|MaximumDriveCount|MaximumErrorCount|MaximumFunctionCount|MaximumHistoryCount|MaximumVariableCount|OFS|OutputEncoding|ProgressPreference|PsCulture|PSDebugContext|PSDefaultParameterValues|PSEmailServer|PSItem|PSModuleAutoloadingPreference|PSSenderInfo|PSSessionApplicationName|PSSessionConfigurationName|PSSessionOption|VerbosePreference|WarningPreference|WhatIfPreference))\b + + comment + then, there are four variations on variables, in general: with and without scope, and with and without curly braces + captures