multilspy intends to ease the process of using language servers, by handling various steps in using a language server:
* Automatically handling the download of platform-specific server binaries, and setup/teardown of language servers
* Handling JSON-RPC based communication between the client and the server
* Maintaining and passing hand-tuned server and language specific configuration parameters * Providing a simple API to the user, while executing all steps of server-specific protocol steps to execute the query/request.
Some of the analyses results that multilspy can provide are:
* Finding the definition of a function or a class (textDocument/definition)
* Finding the callers of a function or the instantiations of a class (textDocument/references)
* Providing type-based dereference completions (textDocument/completion)
* Getting information displayed when hovering over symbols, like method signature (textDocument/hover)
* Getting list/tree of all symbols defined in a given file, along with symbol type like class, method, etc. (textDocument/documentSymbol)
Use of multilspy in AI4Code Scenarios like Monitor-Guided Decoding
multilspy provides all the features that language-server-protocol provides to IDEs like VSCode. It is useful to develop toolsets that can interface with AI systems like Large Language Models (LLM). One such usecase is Monitor-Guided Decoding, where multilspy is used to find results of static analyses like type-directed completions, to guide the token-by-token generation of code using an LLM, ensuring that all generated identifier/method names are valid in the context of the repository, significantly boosting the compilability of generated code. MGD also demonstrates use of multilspy to create monitors that ensure all function calls in LLM generated code receive correct number of arguments, and that functions of an object are called in the right order following a protocol (like not calling "read" before "open" on a file object).