Skip to content

feat: port pspath workspace support#3

Open
dkattan wants to merge 8 commits into
feature/submodule-to-nugetfrom
feature/get-content-host-package
Open

feat: port pspath workspace support#3
dkattan wants to merge 8 commits into
feature/submodule-to-nugetfrom
feature/get-content-host-package

Conversation

@dkattan

@dkattan dkattan commented May 30, 2026

Copy link
Copy Markdown

Summary

  • port the provider-backed pspath:// workspace and document handling from dkattan/feature/get-content
  • keep the changes compatible with the existing feature/submodule-to-nuget packaging branch
  • publish Microsoft.PowerShell.EditorServices.Host 3.18.1-preview.3 from this branch

Validation

dkattan and others added 7 commits May 30, 2026 11:54
Port the provider-backed workspace and pspath URI support from
feature/get-content onto the private host-package branch so the
Immense wrapper package can be published for ImmyBot consumption.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the provider-backed workspace port compatible with the older
feature/submodule-to-nuget branch by using ScriptFile.IsInMemory and
restoring the workspace path helpers AnalysisService still expects.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When Get-ChildItem enumerates items from the ScriptPSProvider drive,
PowerShell sets PSPath to the drive-qualified form (pspath:\local\Function\script.ps1)
rather than the provider-qualified form (ScriptPSProvider::local\Function\script.ps1).
CreatePowerShellPathUri now detects drive-qualified pspath: paths and converts
them to pspath://ScriptPSProvider/local/Function/script.ps1 URIs so they
round-trip correctly through GetPowerShellPath and TryGetFile.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Three fixes for EnumeratePSFiles to work with non-FileSystem providers:

1. CreatePowerShellPathUri: handle provider-qualified pspath: drive paths
   (ScriptPSProvider::pspath:\local\Function\script.ps1) by stripping the
   provider prefix and reconstructing the URI from the drive-qualified path.

2. Skip Include/Exclude/Depth/FollowSymlink parameters for non-FileSystem
   provider paths. These are FileSystem-specific dynamic parameters that cause
   Get-ChildItem to fail with ProviderInvocationException on custom providers
   like ScriptPSProvider.

3. Add s_psPathProviderHost constant for the ScriptPSProvider host component
   used in pspath:// URIs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Fix DebugMode check in BreakpointHandlers to use flag-based comparison
- Re-call SetDebugMode after breakpoint registration to trigger SetInternalDebugMode
- Normalize file:///scripts/... URIs to pspath:// for breakpoint matching
- Use temp file approach for script execution to ensure functionContext._file is set
- Add TLS _debuggingMode fix for pipeline thread context

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace the global scope filter in ShouldAddToAutoVariables with a
built-in variable name allowlist. Previously, any variable that existed
in the global scope was filtered from Auto — but dot-sourced scripts
put user variables in the global scope, so they never appeared.

Also allow all LocalVariable types through (not just the curated
whitelist) and clean up diagnostic logging.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Read VariableLayerAttribute from PSVariable.Attributes during breakpoint
stops to create custom DAP scope containers like 'Script', 'RunContext',
'Action', 'Session'. VariableDetails.PSVariable property stores the
original PSVariable reference for attribute inspection.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dkattan dkattan force-pushed the feature/get-content-host-package branch from 744038a to bec33ff Compare July 3, 2026 12:27
Remove all /tmp/pses-debug.log diagnostic logging from
LaunchScriptAsync. Keep only the essential TLS _debuggingMode fix
and CurrentRunspace null fix. Replace File.AppendAllText error
logging with _logger.LogError calls.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant