[BUG] modular/vscode-mojo (extension UX bug)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 38
- Forks
- 17
- Avg merge
- 4d 13h
- Merged PRs (30d)
- 13
Description
Summary
When lsp_server_path in modular.cfg points to a binary that does not exist
on disk, the extension attempts to spawn it and fails with a raw Node.js
ENOENT error. The user gets no actionable message explaining what is wrong or
how to fix it.
This is a real scenario as of MAX 26.5.0 / Mojo 1.0.0 stable, where
mojo-lsp-server is referenced in modular.cfg but not included in any
conda package. See: Issue 7072
Environment
Environment: default
Features: default
Channels: https://conda.modular.com/max, conda-forge
Dependency count: 1
Dependencies: max
Target platforms: linux-64
Resolved platform: linux-64 (archspec=x86_64, glibc=2.28, linux=4.18, __unix)
Minimum platform: linux-64 (__glibc >=2.17,<3.0.a0, __unix)
Prefix location: /home/anmig/dev/mojo/gpu-intro/.pixi/envs/default
Installed for: linux-64
Name Version Build Size Kind Source
max 26.5.0 3.12release 17.70 MiB conda https://conda.modular.com/max
max-core 26.5.0 release 112.14 MiB conda https://conda.modular.com/max
Observed Extension Log
["INFO"] Activating language client
["INFO"] Launching Language Server '/path/to/.pixi/envs/default/bin/mojo-lsp-server'
["INFO"] Launching Language Server
[Error] Mojo Language Client client: couldn't create connection to server.
Launching server using command .../mojo-lsp-server failed.
Error: spawn .../mojo-lsp-server ENOENT
Code Path
In createSDKFromHomePath, lsp_server_path is read directly from
modular.cfg and passed to the HomeSDK constructor without checking whether
the file exists on disk:
const lspServerPath = config["mojo-max"]["lsp_server_path"];
// ... no fs.stat / existence check before use
return new HomeSDK(..., lspServerPath, ...);
The retrievePath helper (which does check existence) is only used in
createSDKFromWheelLayout, not in the modular.cfg code path.
Suggested Fix
Before spawning, check that the resolved lsp_server_path exists. If it
doesn't, surface a clear notification rather than letting the spawn fail:
Mojo language server not found at the path specified in modular.cfg
(lsp_server_path). Your MAX installation may be incomplete or outdated.
Language features will be unavailable.
This would have made the root cause immediately obvious rather than requiring
users to dig through extension source to understand what went wrong.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at createSDKFromHomePath, where lsp_server_path from modular.cfg is passed to HomeSDK, and compare it with retrievePath in createSDKFromWheelLayout. Verify the missing-binary path produces an actionable notification instead of a raw ENOENT spawn error, while the existing path continues to launch normally.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- developer-experience, devtools
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 74/100