Skip to content

Commit 1116cc0

Browse files
committed
Add more information to Claude
1 parent 762f604 commit 1116cc0

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

CLAUDE.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## Project Overview
66

7-
sourcekit-bazel-bsp is a Build Server Protocol (BSP) implementation that bridges sourcekit-lsp (Swift's official Language Server Protocol) with Bazel-based iOS projects. It enables iOS development in alternative IDEs like Cursor and VSCode by providing language server features without requiring Xcode IDE.
7+
sourcekit-bazel-bsp is a Build Server Protocol (BSP) implementation that bridges sourcekit-lsp (Swift's official Language Server Protocol) with Bazel-based iOS projects. It enables iOS development in alternative IDEs like Cursor and VSCode by providing language server features without requiring the Xcode IDE.
88

99
The project itself is built using Swift Package Manager. There is also a `Example/` folder containing a Bazel iOS application demonstrating the tool's functionality.
1010

@@ -14,6 +14,8 @@ The project itself is built using Swift Package Manager. There is also a `Exampl
1414
- **Build the project**: `swift build`
1515
- **Debug build**: `swift build`
1616
- **Release build**: `swift build -c release`
17+
- **Lint**: `swift format lint Sources/ Tests/ Example/ --recursive`
18+
- **Format**: `swift format Sources/ Tests/ Example/ --recursive --in-place`
1719
- **Run tests**: `swift test`
1820

1921
### For the example project
@@ -24,27 +26,26 @@ The project itself is built using Swift Package Manager. There is also a `Exampl
2426

2527
### Core Components
2628

27-
1. **BSP Server** (`BSPServer.swift`)
28-
- Main server implementation using JSONRPCConnection
29-
- Handles client lifecycle and message routing
29+
1. **BSP Server** (`Sources/SourceKitBazelBSP/Server/SourceKitBazelBSPServer.swift`)
30+
- Main server implementation using LSPConnection
31+
- Handles client lifecycle and message routing + registration
32+
- Server configuration managed by `BaseServerConfig.swift` and `InitializedServerConfig.swift`
3033

31-
2. **Message Handler** (`BSPServerMessageHandler.swift`)
32-
- Protocol defining BSP request/notification handling
33-
- Routes incoming requests to appropriate handlers
34+
2. **Message Handlers** (`Sources/SourceKitBazelBSP/Server/MessageHandler/`)
35+
- `BSPMessageHandler.swift` - Main (dynamic, registration-based) message dispatcher
3436

35-
3. **Request Handlers** (`Requests/`)
36-
- `InitializeRequestHandler.swift` - BSP initialization
37-
- `WorkspaceBuildTargetsHandler.swift` - Target discovery
38-
- `BuildTargetSourcesHandler.swift` - Source file resolution
39-
- `TextDocumentSourceKitOptionsHandler.swift` - SourceKit configuration
40-
- `PrepareTargetHandler.swift` - Build preparation
37+
3. **Request Handlers** (`Sources/SourceKitBazelBSP/RequestHandlers/`)
38+
- Various handlers that are dynamically registered to the main BSPMessageHandler by the server.
4139

42-
4. **Command Structure** (`Commands/`)
43-
- Uses Swift ArgumentParser for CLI interface
44-
- Main entry point in `SourcekitBazelBsp.swift`
40+
4. **Entry Point** (`Sources/sourcekit-bazel-bsp/`)
41+
- CLI-related code and argument parsing.
4542

46-
When making changes to the BSP handling code, you should always first inspect how SourceKit-LSP handles will handle the request on their end. The source code for SourceKit-LSP should be available locally inside the `.build` folder after building the tool for the first time.
43+
5. **Proto Bindings** (`Sources/BazelProtobufBindings/`)
44+
- Protobuf bindings to allow type-safe querying with Bazel.
45+
46+
When making changes to the message handlers, you should always first inspect how SourceKit-LSP handles will handle the request on their end. The source code for SourceKit-LSP should be available locally inside the `.build` folder after building the tool for the first time.
4747

4848
### Key Dependencies
4949
- **sourcekit-lsp**: Provides BuildServerProtocol and LSPBindings. Receives BSP requests and forwards to this server
5050
- **Bazel, rules_swift, rules_apple, and apple_support**: Common Bazel-related support for Apple projects, for the example project
51+
- **swift-protobuf**: For generating the Bazel bindings.

0 commit comments

Comments
 (0)