Skip to content

Commit 49ef881

Browse files
committed
Remove vscode-uri dep
1 parent 02d817c commit 49ef881

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
lines changed

package-lock.json

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@
9999
"dependencies": {
100100
"@types/tmp": "^0.2.0",
101101
"chokidar": "^3.4.2",
102-
"tmp": "^0.2.1",
103-
"vscode-uri": "^2.1.2"
102+
"tmp": "^0.2.1"
104103
}
105104
}

server/src/server.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import * as path from 'path';
88
import fs from 'fs';
99
// TODO: check DidChangeWatchedFilesNotification. Check DidChangeTextDocumentNotification. Do they fire on uninitialized files?
1010
import { DidOpenTextDocumentNotification, DidChangeTextDocumentNotification, DidCloseTextDocumentNotification, DidChangeWatchedFilesNotification, CompletionResolveRequest } from 'vscode-languageserver-protocol';
11-
import { uriToFsPath, URI } from 'vscode-uri';
1211
import * as utils from './utils';
1312
import * as c from './constants';
1413
import * as chokidar from 'chokidar'
@@ -103,7 +102,7 @@ let stopWatchingCompilerLog = () => {
103102
}
104103

105104
let 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
}
122121
let 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
}
140139
let 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
}
145144
let 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

Comments
 (0)