由“import std”引发的特殊需求 #6941
Replies: 3 comments
-
Title: Special requirements caused by "import std" In what scenario do you need this feature?cause: Clion's clangd and Visual Studio's Intellisense are both built into the IDE. Describe possible solutionsImplement functions to modify the syntax version used by the language server Can make the entire tool chain suitable for writing code with the latest C++ version Describe your alternativesImprove the process of building directly without using CMake in Clion Other informationNo response |
Beta Was this translation helpful? Give feedback.
-
这跟 xmake 有啥关系,intellisense 的事情 vscode 目前会自动生成 compile_commands,可以搭配 clangd 搞,clangd 是否很好支持 std modules,那就是 clangd 的事情了。 clion 插件目前不支持,clion 插件开发体验太差,intelisense 和 debug 不好搞,我也没空弄,xmake 菜单栏有个生成 compile_commands 或者生成 cmakelists来变相支持。或者提 pr 过来给支持上。 |
Beta Was this translation helpful? Give feedback.
-
What does this have to do with xmake? It’s about intellisense. vscode currently automatically generates compile_commands, which can be used with clangd. Whether clangd supports std modules well is a matter for clangd. The clion plug-in is currently not supported. The clion plug-in development experience is too poor. Intelisense and debug are difficult to handle and I don’t have time to do them. You can generate cmakelists to provide disguised support. Or submit a PR to support. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
你在什么场景下需要该功能?
起因:
为了使用"import std"
我在xmake.lua里添加
后,IDE内编辑器仍和未修改xmake.lua前一样实时语法检查报错:
使用CLion2025.2.3+mingw-builds-binaries x86_64-15.2.0-release-posix-seh-ucrt-rt_v13-rev0默认情况下:
使用Visual Studio2026insider默认情况下:
CLion中,通过在CMakeLists手动添加
解决
Visual Studio中,通过建立sln项目专门修改项目属性中"C++ 语言标准"和"生成 ISO C++23 标准库模块"解决,但xmake插件的build没开发集成于“生成”功能里。
都无法一条龙使用
Clion的clangd、Visual Studio的Intellisense都是内置于IDE里的
但是xmake.lua中添加set_languages("c++latest")后修改的是编译参数
并不会使得用于代码检查的语言服务器使用的语法版本改变
而且
xmake并不是万能的
在修改了其他文件完成自己需要的功能情况下
每次更改xmake.lua更新其他文件(CppProperties.json、compile_commands.json、CMakeLists)时会清除掉原来数据 写入了新数据,也就失去了那些文件中手动添加的属性
描述可能的解决方案
实现函数来修改语言服务器使用的语法版本
实现 允许在xmake.lua中直接修改CppProperties.json、CMakeLists部分内容 的功能
加强xmake.lua的项目配置能力
可以使整个工具链能够适用于编写最新C++版本的代码
描述你认为的候选方案
完善Clion里不使用CMake直接进行构建的流程
其他信息
No response
Beta Was this translation helpful? Give feedback.
All reactions