-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zig: setting up Zig + LSP(ZLS) with Vscode/Sublime Text 4/Clion #376
Comments
Zig + Vscode/Sublime Text 4/Clion 搭建开发环境:
✅ 1. 安装 zig. 安装 Zig:
# for macos + m1:
install:zig:dev:
cmds:
- mkdir -p $HOME/.local/bin/;
- cd $HOME/.local/bin/; curl -L https://ziglang.org/builds/zig-macos-aarch64-0.10.0-dev.2617+47c4d4450.tar.xz | tar -xJ --strip-components=1 -C .;
- chmod +x $HOME/.local/bin/zig;
- zig version
install:zig:
cmds:
- brew install zig
- zig version
- brew install xz # for zig zls
- mkdir $HOME/zls && cd $HOME/zls && curl -L https://github.com/zigtools/zls/releases/download/0.9.0/x86_64-macos.tar.xz | tar -xJ --strip-components=1 -C .
- chmod +x $HOME/zls/zls
- sudo $HOME/zls/zls configure
ignore_error: true
➤ which zig
/Users/dev/.local/bin/zig
➤ zig version
0.10.0-dev.2617+47c4d4450
➤ zig env
{
"zig_exe": "/Users/dev/.local/bin/zig",
"lib_dir": "/Users/dev/.local/bin/lib/zig",
"std_dir": "/Users/dev/.local/bin/lib/zig/std",
"global_cache_dir": "/Users/dev/.cache/zig",
"version": "0.10.0-dev.2617+47c4d4450"
} 安装 ZLS: (代码解析)
install:zls:
cmds:
- brew install xz # for zig zls
- mkdir $HOME/zls && cd $HOME/zls && curl -L https://github.com/zigtools/zls/releases/download/0.9.0/x86_64-macos.tar.xz | tar -xJ --strip-components=1 -C .
- chmod +x $HOME/zls/zls
- sudo $HOME/zls/zls configure
ignore_error: true
Welcome to the ZLS configuration wizard!
*
|\
/* \
| *\
_/_*___|_ x
| @ @ /
@ \ /
\__-/ /
? Should this configuration be system-wide? (y/n) > y
Found zig executable '/Users/dev/.local/bin/zig' in PATH.
? Which code editor do you use? (select one)
- VSCode
- Sublime
- Kate
- Neovim
- Vim8
- Emacs
- Doom
- Other
> vscode
? Do you want to enable snippets? (y/n) > y
? Do you want to enable style warnings? (y/n) > y
? Do you want to enable semantic highlighting? (y/n) > y
? Do you want to enable .* and .? completions? (y/n) > y
Writing config to /Library/Preferences/zls.json ... successful.
To use ZLS in Visual Studio Code, install the 'ZLS for VSCode' extension from
'https://github.com/zigtools/zls-vscode/releases' or via the extensions menu.
Then, open VSCode's 'settings.json' file, and add:
"zigLanguageClient.path": "[command_or_path_to_zls]"
Thank you for choosing ZLS! vscode 配置:
|
vscode 配置:
# vscode 设置, 搜索 zls, 添加对应的 zls 安装路径
/Users/dev/zls/zls
|
clion / IntelliJ IDEA 配置:
|
1 |
Open
Sublime Text 4 + ZLS 配置 Zig 开发环境:
// Settings in here override those in "LSP/LSP.sublime-settings"
{
"clients": {
"zig": {
"command": ["/Users/dev/zls/zls"],
"enabled": true,
"selector": "source.zig"
}
}
}
插件安装:
|
zls-vscode 插件炸机:
|
This was referenced Sep 9, 2022
hhstore
changed the title
Zig: with Vscode/Sublime Text 4/Clion
Zig: configure LSP(ZLS) with Vscode/Sublime Text 4/Clion
Nov 4, 2022
hhstore
changed the title
Zig: configure LSP(ZLS) with Vscode/Sublime Text 4/Clion
Zig: setting up Zig + LSP(ZLS) with Vscode/Sublime Text 4/Clion
Nov 4, 2022
如果用最新版本的 zls-vscode, 安装方式:zig + zls-vscode + zls,最好看下 zls-vscode 提示的编译 zls 的 zig 版本,下载一个一样的版本 zig 就可以了。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
related:
The text was updated successfully, but these errors were encountered: