From 87ccd4bcd14bd67037c709829575f62caf8251bb Mon Sep 17 00:00:00 2001 From: David Sherret Date: Fri, 31 Mar 2023 12:48:18 -0400 Subject: fix(lsp): better handling of `data:` urls (#18527) 1. Log instead of error when the referrer can't be found 2. Fixes typescript to resolve data urls correctly. Properly documented here: https://github.com/denoland/TypeScript/pull/4/files#diff-180da7c288743d11d8590d30f0c07c48e5dcf291aa671bbea0dd520a9a1359d2 Closes #18524 --- cli/tsc/00_typescript.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cli/tsc') diff --git a/cli/tsc/00_typescript.js b/cli/tsc/00_typescript.js index 6bbd968a9..bae91eee2 100644 --- a/cli/tsc/00_typescript.js +++ b/cli/tsc/00_typescript.js @@ -6712,6 +6712,9 @@ ${lanes.join("\n")} } return ~path.length; } + if (path.startsWith("data:")) { + return ~path.length; + } return 0; } function getRootLength(path) { @@ -6870,6 +6873,9 @@ ${lanes.join("\n")} } function ensureTrailingDirectorySeparator(path) { if (!hasTrailingDirectorySeparator(path)) { + if (path.startsWith("data:")) { + return path; + } return path + directorySeparator; } return path; -- cgit v1.2.3