aboutsummaryrefslogtreecommitdiff
path: root/tests/drivers/core_lsp_test.js
diff options
context:
space:
mode:
authorGravatar zinc <zinc@downsta.ir> 2026-10-14 10:05:40 +0000
committerGravatar zinc <zinc@downsta.ir> 2026-10-14 10:05:40 +0000
commitce920b6ff47f32bc06dd27124e1b882f82f3d6ae (patch)
tree89f3dac0aa670294053320599a742d670c0ec5a4 /tests/drivers/core_lsp_test.js
parenttodo: tick the parity runner; zc0 follow-ups it found (diff)
split compiler.zc into files by phase
src/compiler/compiler.zc is now twelve files under src/compiler/, listed in order in src/compiler/parts. cat of the parts in order is byte-identical to the old file, so every compiler and image except the language server's is unchanged. no function was edited. consumers read the list: the makefile, bootstrap-check, genmap (which still writes one compiler.zc into a generated map directory), tinyvm.bat, test.sh, test_win.ps1 and the lsp drivers. the language server embeds each part and serves them joined as the one document tinyvm:/compiler.zc.
Diffstat (limited to 'tests/drivers/core_lsp_test.js')
-rw-r--r--tests/drivers/core_lsp_test.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/drivers/core_lsp_test.js b/tests/drivers/core_lsp_test.js
index c3c01aa..5123537 100644
--- a/tests/drivers/core_lsp_test.js
+++ b/tests/drivers/core_lsp_test.js
@@ -6,6 +6,8 @@ const fs = require('fs');
const cp = require('child_process');
const path = require('path');
const target = process.argv[2];
+// the compiler is the files listed in src/compiler/parts; the server checks them as the one document they make
+const compilerSource = () => fs.readFileSync('src/compiler/parts', 'utf8').split(/\r?\n/).filter(Boolean).map(n => fs.readFileSync(path.join('src/compiler', n), 'utf8')).join('');
const files = ['src/core/core.zc', 'src/runtime/rt.zc', 'src/compiler/compiler.zc', 'src/runtime/run.zc', 'src/lib/std.zc', 'src/lib/icon.zc', 'src/lsp/server.zc', 'src/tools/build.zc'];
const frame = message => {
const body = Buffer.from(JSON.stringify(message));
@@ -13,7 +15,7 @@ const frame = message => {
};
for (const file of files) {
const uri = 'file://' + path.resolve(file);
- const text = fs.readFileSync(file, 'utf8');
+ const text = file === 'src/compiler/compiler.zc' ? compilerSource() : fs.readFileSync(file, 'utf8');
const messages = [
{ jsonrpc: '2.0', id: 1, method: 'initialize', params: {} },
{ jsonrpc: '2.0', method: 'initialized', params: {} },