Skip to content

Skip workspace settings entries whose URI has no filesystem path - #87

Merged
Eduardo Villalpando Mello (edvilme) merged 2 commits into
mainfrom
copilot/fix-workspace-initialization-crash
Aug 17, 2026
Merged

Skip workspace settings entries whose URI has no filesystem path#87
Eduardo Villalpando Mello (edvilme) merged 2 commits into
mainfrom
copilot/fix-workspace-initialization-crash

Conversation

Copilot AI commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

In a mixed multi-root workspace (a local file: folder plus a virtual root such as MicroPico's pico:), uris.to_fs_path("pico:") returns None, which flowed into normalize_path()pathlib.Path(None) and raised TypeError, blocking initialization of the Pylint, Black, and isort servers.

Changes

  • server.pyToolServer.update_workspace_settings() now resolves the filesystem path into a local variable and skips entries where it is None; file: roots are registered unchanged.
for setting in settings:
    workspace_path = uris.to_fs_path(setting["workspace"])
    # Virtual workspace roots, such as "pico:", have no local
    # filesystem path, so they cannot be registered here.
    if workspace_path is None:
        continue

    key = normalize_path(
        workspace_path,
        resolve_symlinks=self.config.resolve_symlinks,
    )
  • tests/test_server.py — regression test in TestUpdateWorkspaceSettings feeding file:///local-workspace (mocked to /local-workspace) alongside pico: (mocked to None), asserting no raise, a single registered workspace, and its workspace / workspaceFS values.

Scope

Deliberately limited to filesystem-based workspace registration. Document synchronization and stdin-based tool execution are untouched, so documents from a virtual root can still be delivered and processed by consuming language servers — they simply fall back to the existing cwd-based settings lookup rather than a workspace-specific entry. Virtual-filesystem mirroring is out of scope here.

Co-authored-by: edvilme <5952839+edvilme@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix language-server initialization crash in mixed multi-root workspace Skip workspace settings entries whose URI has no filesystem path Aug 17, 2026
@edvilme
Eduardo Villalpando Mello (edvilme) marked this pull request as ready for review August 17, 2026 23:26
@edvilme Eduardo Villalpando Mello (edvilme) added the bug Something isn't working label Aug 17, 2026
@edvilme
Eduardo Villalpando Mello (edvilme) merged commit 28b4b4f into main Aug 17, 2026
21 of 22 checks passed
@edvilme
Eduardo Villalpando Mello (edvilme) deleted the copilot/fix-workspace-initialization-crash branch August 17, 2026 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants