Rewrite Variable Logic From Scratch

オープン
#137 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
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 の本文から書いたものです。

説明

enhancement project

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>:folder don'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 $Variable syntax.
  • 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 and Hello as 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 はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

PowerShell/EditorSyntax のほかの issue

PowerShell/EditorSyntax の issue をすべて見る

似ている issue

DevTools の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。