Ada, Bash lsp tests passing

This commit is contained in:
Radon Rosborough 2020-07-31 16:49:20 -06:00
parent 423cf8eea7
commit 41cafcd832
2 changed files with 14 additions and 4 deletions

View File

@ -68,7 +68,13 @@ export const langs: { [key: string]: LangConfig } = {
main: "main.adb",
compile: "x86_64-linux-gnu-gnatmake-9 main.adb",
run: "./main",
lsp: { start: "ada_language_server" },
lsp: {
start: "ada_language_server",
code: `
Ada.IO`,
after: `);`,
item: "IO_Exceptions",
},
template: `with Ada.Text_IO;
procedure Main is
@ -155,7 +161,11 @@ implement main0 () = ()
main: "main.bash",
run: "bash --rcfile main.bash",
scope: { code: `x="$(expr 123 \\* 234)"`, input: `echo "$x"` },
lsp: { start: "bash-language-server start" },
lsp: {
start: "bash-language-server start",
code: "read",
item: "readonly",
},
template: `echo "Hello, world!"
`,
},

View File

@ -246,7 +246,7 @@ class Test {
const after = this.config.lsp!.after;
const item = this.config.lsp!.item!; // FIXME
const idx = after
? this.config.template.indexOf(after)
? this.config.template.indexOf(after) + after.length
: this.config.template.length;
const code =
this.config.template.slice(0, idx) +
@ -522,7 +522,7 @@ class Test {
},
});
} else if (msg.output.id === "ecdb8a55-f755-4553-ae8e-91d6ebbc2045") {
return msg.output.result.items;
return msg.output.result.items || msg.output.result;
}
}
}