@bgforge/mls-server 3.13.2 → 3.14.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/out/compile-worker.js +11 -0
- package/out/completion.fallout-ssl.json +6 -6
- package/out/hover.fallout-ssl.json +6 -6
- package/out/server.js +409 -464
- package/out/sslc-wrapper.mjs +47 -0
- package/out/tree-sitter-baf.wasm +0 -0
- package/out/tree-sitter-ssl.wasm +0 -0
- package/out/tssl-compile-worker.js +42235 -0
- package/package.json +3 -3
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runs the WebAssembly SSL compiler in the directory it was actually started in.
|
|
3
|
+
*
|
|
4
|
+
* The compiler package ships its own command-line wrapper, which derives the directory to compile in as
|
|
5
|
+
* `join(parse(cwd).dir, parse(cwd).name)`. That reads whatever follows the last dot of the final segment as
|
|
6
|
+
* a file extension and drops it, so a mod directory named for its version - `mymod.v2` - becomes `mymod`,
|
|
7
|
+
* the compiler changes into a directory that does not exist, and the run dies with a bare
|
|
8
|
+
* `ErrnoError undefined undefined` naming neither the cause nor the path. The working directory cannot
|
|
9
|
+
* simply be moved somewhere without a dot: the compiler resolves `#include` against it.
|
|
10
|
+
*
|
|
11
|
+
* So this stands in for that wrapper, differing only in changing into the working directory as given. It
|
|
12
|
+
* is forked rather than imported: a compile is a fresh process, which is what keeps a compiler crash away
|
|
13
|
+
* from the language server. Output is collected and written once at the end rather than streamed, so what
|
|
14
|
+
* the parent parses is shaped exactly as the package's own wrapper shaped it.
|
|
15
|
+
*
|
|
16
|
+
* Not a TypeScript file, unlike the rest of this directory: it is executed as-is rather than bundled, and
|
|
17
|
+
* the module it loads is an Emscripten build that ships no types. The build copies it beside the server
|
|
18
|
+
* bundle, where the same relative path from ssl_compiler.ts resolves as it does here in the source tree.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
// Named lowercase because it is a factory, not a constructor: the Emscripten build exports it
|
|
22
|
+
// capitalised, and calling it that way reads as a missing `new`.
|
|
23
|
+
import createCompiler from "sslc-emscripten-noderawfs";
|
|
24
|
+
|
|
25
|
+
const stdout = [];
|
|
26
|
+
const stderr = [];
|
|
27
|
+
|
|
28
|
+
let returnCode;
|
|
29
|
+
try {
|
|
30
|
+
const instance = await createCompiler({
|
|
31
|
+
print: (text) => stdout.push(text),
|
|
32
|
+
printErr: (text) => stderr.push(text),
|
|
33
|
+
noInitialRun: true,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
// The whole point of this file. `process.cwd()` is where the parent asked for the compile to happen.
|
|
37
|
+
instance.FS.chdir(process.cwd());
|
|
38
|
+
returnCode = instance.callMain(process.argv.slice(2));
|
|
39
|
+
instance.FS.chdir("/");
|
|
40
|
+
} catch (error) {
|
|
41
|
+
returnCode = 1;
|
|
42
|
+
stderr.push(`ERROR: ${error.name} ${error.message} ${error.stack}`);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
console.log(stdout.join("\n"));
|
|
46
|
+
if (stderr.length > 0) console.error(stderr.join("\n"));
|
|
47
|
+
process.exit(returnCode);
|
package/out/tree-sitter-baf.wasm
CHANGED
|
Binary file
|
package/out/tree-sitter-ssl.wasm
CHANGED
|
Binary file
|