A XMake integration for Zed editor with automatic LSP installation, comprehensive syntax highlighting, and build tasks.
It is deeply integrated with xmake and Zed editor to provide a convenient and fast cross-platform c/c++ development and building.
You need install xmake first and a project with xmake.lua.
Please see xmake-github and website if you want to known more about xmake.
-
Language Server (xmake_ls)
-
Syntax Highlighting (300+ functions)
-
Code Intelligence
-
Symbol Navigation
-
Project Templates
-
Full LSP Integration: Complete language server support via xmake_ls
-
Auto-completion: Intelligent code completion for XMake APIs
-
Diagnostics: Real-time error detection and warnings
-
Hover Information: Documentation on hover
-
Code Actions: Quick fixes and refactoring support
-
Go to Definition: Navigate to symbol definitions
-
Find References: Locate all usages of symbols
-
Document Symbols: Outline of targets, options, rules, tasks
-
Workspace Symbols: Search across all xmake.lua files
-
Formatting: Document and range formatting support
- Target APIs: target, set_kind, set_version, set_description, set_default
- File APIs: add_files, add_headerfiles, add_installfiles, remove_files
- Include APIs: add_includedirs, add_sysincludedirs, add_defines, add_undefines
- Linking APIs: add_links, add_linkdirs, add_syslinks, add_frameworks, add_deps
- Compiler APIs: add_cflags, add_cxxflags, add_ldflags, set_warnings, set_optimize
- Rule APIs: add_rules, rule, on_load, on_build, before_build, after_build
- Option APIs: option, add_options, set_default, set_showmenu
- Package APIs: add_requires, add_packages, add_repositories, add_requireconfs
- Task APIs: task, on_run, set_menu
- Utility APIs: is_plat, is_arch, is_mode, is_host, has_config, get_config
- Global Modules: os, path, string, table, math, io, debug, coroutine, hash, utils
| Platform | Architecture | Auto-Install |
|---|---|---|
| macOS | ARM64 (Apple Silicon) | ✅ |
| macOS | x64 (Intel) | ✅ |
| Linux | x64 | ✅ |
| Linux | ARM64 | ✅ |
| Linux | RISC-V | ✅ (musl) |
| Windows | x64 | ✅ |
| Windows | ARM64 | ✅ |
| Windows | x86 (32-bit) | ✅ |
-
Install Lua Extension (required for syntax highlighting)
- Press
Cmd+Shift+X→ Search "Lua" → Install - xmake.lua files use Lua syntax, so this grammar is needed
- Press
-
Install XMake Extension
- Press
Cmd+Shift+X(macOS) orCtrl+Shift+X(Linux/Windows) - Search for "XMake"
- Click Install
- Press
The XMake extension will automatically download and install the xmake_ls language server when you open an xmake.lua file.
Create new xmake projects using the built-in tasks:
- Open Command Palette (
Cmd+Shift+P/Ctrl+Shift+P) - Type "Tasks: Run Task"
- Select "xmake: Create project help" to see available options
Example:
# C++ console project
xmake create -l c++ -t console myproject
# Rust static library
xmake create -l rust -t static mylib
# Zig shared library
xmake create -l zig -t shared mylib
# Qt widget application
xmake create -l c++ -t qt.widgetapp myapp
# iOS app
xmake create -l objc -t xcode.iosapp myapp| Language | Console | Static | Shared | Module |
|---|---|---|---|---|
| C | ✅ | ✅ | ✅ | ✅ |
| C++ | ✅ | ✅ | ✅ | ✅ |
| Rust | ✅ | ✅ | ❌ | ❌ |
| Zig | ✅ | ✅ | ✅ | ❌ |
| Go | ✅ | ✅ | ❌ | ❌ |
| D Language | ✅ | ✅ | ✅ | ❌ |
| CUDA | ✅ | ✅ | ✅ | ❌ |
| Swift | ✅ | ❌ | ❌ | ❌ |
| Fortran | ✅ | ✅ | ✅ | ❌ |
| Objective-C | ✅ | ❌ | ❌ | ❌ |
| Objective-C++ | ✅ | ❌ | ❌ | ❌ |
| Nim | ✅ | ✅ | ✅ | ❌ |
| Kotlin | ✅ | ✅ | ✅ | ❌ |
| Vala | ✅ | ✅ | ✅ | ❌ |
| Pascal | ✅ | ✅ | ✅ | ❌ |
- Console: Basic executable projects
- Static Library: .a / .lib files
- Shared Library: .so / .dylib / .dll files
- Module: C/C++ module binaries
- Qt: Console, Quick App, Widget App (static/shared variants)
- TBOX: Console, Static, Shared library projects
- wxWidgets: Desktop GUI applications
- Xcode: Bundle, Framework, macOS App, iOS App
- XMake CLI: Command-line tool projects
If you already have xmake_ls installed via your package manager or built from source, the extension will automatically detect and use it from your PATH.
# Example: Install from source
cargo install --git https://github.com/CppCXY/xmake_ls xmake_lsOverride the binary location in your Zed settings (~/.config/zed/settings.json):
{
"lsp": {
"xmake-ls": {
"binary": {
"path": "/custom/path/to/xmake_ls"
}
}
}
}Linux users can choose their preferred binary variant. Add to your Zed settings:
{
"lsp": {
"xmake-ls": {
"settings": {
"linux_variant": "musl"
}
}
}
}| Variant | Description | Best For |
|---|---|---|
x64-glibc.2.17 |
Default for x86_64 | Ubuntu 16.04+, Debian 8+, RHEL/CentOS 7+ |
x64 |
Newer glibc | Recent distros (Ubuntu 20.04+, Fedora 30+) |
aarch64-glibc.2.17 |
Default for ARM64 | ARM-based servers, Raspberry Pi 3+ |
musl |
Alpine Linux libc | Alpine Linux, embedded systems, containers |
riscv64 |
RISC-V architecture | RISC-V hardware |
Variant Selection Guide:
- Don't know? Use default (auto-selected based on architecture)
- Alpine Linux, containers: Use
musl - Older distros: Use
*-glibc.2.17variants - Latest distros: Use
x64oraarch64
The extension checks for xmake_ls in the following order:
- Custom path from Zed settings (highest priority)
- System installation via PATH (
which xmake_ls) - Cached download from previous extension installation
- Auto-download from GitHub releases (with platform/variant detection)
Run Zed from the terminal to see detailed logs:
zed --foregroundRemove the cached binary to trigger a fresh download:
# macOS/Linux
rm -rf ~/.local/share/zed/extensions/xmake/
# Windows
Remove-Item -Recurse -Force "$env:LOCALAPPDATA\Zed\extensions\xmake"-
Verify xmake_ls is executable:
xmake_ls --version
-
Check Zed's language server status:
- Open Command Palette (
Cmd+Shift+P/Ctrl+Shift+P) - Type "Zed: Open Log"
- Look for xmake_ls errors
- Open Command Palette (
-
Try manual installation:
# Download for your platform from: # https://github.com/CppCXY/xmake_ls/releases/latest
If you're getting glibc version errors, explicitly set your variant:
{
"lsp": {
"xmake-ls": {
"settings": {
"linux_variant": "musl"
}
}
}
}Please see CONTRIBUTING for details.
Apache License 2.0 - See LICENSE for details.