Skip to content

Commit 18406f7

Browse files
committed
Remove vscode-uri
1 parent 2388fa2 commit 18406f7

File tree

3 files changed

+8
-19
lines changed

3 files changed

+8
-19
lines changed

server/package-lock.json

+1-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
},
1414
"dependencies": {
1515
"vscode-languageserver": "^6.1.1",
16-
"vscode-languageserver-textdocument": "^1.0.1",
17-
"vscode-uri": "^3.0.2"
16+
"vscode-languageserver-textdocument": "^1.0.1"
1817
},
1918
"scripts": {}
2019
}

server/src/utils.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import * as path from "path";
66
import * as t from "vscode-languageserver-types";
77
import fs from "fs";
88
import * as os from "os";
9-
import { URI } from 'vscode-uri';
109

1110
let tempFilePrefix = "rescript_format_file_" + process.pid + "_";
1211
let tempFileId = 0;
@@ -161,7 +160,7 @@ export let parseDiagnosticLocation = (location: string): Range => {
161160
};
162161

163162
let findLocationSeparator = (fileAndLocation: string) => {
164-
// Exclude the two first letters in windows paths to avoid the first colon in eg "c:\\.."
163+
// Exclude the two first letters in windows paths to avoid the first colon in eg "c:\\.."
165164
if (process.platform === "win32") {
166165
return fileAndLocation.indexOf(":", 2);
167166
} else {
@@ -174,11 +173,13 @@ let separateFileAndLocation = (fileAndLocation: string): [string, string] => {
174173
let file = fileAndLocation.slice(0, locationSeparator);
175174
let location = fileAndLocation.slice(locationSeparator + 1);
176175

177-
return [URI.file(file).toString(), location];
176+
if (process.platform === "win32") {
177+
return [`file:\\\\\\${file}`, location];
178+
} else {
179+
return [file, location]
180+
}
178181
};
179182

180-
181-
182183
type filesDiagnostics = {
183184
[key: string]: p.Diagnostic[];
184185
};

0 commit comments

Comments
 (0)