@@ -6,7 +6,6 @@ import * as path from "path";
6
6
import * as t from "vscode-languageserver-types" ;
7
7
import fs from "fs" ;
8
8
import * as os from "os" ;
9
- import { URI } from 'vscode-uri' ;
10
9
11
10
let tempFilePrefix = "rescript_format_file_" + process . pid + "_" ;
12
11
let tempFileId = 0 ;
@@ -161,7 +160,7 @@ export let parseDiagnosticLocation = (location: string): Range => {
161
160
} ;
162
161
163
162
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:\\.."
165
164
if ( process . platform === "win32" ) {
166
165
return fileAndLocation . indexOf ( ":" , 2 ) ;
167
166
} else {
@@ -174,11 +173,13 @@ let separateFileAndLocation = (fileAndLocation: string): [string, string] => {
174
173
let file = fileAndLocation . slice ( 0 , locationSeparator ) ;
175
174
let location = fileAndLocation . slice ( locationSeparator + 1 ) ;
176
175
177
- return [ URI . file ( file ) . toString ( ) , location ] ;
176
+ if ( process . platform === "win32" ) {
177
+ return [ `file:\\\\\\${ file } ` , location ] ;
178
+ } else {
179
+ return [ file , location ]
180
+ }
178
181
} ;
179
182
180
-
181
-
182
183
type filesDiagnostics = {
183
184
[ key : string ] : p . Diagnostic [ ] ;
184
185
} ;
0 commit comments