Rewrite Variable Logic From Scratch
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 20/100
- Issue 類型
- 重構
- 描述清晰度
- 需要釐清
- 活躍度
- 停滯
- 技術堆疊
- powershell
- 領域
- devtools
研究方向
No files or tests are named. Start by reviewing the scope and rule questions in this issue and linked issues #127, #129–#133, and #138; done requires a defined grammar rewrite covering the listed variable forms and highlighting cases, but the planned format is still TBD.
由索引模型根據 Issue 內容生成。
描述
There are multiple issues with variables as they stand now in the grammar some of which have been reported and some of which haven't:
- Punctuation in variables with properties and methods isn't scoped correctly: #131
- The sigil for a sub-expression is not handled the same way as the sigil on a variable: #132
- Some language variables like
$_,$$,$?are treated differently depending on context and are currently scoped incorrectly: #133 - Properties and method highlighting breaks when the variable has an array position specified: #127
- Multiple legal characters break variable highlighting (
$Var?Iable), and special automatic variables like$<drive letter>:folderdon't highlight correctly: #49
There are also questions about the correct scope of properties and methods (mentioned #131) and questions about to what extent the grammar should be concerned with user expectation/"most themes" vs either correctness (subjective) or consistency (with which languages?) (#130 and #129).
Background
The following cases need to be covered with as little repetition / complexity as possible:
- Regular variables with and without scopes, properties, array position, methods, etc.
- Variables contained within strings.
- Variables contained within sub-expressions with and without scopes, properties, array position, methods, etc.
- Variables in and out of strings and sub-expressions when using the
${Variable}format again with and without scopes, properties, array position, methods, etc.
The following gotchas need to be taken in to account:
- Which special characters are legal within
${Variable}syntax vs$Variablesyntax. - International characters (
\p{L}vs [A-z]`). - Access of variables through splatting where the sigil is
@. - Separate scoping for constants, automatic variables, language variables, etc.
$$where"$$Hello"needs to show$$as the variable andHelloas part of the double quoted string and other similar oddities.- Lots of others...
Planned Format/Rules
??? tbd
Re: Scope selection -> See #138
- 主要語言
- PowerShell
- 星號
- 151
- 分支
- 55
- PR 合併指標
- 30 天內沒有已合併 PR
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 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 個 reaction ·
-
Issue-Bug
難度 3/5 1-2 天 新手友好度 48/100
PowerShell/EditorSyntax#219 · 2 則留言 ·
查看 PowerShell/EditorSyntax 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
0xMiden/bridge-portal#132 ·
-
bug
難度 2/5 1-3 小時 新手友好度 84/100
newrelic-experimental/preflight#793 · 1 則留言 ·
-
enhancement
難度 2/5 1-3 小時 新手友好度 70/100
babalae/bettergi-scripts-list#3674 ·
-
難度 2/5 1-3 小時 新手友好度 88/100
caddyserver/caddy#8046 ·
-
難度 2/5 1-3 小時 新手友好度 82/100
zilliztech/memsearch#759 ·