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,3 +1,4 @@
import java.time.Duration
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
@ -9,6 +10,8 @@ plugins {
id("org.jetbrains.intellij.platform") version "2.18.1"
}
val localIde = providers.gradleProperty("localIde")
group = providers.gradleProperty("pluginGroup").get()
version = providers.gradleProperty("pluginVersion").get()
@ -65,6 +68,9 @@ intellijPlatform {
create(IntelliJPlatformType.IntellijIdeaCommunity, providers.gradleProperty("platformVersion").get()) {
useInstaller = false
}
// -PlocalIde=/path/to/IDE.app also checks against an installed IDE,
// e.g. the newer one a developer actually uses
localIde.orNull?.let { local(it) }
}
}
@ -87,8 +93,32 @@ tasks.named<JavaExec>("runIde") {
args = listOf(repoRoot.absolutePath)
}
// `./gradlew runLocalIde -PlocalIde=/Applications/IntelliJ IDEA.app [-PopenProject=dir]`:
// the same sandbox as runIde, booted from an installed IDE instead of the
// downloaded one, so the plugin can be tried on exactly that build.
val runLocalIde by intellijPlatformTesting.runIde.registering {
localPath = localIde.map { file(it) }
task {
args = listOf(providers.gradleProperty("openProject").getOrElse(repoRoot.absolutePath))
}
plugins {
plugin("com.redhat.devtools.lsp4ij", providers.gradleProperty("lsp4ijVersion").get())
}
}
// The palette Color.* resolves against, straight from the docs it is generated
// into (`ludic-dev docs-palette`), so the swatches cannot drift from the compiler.
tasks.named<ProcessResources>("processResources") {
from(File(repoRoot, "docs/language/colors/palette.json"))
}
tasks.test {
useJUnit()
// a platform test that waits on a modal dialog or an event that never
// comes blocks forever; fail the run instead of hanging it
timeout.set(Duration.ofMinutes(10))
systemProperty("idea.test.timeout", "120")
testLogging {
events("passed", "failed", "skipped")
showStandardStreams = false