Decide on scope names for all language constructs
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- powershell
- 領域
- tooling
調査の方向性
Review the scope-name table and the refactored language file mentioned in the issue, then compare the proposed names with the documented VS Code theme scopes. The work is done when the scope naming discussion reaches an agreed convention for the listed PowerShell constructs and the table reflects that decision.
索引モデルが issue の本文から書いたものです。
説明
I'd like to have a discussion where we decide on the "correct" scope names for all PowerShell language constructs. This will mean much less work when doing updates to the tmLanguage file in the future, as the scopes (as well as the color(!) of each) are checked by a Travis CI build job on the vscode repo.
General
- All scope names should end in
.powershell
As we decide, we can fill out this table:
| Language construct | Scope Name | Comments/Examples |
|---|---|---|
| Line comment | comment.line.number-sign | # comments |
| Block comment | comment.block | <# comments #> |
| Help directives | comment.documentation.embedded | Meta scope |
| Help directives - keywords | keyword.operator.documentation | .SYNOPSIS |
| Help directives - keyword value | constant.string.documentation | 'ParameterName' in .PARAMETER ParameterName |
| #Requires statement | keywords.operator.documentation | 'Requires' in #Requires -Version 3.0 |
| #Requires statement - parameter | constant.string.documentation | '-Version 3.0' in #Requires -Version 3.0 |
| String - double quoted | string.quoted.double | "string" |
| String - single quoted | string.quoted.single | 'string' |
| String - escape characters | constant.character.escape | 't' in "onettwo" |
| String - heredoc double quoted | string.quoted.double.heredoc | |
| String - heredoc single quoted | string.quoted.single.heredoc | |
| ScriptBlock | meta.scriptblock | { ... } |
| SubExpression | meta.subexpression | $( ... ) |
| Hashtable | meta.hashtable | @{ ... } |
| Array | meta.array | @(1,2,3) & (1,2,3) |
| Property/Member | entity.other.attribute-name | 'property' in (Invoke-Something).property & 'property' in $var.property |
| Numeric Constant - real | constant.numeric.real | +.5 |
| Numeric Constant - integer | constant.numeric.integer | 5 |
| Numeric Constant - hexadecimal | constant.numeric.hexadecimal | 0x20 |
| Type | entity.name.type | 'string' in [string] |
| Type - static method | meta.method | '::MinValue' in [int]::MinValue |
| Parameter decorator | entity.name.type | 'Parameter' in [Parameter(Position = 1)] |
| Parameter decorator - property | entity.other.attribute-name | 'Position' in [Parameter(Position = 1)] |
| Function | meta.function | Meta scope |
| Function - keyword | storage.type | 'function' in function script:Invoke-Something { ... } |
| Function - scope | storage.modifier.scope | 'script' in function script:Invoke-Something { ... } |
| Function - name | entity.name.function | 'Invoke-Something' in function script:Invoke-Something { ... } |
| Command | meta.command | Meta scope |
| Command - keyword | support.function | 'Invoke-Something' in Invoke-Something -p1 'v1' |
| Command - parameter | variable.parameter | '-p1' in Invoke-Something -p1 'v1' |
| Reserved words | keyword.other | configuration |
| Control words | keyword.control | break |
| Enum - keyword | storage.type | 'enum' in enum myEnum { ... } |
| Enum - name | entity.name.function | 'myEnum' in enum myEnum { ... } |
| Class | meta.class | Meta scope |
| Class - keyword | storage.type | 'class' in class myClass : inheritedClass { ... } |
| Class - name | entity.name.function | 'myClass' in class myClass : inheritedClass { ... } |
| Class - inheritance | entity.other.inherited-class | 'inheritedClass' in class myClass : inheritedClass { ... } |
| Class - reserved words | keyword.other | hidden & static |
| Class - control words | keyword.control.class | 'base' in : base( ... ) |
| Operator - redirection | keyword.operator.redirection | 2>&1 |
| Operator - comparison | keyword.operator.comparison | -gt |
| Operator - bitwise | keyword.operator.bitwise | -band |
| Operator - logical | keyword.operator.logical | -and |
| Operator - format | keyword.operator.format | -f |
| Operator - assignment | keyword.operator.assignment | += |
| Operator - logical not | keyword.operator.logical-not | -not & ! |
| Operator - multiplicative | keyword.operator.multiplicative | / & * |
| Operator - unary plus | keyword.operator.unary-plus | + |
| Operator - unary minus | keyword.operator.unary-minus | - |
| Operator - additive | keyword.operator.additive | + & - |
| Operator - range | keyword.operator.range | .. |
| Operator - command invocation | keyword.operator.other | & |
| Operator - stop parsing | keyword.operator | --% |
| Switch - keyword | keyword.control | 'switch' in switch -regex ($var) { ... } |
| Switch - parameter | variable.parameter | '-regex' in switch -regex ($var) { ... } |
| Switch - reserved word | keyword.other | default |
| Illegal | invalid.illegal | Space after backtick |
| 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 |
I have started by filling out the scope names as I have used them in my refactored language file.
About scopes and highlighting
If, in the theme, there are colorization rules only for the scope constant.operator, both constant.operator and constant.operator.range will be colorized the same.
If there isn't any colorization rules for a scope, it will be colorized with the "root" color of the current scope. Meaning if the word 'test' only belong to the source scope (or have a scope name that is not defined in the current theme), it will be colorized with the default background color. If the word 'test' is found inside another scope, for instance a string, it will be colorized with the color for the string scope.
Colorization rules may differ between editors. For instance the background parameter. This is supported on Sublime Text, but not in VSCode.
A matched set of characters can be (and more often than not are) assigned multiple scopes. So for example the word variable in function MyFunction {"this is $("a $variable")"} have the following scopes: source, string.quoted.double, meta.subexpression, string.quoted.double and lastly variable.other.readwrite. Only the last one is used for colorization.
About the default themes in VSCode
There are five themes that are defined as default themes in Visual Studio Code:
- dark_plus "Dark+"
- dark_vs "Dark Visual Studio"
- hc_black "Dark Visual Studio"
- light_plus "Light+"
- light_vs "Light Visual Studio"
The themes supports nesting, and:
- Light+ includes light_vs (Light Visual Studio)
- Dark+ includes dark_vs (Dark Visual Studio)
The following scopes are defined in the plus-themes:
- meta.type.name, meta.return.type, meta.return-type, meta.cast, meta.type.annotation, support.type, entity.name.class, entity.name.type, storage.type.cs, storage.type.java
- entity.name.function, entity.name.method
- keyword.control
- meta.parameter.type.variable, variable.parameter, variable, variable.name
The following scopes are defined in the "old" default themes:
- emphasis
- strong
- header
- comment
- constant.language
- constant.numeric
- constant.regexp
- constant.rgb-value
- entity.name.tag
- entity.name.selector
- entity.other.attribute-name
- entity.other.attribute-name.css
- invalid
- markup.underline
- markup.bold
- markup.heading
- markup.italic
- markup.inserted
- markup.deleted
- markup.changed
- meta.selector
- meta.tag
- meta.preprocessor
- meta.preprocessor.string
- meta.preprocessor.numeric
- meta.structure.dictionary.key.python
- storage
- storage.type
- storage.modifier
- string
- string.xml, string.jade, string.yaml, string.html
- string.regexp
- support.property-value
- support.type.property-name.css, support.type.property-name.less, support.type.property-name.sass
- support.type.property-name
- keyword
- keyword.control
- keyword.operator
- keyword.operator.new
- keyword.other.unit
- keyword.control.less
- metatag.php
- support.function.git-rebase
- constant.sha.git-rebase
- storage.modifier.import.java, storage.modifier.package.java
Scope names on the same line, means they are defined in the same colorization rule.
- 主要言語
- PowerShell
- スター
- 151
- フォーク
- 55
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
PowerShell/EditorSyntax のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
PowerShell/EditorSyntax#224 · コメント 2 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
PowerShell/EditorSyntax#222 · コメント 2 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
PowerShell/EditorSyntax#221 · コメント 2 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
PowerShell/EditorSyntax#220 · コメント 2 件 · リアクション 1 件 ·
-
Issue-Bug
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
PowerShell/EditorSyntax#219 · コメント 2 件 ·
PowerShell/EditorSyntax の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
palladius/rails8-app-on-gcp#145 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
elastic/gradle-plugins#156 ·
-
area:workflow bug ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
fil-donadoni/tolaria#4409 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
dotenvx/dotenv-vscode#139 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
Fission-AI/OpenSpec#1960 ·