PowerShell / PowerShell/vscode-powershell

Need a better (cross-platform friendly) way to configure additional PowerShell paths

オープン
#5,233 コメント 2 件 リアクション 2 件 担当者 0 名 GitHub で見る

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

Issue-Enhancement
主要言語
TypeScript
スター
1.9k
フォーク
548
PR マージ指標
30日以内にマージされた PR はありません

説明

Prerequisites
  • I have written a descriptive issue title.
  • I have searched all issues to ensure it has not already been reported.
Summary
Context
  • I use PowerShell across operating systems

  • I customized additional PowerShell executables for vscode-powershell using powerShellAdditionalExePaths:

    "powershell.powerShellAdditionalExePaths": {
      "PowerShell 7.5 (macOS)": "/opt/homebrew/bin/pwsh",
      "PowerShell 7 (Windows)": "C:/<path>/<to>/pwsh.exe"
    },
    "powershell.powerShellDefaultVersion": "PowerShell 7 (Windows)",
    
  • I'm syncing and reusing my vscode settings across operating systems

The problem

Every time I work with PowerShell files I have to bear the annoying warning of addtional executable I've configured for the other platform not being found.

Image

Proposed Design

Introduce a new cross-platform/syncing firendly way to customize additional executables

Proposed interface:

type OS = "Windows" | "macOS" | "Linux"

interface AddtionalPowerShellLocation {
  name: String
  path: String
  os: OS
  default: Boolean | undefined
}

type Locations = AddtionalPowerShellLocation[]

To not break[^1] existing powerShellAdditionalExePaths, it'd be a new additionalPowerShellLocations key for holding these locations:

"powershell.additionalPowerShellLocations": [
  {
    "name": "PowerShell 7",
    "path": "/opt/powershell/pwsh",
    "os": "macOS",
    "default": true
  },
  {
    "name": "PowerShell 7",
    "path": "C:/PowerShell/stable/pwsh.exe",
    "os": "Windows",
    "default": true
  },
  {
    "name": "PowerShell Nightly",
    "path": "C:/PowerShell/nightly/pwsh.exe",
    "os": "Windows"
  },
  {
    "name": "PowerShell Nightly",
    "path": "/opt/powershell-nightly/pwsh",
    "os": "macOS"
  },
  {
    "name": "PowerShell 7",
    "path": "/opt/powershell7/pwsh",
    "os": "Linux"
  }
]

Then vscode-powershell can filter out items that are not for the target platform, and launch the first additonal PowerShell executable it successfully resolved. Nothing changes for system fallbacks in this proposal.

powerShellAdditionalExePaths and powerShellDefaultVersion then could be marked as deprecated.

The proposed design might not be optimal, so please comment.

[^1]: It was a breaking change when powerShellAdditionalExePaths was introduced https://github.com/PowerShell/vscode-powershell/issues/4167

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

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

はじめの一歩

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

調査の方向性

ソースファイルもテストも指定されていません。まず、powershell.powerShellAdditionalExePaths と powershell.powerShellDefaultVersion を読み取るコードを見つけ、次に実行可能ファイルの検出とプラットフォームフィルタリングの仕組みを確認してください。既存の設定を壊すことなく、クロスプラットフォームの additionalPowerShellLocations 構成が機能すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
powershell, typescript
領域
developer-experience, tooling
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
静か
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

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

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