The Wayback Machine - https://web.archive.org/web/20260123232038/https://github.com/RustPython/RustPython/issues/1704
Skip to content

[RFC] Language Server Protocol in Interpreter #1704

@abitrolly

Description

@abitrolly

Summary

Right now all Language Servers for Python are external to Python interpreter itself. What it takes to implement Language Server directly in RustPython binary?

Detailed Explanation

I was looking for a single binary that could work with https://github.com/autozimu/LanguageClient-neovim for Python syntax completion in vim. Something that doesn't require to install a lot of Python dependencies on my system and run unsafe code without isolation/

Drawbacks, Rationale, and Alternatives

I think using RustPython as LSP server is a fun way to try it and extend. Other options include LSP from Microsoft and Palantir. There was the server from Sourcegraph with nice features like no arbitrary code execution.

Unresolved Questions

I do not know which level of isolation from operating system can RustPython provide while indexing Python source. Don't know if it is possible to reuse lexer, parser and other interpreter pieces for Language Server. Maybe refactoring them for reuse will provide better modularity and testing capabilities. In any case it is interesting to know the opinion about the idea.

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFCRequest for comments

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions