Skip to main content

Core LSP client infrastructure for SwiftLens

Project description

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:

pip install swiftlens-core-*.whl

Usage

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

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

swiftlens_core-0.1.6-cp313-cp313-macosx_15_0_arm64.whl (570.6 kB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

File details

Details for the file swiftlens_core-0.1.6-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for swiftlens_core-0.1.6-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 9d6603ede79ef6a0faf9f49aa956ea9675cc8326e1d4432b92f1bcf615c29987
MD5 3cca1e35e71e1adb987e8602050156be
BLAKE2b-256 994df822a8c1df0062f33c3f705c830a0d66ca2f2e21e262af732713ae663990

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page