Closed lukester1975 closed 1 year ago
cc @wolfpld. Could we change the commit to prioritize the workspace root meson.build if it exists?
Thanks @lukester1975.
NP.
You probably do want some sort of closest-to-workspace-root ordering though, if the idea is to cope with the root meson.build
not being in the workspace root?
a/meson.build
a/b/meson.build
Wouldn't want a/b/meson.build
(at least, generally, for sane layouts)...
Sorting the initial list of meson files by length sounds like a good solution to the problem at hand.
The idea is to exclude all dependent meson.build
files (included with subdir
) from the list, but this has not yet been done.
Should be fixed by #188.
My understanding is we only need to know if it's a Meson project or not. We don't actually need to search for all meson.build files, we could just check if it exists at the root of the workspace?
There is no requirement to keep a single "meson project" meson.build
file in the repository. In some cases, such a setup would be too restrictive.
Problem being the list returned by
const mesonFiles = await vscode.workspace.findFiles("**/meson.build");
; the first entry is taken but the order is ... well, maybe not non-deterministic, but not necessarily workspace root "down" (e.g. Windows).Wouldn't like to say what the best solution is, but I hacked just to order by path length to check #186 at least superficially worked on Windows: https://github.com/lukester1975/vscode-meson/commit/2d3201297801f6081d35b49ac840b652f3223694
Thanks