feat(tooling): JetBrains IDE support, LSP navigation, barrel imports, package scripts and hooks

- JetBrains plugin 1.4.0: semantic colours (builtin / vendor / own), template strings,
  brace handling, run configurations and a test console, package.ludic and
  package.lock.ludic editing (completion, docs, app preview, colour previews, asset
  navigation), External Libraries for the runtime and packages, doc pages for built-ins
- ludic-lsp: go to definition for imports, document links, hover with inferred types,
  type definition, signature help with parameters, docs from docs/language
- `import "dir"` resolves a barrel `dir/index.ludic`
- package.ludic `entry`, `script` and `hook before|after <command>`; `ludic <script>`,
  `ludic script`, `ludic scripts`
- `ludic test --verbose` and `--test NAME`; the test runner filters by name

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-16 16:00:28 +03:00
parent da57b20156
commit f92d7f89c6
75 changed files with 46802 additions and 40343 deletions

View file

@ -1,8 +1,8 @@
# Ludic for JetBrains IDEs
Works in IntelliJ IDEA (Community and Ultimate), CLion, GoLand, PyCharm, Rider,
WebStorm — anything on the IntelliJ Platform 2023.2 through 2026.2
(`since-build` 232, `until-build` 262.*).
WebStorm — anything on the IntelliJ Platform 2024.2 through 2026.2
(`since-build` 242, `until-build` 262.*).
`until-build` 262 is deliberately ahead of the newest released platform — 2025.3
is build **253**, and no 262 IDE exists yet. That headroom is the point: an
@ -17,7 +17,7 @@ packages cleanly can still fail to load:
scheduled-for-removal API usages.
- `./gradlew runIde` boots a real IDEA 2025.3 with the plugin installed. The
sandbox log line to look for is
`Loaded custom plugins: LSP4IJ (0.20.1), Ludic (1.0.0)` in
`Loaded custom plugins: LSP4IJ (0.20.1), Ludic (1.4.0)` in
`.intellijPlatform/sandbox/Ludic/IC-2025.3/log/idea.log`.
**If the plugin does not appear in Settings -> Plugins after installing**, the
@ -35,7 +35,7 @@ as the error message, which is not obvious the first time you see it:
```bash
export JAVA_HOME=$(/usr/libexec/java_home -v 21) # macOS
cd tools/editors/jetbrains
./gradlew buildPlugin # -> build/distributions/Ludic-1.0.0.zip
./gradlew buildPlugin # -> build/distributions/Ludic-1.4.0.zip
./gradlew runIde # try it in a sandbox IDE
```
@ -51,8 +51,39 @@ includes the plugin build in the toolchain's own test run.
Install the zip with **Settings -> Plugins -> ⚙ -> Install Plugin from Disk**.
LSP4IJ is a required dependency; the IDE offers to install it for you.
## What you get
- **Editing**: highlighting (Settings | Editor | Color Scheme | Ludic), brace and
quote pairing, folding, `#` comments, smart indent on Enter and on typing a
closer, Code Style page (2 spaces by default), live templates (`prog`,
`handler`, `on`, `test`, `fn`, `forq`, ...), `package.ludic` directives.
- **Language server** (`ludic-lsp` via LSP4IJ): completion, diagnostics
(including the compiler's own on save), hover, parameter info, go to
definition, find/highlight usages, rename, formatting, inlay hints, semantic
colours, Structure view, breadcrumbs, Go to Symbol.
- **Run / test**: a *Ludic* run configuration (`ludic run`, `build`, `test` or
any other `ludic` command); green gutter buttons on `program` and on every
`test "name"` (which runs just that test via `ludic test --test NAME`);
results in the test tree with navigation; `file.ludic:line` links in every
console. Per-test results need a toolchain with `ludic test --verbose`
(0.17+); an older one still gives per-file results.
- **Project**: File | New | Project | Ludic (runs `ludic new`), File | New |
Ludic File (program, module, test), Tools | Ludic (run, build, test, fmt,
get, pack, bundle, clean, doctor).
There is no debugger: `ludicc` does not emit debug info yet.
## Settings
**Settings -> Languages & Frameworks -> Ludic** — the path to `ludic-lsp` and to
`ludicc`. Both default to `bin/` under the project root, which is where
`bin/ludic-dev tools` puts them.
**Settings -> Languages & Frameworks -> Ludic** — the paths to `ludic`,
`ludic-lsp` and `ludicc`. Each blank one is looked up in `bin/` under the
project root, then on `PATH`, then in `~/.ludic/bin`. Changing a path restarts
the language server.
## Testing
```bash
./gradlew test # ~70 headless platform tests, ~25 s
./gradlew verifyPlugin -PlocalIde="/Applications/IntelliJ IDEA.app" # also verify against an installed IDE
./gradlew runLocalIde -PlocalIde="/Applications/IntelliJ IDEA.app" -PopenProject=/path/to/game
```