@@ -8,7 +8,6 @@ import * as path from 'path';
88import fs from 'fs' ;
99// TODO: check DidChangeWatchedFilesNotification. Check DidChangeTextDocumentNotification. Do they fire on uninitialized files?
1010import { DidOpenTextDocumentNotification , DidChangeTextDocumentNotification , DidCloseTextDocumentNotification , DidChangeWatchedFilesNotification , CompletionResolveRequest } from 'vscode-languageserver-protocol' ;
11- import { uriToFsPath , URI } from 'vscode-uri' ;
1211import * as utils from './utils' ;
1312import * as c from './constants' ;
1413import * as chokidar from 'chokidar'
@@ -103,7 +102,7 @@ let stopWatchingCompilerLog = () => {
103102}
104103
105104let openedFile = ( fileUri : string , fileContent : string ) => {
106- let filePath = uriToFsPath ( URI . parse ( fileUri ) , true ) ;
105+ let filePath = fileURLToPath ( fileUri )
107106
108107 stupidFileContentCache . set ( filePath , fileContent )
109108
@@ -120,7 +119,7 @@ let openedFile = (fileUri: string, fileContent: string) => {
120119 }
121120}
122121let closedFile = ( fileUri : string ) => {
123- let filePath = uriToFsPath ( URI . parse ( fileUri ) , true ) ;
122+ let filePath = fileURLToPath ( fileUri )
124123
125124 stupidFileContentCache . delete ( filePath )
126125
@@ -138,12 +137,12 @@ let closedFile = (fileUri: string) => {
138137 }
139138}
140139let updateOpenedFile = ( fileUri : string , fileContent : string ) => {
141- let filePath = uriToFsPath ( URI . parse ( fileUri ) , true )
140+ let filePath = fileURLToPath ( fileUri )
142141 assert ( stupidFileContentCache . has ( filePath ) )
143142 stupidFileContentCache . set ( filePath , fileContent )
144143}
145144let getOpenedFileContent = ( fileUri : string ) => {
146- let filePath = uriToFsPath ( URI . parse ( fileUri ) , true )
145+ let filePath = fileURLToPath ( fileUri )
147146 let content = stupidFileContentCache . get ( filePath ) !
148147 assert ( content != null )
149148 return content
@@ -251,7 +250,7 @@ process.on('message', (a: (m.RequestMessage | m.NotificationMessage)) => {
251250 }
252251 } else if ( aa . method === p . DocumentFormattingRequest . method ) {
253252 let params = ( aa . params as p . DocumentFormattingParams )
254- let filePath = uriToFsPath ( URI . parse ( params . textDocument . uri ) , true ) ;
253+ let filePath = fileURLToPath ( params . textDocument . uri )
255254 let extension = path . extname ( params . textDocument . uri ) ;
256255 if ( extension !== c . resExt && extension !== c . resiExt ) {
257256 let response : m . ResponseMessage = {
0 commit comments