diff options
Diffstat (limited to 'tests/drivers/core_lsp_test.js')
| -rw-r--r-- | tests/drivers/core_lsp_test.js | 4 |
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: {} }, |
