@usethesource/rascal-vscode-dsl-lsp-server 0.6.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/LICENSE.txt +24 -0
- package/README.md +9 -0
- package/assets/jars/.gitignore +1 -0
- package/assets/jars/rascal-lsp.jar +0 -0
- package/assets/jars/rascal.jar +0 -0
- package/lib/RascalExtension.d.ts +23 -0
- package/lib/RascalExtension.js +147 -0
- package/lib/RascalExtension.js.map +1 -0
- package/lib/RascalTerminalLinkProvider.d.ts +22 -0
- package/lib/RascalTerminalLinkProvider.js +142 -0
- package/lib/RascalTerminalLinkProvider.js.map +1 -0
- package/lib/auto-jvm/JavaLookup.d.ts +2 -0
- package/lib/auto-jvm/JavaLookup.js +181 -0
- package/lib/auto-jvm/JavaLookup.js.map +1 -0
- package/lib/auto-jvm/downloaders.d.ts +18 -0
- package/lib/auto-jvm/downloaders.js +332 -0
- package/lib/auto-jvm/downloaders.js.map +1 -0
- package/lib/extension.d.ts +7 -0
- package/lib/extension.js +43 -0
- package/lib/extension.js.map +1 -0
- package/lib/fs/RascalFileSystemProviders.d.ts +34 -0
- package/lib/fs/RascalFileSystemProviders.js +69 -0
- package/lib/fs/RascalFileSystemProviders.js.map +1 -0
- package/lib/fs/VSCodeURIResolver.d.ts +71 -0
- package/lib/fs/VSCodeURIResolver.js +383 -0
- package/lib/fs/VSCodeURIResolver.js.map +1 -0
- package/lib/lsp/ParameterizedLanguageServer.d.ts +26 -0
- package/lib/lsp/ParameterizedLanguageServer.js +135 -0
- package/lib/lsp/ParameterizedLanguageServer.js.map +1 -0
- package/lib/lsp/RascalLSPConnection.d.ts +13 -0
- package/lib/lsp/RascalLSPConnection.js +187 -0
- package/lib/lsp/RascalLSPConnection.js.map +1 -0
- package/lib/lsp/RascalLanguageServer.d.ts +9 -0
- package/lib/lsp/RascalLanguageServer.js +32 -0
- package/lib/lsp/RascalLanguageServer.js.map +1 -0
- package/lib/lsp/library.d.ts +2 -0
- package/lib/lsp/library.js +35 -0
- package/lib/lsp/library.js.map +1 -0
- package/lib/test/normal-suite/JavaDownload.test.d.ts +1 -0
- package/lib/test/normal-suite/JavaDownload.test.js +105 -0
- package/lib/test/normal-suite/JavaDownload.test.js.map +1 -0
- package/lib/test/runVSCodeTests.d.ts +1 -0
- package/lib/test/runVSCodeTests.js +48 -0
- package/lib/test/runVSCodeTests.js.map +1 -0
- package/lib/test/vscode-suite/extension.test.d.ts +1 -0
- package/lib/test/vscode-suite/extension.test.js +44 -0
- package/lib/test/vscode-suite/extension.test.js.map +1 -0
- package/lib/test/vscode-suite/index.d.ts +1 -0
- package/lib/test/vscode-suite/index.js +66 -0
- package/lib/test/vscode-suite/index.js.map +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.activateLanguageClient = void 0;
|
|
4
|
+
/*
|
|
5
|
+
* Copyright (c) 2018-2021, NWO-I CWI and Swat.engineering
|
|
6
|
+
* All rights reserved.
|
|
7
|
+
*
|
|
8
|
+
* Redistribution and use in source and binary forms, with or without
|
|
9
|
+
* modification, are permitted provided that the following conditions are met:
|
|
10
|
+
*
|
|
11
|
+
* 1. Redistributions of source code must retain the above copyright notice,
|
|
12
|
+
* this list of conditions and the following disclaimer.
|
|
13
|
+
*
|
|
14
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
15
|
+
* this list of conditions and the following disclaimer in the documentation
|
|
16
|
+
* and/or other materials provided with the distribution.
|
|
17
|
+
*
|
|
18
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
19
|
+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
20
|
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
21
|
+
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
|
22
|
+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
23
|
+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
24
|
+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
25
|
+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
26
|
+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
27
|
+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
28
|
+
* POSSIBILITY OF SUCH DAMAGE.
|
|
29
|
+
*/
|
|
30
|
+
const vscode = require("vscode");
|
|
31
|
+
const net = require("net");
|
|
32
|
+
const os = require("os");
|
|
33
|
+
const path = require("path");
|
|
34
|
+
const node_1 = require("vscode-languageclient/node");
|
|
35
|
+
const JavaLookup_1 = require("../auto-jvm/JavaLookup");
|
|
36
|
+
const RascalFileSystemProviders_1 = require("../fs/RascalFileSystemProviders");
|
|
37
|
+
async function activateLanguageClient({ language, title, jarPath, vfsServer, isParametricServer = false, deployMode = true, devPort = -1, dedicated = false, lspArg = "" }) {
|
|
38
|
+
const serverOptions = deployMode
|
|
39
|
+
? await buildRascalServerOptions(jarPath, isParametricServer, dedicated, lspArg)
|
|
40
|
+
: () => connectToRascalLanguageServerSocket(devPort) // we assume a server is running in debug mode
|
|
41
|
+
.then((socket) => ({ writer: socket, reader: socket }));
|
|
42
|
+
const clientOptions = {
|
|
43
|
+
documentSelector: [{ scheme: '*', language: language }],
|
|
44
|
+
};
|
|
45
|
+
const client = new node_1.LanguageClient(language, title, serverOptions, clientOptions, !deployMode);
|
|
46
|
+
await client.start();
|
|
47
|
+
client.sendNotification("rascal/vfs/register", {
|
|
48
|
+
port: vfsServer.port
|
|
49
|
+
});
|
|
50
|
+
client.onNotification("rascal/showContent", (bp) => {
|
|
51
|
+
showContentPanel(bp.uri);
|
|
52
|
+
});
|
|
53
|
+
const schemesReply = client.sendRequest("rascal/filesystem/schemes");
|
|
54
|
+
schemesReply.then(schemes => {
|
|
55
|
+
vfsServer.ignoreSchemes(schemes);
|
|
56
|
+
new RascalFileSystemProviders_1.RascalFileSystemProvider(client).registerSchemes(schemes);
|
|
57
|
+
});
|
|
58
|
+
return client;
|
|
59
|
+
}
|
|
60
|
+
exports.activateLanguageClient = activateLanguageClient;
|
|
61
|
+
async function showContentPanel(url) {
|
|
62
|
+
// dispose of old panel in case it existed
|
|
63
|
+
const allOpenTabs = vscode.window.tabGroups.all.flatMap(tg => tg.tabs);
|
|
64
|
+
const tabsForThisPanel = allOpenTabs.filter(t => t.input instanceof vscode.TabInputWebview && t.label === url);
|
|
65
|
+
await vscode.window.tabGroups.close(tabsForThisPanel);
|
|
66
|
+
const panel = vscode.window.createWebviewPanel("text/html", url, vscode.ViewColumn.One, {
|
|
67
|
+
enableScripts: true,
|
|
68
|
+
});
|
|
69
|
+
loadURLintoPanel(panel, url);
|
|
70
|
+
}
|
|
71
|
+
function loadURLintoPanel(panel, url) {
|
|
72
|
+
panel.webview.html = `
|
|
73
|
+
<!DOCTYPE html>
|
|
74
|
+
<html lang="en">
|
|
75
|
+
<head>
|
|
76
|
+
<meta charset="UTF-8">
|
|
77
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
78
|
+
</head>
|
|
79
|
+
<body>
|
|
80
|
+
<iframe
|
|
81
|
+
id="iframe-rascal-content"
|
|
82
|
+
src="${url}"
|
|
83
|
+
frameborder="0"
|
|
84
|
+
sandbox="allow-scripts allow-forms allow-same-origin allow-pointer-lock allow-downloads allow-top-navigation"
|
|
85
|
+
style="display: block; margin: 0px; overflow: hidden; position: absolute; width: 100%; height: 100%; visibility: visible;"
|
|
86
|
+
>
|
|
87
|
+
Loading ${url}...
|
|
88
|
+
</iframe>
|
|
89
|
+
</body>
|
|
90
|
+
</html>`;
|
|
91
|
+
}
|
|
92
|
+
async function buildRascalServerOptions(jarPath, isParametricServer, dedicated, lspArg) {
|
|
93
|
+
const classpath = buildCompilerJVMPath(jarPath, isParametricServer);
|
|
94
|
+
const commandArgs = [
|
|
95
|
+
'-Dlog4j2.configurationFactory=org.rascalmpl.vscode.lsp.LogRedirectConfiguration',
|
|
96
|
+
'-Dlog4j2.level=DEBUG',
|
|
97
|
+
'-Drascal.fallbackResolver=org.rascalmpl.vscode.lsp.uri.FallbackResolver',
|
|
98
|
+
'-Drascal.lsp.deploy=true',
|
|
99
|
+
'-Drascal.compilerClasspath=' + classpath
|
|
100
|
+
];
|
|
101
|
+
let mainClass;
|
|
102
|
+
if (isParametricServer) {
|
|
103
|
+
mainClass = 'org.rascalmpl.vscode.lsp.parametric.ParametricLanguageServer';
|
|
104
|
+
commandArgs.push(calculateDSLMemoryReservation(dedicated));
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
mainClass = 'org.rascalmpl.vscode.lsp.rascal.RascalLanguageServer';
|
|
108
|
+
commandArgs.push(calculateRascalMemoryReservation());
|
|
109
|
+
}
|
|
110
|
+
commandArgs.push('-cp', classpath, mainClass);
|
|
111
|
+
if (isParametricServer && dedicated && lspArg !== undefined) {
|
|
112
|
+
commandArgs.push(lspArg);
|
|
113
|
+
}
|
|
114
|
+
return {
|
|
115
|
+
command: await (0, JavaLookup_1.getJavaExecutable)(),
|
|
116
|
+
args: commandArgs
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
function buildCompilerJVMPath(jarPath, isParametricServer) {
|
|
120
|
+
const jars = ['rascal-lsp.jar', 'rascal.jar'];
|
|
121
|
+
if (!isParametricServer) {
|
|
122
|
+
jars.push('rascal-core.jar', 'typepal.jar');
|
|
123
|
+
}
|
|
124
|
+
return jars.map(j => path.join(jarPath, j)).join(path.delimiter);
|
|
125
|
+
}
|
|
126
|
+
function gb(amount) {
|
|
127
|
+
return amount * (1024 * 1024 * 1024);
|
|
128
|
+
}
|
|
129
|
+
function calculateRascalMemoryReservation() {
|
|
130
|
+
// rascal lsp needs at least 800M but runs better with 2G or even 2.5G (especially the type checker)
|
|
131
|
+
if (os.totalmem() >= gb(32)) {
|
|
132
|
+
return "-Xmx2500M";
|
|
133
|
+
}
|
|
134
|
+
if (os.totalmem() >= gb(16)) {
|
|
135
|
+
return "-Xmx1500M";
|
|
136
|
+
}
|
|
137
|
+
if (os.totalmem() >= gb(8)) {
|
|
138
|
+
return "-Xmx1200M";
|
|
139
|
+
}
|
|
140
|
+
return "-Xmx800M";
|
|
141
|
+
}
|
|
142
|
+
function calculateDSLMemoryReservation(_dedicated) {
|
|
143
|
+
// this is a hard one, if you register many DSLs, it can grow quite a bit
|
|
144
|
+
// 400MB per language is a reasonable estimate (for average sized languages)
|
|
145
|
+
if (os.totalmem() >= gb(32)) {
|
|
146
|
+
return "-Xmx2400M";
|
|
147
|
+
}
|
|
148
|
+
if (os.totalmem() >= gb(16)) {
|
|
149
|
+
return "-Xmx1600M";
|
|
150
|
+
}
|
|
151
|
+
if (os.totalmem() >= gb(8)) {
|
|
152
|
+
return "-Xmx1200M";
|
|
153
|
+
}
|
|
154
|
+
return "-Xmx800M";
|
|
155
|
+
}
|
|
156
|
+
function connectToRascalLanguageServerSocket(port) {
|
|
157
|
+
return new Promise((connected, failed) => {
|
|
158
|
+
const maxTries = 20;
|
|
159
|
+
const host = '127.0.0.1';
|
|
160
|
+
let retryDelay = 0;
|
|
161
|
+
const client = new net.Socket();
|
|
162
|
+
let tries = 0;
|
|
163
|
+
function retry(err) {
|
|
164
|
+
if (tries <= maxTries) {
|
|
165
|
+
setTimeout(() => {
|
|
166
|
+
tries++;
|
|
167
|
+
retryDelay = Math.min(2500, retryDelay + 250);
|
|
168
|
+
client.connect(port, host);
|
|
169
|
+
}, retryDelay);
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
return failed("Connection retries exceeded" + (err ? (": " + err.message) : ""));
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
client.setTimeout(1000);
|
|
176
|
+
client.on('timeout', retry);
|
|
177
|
+
client.on('error', retry);
|
|
178
|
+
client.once('connect', () => {
|
|
179
|
+
client.setTimeout(0);
|
|
180
|
+
client.setNoDelay(true);
|
|
181
|
+
client.removeAllListeners();
|
|
182
|
+
return connected(client);
|
|
183
|
+
});
|
|
184
|
+
return retry();
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
//# sourceMappingURL=RascalLSPConnection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RascalLSPConnection.js","sourceRoot":"","sources":["../../src/lsp/RascalLSPConnection.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,iCAAiC;AACjC,2BAA2B;AAC3B,yBAAyB;AACzB,6BAA6B;AAE7B,qDAAuH;AACvH,uDAA2D;AAC3D,+EAA2E;AAKpE,KAAK,UAAU,sBAAsB,CACxC,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,kBAAkB,GAAG,KAAK,EAAE,UAAU,GAAG,IAAI,EAAE,OAAO,GAAG,CAAC,CAAC,EAAE,SAAS,GAAG,KAAK,EAAE,MAAM,GAAG,EAAE,EAC4E;IAE9M,MAAM,aAAa,GAAkB,UAAU;QAC3C,CAAC,CAAC,MAAM,wBAAwB,CAAC,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,CAAC;QAChF,CAAC,CAAC,GAAG,EAAE,CAAC,mCAAmC,CAAC,OAAO,CAAC,CAAC,8CAA8C;aAC9F,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAa,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAC,CAAA,CAAC,CAAC;IAE1E,MAAM,aAAa,GAA0B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,CAAC,MAAM,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;QAEH,OAAO,KAAK,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as vscode from 'vscode';
|
|
2
|
+
import { LanguageClient } from 'vscode-languageclient/node';
|
|
3
|
+
import { VSCodeUriResolverServer } from '../fs/VSCodeURIResolver';
|
|
4
|
+
import { ParameterizedLanguageServer } from './ParameterizedLanguageServer';
|
|
5
|
+
export declare class RascalLanguageServer implements vscode.Disposable {
|
|
6
|
+
readonly rascalClient: Promise<LanguageClient>;
|
|
7
|
+
constructor(context: vscode.ExtensionContext, vfsServer: VSCodeUriResolverServer, absoluteJarPath: string, dslLSP: ParameterizedLanguageServer, deployMode?: boolean);
|
|
8
|
+
dispose(): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RascalLanguageServer = void 0;
|
|
4
|
+
const RascalLSPConnection_1 = require("./RascalLSPConnection");
|
|
5
|
+
class RascalLanguageServer {
|
|
6
|
+
constructor(context, vfsServer, absoluteJarPath, dslLSP, deployMode = true) {
|
|
7
|
+
this.rascalClient = (0, RascalLSPConnection_1.activateLanguageClient)({
|
|
8
|
+
deployMode: deployMode,
|
|
9
|
+
devPort: 8888,
|
|
10
|
+
isParametricServer: false,
|
|
11
|
+
jarPath: absoluteJarPath,
|
|
12
|
+
language: "rascalmpl",
|
|
13
|
+
title: 'Rascal MPL Language Server',
|
|
14
|
+
vfsServer: vfsServer,
|
|
15
|
+
dedicated: false,
|
|
16
|
+
lspArg: undefined
|
|
17
|
+
});
|
|
18
|
+
this.rascalClient.then(client => {
|
|
19
|
+
client.onNotification("rascal/receiveRegisterLanguage", (lang) => {
|
|
20
|
+
dslLSP.registerLanguage(lang);
|
|
21
|
+
});
|
|
22
|
+
client.onNotification("rascal/receiveUnregisterLanguage", (lang) => {
|
|
23
|
+
dslLSP.unregisterLanguage(lang);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
dispose() {
|
|
28
|
+
this.rascalClient.then(c => c.dispose());
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.RascalLanguageServer = RascalLanguageServer;
|
|
32
|
+
//# sourceMappingURL=RascalLanguageServer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RascalLanguageServer.js","sourceRoot":"","sources":["../../src/lsp/RascalLanguageServer.ts"],"names":[],"mappings":";;;AA8BA,+DAA+D;AAI/D,MAAa,oBAAoB;IAG7B,YACI,OAAgC,EAChC,SAAkC,EAClC,eAAuB,EACvB,MAAmC,EACnC,UAAU,GAAG,IAAI;QACjB,IAAI,CAAC,YAAY,GAAG,IAAA,4CAAsB,EAAC;YACvC,UAAU,EAAE,UAAU;YACtB,OAAO,EAAE,IAAI;YACb,kBAAkB,EAAE,KAAK;YACzB,OAAO,EAAE,eAAe;YACxB,QAAQ,EAAE,WAAW;YACrB,KAAK,EAAE,4BAA4B;YACnC,SAAS,EAAE,SAAS;YACpB,SAAS,EAAE,KAAK;YAChB,MAAM,EAAE,SAAS;SACpB,CAAC,CAAC;QAEH,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;YAC5B,MAAM,CAAC,cAAc,CAAC,gCAAgC,EAAE,CAAC,IAAsB,EAAE,EAAE;gBAC/E,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;YAClC,CAAC,CAAC,CAAC;YACH,MAAM,CAAC,cAAc,CAAC,kCAAkC,EAAE,CAAC,IAAsB,EAAE,EAAE;gBACjF,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;YACpC,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IACD,OAAO;QACH,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IAC7C,CAAC;CAEJ;AAlCD,oDAkCC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VSCodeUriResolverServer = exports.ParameterizedLanguageServer = void 0;
|
|
4
|
+
/*
|
|
5
|
+
* Copyright (c) 2018-2021, NWO-I CWI and Swat.engineering
|
|
6
|
+
* All rights reserved.
|
|
7
|
+
*
|
|
8
|
+
* Redistribution and use in source and binary forms, with or without
|
|
9
|
+
* modification, are permitted provided that the following conditions are met:
|
|
10
|
+
*
|
|
11
|
+
* 1. Redistributions of source code must retain the above copyright notice,
|
|
12
|
+
* this list of conditions and the following disclaimer.
|
|
13
|
+
*
|
|
14
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
15
|
+
* this list of conditions and the following disclaimer in the documentation
|
|
16
|
+
* and/or other materials provided with the distribution.
|
|
17
|
+
*
|
|
18
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
19
|
+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
20
|
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
21
|
+
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
|
22
|
+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
23
|
+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
24
|
+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
25
|
+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
26
|
+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
27
|
+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
28
|
+
* POSSIBILITY OF SUCH DAMAGE.
|
|
29
|
+
*/
|
|
30
|
+
// make sure that everything you might need to run `ParameterizedLanguageServer` is exported in this file
|
|
31
|
+
var ParameterizedLanguageServer_1 = require("./ParameterizedLanguageServer");
|
|
32
|
+
Object.defineProperty(exports, "ParameterizedLanguageServer", { enumerable: true, get: function () { return ParameterizedLanguageServer_1.ParameterizedLanguageServer; } });
|
|
33
|
+
var VSCodeURIResolver_1 = require("../fs/VSCodeURIResolver");
|
|
34
|
+
Object.defineProperty(exports, "VSCodeUriResolverServer", { enumerable: true, get: function () { return VSCodeURIResolver_1.VSCodeUriResolverServer; } });
|
|
35
|
+
//# sourceMappingURL=library.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"library.js","sourceRoot":"","sources":["../../src/lsp/library.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,yGAAyG;AACzG,6EAA+F;AAAtF,0IAAA,2BAA2B,OAAA;AACpC,6DAAkE;AAAzD,4HAAA,uBAAuB,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/*
|
|
4
|
+
* Copyright (c) 2018-2021, NWO-I CWI and Swat.engineering
|
|
5
|
+
* All rights reserved.
|
|
6
|
+
*
|
|
7
|
+
* Redistribution and use in source and binary forms, with or without
|
|
8
|
+
* modification, are permitted provided that the following conditions are met:
|
|
9
|
+
*
|
|
10
|
+
* 1. Redistributions of source code must retain the above copyright notice,
|
|
11
|
+
* this list of conditions and the following disclaimer.
|
|
12
|
+
*
|
|
13
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
14
|
+
* this list of conditions and the following disclaimer in the documentation
|
|
15
|
+
* and/or other materials provided with the distribution.
|
|
16
|
+
*
|
|
17
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
18
|
+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
19
|
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
20
|
+
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
|
21
|
+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
22
|
+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
23
|
+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
24
|
+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
25
|
+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
26
|
+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
27
|
+
* POSSIBILITY OF SUCH DAMAGE.
|
|
28
|
+
*/
|
|
29
|
+
const assert = require("assert");
|
|
30
|
+
const fs_1 = require("fs");
|
|
31
|
+
const temp = require("temp");
|
|
32
|
+
const jd = require("../../auto-jvm/downloaders");
|
|
33
|
+
const mocha_1 = require("mocha");
|
|
34
|
+
const path_1 = require("path");
|
|
35
|
+
(0, mocha_1.describe)('JVM Download', function () {
|
|
36
|
+
const tempDir = temp.mkdirSync();
|
|
37
|
+
function testTemurin(version, arch, platform) {
|
|
38
|
+
return async function () {
|
|
39
|
+
const newPath = await jd.fetchAndUnpackTemurin(arch, platform, await jd.identifyLatestTemurinLTSRelease(version), (0, path_1.join)(tempDir, "temurin", arch, platform), () => { });
|
|
40
|
+
assert.ok((0, fs_1.statSync)(newPath).isFile());
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function testCorretto(version, arch, platform) {
|
|
44
|
+
return async function () {
|
|
45
|
+
const newPath = await jd.fetchAndUnpackCorretto(arch, platform, version, (0, path_1.join)(tempDir, "corretto", arch, platform), () => { });
|
|
46
|
+
assert.ok((0, fs_1.statSync)(newPath).isFile());
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function testMSOpenJDK(version, arch, platform) {
|
|
50
|
+
return async function () {
|
|
51
|
+
const newPath = await jd.fetchAndUnpackMicrosoftJDK(arch, platform, version, (0, path_1.join)(tempDir, "msjdk", arch, platform), () => { });
|
|
52
|
+
assert.ok((0, fs_1.statSync)(newPath).isFile());
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
const downloadTimeout = 60000;
|
|
56
|
+
const testAll = false;
|
|
57
|
+
(0, mocha_1.describe)(`Eclipse Temurin jdk11`, function () {
|
|
58
|
+
if (testAll) {
|
|
59
|
+
it(`Mac x64`, testTemurin(11, "x64", "mac")).timeout(downloadTimeout);
|
|
60
|
+
it(`Linux arm`, testTemurin(11, "arm", "linux")).timeout(downloadTimeout);
|
|
61
|
+
}
|
|
62
|
+
it(`Windows x64`, testTemurin(11, "x64", "windows")).timeout(downloadTimeout);
|
|
63
|
+
});
|
|
64
|
+
(0, mocha_1.describe)(`Eclipse Temurin jdk17`, function () {
|
|
65
|
+
if (testAll) {
|
|
66
|
+
it(`Mac aarch64`, testTemurin(17, "aarch64", "mac")).timeout(downloadTimeout);
|
|
67
|
+
it(`Windows x64`, testTemurin(17, "x64", "windows")).timeout(downloadTimeout);
|
|
68
|
+
}
|
|
69
|
+
it(`Linux x64`, testTemurin(17, "x64", "linux")).timeout(downloadTimeout);
|
|
70
|
+
});
|
|
71
|
+
(0, mocha_1.describe)(`Amazon Corretto jdk11`, function () {
|
|
72
|
+
if (testAll) {
|
|
73
|
+
it(`Windows x64`, testCorretto(11, "x64", "windows")).timeout(downloadTimeout);
|
|
74
|
+
it(`Mac x64`, testCorretto(11, "x64", "macos")).timeout(downloadTimeout);
|
|
75
|
+
}
|
|
76
|
+
it(`Linux arch64`, testCorretto(11, "aarch64", "linux")).timeout(downloadTimeout);
|
|
77
|
+
});
|
|
78
|
+
(0, mocha_1.describe)(`Amazon Corretto jdk17`, function () {
|
|
79
|
+
if (testAll) {
|
|
80
|
+
it(`Windows x64`, testCorretto(17, "x64", "windows")).timeout(downloadTimeout);
|
|
81
|
+
it(`Linux x64`, testCorretto(17, "x64", "linux")).timeout(downloadTimeout);
|
|
82
|
+
}
|
|
83
|
+
it(`Mac aarch64`, testCorretto(17, "aarch64", "macos")).timeout(downloadTimeout);
|
|
84
|
+
});
|
|
85
|
+
(0, mocha_1.describe)(`Microsoft OpenJDK jdk11`, function () {
|
|
86
|
+
it(`Windows x64`, testMSOpenJDK(11, "x64", "windows")).timeout(downloadTimeout);
|
|
87
|
+
if (testAll) {
|
|
88
|
+
it(`Linux aarch64`, testMSOpenJDK(11, "aarch64", "linux")).timeout(downloadTimeout);
|
|
89
|
+
it(`Mac x64`, testMSOpenJDK(11, "x64", "macOS")).timeout(downloadTimeout);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
(0, mocha_1.describe)(`Microsoft OpenJDK jdk17`, function () {
|
|
93
|
+
if (testAll) {
|
|
94
|
+
it(`Windows aarch64`, testMSOpenJDK(17, "aarch64", "windows")).timeout(downloadTimeout);
|
|
95
|
+
it(`Mac aarch64`, testMSOpenJDK(17, "aarch64", "macOS")).timeout(downloadTimeout);
|
|
96
|
+
}
|
|
97
|
+
it(`Linux x64`, testMSOpenJDK(17, "x64", "linux")).timeout(downloadTimeout);
|
|
98
|
+
});
|
|
99
|
+
(0, mocha_1.after)(() => {
|
|
100
|
+
console.log(tempDir);
|
|
101
|
+
// do the rm in the background, since it might take a while
|
|
102
|
+
(0, fs_1.rm)(tempDir, { recursive: true, force: true }, () => { });
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
//# sourceMappingURL=JavaDownload.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JavaDownload.test.js","sourceRoot":"","sources":["../../../src/test/normal-suite/JavaDownload.test.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,iCAAiC;AACjC,2BAAkC;AAClC,6BAA8B;AAC9B,iDAAiD;AACjD,iCAAwC;AACxC,+BAA4B;AAG5B,IAAA,gBAAQ,EAAC,cAAc,EAAE;IACrB,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;IACjC,SAAS,WAAW,CAAC,OAAe,EAAE,IAA6B,EAAE,QAA6B;QAC9F,OAAO,KAAK;YACR,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,qBAAqB,CAAC,IAAI,EAC/C,QAAQ,EAAE,MAAM,EAAE,CAAC,+BAA+B,CAAC,OAAO,CAAC,EAAE,IAAA,WAAI,EAAC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;YACrH,MAAM,CAAC,EAAE,CAAC,IAAA,aAAQ,EAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;QAC1C,CAAC,CAAC;IACN,CAAC;IAED,SAAS,YAAY,CAAC,OAAe,EAAE,IAA8B,EAAE,QAA8B;QACjG,OAAO,KAAK;YACR,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,sBAAsB,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAA,WAAI,EAAC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,GAAG,EAAE,GAAE,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
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/*
|
|
4
|
+
* Copyright (c) 2018-2021, NWO-I CWI and Swat.engineering
|
|
5
|
+
* All rights reserved.
|
|
6
|
+
*
|
|
7
|
+
* Redistribution and use in source and binary forms, with or without
|
|
8
|
+
* modification, are permitted provided that the following conditions are met:
|
|
9
|
+
*
|
|
10
|
+
* 1. Redistributions of source code must retain the above copyright notice,
|
|
11
|
+
* this list of conditions and the following disclaimer.
|
|
12
|
+
*
|
|
13
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
14
|
+
* this list of conditions and the following disclaimer in the documentation
|
|
15
|
+
* and/or other materials provided with the distribution.
|
|
16
|
+
*
|
|
17
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
18
|
+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
19
|
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
20
|
+
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
|
21
|
+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
22
|
+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
23
|
+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
24
|
+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
25
|
+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
26
|
+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
27
|
+
* POSSIBILITY OF SUCH DAMAGE.
|
|
28
|
+
*/
|
|
29
|
+
const path = require("path");
|
|
30
|
+
const test_electron_1 = require("@vscode/test-electron");
|
|
31
|
+
async function main() {
|
|
32
|
+
try {
|
|
33
|
+
// The folder containing the Extension Manifest package.json
|
|
34
|
+
// Passed to `--extensionDevelopmentPath`
|
|
35
|
+
const extensionDevelopmentPath = path.resolve(__dirname, '../../');
|
|
36
|
+
// The path to test runner
|
|
37
|
+
// Passed to --extensionTestsPath
|
|
38
|
+
const extensionTestsPath = path.resolve(__dirname, './vscode-suite/index');
|
|
39
|
+
// Download VS Code, unzip it and run the integration test
|
|
40
|
+
await (0, test_electron_1.runTests)({ extensionDevelopmentPath, extensionTestsPath });
|
|
41
|
+
}
|
|
42
|
+
catch (err) {
|
|
43
|
+
console.error('Failed to run tests');
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
main();
|
|
48
|
+
//# sourceMappingURL=runVSCodeTests.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runVSCodeTests.js","sourceRoot":"","sources":["../../src/test/runVSCodeTests.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,6BAA6B;AAE7B,yDAAiD;AAEjD,KAAK,UAAU,IAAI;IACf,IAAI;QACA,4DAA4D;QAC5D,yCAAyC;QACzC,MAAM,wBAAwB,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAEnE,0BAA0B;QAC1B,iCAAiC;QACjC,MAAM,kBAAkB,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,sBAAsB,CAAC,CAAC;QAE3E,0DAA0D;QAC1D,MAAM,IAAA,wBAAQ,EAAC,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,CAAC,CAAC;KACpE;IAAC,OAAO,GAAG,EAAE;QACV,OAAO,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACnB;AACL,CAAC;AAED,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/*
|
|
4
|
+
* Copyright (c) 2018-2021, NWO-I CWI and Swat.engineering
|
|
5
|
+
* All rights reserved.
|
|
6
|
+
*
|
|
7
|
+
* Redistribution and use in source and binary forms, with or without
|
|
8
|
+
* modification, are permitted provided that the following conditions are met:
|
|
9
|
+
*
|
|
10
|
+
* 1. Redistributions of source code must retain the above copyright notice,
|
|
11
|
+
* this list of conditions and the following disclaimer.
|
|
12
|
+
*
|
|
13
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
14
|
+
* this list of conditions and the following disclaimer in the documentation
|
|
15
|
+
* and/or other materials provided with the distribution.
|
|
16
|
+
*
|
|
17
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
18
|
+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
19
|
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
20
|
+
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
|
21
|
+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
22
|
+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
23
|
+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
24
|
+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
25
|
+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
26
|
+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
27
|
+
* POSSIBILITY OF SUCH DAMAGE.
|
|
28
|
+
*/
|
|
29
|
+
const assert = require("assert");
|
|
30
|
+
const vscode = require("vscode");
|
|
31
|
+
suite('Extension Test Suite', () => {
|
|
32
|
+
vscode.window.showInformationMessage('Start all tests.');
|
|
33
|
+
suiteSetup(async function () {
|
|
34
|
+
await vscode.extensions.getExtension('usethesource.rascalmpl').activate();
|
|
35
|
+
});
|
|
36
|
+
const rascalExtension = vscode.extensions.getExtension('usethesource.rascalmpl');
|
|
37
|
+
test("Rascal extension is started", () => {
|
|
38
|
+
assert.strictEqual(rascalExtension.isActive, true);
|
|
39
|
+
});
|
|
40
|
+
test('Never commit debug mode', () => {
|
|
41
|
+
assert.strictEqual(rascalExtension.exports.getRascalExtensionDeploymode(), true);
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
//# sourceMappingURL=extension.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension.test.js","sourceRoot":"","sources":["../../../src/test/vscode-suite/extension.test.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,iCAAiC;AACjC,iCAAiC;AAEjC,KAAK,CAAC,sBAAsB,EAAE,GAAG,EAAE;IAC/B,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAAC,kBAAkB,CAAC,CAAC;IAEzD,UAAU,CAAC,KAAK;QAClB,MAAM,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,wBAAwB,CAAE,CAAC,QAAQ,EAAE,CAAC;IAC5E,CAAC,CAAC,CAAC;IAEA,MAAM,eAAe,GAAyB,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,wBAAwB,CAAE,CAAC;IAExG,IAAI,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACrC,MAAM,CAAC,WAAW,CAAC,eAAe,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,yBAAyB,EAAE,GAAG,EAAE;QACjC,MAAM,CAAC,WAAW,CAAC,eAAe,CAAC,OAAO,CAAC,4BAA4B,EAAE,EAAE,IAAI,CAAC,CAAC;IACrF,CAAC,CAAC,CAAC;AAEP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function run(): Promise<void>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.run = void 0;
|
|
4
|
+
/*
|
|
5
|
+
* Copyright (c) 2018-2021, NWO-I CWI and Swat.engineering
|
|
6
|
+
* All rights reserved.
|
|
7
|
+
*
|
|
8
|
+
* Redistribution and use in source and binary forms, with or without
|
|
9
|
+
* modification, are permitted provided that the following conditions are met:
|
|
10
|
+
*
|
|
11
|
+
* 1. Redistributions of source code must retain the above copyright notice,
|
|
12
|
+
* this list of conditions and the following disclaimer.
|
|
13
|
+
*
|
|
14
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
15
|
+
* this list of conditions and the following disclaimer in the documentation
|
|
16
|
+
* and/or other materials provided with the distribution.
|
|
17
|
+
*
|
|
18
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
19
|
+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
20
|
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
21
|
+
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
|
22
|
+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
23
|
+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
24
|
+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
25
|
+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
26
|
+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
27
|
+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
28
|
+
* POSSIBILITY OF SUCH DAMAGE.
|
|
29
|
+
*/
|
|
30
|
+
const path = require("path");
|
|
31
|
+
const Mocha = require("mocha");
|
|
32
|
+
const glob = require("glob");
|
|
33
|
+
function run() {
|
|
34
|
+
// Create the mocha test
|
|
35
|
+
const mocha = new Mocha({
|
|
36
|
+
ui: 'tdd',
|
|
37
|
+
color: true
|
|
38
|
+
});
|
|
39
|
+
const testsRoot = path.resolve(__dirname, '..');
|
|
40
|
+
return new Promise((c, e) => {
|
|
41
|
+
glob('vscode-suite/*.test.js', { cwd: testsRoot }, (err, files) => {
|
|
42
|
+
if (err) {
|
|
43
|
+
return e(err);
|
|
44
|
+
}
|
|
45
|
+
// Add files to the test suite
|
|
46
|
+
files.forEach(f => mocha.addFile(path.resolve(testsRoot, f)));
|
|
47
|
+
try {
|
|
48
|
+
// Run the mocha test
|
|
49
|
+
mocha.run(failures => {
|
|
50
|
+
if (failures > 0) {
|
|
51
|
+
e(new Error(`${failures} tests failed.`));
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
c();
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
catch (err) {
|
|
59
|
+
console.error(err);
|
|
60
|
+
e(err);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
exports.run = run;
|
|
66
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/test/vscode-suite/index.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,6BAA6B;AAC7B,+BAA+B;AAC/B,6BAA6B;AAE7B,SAAgB,GAAG;IAClB,wBAAwB;IACxB,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC;QACvB,EAAE,EAAE,KAAK;QACT,KAAK,EAAE,IAAI;KACX,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAEhD,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAC3B,IAAI,CAAC,wBAAwB,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;YACjE,IAAI,GAAG,EAAE;gBACR,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC;aACd;YAED,8BAA8B;YAC9B,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;YAE9D,IAAI;gBACH,qBAAqB;gBACrB,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;oBACpB,IAAI,QAAQ,GAAG,CAAC,EAAE;wBACjB,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,QAAQ,gBAAgB,CAAC,CAAC,CAAC;qBAC1C;yBAAM;wBACN,CAAC,EAAE,CAAC;qBACJ;gBACF,CAAC,CAAC,CAAC;aACH;YAAC,OAAO,GAAG,EAAE;gBACb,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACnB,CAAC,CAAC,GAAG,CAAC,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