Skip to content

About

IDE plugin for Jetbrain ecosystem

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

MetaScript — IntelliJ Platform Plugin

LSP-backed MetaScript support for the entire JetBrains IDE family: IntelliJ IDEA Ultimate/Community, WebStorm, PyCharm Pro/Community, GoLand, RubyMine, PhpStorm, CLion, RustRover, Rider, DataGrip, DataSpell, Android Studio, Aqua, AppCode.

Provides go-to-definition, find usages, rename, hover documentation, completion, signature help, inlay hints, semantic highlighting, and diagnostics for .ms, .cms, .jms, .ems, .wms, .rms files.


Architecture

Layer Provider Notes
File type MetaScriptFileType (Kotlin) Registers the 6 extensions.
Lexical highlighting TextMate grammar (bundled) Reused from the VSCode plugin.
Semantic highlighting LSP textDocument/semanticTokens Variables/functions/classes etc.
Editor config language-configuration.json (TextMate bundle) Brackets, comments, indent.
LSP integration LSP4IJ — LanguageServerFactory + ProcessStreamConnectionProvider Spawns msc lsp.

The plugin only depends on LSP — no native PSI, no custom lexer/parser. Same msc lsp server as VSCode, Neovim, Zed.


Requirements

  • IntelliJ-based IDE, build 242+ (i.e. 2024.2 or newer).
  • The msc compiler binary on PATH or at ~/.metascript/bin/msc[.exe] (the canonical location written by metascriptlang.org/install.{sh,ps1}).
  • The LSP4IJ plugin (com.redhat.devtools.lsp4ij). Auto-installed by the Marketplace when you install MetaScript; install manually if sideloading.

Install — end users

From JetBrains Marketplace

  1. Settings | Plugins | Marketplace
  2. Search for MetaScript
  3. Click Install — IDE prompts to install LSP4IJ alongside; accept.
  4. Restart IDE.

From a local .zip (sideload)

# In the IDE: Settings | Plugins → gear icon → Install Plugin from Disk...
# Pick: build/distributions/metascript-intellij-X.Y.Z.zip
# (LSP4IJ must be installed first — search Marketplace for "LSP4IJ".)

Build & dev — contributors

# From the plugin root (this directory in monorepo: tools/editor-plugin/jetbrains/):

# Generate Gradle wrapper jar (one-time, requires system Gradle 8.13+).
gradle wrapper --gradle-version 8.13

# Build the plugin distribution.
./gradlew buildPlugin
# Output: build/distributions/metascript-intellij-0.1.0.zip

# Launch a sandboxed IntelliJ Community IDE with the plugin pre-installed.
# Useful for live testing.
./gradlew runIde

# Run the JetBrains Plugin Verifier — checks API compatibility against the
# declared since-build range.
./gradlew verifyPlugin

Sync TextMate assets from the VSCode plugin

The TextMate grammar, language-configuration, and icon are owned by the VSCode plugin (tools/editor-plugin/vscode/). The IntelliJ plugin keeps a mirror under src/main/resources/textmate/metascript/ and src/main/resources/icons/.

After editing the grammar in vscode/syntaxes/metascript.tmLanguage.json, re-sync into this plugin:

bash ../build.sh
# Section "Syncing IntelliJ TextMate bundle" copies all three files.

build.sh does NOT run gradle buildPlugin — that is left to this README.


Publishing

  1. Bump pluginVersion in gradle.properties.
  2. Add a <change-notes> entry in META-INF/plugin.xml.
  3. Verify: ./gradlew verifyPlugin.
  4. Build: ./gradlew buildPlugin → upload the .zip manually, OR
  5. Direct publish: ./gradlew publishPlugin -PintellijPublishToken=<token>.

JetBrains Marketplace review for the first version typically takes 3–7 days; subsequent updates are near-instant.


Server discovery

MetaScriptServerPathDiscovery.find() mirrors the VSCode extension:

  1. ~/.metascript/bin/msc[.exe] — canonical install location.
  2. Bare msc — falls through to PATH.

A user-overridable Settings panel is intentionally deferred to v0.2 so the initial release ships fast. Power users can mv/symlink to redirect the canonical path for now.


Troubleshooting

  • "Unable to start MetaScript Language Server" — the msc binary isn't on PATH. Run the install script from https://metascriptlang.org/install.sh or set ~/.metascript/bin/msc explicitly.
  • No syntax highlighting before LSP responds — TextMate bundle didn't load. Settings | Editor | TextMate Bundles should list metascript. If absent, file an issue — bundle registration likely broke.
  • LSP4IJ status not "Running" — open the LSP console (Settings | Languages & Frameworks | Language Servers | MetaScript → Show Console) for stderr from the msc subprocess.

About

IDE plugin for Jetbrain ecosystem

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages