vscode-meson
vscode-meson copied to clipboard
Multi-root workspace support
Let's move toward support multi-root workspaces. What is this going to entail?
- Remove
mesonbuild.buildFolder
in favor ofmesonbuild.buildDirectories
where the value can either be a string or an object where the keys are the names of workspace folders and the values are their build directories. - How will this work with the muon formatter/linter?
- How will this work with the language server?
cc @lukester1975 @wolfpld @xclaesse
Just multiple roots, not build dirs for now?
The way I did that was to remove anything that referenced vscode.workspace.workspaceFolders[0]
and using all entries; didn't find a need for a setting (though that did change for multiple build dirs).
Then each root was just treated the same as now.
Maybe later I'll add a pic of how it looked in the ui for info. Funnily enough, I was recently pondering pulling out the ui stuff from that old branch as that in itself is probably quite self contained.
Cheers
With https://github.com/mesonbuild/vscode-meson/pull/195 multi-root works by asking the user to select one Meson project if more than one is detected. In that case we have only one builddir at a time. Note that it adds a command to let the user switch between meson projects.
Supporting multiple meson projects concurrently is a much bigger task. It means merging tasks in the side panel tree view? The build/configure commands should run on each projects? IMHO that's becoming too complicated and should be left out of scope.
One refactor that would be great however, is to be able to switch between projects without requiring a complete reload of the window.
Supporting multiple meson projects concurrently is a much bigger task. It means merging tasks in the side panel tree view? The build/configure commands should run on each projects? IMHO that's becoming too complicated and should be left out of scope.
I'm not sure how this would even work conceptually. We need to have some notion of a single "active" configuration, since we are also providing compile_commands.json
to the C++ language server (currently Microsoft's, in the future also clangd). If more than one configuration would be active, what do we want to pass to the language server?
Consider that any two Meson project configurations may provide a conflicting set of compilation commands for a single source file. Which is actually part of the reason I want to have support for multiple configurations.
Ah I didn't see any of the #195 conversation.
R.e. my old branch: in side bar terms, the ui was simple:
Context menus on anything that makes sense, configure button per root etc.
One thing I never finished was indeed having an "active build directory" such that the command palette ui wasn't horrible. Also, all my old work pre-dated the debug provider and test integration work, so no idea how that would be affected.
Just to note: personally I'm only interested in multiple build dirs (blame full fat VS). I just did multiple roots as it dropped out pretty easily IIRC, but never use it.
How will this work with the language server?
It's after the rewrite (So post Oct 2024, maybe earlier) The rewrite would remove technical debt that makes it difficult to implement that in the current state