diff --git a/libs/vscode/nx-workspace/src/lib/get-nx-workspace-config.ts b/libs/vscode/nx-workspace/src/lib/get-nx-workspace-config.ts index ed8488a2af..9634995857 100644 --- a/libs/vscode/nx-workspace/src/lib/get-nx-workspace-config.ts +++ b/libs/vscode/nx-workspace/src/lib/get-nx-workspace-config.ts @@ -25,7 +25,8 @@ export type NxWorkspaceConfiguration = ProjectsConfigurations & */ export async function getNxWorkspaceConfig( basedir: string, - format: 'nx' | 'angularCli' + format: 'nx' | 'angularCli', + isNxWorkspace: boolean ): Promise<{ workspaceConfiguration: NxWorkspaceConfiguration; configPath: string; @@ -56,7 +57,7 @@ export async function getNxWorkspaceConfig( let projectGraph: ProjectGraph | null = null; try { - if (format === 'angularCli') { + if (!isNxWorkspace) { throw 'No project graph support'; } diff --git a/libs/vscode/nx-workspace/src/lib/nx-workspace.ts b/libs/vscode/nx-workspace/src/lib/nx-workspace.ts index 6a589c5add..71554082fd 100644 --- a/libs/vscode/nx-workspace/src/lib/nx-workspace.ts +++ b/libs/vscode/nx-workspace/src/lib/nx-workspace.ts @@ -1,5 +1,6 @@ import type { NxJsonConfiguration, ProjectsConfigurations } from '@nrwl/devkit'; import { + checkIsNxWorkspace, clearJsonCache, fileExists, getOutputChannel, @@ -85,9 +86,11 @@ async function _workspace(): Promise { const isAngularWorkspace = await fileExists( join(workspacePath, 'angular.json') ); + const isNxWorkspace = await checkIsNxWorkspace(workspacePath); const config = await getNxWorkspaceConfig( workspacePath, - isAngularWorkspace ? 'angularCli' : 'nx' + isAngularWorkspace ? 'angularCli' : 'nx', + isNxWorkspace ); const isLerna = await fileExists(join(workspacePath, 'lerna.json'));