ms-iot / vscode-ros

Visual Studio Code extension for Robot Operating System (ROS) development
https://marketplace.visualstudio.com/items?itemName=ms-iot.vscode-ros
MIT License
406 stars 94 forks source link

[feature] Clangd support #699

Open philippewarren opened 2 years ago

philippewarren commented 2 years ago

what is needed Add support for the clangd language server. At least, allow the ROS extension to start if the C/C++ extension is disabled or not launched.

why is it needed Clangd with DCMAKE_EXPORT_COMPILE_COMMANDS is a good alternative to MS C/C++ and its numerous configurations for include paths and everything. This would allow users to use their preferred language server. Currently, if someone uses Clangd and therefore disables Intellisense for the C/C++ extension, the C/C++ extensions does not launch, which in turns makes the ROS extension fail to launch.

ooeygui commented 2 years ago

Thank you for the feedback. Internally the ROS node configures the C++ debug engine during launch debugging. The dependency is there because it references a type from another extension. Without the dependency, the ROS extension would need to introspect at runtime and ask the user to install the Microsoft extension. Additionally, to support this case the ROS extension should be enlightened to configure the clangd C++ configuration.

I've added the help wanted tag in case someone wants to take a crack at this; at my current burn rate and backlog, I don't think I'll get to this for a very long time.

philippewarren commented 2 years ago

My feature request was triggered by the fact that I can no longer use the ROS extension when I disable IntelliSense in the C/C++ extension. I don't really mind if the debugging with the ROS extension uses the C/C++ extension. After a bit more searching, it turns out that this is a regression bug in the C/C++ extension. It used to load even if IntelliSense was disabled, and now it fails to load, which in turn causes the ROS extension to fail to load. https://github.com/microsoft/vscode-cpptools/issues/9083

Once that issue is resolved, my problem will be solved. Supporting clangd instead of MS C/C++ could still be a help wanted kind of long-term goal, but it won't really matter to me.