Skip to content

Conversation

@ExquisiteCore
Copy link
Contributor

#12 添加clangd的支持

@CLAassistant
Copy link

CLAassistant commented Nov 17, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 2 committers have signed the CLA.

❌ ExquisiteCore
❌ Sunrisepeak
You have signed the CLA already but the status is still pending? Let us recheck it.

@Sunrisepeak Sunrisepeak added documentation | 文档 Improvements or additions to documentation feature | 新模块 New feature or request labels Nov 17, 2025
1. 在项目根目录,进入 dslings 目录生成编译数据库:
```bash
cd dslings
xmake project -k compile_commands
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我测试了一下,不知道是不是我环境的问题(wsl+nvim),使用d2x checker时不会跳转到对应的文件

Copy link
Member

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 之类的

你知道有什么简单的方法吗?

Sunrisepeak added a commit to d2learn/xlings that referenced this pull request Nov 18, 2025
- mcpp-community/d2mcpp#23

Signed-off-by: sunrisepeak <speakshen@163.com>
Sunrisepeak added a commit to d2learn/xlings that referenced this pull request Nov 18, 2025
- mcpp-community/d2mcpp#23

Signed-off-by: sunrisepeak <speakshen@163.com>
Copy link
Member

@Sunrisepeak Sunrisepeak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Sunrisepeak Sunrisepeak merged commit 6e69f75 into mcpp-community:main Nov 18, 2025
1 check was pending
@Sunrisepeak
Copy link
Member

现在更新xlings最新版本, 并修改项目的editor配置, 即可使用nvim并支持自动跳转

xlings self update
xim --update index

1.编辑项目配置文件config.xlings中的editor属性, 设置为nvim (或zed)

d2x = {
    checker = {
        name = "dslings",
        editor = "nvim", -- option: vscode, nvim, zed
    },

-> 具体细节

@Sunrisepeak Sunrisepeak changed the title #12 添加clangd的支持 #12 添加clangd 以及 VSCode / Zed / NeoVim 编辑器的支持 Nov 18, 2025
@Sunrisepeak Sunrisepeak changed the title #12 添加clangd 以及 VSCode / Zed / NeoVim 编辑器的支持 添加clangd 以及 VSCode / Zed / NeoVim 编辑器的支持 Nov 18, 2025
This was referenced Nov 18, 2025
Sunrisepeak added a commit that referenced this pull request Nov 18, 2025
* 添加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>
Sunrisepeak added a commit that referenced this pull request Nov 20, 2025
* 添加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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation | 文档 Improvements or additions to documentation feature | 新模块 New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants