Skip to content

Commit

Permalink
vala: Setup Vala project before starting the language server
Browse files Browse the repository at this point in the history
Closes #913
  • Loading branch information
Diego-Ivan committed Jul 12, 2024
1 parent 24ac6d3 commit a61df96
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
5 changes: 0 additions & 5 deletions src/PanelCode.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import GObject from "gi://GObject";
import { makeDropdownFlat, settings as global_settings } from "./util.js";
import { setupRustProject } from "./langs/rust/rust.js";
import { setupTypeScriptProject } from "./langs/typescript/typescript.js";
import { setupValaProject } from "./langs/vala/vala.js";

export default function PanelCode({
builder,
Expand Down Expand Up @@ -56,10 +55,6 @@ export default function PanelCode({
stack_code.visible_child_name = panel.language;
previewer.useInternal().catch(console.error);

if (panel.language.toLowerCase() === "vala") {
setupValaProject(file).catch(console.error);
}

if (panel.language.toLowerCase() === "rust") {
setupRustProject(file).catch(console.error);
}
Expand Down
12 changes: 3 additions & 9 deletions src/langs/vala/vala.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,9 @@ export function setup({ document }) {

const { file, buffer, code_view } = document;

const api_file = Gio.File.new_for_path(pkg.pkgdatadir).get_child(
"workbench.vala",
);
api_file.copy(
file.get_parent().get_child("workbench.vala"),
Gio.FileCopyFlags.OVERWRITE,
null,
null,
);
// VLS needs the project to be already setup once it starts,
// otherwise it won't pick it up later.
setupValaProject(file.get_parent()).catch(console.error);

const lspc = createLSPClient({
lang: getLanguage("vala"),
Expand Down

0 comments on commit a61df96

Please sign in to comment.