Support provider-backed workspace URIs via pspath#2136
Conversation
59af6f2 to
42c028f
Compare
|
@andyleejordan Curious your thoughts on this. It ended up being heavier-handed than I wanted with all the async changes, but I'm wondering if that would be desirable if I split it into a separate MR? I know @SeeminglyScience doesn't want me changing the public interfaces, but they likely should've been Task<> from the start, async or not. |
42c028f to
e72a219
Compare
974e92e to
1faf9f2
Compare
Can you talk through what you're trying to solve? When you make a synchronous method return |
1faf9f2 to
974e92e
Compare
caa9e27 to
677f42c
Compare
80b2351 to
9ce8911
Compare
Rebase feature/get-content onto current upstream/main. Keep WorkspaceService synchronous while routing file reads and workspace enumeration through PowerShell when a host is available, add pspath URI support, and cover provider-backed launching in tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
7f57a6c to
c942560
Compare
|
Rebased this branch onto the current On the sync/async concern: I kept I also added targeted coverage for provider-backed launch ( |
Allow TryGetFile() to return existing in-memory untitled documents. This preserves the debugger's untitled script workflow while still letting provider-backed paths flow through WorkspaceService. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use direct file I/O for file-backed documents and filesystem traversal for file-backed workspace folders, while preserving PowerShell-backed behavior for provider URIs. This avoids cross-thread/apartment host invocations for ordinary workspace requests and keeps provider-backed paths working. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add concrete input/output examples to the pspath helper methods called out in PR review comments so the document/path transformations are easier to follow. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
pspath://document support so provider-backed scripts can participate in workspace operations without pretending to befile://pathsWhy
The goal of this branch is to let PSES honor custom PSProviders for workspace content while still behaving normally for ordinary files. The final shape is intentionally hybrid: provider-backed URIs use PowerShell so custom providers are respected, and file-backed URIs stay on the existing filesystem path to avoid regressions in debugger, symbol, and code lens flows.
This also supports web-based VS Code scenarios where the editor does not share the same filesystem as the language server. In that setup, an extension can contribute a VS Code FileProvider for
pspath:while PSES loads a matching PSProvider in its runspace; both sides can point at the same backing persistence mechanism, such as an API, so the client and the language server address the same logical content.Files changed
WorkspaceServiceaddspspathconversion helpers plus provider-backed enumeration/read supportScriptFileexplicitly recognizes supported URI schemes and treats only true in-memory schemes as untitledDidChangeWatchedFilesHandlerreloads content through the workspace service and handles non-file URIs more safelyValidation