Skip to content
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

Multi-root workspace support #201

Open
tristan957 opened this issue Nov 23, 2023 · 9 comments
Open

Multi-root workspace support #201

tristan957 opened this issue Nov 23, 2023 · 9 comments

Comments

@tristan957
Copy link
Contributor

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

@lukester1975
Copy link
Contributor

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

@xclaesse
Copy link
Member

With #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
Copy link
Member

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

@wolfpld
Copy link
Contributor

wolfpld commented Nov 23, 2023

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.

@lukester1975
Copy link
Contributor

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
Copy link
Contributor

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.

@JCWasmx86
Copy link
Contributor

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

@zenshosan
Copy link

Hi, I am new to this repository and have recently started using meson.

Is this ticket still active?
I really need support for multiple build directories. If you don't mind, I would like to contribute with coding to make this happen.

Actually, what I need is to be able to select one builddir I need now from several builddirs; rewriting "mesonbuild.buildFolder" in settings.json is not very useful.

If this is out of scope of this issue, I will post it as a separate issue.

@tristan957
Copy link
Contributor Author

It sounds like your issue is different. Multiple build directories would be great to have. Contributions are always welcome. Thanks for offering to step up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants