Skip to content

Allow extending PSModulePath in settings.json #2356

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
chriskuech opened this issue Dec 10, 2019 · 3 comments
Closed

Allow extending PSModulePath in settings.json #2356

chriskuech opened this issue Dec 10, 2019 · 3 comments
Labels
Area-Workspaces Issue-Enhancement A feature request (enhancement). Resolution-Duplicate Will close automatically.

Comments

@chriskuech
Copy link

Summary of the new feature

Right now, PowerShell has very limited capabilities for IntelliSense due to how dynamic the language is and some specific bugs with its implementation. The only pattern that seems to work is to create a custom modules folder in the workspace, update PSModulePath to include the custom modules folder, then reference the modules in code by name (instead of path). This works around the language limitations, but requires running initialization scripts in the session or modifying global environment variables to work. Users should be able to update PSModulePath in their vscode settings.json so they can define classes/functions that are discovered by IntelliSense without confusing manual tasks (initializing VS Code's session) or modifying their global environment for a single workspace (setting environment variables).

Proposed technical implementation details (optional)

Add a field "powershell.psModulePath" to settings.json that takes an array of string paths and prepends them to the PSModulePath environment variable prior to loading intellisense.

@ghost ghost added the Needs: Triage Maintainer attention needed! label Dec 10, 2019
@rkeithhill
Copy link
Contributor

I think a more generic solution would be to support workspace specific initialization/profile scripts. This would let you set up $env:PSModulePath among other things.

@SydneyhSmith
Copy link
Collaborator

@chriskuech thanks for opening this issue, looks like we are already tracking this request with #880
Agree with @rkeithhill that a generic approach is likely the best option--we are tracking that particular request with #190 so I will mark this as duplicate.

@SydneyhSmith SydneyhSmith added Area-Workspaces Issue-Enhancement A feature request (enhancement). Resolution-Duplicate Will close automatically. and removed Needs: Triage Maintainer attention needed! labels Dec 12, 2019
@ghost
Copy link

ghost commented Dec 13, 2019

This issue has been marked as duplicate and has not had any activity for 1 day. It has been closed for housekeeping purposes.

@ghost ghost closed this as completed Dec 13, 2019
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Workspaces Issue-Enhancement A feature request (enhancement). Resolution-Duplicate Will close automatically.
Projects
None yet
Development

No branches or pull requests

3 participants