vscode-meson icon indicating copy to clipboard operation
vscode-meson copied to clipboard

Multi-root workspace support

Open tristan957 opened this issue 9 months ago • 9 comments

Let's move toward support multi-root workspaces. What is this going to entail?

  • Remove mesonbuild.buildFolder in favor of mesonbuild.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

tristan957 avatar Nov 23 '23 17:11 tristan957

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

lukester1975 avatar Nov 23 '23 17:11 lukester1975

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.

xclaesse avatar Nov 23 '23 18:11 xclaesse

One refactor that would be great however, is to be able to switch between projects without requiring a complete reload of the window.

xclaesse avatar Nov 23 '23 18:11 xclaesse

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.

wolfpld avatar Nov 23 '23 18:11 wolfpld

Ah I didn't see any of the #195 conversation.

R.e. my old branch: in side bar terms, the ui was simple:

multi

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.

lukester1975 avatar Nov 23 '23 18:11 lukester1975

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.

lukester1975 avatar Nov 23 '23 18:11 lukester1975

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

JCWasmx86 avatar Dec 06 '23 19:12 JCWasmx86