Centralized Loading of Required Modules to PowerShellContextService.cs#1537
Centralized Loading of Required Modules to PowerShellContextService.cs#1537dkattan wants to merge 1 commit intoPowerShell:masterPowerShell/PowerShellEditorServices:masterfrom dkattan:centralize-module-loadingdkattan/PowerShellEditorServices:centralize-module-loadingCopy head branch name to clipboard
Conversation
4cafb93 to
b0b9783
Compare
|
Hey @andschwa can you take a look at this CodeQL failure? |
I'm just gonna re-run it 😅 |
Looks like it passed! You mind reviewing it? |
|
I'm so sorry, I haven't gotten to this yet. It'll be the first thing I look at after the next preview release. |
I was able to get everything working without modifying the codebase with the changes in 3.0. Closing this PR. |
|
@dkattan That's amazing! Thank you for your work and ideas, it was influential. |
|
@dkattan For real: |
The primary goal of this change is to make it easier to support runspaces without FileSystem providers. While this is a somewhat obscure use case, it benefits the codebase as a whole by consolidating various often inconsistent permutations of
Into a single working copy.
Summary of changes:
For reference, we are currently Importing modules from disk as needed in the following areas of the codebase:
PowerShellEditorServices/src/PowerShellEditorServices/Services/PowerShellContext/Session/PSReadLinePromptContext.cs
Lines 76 to 78 in 00c7824
PowerShellEditorServices/src/PowerShellEditorServices/Services/PowerShellContext/PowerShellContextService.cs
Lines 240 to 243 in 00c7824
PowerShellEditorServices/src/PowerShellEditorServices/Services/PowerShellContext/PowerShellContextService.cs
Lines 432 to 434 in 00c7824
These following module loading code has been left unmodified as they are not required modules and Import-Module is being used to determine if PSES has the stated capabilities.
PowerShellEditorServices/src/PowerShellEditorServices/Services/PowerShellContext/TemplateService.cs
Lines 94 to 97 in 3274c23
PowerShellEditorServices/src/PowerShellEditorServices/Services/PowerShellContext/Session/Capabilities/DscBreakpointCapability.cs
Lines 94 to 100 in 3274c23