SDK for interacting with lsproxy container
Project description
LSProxy SDK
A Python SDK for interacting with the LSProxy container, providing language-server protocol functionality for code analysis across multiple languages.
Features
- Symbol definition lookup
- Reference lookup across files
- Support for analyzing Python, TypeScript/JavaScript, and Rust
- Built-in retry logic and error handling
- Pydantic models for type safety
Installation
pip install lsproxy-sdk
Usage
- Start the LSProxy container:
docker run --rm -d -p 4444:4444 -v "/path/to/your/code:/mnt/workspace" --name lsproxy agenticlabs/lsproxy:0.1.0a1
- Use the SDK:
from lsproxy import Lsproxy
lsp = Lsproxy()
List all files in the workspace
lsp.list_files()
Get symbols in a file
lsp.get_definitions_in_file(path="path/to/file.py")
Get references to a symbol
# Find all references to a symbol at a specific position
references = lsp.find_references(
GetReferencesRequest(
identifier_position=FilePosition(
file_path="path/to/file.py",
line=10,
character=15
),
include_code_context_lines=2, # Show 2 lines of context around each reference
include_declaration=True # Include the original declaration
)
)
# Print found references
for ref in references.references:
print(f"Reference in {ref.file_path} at line {ref.range.start.line}")
if ref.code_context:
print(ref.code_context)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lsproxy_sdk-0.1.0.tar.gz
(4.8 kB
view details)
Built Distribution
File details
Details for the file lsproxy_sdk-0.1.0.tar.gz
.
File metadata
- Download URL: lsproxy_sdk-0.1.0.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae996b37b691652cc887de47e805b6531e4a45136a7a55e1b21f257e5cd81aae |
|
MD5 | a4e25d1416294ca9a830d5f75570431d |
|
BLAKE2b-256 | 4b1a2f2e2df2fb4bd48ceb1489f964bb565142f0e544d8de49be0cffa2f06963 |
File details
Details for the file lsproxy_sdk-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: lsproxy_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3d7891f056635db8d1b5a949469bae1385b96f7b56926c576ac81204b3a6413 |
|
MD5 | fad883de42d7a05007aeb84554b2ef93 |
|
BLAKE2b-256 | bf7b3f78d2557c4a9db5777c053772543403f4660f3a8a2fff4c404914f24cb3 |