Skip to content

Add native support for JSON RPC use by LSP protocol #9390

@prabirshrestha

Description

@prabirshrestha

Is your feature request about something that is currently impossible or hard to do? Please describe the problem.
It is is possible to do in vimscript or lua but is slow.

Describe the solution you'd like
I would like vim to support json-rpc protocol (https://www.jsonrpc.org/specification) used by language server protocol (https://microsoft.github.io/language-server-protocol/specifications/specification-current/#baseProtocol) which is written in C and can be very fast.

I'm looking for an alternative for json-rpc parsing protocol only and not a full blow language server protocol.
https://github.com/microsoft/vscode-languageserver-node/tree/main/jsonrpc. This implementation has a lot of interesting optimizations.

Describe alternatives you've considered
would have penalty of converting string from vimscript string type to lua string type. Neovim has native support for lua types in vimscript and even added support for lua-cjson.

Additional context
There are some codebase with 10k lines of code in files or servers that send lot of data so parsing past and making the editor responsive would be good.
Would need to support both stdio/tcp while most language server supports both some only support one or the other.

This could also potentially lay the future of remote plugins and make it easy for everyone without writing parsers on both side.

This is similar to fuzzy matching while it can be written in vimscript9 or lua for faster, having native support that is faster would be even better.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions