-
Notifications
You must be signed in to change notification settings - Fork 892
improvement: lsp status icon and refresh #8011
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
manzt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nice! Just a couple comments re the new message types.
marimo/_server/models/lsp.py
Outdated
| import msgspec | ||
|
|
||
|
|
||
| class LspServerHealth(msgspec.Struct, rename="camel"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These booleans (is_running, is_responsive, has_failed) have some overlap. VS Code's LSP client uses a status enum, which we could similarly:
class LspServerHealth(msgspec.Struct, rename="camel"):
"""Health status for a single LSP server.
Status meanings:
- starting: process launched, initializing
- running: healthy and responsive to pings
- stopped: not running (never started or cleanly stopped)
- crashed: exited with non-zero code
- unresponsive: process alive but not responding to pings
"""
server_id: str
status: Literal["starting", "running", "stopped", "crashed", "unresponsive"]
port: int
last_ping_ms: Optional[float] = None
error: Optional[str] = None # Why it crashed/stoppedWe could also consider started_at:
started_at: Optional[float] = None # Unix timestampwhich gives us uptime for free (frontend can show "running for 5m" or detect restart loops).
marimo/_server/models/lsp.py
Outdated
| class LspRestartRequest(msgspec.Struct, rename="camel"): | ||
| """Request to restart LSP servers.""" | ||
|
|
||
| server_ids: Optional[list[str]] = None # None = restart failed servers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth making a ServerId NewType or at least a TypeAlias scoped to this module?
ServerId = typing.NewType("ServerId", str)msgspec handles these fine.
|
🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.19.7-dev37 |
Expose the status icon and allow users to click to refresh if there are any issues.