microsoft / microsoft/vscode-python-environments

Feature Request: Easily Add Folder to PYTHONPATH from VS Code UI

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

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

feature-request needs community feedback
主要言語
TypeScript
スター
138
フォーク
62
平均マージ
1日 4時間
マージ済み PR(30日)
35

説明

Hi, I’m not sure if this belongs here or in vscode-python, but I’d like to request a more user-friendly way to add folders to the Python path in VS Code.

Current Situation
  • The python.analysis.extraPaths setting only affects IntelliSense, not the runtime PYTHONPATH.
  • Using a .env file with PYTHONPATH=path1;path2;path3 is unreliable (in my experience) and not user-friendly.
  • Creating a .pth file in .venv/Lib/site-packages/ as below works, but is also tedious and not user-friendly.
path1/src/
path2/src/
...
Feature Proposal

It would be very helpful to have:

  • A context menu command when right-clicking a folder (e.g., “Add to Python Path”)
  • An accessible command in the Command Palette (Ctrl+Shift+P)
  • A button in the python-environments extension UI (it would be very intuitive to have a small icon/button next to each venv in the list. Clicking this button could prompt the user to select a folder, and then automatically add that folder to the venv using the .pth method.)

This should add the folder to the Python path of the currently selected virtual environment in VS Code.

This would make managing the Python path much easier, especially for users coming from PyCharm, where this is a standard feature.

Thanks!

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

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

はじめの一歩

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

調査の方向性

この issue ではファイル、テスト、実装のエントリポイントが指定されていないため、まずこれが vscode-python と vscode-python-environments のどちらに該当するかを判断し、既存の環境 UI とコマンド登録を確認します。完了とするには、スコープが決定され、選択したフォルダーを現在選択されている仮想環境の Python パスに追加する、ユーザー向けの方法が必要です。

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

評価

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

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

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