{"id":40871475,"url":"https://github.com/aelam/sourcekit-bsp","last_synced_at":"2026-01-22T00:40:40.023Z","repository":{"id":264039772,"uuid":"892175586","full_name":"aelam/sourcekit-bsp","owner":"aelam","description":"sourcekit-bsp for Xcode Project and SwiftPM Project","archived":false,"fork":false,"pushed_at":"2025-11-02T12:53:11.000Z","size":102129,"stargazers_count":6,"open_issues_count":15,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-11-02T14:31:09.403Z","etag":null,"topics":["bsp","sourcekit-lsp","xcodebuildserver"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aelam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-21T16:30:42.000Z","updated_at":"2025-11-02T12:53:15.000Z","dependencies_parsed_at":"2025-08-02T16:05:07.403Z","dependency_job_id":"b98c2764-e203-4dd1-8f8f-434951d1ae68","html_url":"https://github.com/aelam/sourcekit-bsp","commit_stats":null,"previous_names":["aelam/xcodebuildserver","aelam/sourcekit-bsp"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/aelam/sourcekit-bsp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aelam%2Fsourcekit-bsp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aelam%2Fsourcekit-bsp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aelam%2Fsourcekit-bsp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aelam%2Fsourcekit-bsp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aelam","download_url":"https://codeload.github.com/aelam/sourcekit-bsp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aelam%2Fsourcekit-bsp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28648460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T21:29:11.980Z","status":"ssl_error","status_checked_at":"2026-01-21T21:24:31.872Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bsp","sourcekit-lsp","xcodebuildserver"],"created_at":"2026-01-22T00:40:39.454Z","updated_at":"2026-01-22T00:40:40.016Z","avatar_url":"https://github.com/aelam.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sourcekit-bsp\n\n[![Swift](https://img.shields.io/badge/swift-6.1+-orange.svg)](https://swift.org)\n[![Platform](https://img.shields.io/badge/platform-macOS-lightgrey.svg)](https://developer.apple.com/macos/)\n[![Build Status](https://github.com/aelam/sourcekit-bsp/workflows/CI/badge.svg)](https://github.com/aelam/sourcekit-bsp/actions)\n[![codecov](https://codecov.io/github/aelam/sourcekit-bsp/graph/badge.svg?token=SUL2UI5FQD)](https://codecov.io/github/aelam/sourcekit-bsp)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\nA Build Server Protocol (BSP) implementation for Xcode projects, enabling better IDE integration with Swift and Objective-C codebases.\n\n## Features\n\n- 🔧 **BSP 2.0 Support**: Full compatibility with Build Server Protocol 2.0\n- 🏗️ **Xcode Integration**: Seamless integration with Xcode build system\n- ⚡ **Fast Indexing**: Efficient source code indexing and navigation\n- 📁 **Multi-target Support**: Support for complex Xcode project structures\n- 🔍 **SourceKit Integration**: Native Swift language server capabilities with complete `textDocument/sourceKitOptions` implementation\n- 🛡️ **Thread-safe**: Robust concurrent operations with Swift actors\n- 📊 **Comprehensive Build Settings**: Full support for per-file compiler arguments via `XcodeProj`\n\n## Demo\n\nSee sourcekit-bsp in action with seamless code navigation and jump-to-definition:\n\n![Navigation Demo](Docs/Navigation.gif)\n\n## Installation\n\n### Manual Installation\n1. Download the latest release from [GitHub Releases](https://github.com/aelam/sourcekit-bsp/releases)\n2. Extract and move to your PATH:\n   ```bash\n   tar -xzf sourcekit-bsp-macos-universal.tar.gz\n   sudo mv release/sourcekit-bsp /usr/local/bin/\n   chmod +x /usr/local/bin/sourcekit-bsp\n   ```\n\n### Build from Source\n```shell\ngit clone https://github.com/wang.lun/sourcekit-bsp.git\ncd sourcekit-bsp\nswift build -c release\ncp .build/release/sourcekit-bsp /usr/local/bin/sourcekit-bsp\n```\n\n### Homebrew (Coming Soon)\n```shell\n# Not yet available\nbrew install sourcekit-bsp\n```\n\n## Configuration\n\n### BSP Configuration\n\n Create a `buildServer.json` ~~`.bsp/sourcekit-bsp.json`~~ file in your project root:\n\n```json\n{\n   \"name\": \"sourcekit-bsp\",\n   \"version\": \"0.2\",\n   \"bspVersion\": \"2.2.0\",\n   \"languages\": [\n      \"objective-c\",\n      \"objective-cpp\",\n      \"swift\"\n   ],\n   \"argv\": [\n      \"path/to/sourcekit-bsp\"\n   ]\n}\n```\n\nsourcekit-lsp looks for configuration in the following order:\n1. `.bsp/*.json` files (BSP standard)\n   - `*.json` in `.bsp/` directory for your project/workspace\n2. `buildServer.json` in project root (legacy support)\n\nNOTE: `vscode-swift` requires the `buildServer.json` file to be located in the root of your non-SwiftPM project.\n\n\n### Project Configuration\n\nFor complex projects, create a `.sourcekit-bsp/project.json` configuration file:\n\n```json\n{\n  \"workspace\": \"YourProject.xcworkspace\",\n  \"project\": \"YourProject.xcodeproj\",\n  \"scheme\": \"YourScheme\",\n  \"configuration\": \"Debug\"\n}\n```\n\n#### Configuration Options\n\n| Option | Description | Required |\n|--------|-------------|----------|\n| `workspace` | Path to .xcworkspace file | Yes* |\n| `project` | Path to .xcodeproj file | Yes* |\n| `scheme` | Xcode scheme to use | Yes |\n| `configuration` | Build configuration (Debug/Release) | No (defaults to Debug) |\n\n*Either `workspace` or `project` is required.\n\n#### When Project Configuration is Required\n\nThe `.sourcekit-bsp/project.json` file is required for:\n- Multiple workspaces\n- Multiple projects without a workspace\n- Custom build configurations\n- Projects/workspaces with multiple schemes for multi iOS apps that sourcekit-bsp can not guess which one is main \n\n## Quick Start\n\n1. **Install sourcekit-bsp** using one of the installation methods above\n\n2. **Configure your project** following the configuration section\n\n3. **Validate your project**:\n   ```shell\n   XcodeProjectCLI /path/to/projectFolder\n   ```\n   This will check your project settings and report any issues.\n\n4. **Start the server**:\n   ```shell\n   sourcekit-bsp\n   ```\n\n5. **Connect from your IDE**: Configure your IDE to connect to the BSP server (typically on stdio).\n\n## IDE Integration\n\n### VS Code with SourceKit-LSP\n\nInstall the VSCode-Swift extension. For Swift versions lower than 6.1, configure:\n\n```json\n{\n  \"swift.sourcekit-lsp.serverPath\": \"/path/to/sourcekit-lsp\",\n  \"swift.sourcekit-lsp.toolchainPath\": \"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain\"\n}\n```\n\n### Vim/Neovim\n\nUse with [vim-lsp](https://github.com/prabirshrestha/vim-lsp) or [coc.nvim](https://github.com/neoclide/coc.nvim).\n\n\n## Development\n\n### Prerequisites\n- macOS 12.0+\n- Xcode 14.0+\n- Swift 6.1+\n\n### Building\n```bash\nswift build\n```\n\n### Testing\n```bash\nswift test\n```\n\n## Architecture\n\n```\n┌─────────────────┐    JSON-RPC     ┌──────────────────┐\n│       IDE       │ ◄─────────────► │  sourcekit-bsp   │\n└─────────────────┘                 └──────────────────┘\n                                            │\n                                            ▼\n                                    ┌─────────────────┐\n                                    │ Xcode Build     │\n                                    │ System          │\n                                    └─────────────────┘\n```\n\n### Key Components\n\n- **BSPServerService**: Core BSP protocol implementation\n- **JSONRPCConnection**: JSON-RPC transport layer\n- **ProjectManagerProvider** : Provides access to the ProjectManager\n- **ProjectManager**: Manages Xcode project/workspace parsing and build settings extraction\n- **XcodeProjectManager**: Handles Xcode-specific project operations\n- **XcodeBuild Integration**: Interface with xcodebuild tool\n- **SwiftPMProjectManager**: (TODO)Handles SwiftPM-specific project operations\n\n\n### BSP Method Support\n\n| Method | Status | Description |\n|--------|--------|-------------|\n| `build/initialize` | ✅ Complete | Server initialization with capabilities |\n| `build/initialized` | ✅ Complete | Post-initialization notification |\n| `workspace/buildTargets` | ✅ Complete | List all build targets |\n| `buildTarget/sources` | ✅ Complete | Get source files for targets |\n| `textDocument/sourceKitOptions` | ✅ **Complete** | **Per-file compiler arguments from buildSettingsForIndex** |\n| `buildTarget/prepare` | [ ] | Background indexing preparation |\n| `buildTarget/didChange` | [ ] | Build target change notifications, need a BSP client with full feature |\n| `workspace/didChangeWatchedFiles` | [] | File system change handling |\n\n## Troubleshooting\n\n### Common Issues\n\n1. **Server not starting**: Check that your configuration file is valid JSON\n2. **Build failures**: Ensure your Xcode project builds successfully first\n3. **Index not updating**: Verify that the scheme and configuration are correct\n\n### Logging\n\nLogs are written to `/tmp/sourcekit-bsp.log`\n\n### Verify if sourcekit-bsp can resolve your project\n\n```sh\n# See if project can be resolved\nXcodeProjectCLI resolveProject --workspace-folder /path/to/projectFolder\n\n# See if buildSettings of project can be resolved\nXcodeProjectCLI buildSettings \\\n--workspace-folder /path/to/projectFolder \\\n--xcodeproj relative/path/of/workspace-folder/to/{project}.xcodeproj \\\n--target targetNameInXcodeProj\n\n# See if a source file compile arguments can be generated\nXcodeProjectCLI compileArguments \\\n--workspace-folder /path/to/projectFolder \\ \n--xcodeproj relative/path/of/workspace-folder/to/{project}.xcodeproj \\\n--target targetNameInXcodeProj \\\n--source-file relative/path/of/workspace-folder/to/source-file\n\n```\n\n\n## Contributing\n\nWe welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details.\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests\n5. Submit a pull request\n\n## References\n\n- [Build Server Protocol Specification](https://build-server-protocol.github.io/)\n- [SourceKit-LSP](https://github.com/apple/sourcekit-lsp)\n  - [Implementing a BSP server](https://github.com/swiftlang/sourcekit-lsp/blob/main/Contributor%20Documentation/Implementing%20a%20BSP%20server.md)\n\nInspired by [sourcekit-bazel-bsp](https://github.com/spotify/sourcekit-bazel-bsp)\nand [xcode-build-server](https://github.com/SolaWing/xcode-build-server)\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\n- Apple for SourceKit and the Swift toolchain\n- The Build Server Protocol community\n- Contributors to the Swift ecosystem\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faelam%2Fsourcekit-bsp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faelam%2Fsourcekit-bsp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faelam%2Fsourcekit-bsp/lists"}