[Qbs] Missing feature qbs API command "generate"

Иван Комиссаров abbapoh at gmail.com
Fri Jul 4 10:30:21 CEST 2025


Hello!

> 2 июля 2025 г., в 19:38, Jochen Becher via Qbs <qbs at qt-project.org> написал(а):
> 
> HI,
> 
> I am currently working on some improvements of the VSCode extension
> vscode-qbs. I would like to add some support for clangd: whenever a
> project is resolved, it should also generate the clangdb
> (compile_commands.json). With some configuration of the clang extension
> it is possible to have full automated clangd support.

Nice, I actually was asking Denis (vscode extension author) about clangd quite a while ago.
Seems like a nice feature.


> I tested this
> manually and with the exception of some issues with gcc options that
> are not supported by clang it works well. 
> 
> So what I need is a qbs API command "generate" to run the generator
> explicitly or an extension of the existing command "resolve-project" to
> also generate clangdb.

Note that generating compile commands can take time, maybe use an option or auto-detect if clangd is present?

> 
> Is this a planned feature or should I implement it myself? What would
> be your preferred way? Having a separate command or extending resolve-
> project?

No, we did not plan to add a feature.
Please, go ahead and add a command to the API, contributions are always welcome.

I would probably add a «generate» command to the command palette in VSCode (so users could call generators mannually) and call it automatically when
resolving/when appropriate.

Ivan


More information about the Qbs mailing list