An Apex Language Server Protocol (LSP) server written in Dart.
Binaries are compiled for each Operating System (Windows, MacOs, Linux) and can be downloaded from the release page.
When using the (sf-zed)[https://github.com/cesarParra/sf-zed] plugin, the latest version is automatically installed for you.
- Only local files
- No inheritance support (
super.calls are not autocompleted) - No Apexdocs support
- No Apexdocs support
- Dart SDK (>= 3.0)
- Integration tests:
git,make, andclang(Xcode Command Line Tools on macOS,build-essentialon Linux)
From the repo root:
dart run bin/apex_lsp.dart
The server version reported to LSP clients is kept in lib/version.dart, which is generated from pubspec.yaml. After bumping version: in pubspec.yaml, regenerate it:
dart run tool/generate_version.dartCommit both pubspec.yaml and the updated lib/version.dart together.
The integration tests use a native Tree-sitter Apex library built by tool/build_tree_sitter_lib.sh. The script clones the Tree-sitter runtime and tree-sitter-sfapex into .tree-sitter-build, so the grammar does not need to live in this repo. This setup is supported on macOS (.dylib) and Linux (.so).
If the script is not executable, run:
chmod +x tool/build_tree_sitter_lib.sh
Build the library, set the env var, and run the integration tests:
./tool/build_tree_sitter_lib.sh
# For macOS:
export TS_SFAPEX_LIB="$(pwd)/bin/libtree_sitter_sfapex.dylib"
# For Linux:
export TS_SFAPEX_LIB="$(pwd)/bin/libtree_sitter_sfapex.so"
dart test test/completion/tree_sitter_integration_test.dart