From ed9d0c7dd259c86bc9310417577098f97ae25b5f Mon Sep 17 00:00:00 2001 From: Jonathan Cammisuli Date: Wed, 16 Jun 2021 11:14:32 -0400 Subject: [PATCH] fix: use proper file paths for schemas within windows (#1085) --- libs/vscode/json-schema/src/lib/get-all-executors.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libs/vscode/json-schema/src/lib/get-all-executors.ts b/libs/vscode/json-schema/src/lib/get-all-executors.ts index b88646a69c..136907c5fd 100644 --- a/libs/vscode/json-schema/src/lib/get-all-executors.ts +++ b/libs/vscode/json-schema/src/lib/get-all-executors.ts @@ -1,6 +1,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import { clearJsonCache, readAndCacheJsonFile } from '@nx-console/server'; import { dirname, join } from 'path'; +import { platform } from 'os'; export interface ExecutorInfo { name: string; @@ -89,9 +90,16 @@ function getBuilderPaths( for (const [key, value] of Object.entries( json.builders || json.executors )) { + let path = ''; + if (platform() === 'win32') { + path = `file:///${join(baseDir, value.schema).replace(/\\/g, '/')}` + } else { + path = join(baseDir, value.schema); + } + builders.push({ name: `${collectionName}:${key}`, - path: join(baseDir, value.schema), + path, }); }