@volar/language-service 1.7.10 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/documents.js +6 -2
- package/out/types.d.ts +7 -0
- package/package.json +4 -4
package/out/documents.js
CHANGED
|
@@ -202,10 +202,14 @@ function createDocumentsAndSourceMaps(env, host, mapper) {
|
|
|
202
202
|
};
|
|
203
203
|
function getDocumentByFileName(snapshot, fileName) {
|
|
204
204
|
if (!snapshot2Doc.has(snapshot)) {
|
|
205
|
+
snapshot2Doc.set(snapshot, new Map());
|
|
206
|
+
}
|
|
207
|
+
const map = snapshot2Doc.get(snapshot);
|
|
208
|
+
if (!map.has(fileName)) {
|
|
205
209
|
const uri = env.fileNameToUri(fileName);
|
|
206
|
-
|
|
210
|
+
map.set(fileName, vscode_languageserver_textdocument_1.TextDocument.create(uri, host.getLanguageId?.(fileName) ?? (0, common_1.resolveCommonLanguageId)(uri), version++, snapshot.getText(0, snapshot.getLength())));
|
|
207
211
|
}
|
|
208
|
-
return
|
|
212
|
+
return map.get(fileName);
|
|
209
213
|
}
|
|
210
214
|
}
|
|
211
215
|
exports.createDocumentsAndSourceMaps = createDocumentsAndSourceMaps;
|
package/out/types.d.ts
CHANGED
|
@@ -17,6 +17,13 @@ export interface ServiceEnvironment {
|
|
|
17
17
|
uriToFileName(uri: string): string;
|
|
18
18
|
fileNameToUri(fileName: string): string;
|
|
19
19
|
fs?: FileSystem;
|
|
20
|
+
console?: Console;
|
|
21
|
+
}
|
|
22
|
+
export interface Console {
|
|
23
|
+
error(message: string): void;
|
|
24
|
+
info(message: string): void;
|
|
25
|
+
log(message: string): void;
|
|
26
|
+
warn(message: string): void;
|
|
20
27
|
}
|
|
21
28
|
export interface FileSystem {
|
|
22
29
|
stat(uri: string): Result<FileStat | undefined>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volar/language-service",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.1",
|
|
4
4
|
"main": "out/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
"directory": "packages/language-service"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@volar/language-core": "1.
|
|
17
|
-
"@volar/source-map": "1.
|
|
16
|
+
"@volar/language-core": "1.8.1",
|
|
17
|
+
"@volar/source-map": "1.8.1",
|
|
18
18
|
"vscode-languageserver-protocol": "^3.17.3",
|
|
19
19
|
"vscode-languageserver-textdocument": "^1.0.8",
|
|
20
20
|
"vscode-uri": "^3.0.7"
|
|
21
21
|
},
|
|
22
|
-
"gitHead": "
|
|
22
|
+
"gitHead": "1fec004d7e3c5a28c0ad1d6a1d7a41ab98381abd"
|
|
23
23
|
}
|