@@ -8,7 +8,6 @@ import * as path from 'path';
8
8
import fs from 'fs' ;
9
9
// TODO: check DidChangeWatchedFilesNotification. Check DidChangeTextDocumentNotification. Do they fire on uninitialized files?
10
10
import { DidOpenTextDocumentNotification , DidChangeTextDocumentNotification , DidCloseTextDocumentNotification , DidChangeWatchedFilesNotification , CompletionResolveRequest } from 'vscode-languageserver-protocol' ;
11
- import { uriToFsPath , URI } from 'vscode-uri' ;
12
11
import * as utils from './utils' ;
13
12
import * as c from './constants' ;
14
13
import * as chokidar from 'chokidar'
@@ -103,7 +102,7 @@ let stopWatchingCompilerLog = () => {
103
102
}
104
103
105
104
let openedFile = ( fileUri : string , fileContent : string ) => {
106
- let filePath = uriToFsPath ( URI . parse ( fileUri ) , true ) ;
105
+ let filePath = fileURLToPath ( fileUri )
107
106
108
107
stupidFileContentCache . set ( filePath , fileContent )
109
108
@@ -120,7 +119,7 @@ let openedFile = (fileUri: string, fileContent: string) => {
120
119
}
121
120
}
122
121
let closedFile = ( fileUri : string ) => {
123
- let filePath = uriToFsPath ( URI . parse ( fileUri ) , true ) ;
122
+ let filePath = fileURLToPath ( fileUri )
124
123
125
124
stupidFileContentCache . delete ( filePath )
126
125
@@ -138,12 +137,12 @@ let closedFile = (fileUri: string) => {
138
137
}
139
138
}
140
139
let updateOpenedFile = ( fileUri : string , fileContent : string ) => {
141
- let filePath = uriToFsPath ( URI . parse ( fileUri ) , true )
140
+ let filePath = fileURLToPath ( fileUri )
142
141
assert ( stupidFileContentCache . has ( filePath ) )
143
142
stupidFileContentCache . set ( filePath , fileContent )
144
143
}
145
144
let getOpenedFileContent = ( fileUri : string ) => {
146
- let filePath = uriToFsPath ( URI . parse ( fileUri ) , true )
145
+ let filePath = fileURLToPath ( fileUri )
147
146
let content = stupidFileContentCache . get ( filePath ) !
148
147
assert ( content != null )
149
148
return content
@@ -251,7 +250,7 @@ process.on('message', (a: (m.RequestMessage | m.NotificationMessage)) => {
251
250
}
252
251
} else if ( aa . method === p . DocumentFormattingRequest . method ) {
253
252
let params = ( aa . params as p . DocumentFormattingParams )
254
- let filePath = uriToFsPath ( URI . parse ( params . textDocument . uri ) , true ) ;
253
+ let filePath = fileURLToPath ( params . textDocument . uri )
255
254
let extension = path . extname ( params . textDocument . uri ) ;
256
255
if ( extension !== c . resExt && extension !== c . resiExt ) {
257
256
let response : m . ResponseMessage = {
0 commit comments