-
-
Notifications
You must be signed in to change notification settings - Fork 90
Expand file tree
/
Copy pathvala.js
More file actions
62 lines (54 loc) · 1.66 KB
/
vala.js
File metadata and controls
62 lines (54 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/* eslint-disable no-restricted-globals */
import Gio from "gi://Gio";
import { getLanguage } from "../common.js";
import { checkFile, diagnose } from "./util.js";
const languageId = "vala";
export default async function vala({ file, lspc, demo_dir }) {
print(` ${file.get_path()}`);
const file_api = Gio.File.new_for_path(pkg.pkgdatadir).get_child(
"workbench.vala",
);
file_api.copy(
demo_dir.get_child("workbench.vala"),
Gio.FileCopyFlags.OVERWRITE,
null,
null,
);
await diagnose({
file,
lspc,
languageId,
filter(diagnostic) {
// FIXME: deprecated features, no replacement?
if (demo_dir.get_basename() === "Text Fields") {
const ignore_for_text_fields = [
"`Gtk.EntryCompletion' has been deprecated since 4.10",
"`Gtk.Entry.completion' has been deprecated since 4.10",
"`Gtk.ListStore' has been deprecated since 4.10",
"`Gtk.TreeIter' has been deprecated since 4.10",
];
return !ignore_for_text_fields.includes(diagnostic.message);
// Gtk.StyleContext class is deprecated but not the following methods
// gtk_style_context_add_provider_for_display
// gtk_style_context_remove_provider_for_display
} else if (demo_dir.get_basename() === "CSS Gradients") {
return (
diagnostic.message !==
"`Gtk.StyleContext' has been deprecated since 4.10"
);
}
return true;
},
});
await checkFile({
lspc,
file,
lang: getLanguage(languageId),
uri: file.get_uri(),
});
await lspc._notify("textDocument/didClose", {
textDocument: {
uri: file.get_uri(),
},
});
}