Skip to content

Commit a61df96

Browse files
committed
vala: Setup Vala project before starting the language server
Closes #913
1 parent 24ac6d3 commit a61df96

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

src/PanelCode.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import GObject from "gi://GObject";
44
import { makeDropdownFlat, settings as global_settings } from "./util.js";
55
import { setupRustProject } from "./langs/rust/rust.js";
66
import { setupTypeScriptProject } from "./langs/typescript/typescript.js";
7-
import { setupValaProject } from "./langs/vala/vala.js";
87

98
export default function PanelCode({
109
builder,
@@ -56,10 +55,6 @@ export default function PanelCode({
5655
stack_code.visible_child_name = panel.language;
5756
previewer.useInternal().catch(console.error);
5857

59-
if (panel.language.toLowerCase() === "vala") {
60-
setupValaProject(file).catch(console.error);
61-
}
62-
6358
if (panel.language.toLowerCase() === "rust") {
6459
setupRustProject(file).catch(console.error);
6560
}

src/langs/vala/vala.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,9 @@ export function setup({ document }) {
99

1010
const { file, buffer, code_view } = document;
1111

12-
const api_file = Gio.File.new_for_path(pkg.pkgdatadir).get_child(
13-
"workbench.vala",
14-
);
15-
api_file.copy(
16-
file.get_parent().get_child("workbench.vala"),
17-
Gio.FileCopyFlags.OVERWRITE,
18-
null,
19-
null,
20-
);
12+
// VLS needs the project to be already setup once it starts,
13+
// otherwise it won't pick it up later.
14+
setupValaProject(file.get_parent()).catch(console.error);
2115

2216
const lspc = createLSPClient({
2317
lang: getLanguage("vala"),

0 commit comments

Comments
 (0)