mirror of
https://github.com/Nexoniarz/Finch.git
synced 2026-11-03 00:44:27 +00:00
CMake: enable C (Homebrew LLVM's config needs it); Kate: highlighting, language server setup, install script
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
484c14fe77
commit
fd86eb885c
6 changed files with 272 additions and 1 deletions
27
editors/kate/install.sh
Executable file
27
editors/kate/install.sh
Executable file
|
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env bash
|
||||
# Installs Finch support for Kate (also KWrite and KDevelop):
|
||||
# - syntax highlighting: ~/.local/share/org.kde.syntax-highlighting/syntax/finch.xml
|
||||
# - the language server: adds "finch" to ~/.config/kate/lspclient/settings.json
|
||||
# Then restart Kate and enable Settings → Configure Kate → Plugins → "LSP Client".
|
||||
set -eu
|
||||
here="$(cd "$(dirname "$0")" && pwd)"
|
||||
data="${XDG_DATA_HOME:-$HOME/.local/share}/org.kde.syntax-highlighting/syntax"
|
||||
conf="${XDG_CONFIG_HOME:-$HOME/.config}/kate/lspclient"
|
||||
mkdir -p "$data" "$conf"
|
||||
cp "$here/finch.xml" "$data/finch.xml"
|
||||
echo "highlighting: $data/finch.xml"
|
||||
|
||||
# merge into the user's LSP settings instead of replacing them
|
||||
python3 - "$conf/settings.json" "$here/lspclient.json" <<'PY'
|
||||
import json, os, sys
|
||||
path, ours = sys.argv[1], json.load(open(sys.argv[2]))
|
||||
cur = {}
|
||||
if os.path.exists(path) and os.path.getsize(path) > 0:
|
||||
cur = json.load(open(path))
|
||||
cur.setdefault("servers", {}).update(ours["servers"])
|
||||
with open(path, "w") as f:
|
||||
json.dump(cur, f, indent=4)
|
||||
f.write("\n")
|
||||
print("language server: " + path)
|
||||
PY
|
||||
command -v finch > /dev/null || echo "note: 'finch' isn't on your PATH yet; Kate starts the language server with 'finch lsp'"
|
||||
Loading…
Reference in a new issue