From 9b81c116fc3c67ab882da98c572e7e10a1ce33c0 Mon Sep 17 00:00:00 2001 From: mmews Date: Thu, 4 Jan 2024 11:27:31 +0100 Subject: [PATCH] respect pnpm-workspaces.yaml --- .../eclipse/n4js/utils/ProjectDescriptionLoader.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/org.eclipse.n4js/src/org/eclipse/n4js/utils/ProjectDescriptionLoader.java b/plugins/org.eclipse.n4js/src/org/eclipse/n4js/utils/ProjectDescriptionLoader.java index 0e1ed3f551..ca9ddd160d 100644 --- a/plugins/org.eclipse.n4js/src/org/eclipse/n4js/utils/ProjectDescriptionLoader.java +++ b/plugins/org.eclipse.n4js/src/org/eclipse/n4js/utils/ProjectDescriptionLoader.java @@ -293,8 +293,15 @@ private void setInformationFromPnpmWorkspace(FileURI location, ProjectDescriptio Multimap pnpmWorkspacesYaml = YamlUtil.loadYamlAtLocation(path); Collection packagesEntries = pnpmWorkspacesYaml.get("packages"); if (!packagesEntries.isEmpty()) { - target.setPnpmWorkspaceRoot(true); - target.getWorkspaces().addAll(packagesEntries); + // check for property discussed here: https://github.com/pnpm/pnpm/issues/2255#issuecomment-576866891 + Collection useYarnConfigEntries = pnpmWorkspacesYaml.get("useYarnConfig"); + if (useYarnConfigEntries.isEmpty() + || !"true".equals(useYarnConfigEntries.iterator().next().toString().toLowerCase())) { + + target.setPnpmWorkspaceRoot(true); + target.getWorkspaces().clear(); + target.getWorkspaces().addAll(packagesEntries); + } } }