-
Notifications
You must be signed in to change notification settings - Fork 3k
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
CMake support #5102
Comments
Note that with CMake support, CMake presets usually offers the best integration with editors. If the CMake plugin support for generating a base config or adds a UI to configure CMake, it should be done through |
Dropping these here as well since this issue seems to also be tagged for cmake language support and a good experience editing the CMake project files themselves is the more important part of this for me personally. |
zed editor called suitable for c++ development without even supporting syntax coloring for .cmake files? |
As soon as someone implements it. Wanna volunteer? I actually had a rough plugin wired up to provide syntax highlighting + neocmakelsp but it broke when the plugin interface was refactored last week. I might find time to fix that plugin and push it to the extension repo eventually but I have no interest in developing a configuration GUI as that does not really have any value to me. There is currently also no way for extensions to define their own GUI so that is going to have to wait a while longer anyway. That said the syntax highlighting + LSP plugin is very straightforward to replicate based on e.g. the uiua language plugin, in case someone else wants to take a stab before I get to it. |
Im not even joking this is how cmakelists.txt looks like. there is no need for complex features like LSP. just syntax coloring could be a great addition, I already had the same issue with xcode, but in there I just enabled c++ coloring and it "did the trick", they also offer no cmake LSP but just syntax coloring. . . (what I meant https://stackoverflow.com/questions/63455480/xcode-11-and-cmake-syntax-highlighting) |
You can do the same trick in Zed |
how |
please let me know if you manage to complete your task |
|
how do I get to the language selector thingy |
I this this is not a solution. It is a trick. Maybe I will start working on plugin for CMake and general C/C++ support. |
There already is syntax highlighting and LSP (clangd) support for C and C++. If you mean build/debug support then I hope you aren't in a hurry because you'll find that Zed is still lacking integration APIs for implementing those. |
I think a first step could be to add
That's also how we handle highlighting
But obviously the downside of that is that it treats The better solution would be to use https://github.com/uyha/tree-sitter-cmake and add a language extension to that. |
is someone fixing this shit or not |
I wanted to add you probably meant
|
I read through all API and will be working on providing general support. I know that there is only syntax highlighting and LSP, but (I hope) that in future this issue will be fixed ASAP |
I don't think so. Tree-Sitter is just general parser and doesn't provides required cabilities (like other C/C++ tools) does. So there is a lot of work to be done |
Hi, I maintain zed cmake extension, which has tree sitter and LSP (https://github.com/k0tran/zed_neocmake). It also has README with short instructions on integrating clangd (C++ LSP) and creating cmake task (shortcut for building your project). It has enough features at least for me. I would like a way to add template of CMake C++ task into the extension/editor interface so you don't need to open github page every time. On the first iterations of the extension I put zed/assets/settings/default.json Line 838 in 17b9d19
I also would like an addition here
If it's required I can make two separate issues for those problems |
@k0tran yeah, I think specific issues such as " |
Check for existing issues
Is your feature request related to a problem?
I think, that CMake language and as the build tool is not related to language requests. CMake language is separate thing, but the build system is other.
Previous mention of this topic: #5269.
Also related: #5437, zed-industries/extensions#135
Related issue just got mention of CMake support, but primary just asks for plugins support. For now Zed is not parsing make file, not loading caches provided by make and so on. For now C/C++/ObjC/... projects are working on file based project structure.
All build tools for C languages (cmake, ninja, mason) are not working for now.
Describe the solution you'd like
I would like to see project loading, like CLion have. JetBrains added support for it in their primary IntelliJ IDEA and in CLion. VSCode also has that feature with CMake plugin. Both of them could be good references for quite good project indexing.
For the UI, I think, that we need in commands in command pallet like building target, reloading project and so on. They could appear in case of CMake project detected and loaded successfully. For developing support, there is one helpful option: cmake caches. In them cmake contains tons of useful information about structure, loading and so on.
I see two ways of solution.
Native support of CMake
This way requires more time and code for achieving result, but it will provide cross-platform support for C/C++ projects (CMake is only one native way of building projects on windows, according to official documentation of Microsoft).
So this way probably will cause the two steps to do:
cmake-build-debug
folder, like CLion does (withcmake -B . -S cmake-build-debug
).After that, You will have folder, that contains structured information about all targets, languages, errors and so on. I look through cargo's and there is no of them, doing this job.
Shadow calling of CMake
Cmake is just preprocessor to other things (ninja, make, mason, xcode). Probably, You may add support for Make projects and then just invoke cmake with generating Makefile (that appears on top of cache folder). This way maybe more useful, because make projects are more widely used and automatically adding support to tons of other languages.
For developers
I am working on monorepo tool that must support CMake build system tool. Because of that, I was need in some sort of parser for it too. I tried to find some sort of solution to these problem for half a year, but there is no tool for getting information from CMake projects.
Just making this note is not useful. For developers I may provide some sort of beta-parser of cmake projects in rust, c or cpp, which may help during Your work in development. Or more detailed documentation about cache folder structure. Like I mentioned in #5104 issue, the way that You propably may use is single interface for build tools.
If applicable, add mockups / screenshots to help present your vision of the feature
Example UI of working with CMake from command pallet
The text was updated successfully, but these errors were encountered: