@volar/test-utils 2.1.4 → 2.2.0-alpha.0
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/index.d.ts +3 -3
- package/index.js +6 -6
- package/package.json +4 -4
package/index.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ export declare function startLanguageServer(serverModule: string, cwd?: string |
|
|
|
40
40
|
sendDocumentLinkRequest(uri: string): Promise<_.DocumentLink[] | null>;
|
|
41
41
|
sendDocumentLinkResolveRequest(link: _.DocumentLink): Promise<_.DocumentLink>;
|
|
42
42
|
};
|
|
43
|
-
export declare function printSnapshots(
|
|
44
|
-
export declare function printSnapshot(
|
|
45
|
-
snapshot: _.
|
|
43
|
+
export declare function printSnapshots(sourceScript: _.SourceScript): Generator<string, void, unknown>;
|
|
44
|
+
export declare function printSnapshot(sourceScript: {
|
|
45
|
+
snapshot: _.SourceScript['snapshot'];
|
|
46
46
|
}, file: _.VirtualCode): Generator<string, void, unknown>;
|
package/index.js
CHANGED
|
@@ -294,21 +294,21 @@ function startLanguageServer(serverModule, cwd) {
|
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
296
|
exports.startLanguageServer = startLanguageServer;
|
|
297
|
-
function* printSnapshots(
|
|
298
|
-
if (
|
|
297
|
+
function* printSnapshots(sourceScript) {
|
|
298
|
+
if (sourceScript.generated) {
|
|
299
299
|
let lastId = 0;
|
|
300
|
-
for (const file of (0, language_core_1.forEachEmbeddedCode)(
|
|
300
|
+
for (const file of (0, language_core_1.forEachEmbeddedCode)(sourceScript.generated.root)) {
|
|
301
301
|
const id = lastId++;
|
|
302
302
|
yield `#${id}`;
|
|
303
|
-
for (const line of printSnapshot(
|
|
303
|
+
for (const line of printSnapshot(sourceScript, file)) {
|
|
304
304
|
yield ' ' + line;
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
309
|
exports.printSnapshots = printSnapshots;
|
|
310
|
-
function* printSnapshot(
|
|
311
|
-
const sourceCode =
|
|
310
|
+
function* printSnapshot(sourceScript, file) {
|
|
311
|
+
const sourceCode = sourceScript.snapshot.getText(0, sourceScript.snapshot.getLength());
|
|
312
312
|
const sourceFileDocument = vscode_languageserver_textdocument_1.TextDocument.create('', '', 0, sourceCode);
|
|
313
313
|
const virtualCode = file.snapshot.getText(0, file.snapshot.getLength());
|
|
314
314
|
const virtualCodeLines = virtualCode.split('\n');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volar/test-utils",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0-alpha.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"**/*.js",
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"@types/node": "latest"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@volar/language-core": "2.
|
|
19
|
-
"@volar/language-server": "2.
|
|
18
|
+
"@volar/language-core": "2.2.0-alpha.0",
|
|
19
|
+
"@volar/language-server": "2.2.0-alpha.0",
|
|
20
20
|
"vscode-languageserver-textdocument": "^1.0.11",
|
|
21
21
|
"vscode-uri": "^3.0.8"
|
|
22
22
|
},
|
|
23
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "95ffe51f944ee87f570be113541e17ddfe75f588"
|
|
24
24
|
}
|