multilspy  by microsoft

LSP client library in Python for building static analysis applications

created 1 year ago
388 stars

Top 75.0% on sourcepulse

GitHubView on GitHub
Project Summary

This Python library simplifies building language server clients for static code analysis, targeting researchers and developers building code intelligence tools or AI-assisted coding systems. It abstracts away the complexities of the Language Server Protocol (LSP), enabling unified access to static analysis results across various programming languages.

How It Works

Multilspy acts as a cross-platform client for LSP-compliant language servers. It automates server binary downloads, setup, and JSON-RPC communication. The library provides a unified API for common LSP requests like finding definitions, references, completions, and hover information, abstracting language-specific protocol nuances. This approach allows developers to query static analysis data from diverse language servers through a consistent interface.

Quick Start & Requirements

  • Install via pip: pip install multilspy
  • Requires Python >= 3.10.
  • Official documentation and usage examples are available within the repository's tests.

Highlighted Details

  • Supports Java (Eclipse JDTLS), Python (jedi-language-server), Rust (Rust Analyzer), C# (OmniSharp), TypeScript/JavaScript (TypeScriptLanguageServer), Go (gopls), Dart, and Ruby (Solargraph).
  • Offers both synchronous and asynchronous APIs for integration into different application contexts.
  • Enables Monitor-Guided Decoding (MGD) for code generation, ensuring generated code adheres to correctness properties via static analysis.
  • Can be used for gathering repository-wide context for coding agents and augmenting LLMs for test case repair.

Maintenance & Community

  • Developed as part of research for NeurIPS 2023 paper "Monitor-Guided Decoding of Code LMs with Static Analysis of Repository Context."
  • Contributions are welcomed, subject to a Contributor License Agreement (CLA).
  • Adheres to the Microsoft Open Source Code of Conduct.

Licensing & Compatibility

  • The README does not explicitly state a license. However, Microsoft's open-source projects typically use permissive licenses like MIT or Apache 2.0. Further clarification on licensing is recommended for commercial use.

Limitations & Caveats

  • The library is research-driven, and its long-term maintenance and feature roadmap are not detailed.
  • Support for additional language servers or LSP features relies on community contributions or future development.
Health Check
Last commit

1 day ago

Responsiveness

Inactive

Pull Requests (30d)
6
Issues (30d)
0
Star History
92 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.