-
Notifications
You must be signed in to change notification settings - Fork 103
添加clangd 以及 VSCode / Zed / NeoVim 编辑器的支持 #23
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
Conversation
|
|
book/src/base/chapter_1.md
Outdated
| 1. 在项目根目录,进入 dslings 目录生成编译数据库: | ||
| ```bash | ||
| cd dslings | ||
| xmake project -k compile_commands |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个命令可以放到config.xlings里, 这样在项目安装的时候会和依赖安装一起执行生成
-- https://xlings.d2learn.org
xname = "mcpp-standard" -- project name
-- xim-deps
xim = {
vscode = "", -- config by checker.editor
cpp = "", -- language:[windows:mingw], [linux:gcc], [macos:clang]
mdbook = "0.4.43", -- for d2x book
xppcmds = {
"xmake project -k compile_commands --project=dslings"
}
}
d2x = {
checker = {
name = "dslings",
editor = "vscode", -- option: vscode, nvim
},
commands = {
update = {
linux = "tools/update_upstream.sh",
macosx = "tools/update_upstream.sh",
windows = [[tools\update_upstream.bat]],
},
},
private = {
-- project private attributes
mcpp = {
lang = "en", -- option: en, zh
}
},
}
xim[d2x.checker.editor or "vscode"] = "" -- config editor deps(default version
--xlings_llm_config = "llm.config.xlings"
包索引中刚加了nvim的支持(linux), 测试前可以更新一下 然后看是否生效
xlings self update
xim --update index然后手动在项目目录运行依赖安装和环境配置命令(如果通过xlings install d2x:mcpp-standard获取项目可以不用手动运行
xlings install- xpkg:nvim: d2learn/xim-pkgindex@a627ae2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我测试了一下,不知道是不是我环境的问题(wsl+nvim),使用d2x checker时不会跳转到对应的文件
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我测试了一下,不知道是不是我环境的问题(wsl+nvim),使用d2x checker时不会跳转到对应的文件
我现在不知道, nvim如何能简单的够通过外部命令自动切换nvim当前编辑的文件, 可能需要 简单的nvim插件 或是 nvim --server 之类的
你知道有什么简单的方法吗?
- mcpp-community/d2mcpp#23 Signed-off-by: sunrisepeak <speakshen@163.com>
- mcpp-community/d2mcpp#23 Signed-off-by: sunrisepeak <speakshen@163.com>
Sunrisepeak
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
|
现在更新xlings最新版本, 并修改项目的editor配置, 即可使用nvim并支持自动跳转 xlings self update
xim --update index1.编辑项目配置文件 d2x = {
checker = {
name = "dslings",
editor = "nvim", -- option: vscode, nvim, zed
},-> 具体细节 |
* 添加clangd支持 * 更新README * 更新README * 删除.clangd * Revert "更新README" This reverts commit fb5ef13. * Revert "更新README" This reverts commit f7b1f7f. * docs: update chapter_1 in EN and CN versions * docs: update chapter_1 in EN and CN version * 更新config.xlings * 更新文档 * add support for nvim and zed * optimize editor config to support nvim and zed --------- Co-authored-by: ExquisiteCore <xiaolongqq1y@163.com>
* 添加clangd支持 * 更新README * 更新README * 删除.clangd * Revert "更新README" This reverts commit fb5ef13. * Revert "更新README" This reverts commit f7b1f7f. * docs: update chapter_1 in EN and CN versions * docs: update chapter_1 in EN and CN version * 更新config.xlings * 更新文档 * add support for nvim and zed * optimize editor config to support nvim and zed --------- Co-authored-by: ExquisiteCore <xiaolongqq1y@163.com> Co-authored-by: SPeak <speakshen@163.com>
#12 添加clangd的支持