From 1eaee25c4a139efd10a9573b3962ee2df4c5d9e2 Mon Sep 17 00:00:00 2001 From: Samuel Rizzo Date: Tue, 7 Apr 2026 12:49:41 +0700 Subject: [PATCH] Support IntelliJ IDEA 2026.1 and refresh build tooling. Bump the target platform to 2026.1, pin the matching Ruby plugin, update build tooling dependencies, and add the repo guide for future Claude sessions. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/build.yml | 2 +- CHANGELOG.md | 4 +++ CLAUDE.md | 56 +++++++++++++++++++++++++++++++++++++ gradle.properties | 6 ++-- gradle/libs.versions.toml | 4 +-- 5 files changed, 66 insertions(+), 6 deletions(-) create mode 100644 CLAUDE.md diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ba7132a..1fa9a93 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -160,7 +160,7 @@ jobs: # Run Qodana inspections - name: Qodana - Code Inspection - uses: JetBrains/qodana-action@v2025.1.1 + uses: JetBrains/qodana-action@v2025.2 with: cache-default-branch-only: true diff --git a/CHANGELOG.md b/CHANGELOG.md index 3522d32..6b11032 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ ## [Unreleased] +### Added + +- Compatibility with IntelliJ 2026.1 + ## [0.0.15] - 2025-12-27 ### Added diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..f5d5175 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,56 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Build and verification + +- `./gradlew build` — full build. +- `./gradlew check` — main local verification task used by the shared run configuration; runs tests and coverage checks. +- `./gradlew verifyPlugin` — JetBrains plugin verification against recommended IDE builds. +- `./gradlew runIde` — launch a development IDE with the plugin installed. +- `./gradlew runIdeForUiTests` — launch the IDE with the robot server enabled for UI tests. +- `./gradlew test --tests 'fully.qualified.TestName'` — run a single test class or method when tests exist. + +## Project setup + +- Gradle wrapper uses Gradle 9.2.1. +- Kotlin JVM toolchain is pinned to Java 21. +- The plugin targets IntelliJ Platform `2025.3` and depends on the Ruby plugin (`org.jetbrains.plugins.ruby`). +- Plugin versioning, target build range, Marketplace metadata, and platform dependency versions live in `gradle.properties`. + +## Architecture + +This is a small IntelliJ Platform plugin that adds RubyMine/RSpec PSI integrations for RSpec `let`-style declarations. + +### Integration points + +The plugin is wired through `src/main/resources/META-INF/plugin.xml`: + +- a Ruby `psi.referenceContributor` registers references for potential `let` reads and overrides +- custom find-usages handler/provider and usage-type provider replace Ruby defaults for supported targets +- a `referencesSearch` extension makes rename/find-usages work from the root declaration +- custom `elementManipulator`, `renamePsiElementProcessor`, and `elementDescriptionProvider` make rename/navigation behave like a first-class language feature + +### Core model + +Most logic revolves around identifying RSpec symbol-defining calls (`let`, `let!`, and `subject`) and mapping Ruby PSI back to the defining `RCall`. + +- `util/LetRCallPsiUtil.java` converts different PSI shapes (`RCall`, `RBlockCall`, `RSymbol`, `RIdentifier`, etc.) into the enclosing RSpec declaration call. +- `util/LetDeclarationPsiUtil.java` handles declaration names, matching, equivalence, and usage classification. +- `util/FindLetDeclarationsUtil.java` walks outward through nested RSpec example groups to find upstream declarations, overridden declarations, and the root declaration for a name. + +That upstream-scope walk is the key behavior in this repo: nested example groups can shadow `let` declarations, so navigation and rename must distinguish between the nearest declaration and the root declaration. + +### Feature flow + +- `referencecontributor/*` attaches references directly to Ruby PSI nodes in RSpec files, separating read references from override references. +- `referencesearch/LetVariableReferencesSearch.java` limits searches to the containing file, searches by declaration name, then filters candidate occurrences back down to RSpector reference types. +- `findusages/*` customizes which elements support Find Usages and how they are labeled in the IDE. +- `refactoring/LetVariableRenameProcessor.java` redirects rename operations to the identifying symbol of the enclosing declaration and filters results to RSpector references only. + +## Repository conventions + +- Plugin description for Marketplace publishing is extracted from the `` block in `README.md`; keep that block in sync with plugin capabilities. +- Changelog HTML for the plugin manifest is generated from `CHANGELOG.md` by the Gradle changelog plugin. +- There are currently shared IDE run configurations for `runIde`, `check`, and `verifyPlugin` under `.run/`. +- There are no committed tests under `src/test` right now, even though the build is configured for JUnit 4 and `check`/`test` tasks are available. diff --git a/gradle.properties b/gradle.properties index 2cce6eb..ae2fcde 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,15 +7,15 @@ pluginRepositoryUrl = https://github.com/srizzo/rspector-rubymine-plugin pluginVersion = 0.0.15 # Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html -pluginSinceBuild = 252 +pluginSinceBuild = 261 # IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension -platformVersion = 2025.3 +platformVersion = 2026.1 # Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html # Example: platformPlugins = com.jetbrains.php:203.4449.22, org.intellij.scala:2023.3.27@EAP # Check latest Ruby versions: https://plugins.jetbrains.com/plugin/1293-ruby/versions -platformPlugins = org.jetbrains.plugins.ruby:253.29346.138 +platformPlugins = org.jetbrains.plugins.ruby:261.22158.274 # Example: platformBundledPlugins = com.intellij.java platformBundledPlugins = # Example: platformBundledModules = intellij.spellchecker diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 3fd64a1..bf2e848 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,10 +5,10 @@ opentest4j = "1.3.0" # plugins changelog = "2.5.0" -intelliJPlatform = "2.10.5" +intelliJPlatform = "2.13.1" kotlin = "2.2.21" kover = "0.9.3" -qodana = "2025.2.2" +qodana = "2025.2.1" [libraries] junit = { group = "junit", name = "junit", version.ref = "junit" }