Skip to content

Polish plugin toward first-class IntelliJ integration - #172

Merged
maxandersen merged 1 commit into
mainfrom
polish/first-class-plugin
Sep 1, 2026
Merged

maxandersen merged 1 commit into
mainfrom
polish/first-class-plugin

Conversation

@maxandersen

Copy link
Copy Markdown
Contributor

Summary

A polish pass to make the plugin feel like a first-class IntelliJ citizen. Every behavioral change is backed by a test; the full suite passes across repeated runs and verifyPlugin reports Compatible.

Changes

Safe script creation

  • New Script dialog validates the destination and shows the reason inline (setErrorText) instead of silently greying OK.
  • Rejects existing files, absolute/C: paths, and paths escaping the selected directory; nested destinations are created and opened.
  • Dropped the unconditional jbang init --force.
  • Fixed created files not opening (synchronous refreshAndFindFileByIoFile instead of async refresh + immediate lookup).

Run/Debug configurations

  • Context-created configurations are matched by canonical script path, not display name, so same-named scripts in different directories no longer collide.
  • Generated configurations are temporary unless saved.
  • Added checkConfiguration() for missing script, directory-instead-of-file, invalid working directory, and missing JBang.

Script detection matches JBang

  • Directives are only recognized in the initial comment block at column zero.
  • Consistent first-200-lines scan; direct detector and file index agree.

Directive editing

  • Multi-token completion for additional //DEPS, //SOURCES, //FILES entries.
  • New DirectiveArgumentCompletion for //JAVA versions, //REPOS shortcuts, and //MAIN classes (registered for Java/Kotlin/Groovy).
  • Quick fixes: uppercase a mis-cased directive, remove a duplicate //DEPS.

Language support

  • JShell (.jsh) now receives directive and directive-argument completion.
  • Partial support for .jsh/.jbang documented honestly.

Catalog schema

  • Accepts current Java versions (22–25) and template properties.

Lifecycle & UX

  • Project-scoped, cancellable coroutine scope on JBangProjectService (cancelled on dispose); async PSI access guarded by file.isValid.
  • Settings use ActionLink and link to Documentation and the issue tracker.
  • Feature tips point to published docs instead of GitHub AsciiDoc source.

Documentation

  • New architecture.adoc, troubleshooting.adoc, known-limitations.adoc, CONTRIBUTING.md.
  • Corrected the "IntelliJ modules are never modified" claim (documents the narrow Kotlin K2 module-library exception).
  • Documented the command preview + Copy button; .DS_Store ignored.

CI

  • Removed the misleading run-ui-tests.yml and the unused qodana.yml.
  • Added Gradle wrapper validation; replaced deprecated ::set-output.

Implementation plan

Full staged plan is in docs/IMPLEMENTATION_PLAN.md. Executed in this order:

  1. Safe script creation
  2. Run configuration identity and validation
  3. Script detection correctness
  4. Directive completion and quick fixes
  5. Language-support contract
  6. Catalog schema
  7. Lifecycle / cancellation
  8. IntelliJ UI polish
  9. Documentation
  10. CI and API cleanup

Every PR step follows: failing test first → implement → targeted test → full ./gradlew test → verifyPlugin for API/registration changes → changelog.

Not included (needs a decision)

  • Linux CLI smoke test (resolve/create/run against a pinned JBang release) — needs an agreed pinned version.
  • Native Run/Debug menu icons — whether to diverge from the JBang gutter icon.

Validation

  • ./gradlew test — green across 5 forced reruns.
  • ./gradlew verifyPlugin --args='-mute TemplateWordInPluginId' — Compatible.

@coderabbitai

coderabbitai Bot commented Aug 30, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • ai-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 23734802-ebbf-4495-9b14-d741e3b06081

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@maxandersen
maxandersen force-pushed the polish/first-class-plugin branch 4 times, most recently from ed918e6 to dc2546b Compare September 1, 2026 23:24
Safe script creation, correct run-config identity/validation, JBang-accurate
detection, richer directive editing + quick fixes, JShell completion, refreshed
catalog schema, project-scoped cancellable sync, settings/UX links, accurate
docs, and CI cleanup. Every change is covered by a test.
@maxandersen
maxandersen force-pushed the polish/first-class-plugin branch from dc2546b to 6b47218 Compare September 1, 2026 23:36
@maxandersen
maxandersen merged commit df4a8b8 into main Sep 1, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant