From 80e2e5aba5d53277a8e391f5a3e6e04ab1c0f814 Mon Sep 17 00:00:00 2001 From: Brad Cornes Date: Fri, 8 Oct 2021 16:48:44 +0100 Subject: [PATCH] Fix resolution of WSL files on Windows (#411) --- packages/tailwindcss-language-server/src/server.ts | 1 - packages/tailwindcss-language-server/src/util/resolveFrom.ts | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/tailwindcss-language-server/src/server.ts b/packages/tailwindcss-language-server/src/server.ts index aa83b05..28b025e 100644 --- a/packages/tailwindcss-language-server/src/server.ts +++ b/packages/tailwindcss-language-server/src/server.ts @@ -430,7 +430,6 @@ async function createProjectService( concurrency: Math.max(os.cpus().length, 1), }) ) - .map(normalizePath) .sort((a: string, b: string) => a.split('/').length - b.split('/').length) .map(path.normalize) diff --git a/packages/tailwindcss-language-server/src/util/resolveFrom.ts b/packages/tailwindcss-language-server/src/util/resolveFrom.ts index 0fd209b..5c13995 100644 --- a/packages/tailwindcss-language-server/src/util/resolveFrom.ts +++ b/packages/tailwindcss-language-server/src/util/resolveFrom.ts @@ -18,6 +18,7 @@ export function setPnpApi(pnpApi: any): void { } export default function resolveFrom(from?: string, id?: string): string { + if (id.startsWith('\\\\')) return id let result = resolver.resolveSync({}, from, id) if (result === false) throw Error() // https://github.com/webpack/enhanced-resolve/issues/282