File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 1
1
import type * as atomIde from "atom-ide-base"
2
2
import * as ls from "./languageclient"
3
- import * as URL from "url"
4
3
import { Point , FilesystemChange , Range , TextEditor } from "atom"
5
4
6
5
/**
@@ -31,12 +30,12 @@ export default class Convert {
31
30
* to deal with http/https sources in the future.
32
31
*/
33
32
public static uriToPath ( uri : string ) : string {
34
- const url = URL . parse ( uri ) /*eslint node/no-deprecated-api: "warn"*/ // TODO
35
- if ( url . protocol !== "file:" || url . path === undefined || url . path = == null ) {
33
+ const url = new URL ( uri , "file://" )
34
+ if ( url . protocol !== "file:" || url . pathname == null ) {
36
35
return uri
37
36
}
38
37
39
- let filePath = decodeURIComponent ( url . path )
38
+ let filePath = decodeURIComponent ( url . pathname )
40
39
if ( process . platform === "win32" ) {
41
40
// Deal with Windows drive names
42
41
if ( filePath [ 0 ] === "/" ) {
You can’t perform that action at this time.
0 commit comments