Skip to main content

LSP Module

The LSP module provides a Language Server Protocol client for code intelligence features.

Installation

pip install praisonaiagents

Quick Start

from praisonaiagents.lsp import LSPClient

client = LSPClient(language="python")
client.connect()

# Get completions
completions = client.complete(file_path, position)

Classes

LSPClient

LSP client for code intelligence.
from praisonaiagents.lsp import LSPClient

client = LSPClient(
    language="python",
    workspace_dir="./project"
)

Methods

MethodDescription
connect()Connect to language server
complete(path, pos)Get completions
hover(path, pos)Get hover info
definition(path, pos)Go to definition
references(path, pos)Find references

LSPConfig

Configuration for LSP client.
from praisonaiagents.lsp import LSPConfig

config = LSPConfig(
    language="python",
    server_path="/usr/bin/pylsp"
)