Skip to content

Commit 002e7f7

Browse files
committed
Revert "fix: fix url.parse deprecation"
This reverts commit 358d254.
1 parent 04c79f7 commit 002e7f7

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/convert.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type * as atomIde from "atom-ide-base"
22
import * as ls from "./languageclient"
3-
import { URL } from "url"
3+
import * as URL from "url"
44
import { Point, FilesystemChange, Range, TextEditor } from "atom"
55

66
/**
@@ -31,13 +31,12 @@ export default class Convert {
3131
* to deal with http/https sources in the future.
3232
*/
3333
public static uriToPath(uri: string): string {
34-
const url = new URL(uri)
35-
const urlPath = url.pathname + url.search
36-
if (url.protocol !== "file:" || urlPath === undefined || urlPath === null) {
34+
const url = URL.parse(uri)
35+
if (url.protocol !== "file:" || url.path === undefined || url.path === null) {
3736
return uri
3837
}
3938

40-
let filePath = decodeURIComponent(urlPath)
39+
let filePath = decodeURIComponent(url.path)
4140
if (process.platform === "win32") {
4241
// Deal with Windows drive names
4342
if (filePath[0] === "/") {

0 commit comments

Comments
 (0)