File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
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 { URL } from "url"
3
+ import * as URL from "url"
4
4
import { Point , FilesystemChange , Range , TextEditor } from "atom"
5
5
6
6
/**
@@ -31,13 +31,12 @@ export default class Convert {
31
31
* to deal with http/https sources in the future.
32
32
*/
33
33
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 ) {
37
36
return uri
38
37
}
39
38
40
- let filePath = decodeURIComponent ( urlPath )
39
+ let filePath = decodeURIComponent ( url . path )
41
40
if ( process . platform === "win32" ) {
42
41
// Deal with Windows drive names
43
42
if ( filePath [ 0 ] === "/" ) {
You can’t perform that action at this time.
0 commit comments