Skip to content

marimo as an lsp server for integration into other editors #5990

@alefminus

Description

@alefminus

Description

I want to use zed to edit marimo notebooks.

A known limitation of marimo's ast rewriting approach is that despite the source being python any python only lsp like pyright would not be able to give the correct completions for anything besides local or dependent variables, and those would lack any type information.

But if marimo itself implemented the LSP protocol, i.e. became a language server, it could solve all of that!

This is somewhat related to the discussion happening here in #4345.

This would enable editing in any LSP supporting editor, and because of the '--watch' feature allowing seamless jumping between the editor and marimo.

Suggested solution

Implement the LSP protocol.

The upside is simple integration to vscode, zed etc.

The downside is that things like dictionary completion based on runtime information will break if the completion is requested before the cells are recomputed. I do not know the LSP well enough but it seems to be mostly (only?) client initiated, so you can't send back a message updating. But that is a relatively minor point.

Are you willing to submit a PR?

  • Yes

Alternatives

MCP probably? but that is too broad, LSP is much more specific.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions