Metadata-Version: 2.4
Name: swiftlens-core
Version: 0.1.4
Summary: Core LSP client infrastructure for SwiftLens
Home-page: 
Author: SwiftLens Team
Author-email: 
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: license-file
Dynamic: requires-python
Dynamic: summary

# swiftlens-core

Core LSP client infrastructure for SwiftLens - a Model Context Protocol server for Swift code analysis.

## Overview

This package contains the low-level SourceKit-LSP integration that powers SwiftLens. It provides:

- Efficient LSP client with process management
- Protocol implementation for SourceKit-LSP communication
- Core LSP operations (symbols, references, definitions, hover, etc.)
- Resource management and timeout handling

## Installation

This package is distributed as a pre-built wheel:

```bash
pip install swiftlens-core-*.whl
```

## Usage

The primary entry point for tool developers is the `managed_lsp_client` context manager:

```python
from swiftlens_core.src.lsp import managed_lsp_client

# Use the managed client for efficient LSP operations
with managed_lsp_client(project_root="/path/to/project") as client:
    # Get document symbols
    symbols = client.get_document_symbols("/path/to/file.swift")
    
    # Find references
    references = client.find_references("/path/to/file.swift", line=10, character=5)
    
    # Get hover information
    hover = client.get_hover("/path/to/file.swift", line=10, character=5)
```

## API Reference

### Core Classes

- `SwiftLSPClient`: Main LSP client class
- `LSPProtocol`: Protocol implementation
- `LSPClientManager`: Client lifecycle management

### Context Manager

- `managed_lsp_client()`: Recommended way to use the LSP client

### Operations

All operations are accessible through the client instance and return structured responses.

## Requirements

- macOS with Xcode installed
- Python 3.9 or higher
- SourceKit-LSP (included with Xcode)

## License

This is proprietary software. See LICENSE file for details.
