microsoft / microsoft/vscode-python-environments
Feature Request: Easily Add Folder to PYTHONPATH from VS Code UI
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- TypeScript
- Estrelas
- 138
- Forks
- 62
- Merge médio
- 1d 4h
- PRs com merge (30d)
- 35
Descrição
Hi, I’m not sure if this belongs here or in [vscode-python](https://github.com/microsoft/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!
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
O issue não nomeia arquivos, testes nem pontos de entrada da implementação; comece determinando se isso pertence ao vscode-python ou ao vscode-python-environments e analisando a UI existente de ambientes e o registro de comandos. Para considerar o trabalho concluído, seria necessário definir o escopo e disponibilizar uma forma voltada ao usuário de adicionar uma pasta selecionada ao caminho Python do ambiente virtual atualmente selecionado.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- python, vscode
- Domínio
- developer-experience, tooling
- Tipo de issue
- Funcionalidade
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Status de atividade
- Estagnada
- Clareza
- Precisa de esclarecimento
- Facilidade para iniciantes
- 25/100