Repository navigation
Conversation
|
It's not clear to me why this is needed. When does this happen? |
|
Fair question, and my PR description overstated it — I can't point to a tool that emits a drive-less URL on Windows. What I can substantiate is the API form the README already promises ( launch('file:///foo/bar/foo.js:12:34')On POSIX that resolves to The current patch guesses the current drive for those URLs. If you'd rather keep rejecting a drive-less path, I'm happy to close this — or turn it into an explicit, clearer error instead of the raw Node one. Which would you prefer? |
|
It doesn't make sense to me to add support for that case. |
What
parseFilecallsfileURLToPath()directly. On Windows, afile:///URL without a driveletter — the form several tools emit — makes Node throw
ERR_INVALID_FILE_URL_PATH, andlaunchEditor()propagates that to the caller instead of opening anything.The change
Catch exactly that error and map the drive-less path onto the current drive, so the editor is still
launched.
//server/shareURLs are still rejected by the existing UNC guard, and every other inputtakes the same path as before.
Verification
node --test parse-file.test.js→ 3 pass / 1 fail(the new case);
parse-file.test.js4/4; the wholelaunch-editorpackage suite 84/84.
No CLA/DCO requirement in the repository.