plum
git clone https://git.pyrossh.dev/plum
A statically typed, imperative programming language inspired by rust, python
ba979cb
— Peter John
2026-11-02T13:33:33+05:30
tooling: editor refresh copies queries/syntaxes; rebuild LSP on core/checker changes
- Makefile.toml +7 -1
- plum-cli/build.rs +8 -4
Makefile.toml
CHANGED
|
@@ -41,9 +41,12 @@ HELIX_DIR="${HELIX_RUNTIME_CONFIG:-${XDG_CONFIG_HOME:-$HOME/.config}/helix}"
|
|
|
41
41
|
if [ -f "$HELIX_DIR/languages.toml" ]; then
|
|
42
42
|
mkdir -p "$HELIX_DIR/runtime/grammars"
|
|
43
43
|
cp "$GRAMMAR_SO" "$HELIX_DIR/runtime/grammars/plum.so"
|
|
44
|
+
mkdir -p "$HELIX_DIR/runtime/queries/plum"
|
|
45
|
+
cp plum-tooling/tree-sitter-plum/queries/plum/*.scm "$HELIX_DIR/runtime/queries/plum/"
|
|
44
46
|
cp "$LSP_BIN" "$HELIX_DIR/plum-lsp"
|
|
45
47
|
chmod +x "$HELIX_DIR/plum-lsp"
|
|
46
48
|
echo "refreshed $HELIX_DIR/runtime/grammars/plum.so"
|
|
49
|
+
echo "refreshed $HELIX_DIR/runtime/queries/plum"
|
|
47
50
|
echo "refreshed $HELIX_DIR/plum-lsp"
|
|
48
51
|
else
|
|
49
52
|
echo "Helix not installed (run \`plum editor helix\` first) — skipping"
|
|
@@ -55,10 +58,13 @@ found_vscode=0
|
|
|
55
58
|
for dir_name in .vscode .vscode-insiders; do
|
|
56
59
|
ext_dir="$HOME/$dir_name/extensions/plum-lang.plum-0.0.1"
|
|
57
60
|
if [ -d "$ext_dir" ]; then
|
|
58
|
-
mkdir -p "$ext_dir/server"
|
|
61
|
+
mkdir -p "$ext_dir/server" "$ext_dir/syntaxes"
|
|
59
62
|
cp "$LSP_BIN" "$ext_dir/server/plum-lsp"
|
|
60
63
|
chmod +x "$ext_dir/server/plum-lsp"
|
|
64
|
+
cp plum-tooling/vscode-plum/syntaxes/plum.tmLanguage.json "$ext_dir/syntaxes/"
|
|
65
|
+
cp plum-tooling/vscode-plum/language-configuration.json "$ext_dir/"
|
|
61
66
|
echo "refreshed $ext_dir/server/plum-lsp"
|
|
67
|
+
echo "refreshed $ext_dir/syntaxes/plum.tmLanguage.json"
|
|
62
68
|
found_vscode=1
|
|
63
69
|
fi
|
|
64
70
|
done
|
plum-cli/build.rs
CHANGED
|
@@ -96,10 +96,14 @@ fn buildPlumLsp(manifest_dir: &std::path::Path, out_dir: &std::path::Path) {
|
|
|
96
96
|
};
|
|
97
97
|
let embed_path = out_dir.join(bin_name);
|
|
98
98
|
|
|
99
|
+
// plum-lsp links plum-core and plum-checker, so a parser or checker change
|
|
100
|
+
// must rebuild it too, or `plum editor` installs a stale server.
|
|
101
|
+
for crate_src in ["../plum-lsp/src", "../plum-core/src", "../plum-checker/src"] {
|
|
99
|
-
|
|
102
|
+
println!(
|
|
100
|
-
|
|
103
|
+
"cargo:rerun-if-changed={}",
|
|
101
|
-
|
|
104
|
+
manifest_dir.join(crate_src).display()
|
|
102
|
-
|
|
105
|
+
);
|
|
106
|
+
}
|
|
103
107
|
|
|
104
108
|
let cargo = env::var("CARGO").unwrap_or_else(|_| "cargo".to_string());
|
|
105
109
|
let status = Command::new(&cargo)
|