PowerShell / PowerShell/vscode-powershell
Enhancement: Text Editor Drop API support for .ps1/.psm1 files
まだ誰も着手していません。
- 主要言語
- 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
Just dropping this here for posterity/discussion. The new vscode release has a proposed API that allows you to drag and drop files into the editor window that will end up stable most likely in the next release.
https://code.visualstudio.com/updates/v1_67#_drop-into-editor
Proposed Design
I think our implementation should translate this into a dot-source, so you can drag a .ps1 file and get a relative path mapping from your current editor. If the editor is unsaved, it will be an absolute path reference instead.
The relative should be built using $PSScriptRoot, so $PSScriptRoot/../mydraggedfile.ps1. Maybe have a preference to toggle this behavior over just normal relative pathing.
Files with a .psd1 or .psm1 prefix would have Import-Module prepended.
Files with a .dll prefix would have Add-Type -path prepended. A binary module should have its .psd1 dropped instead if the intention is to have it via import-module, it's considered bad form to import-module a .dll directly except for testing purposes.
Any other file type would simply drop in as a string reference.
Perhaps have an extensible setting for more file types with a simple templating substitution? For instance a setting like this:
{
"extension": ".xlsx",
"template": "Import-Excel -Path ${filename}"
}
Multiple files dropped would result in individual lines generated for each.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
ソースファイルもテストも指定されていません。まず、リンクされている VS Code Drop Into Editor API proposal を確認し、拡張機能のエディター統合部分を特定してください。完了条件は、要求されたファイルタイプのマッピング、相対パスと絶対パス、複数回のドロップ、および提案されている拡張可能な設定をカバーすることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- powershell, typescript, vscode
- 領域
- tooling
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100