Skip to content

Add documentation provider, inspections, and improve settings UI#118

Draft
inxilpro wants to merge 12 commits into
mainfrom
claude/fix-release-ci-java-7vzyT
Draft

Add documentation provider, inspections, and improve settings UI#118
inxilpro wants to merge 12 commits into
mainfrom
claude/fix-release-ci-java-7vzyT

Conversation

@inxilpro

@inxilpro inxilpro commented Apr 8, 2026

Copy link
Copy Markdown
Owner

Summary

This PR adds comprehensive documentation support for Alpine.js directives and magic properties, introduces an inspection for deprecated x-spread, refactors the settings UI to use modern IntelliJ DSL, and improves code quality with better type safety and caching.

Key Changes

Documentation & Help

  • New AlpineDocumentationProvider: Provides detailed documentation for all Alpine.js directives (x-data, x-show, x-model, etc.) and magic properties ($refs, $store, $el, etc.) with examples and descriptions
  • Supports both full documentation and quick navigate info for IDE tooltips
  • Handles directive shorthand syntax (@click, :class) by mapping to base directives

Code Inspections

  • New DeprecatedXSpreadInspection: Warns users about deprecated x-spread directive and suggests using x-bind with object syntax instead
  • Includes comprehensive test coverage

Settings & Configuration

  • Refactored AlpineSettingsConfigurable: Replaced custom AlpineSettingsComponent with modern IntelliJ UI DSL (panel builder)
  • Cleaner, more maintainable settings UI with proper grouping
  • Improved state management and modification tracking
  • Added comprehensive settings tests

Code Quality Improvements

  • New JsContext data class: Replaces Apache Commons MutablePair for better type safety and readability
  • Caching optimization in AlpineTargetReferenceContributor: Uses CachedValuesManager with PsiModificationTracker for efficient ID map caching
  • Improved logging: Added proper logger usage in AlpinePluginRegistry
  • Better error handling: Enhanced detection logic with proper logging

Testing

  • Added comprehensive test suites:
    • AlpineDocumentationProviderTest: Tests documentation generation for directives and shorthands
    • AlpineCompletionContributorTest: Tests completion suggestions for directives, modifiers, and shorthands
    • AlpineJavaScriptInjectionTest: Tests JavaScript injection into Alpine attributes
    • AlpineSettingsTest: Tests settings persistence and state management
    • PackageJsonDetectorTest: Tests plugin detection from package.json
    • ScriptReferenceDetectorTest: Tests plugin detection from script tags
    • DeprecatedXSpreadInspectionTest: Tests x-spread deprecation warnings

Test Data

  • Added HTML and JSON test fixtures for completion, injection, and detection tests

Build & CI

  • Updated Java version from 17 to 21 in GitHub Actions
  • Changed plugin verification to use recommended() IDE versions instead of hardcoded version

Plugin System

  • Made alpinePlugin extension point dynamic for better plugin lifecycle management

https://claude.ai/code/session_01V2fCJAQ7skygq5KtjRQFjW

claude added 5 commits April 8, 2026 18:47
The release workflow used Java 17 while the project requires Java 21,
causing release builds to fail. Also switched plugin verification from
a single hardcoded IDE version to recommended() for broader coverage.

https://claude.ai/code/session_01V2fCJAQ7skygq5KtjRQFjW
… settings

28 tests covering:
- PackageJsonDetector: verifies plugin detection from package.json dependencies
- ScriptReferenceDetector: verifies detection from HTML script tags and JS imports
- AlpineCompletionContributor: verifies directive, event, bind, and modifier completions
- AlpineJavaScriptInjection: verifies JS injection into Alpine attribute values
- AlpineSettings: verifies app/project settings persistence round-trips

https://claude.ai/code/session_01V2fCJAQ7skygq5KtjRQFjW
…gs UI

- Replace org.apache.commons.lang3.tuple.MutablePair with Kotlin
  data class JsContext(prefix, suffix) across all plugin files
- Add DumbService.isDumb() guards to PackageJsonDetector,
  ScriptReferenceDetector, and AlpinePluginRegistry to prevent
  index access during dumb mode
- Use DumbService.runWhenSmart() for VFS listener callback
- Use project-scoped disposable for message bus connection
- Add @service(Service.Level.PROJECT) to AlpineProjectSettingsState
- Add structured logging via logger<>() to registry and detectors
- Add dynamic="true" to alpinePlugin extension point
- Modernize settings UI with Kotlin UI DSL v2 panel builder,
  eliminating the separate AlpineSettingsComponent class
- Add PSI caching via CachedValuesManager for ID lookups in
  AlpineTargetReferenceContributor

https://claude.ai/code/session_01V2fCJAQ7skygq5KtjRQFjW
- DocumentationProvider showing docs for all Alpine directives (x-data,
  x-show, x-model, etc.) and magic properties ($refs, $dispatch, etc.)
  with examples and descriptions. Handles @event and :bind shorthands.
- DeprecatedXSpreadInspection warns when x-spread is used, recommending
  x-bind with object syntax instead (deprecated in Alpine v3).
- 11 new tests covering documentation generation and inspection warnings.

https://claude.ai/code/session_01V2fCJAQ7skygq5KtjRQFjW
The Kotlin 2.1 K2 compiler's FirIncompatibleClassExpressionChecker
crashes on the Java override of PsiMetaData.init(PsiElement) due to
a nullability mismatch. Accept nullable parameter to work around it.

https://claude.ai/code/session_01V2fCJAQ7skygq5KtjRQFjW
@inxilpro inxilpro force-pushed the claude/fix-release-ci-java-7vzyT branch from c32b5f9 to 3f2b635 Compare April 8, 2026 18:49
@github-actions

github-actions Bot commented Apr 8, 2026

Copy link
Copy Markdown

Qodana Community for JVM

1 new problem were found

Inspection name Severity Problems
Incorrect string capitalization 🔶 Warning 1

💡 Qodana analysis was run in the pull request mode: only the changed files were checked

View the detailed Qodana report

To be able to view the detailed Qodana report, you can either:

To get *.log files or any other Qodana artifacts, run the action with upload-result option set to true,
so that the action will upload the files as the job artifacts:

      - name: 'Qodana Scan'
        uses: JetBrains/qodana-action@v2025.1.1
        with:
          upload-result: true
Contact Qodana team

Contact us at qodana-support@jetbrains.com

claude added 7 commits April 8, 2026 19:11
…ation

- Remove unused LOG variables from PackageJsonDetector and
  ScriptReferenceDetector (and their logger imports)
- Remove unused magicDocs map from AlpineDocumentationProvider
- Remove unused AttributeUtil import from AlpineDocumentationProvider
- Quote 'x-spread' in inspection displayName for capitalization rules

https://claude.ai/code/session_01V2fCJAQ7skygq5KtjRQFjW
PhpStorm/IntelliJ 2026.1 ships with Kotlin metadata version 2.3.0,
which requires Kotlin 2.2.0+ to read. Bumped Kotlin from 2.1.21 to
2.2.0 and extended pluginUntilBuild from 253.* to 261.* to support
the 2026.1 IDE family.

https://claude.ai/code/session_01V2fCJAQ7skygq5KtjRQFjW
The IntelliJ Platform Gradle Plugin can't resolve product-info.json
from a downloaded PhpStorm 2026.1 due to macOS app bundle nesting.
Using local() with the actual installation path avoids this issue
and is faster since it skips downloading.

https://claude.ai/code/session_01V2fCJAQ7skygq5KtjRQFjW
PhpStorm 2026.1 has large JARs that exceed the default Gradle heap
during classpath entry snapshot transforms.

https://claude.ai/code/session_01V2fCJAQ7skygq5KtjRQFjW
In PhpStorm 2026.1, the JSON plugin is a separate bundled module.
Without declaring the dependency, com.intellij.json.psi.* classes
used by PackageJsonDetector are not on the classpath.

https://claude.ai/code/session_01V2fCJAQ7skygq5KtjRQFjW
The local() IDE integration caused test failures due to different
service registration in PhpStorm vs IntelliJ IDEA test sandbox.
Reverting to the standard create() approach with IU 2025.1 which
matches CI. 2026.1 support should be a separate effort with proper
pluginUntilBuild, Kotlin, and JSON module dependency changes.

Also made AlpineSettingsTest more resilient to service availability.

https://claude.ai/code/session_01V2fCJAQ7skygq5KtjRQFjW
Fixes product-info.json resolution failures on macOS ARM where the
Gradle transform cache contains .app bundle paths that older plugin
versions couldn't handle.

https://claude.ai/code/session_01V2fCJAQ7skygq5KtjRQFjW
DenisStetsenko added a commit to DenisStetsenko/IntellijAlpine that referenced this pull request Jun 2, 2026
Compatibility & build:
- Remove the upper compatibility bound; build against 2026.1 (since-build stays 251)
- Bump Gradle 8.13 -> 9.0.0, IntelliJ Platform plugin 2.6.0 -> 2.16.0, Kotlin 2.1.21 -> 2.3.20
- Add bundled JSON module dependency (extracted from the platform in 2024.3+)
- Verify against the recommended IDE set (Compatible on 2025.1 through 2026.2)

Robustness (from inxilpro#118):
- Guard package.json / script detectors and auto-enable against dumb mode
- Tie the package.json VFS listener to project disposal and run on smart mode
- Cache x-target id lookups via CachedValuesManager
- Mark the alpinePlugin extension point dynamic; nullable init() override

Features (from inxilpro#118):
- Quick documentation for Alpine directives
- Inspection flagging the deprecated x-spread directive
- Rewrite the settings panel using Kotlin UI DSL v2

CI & docs:
- Run release and UI-test workflows on Java 21
- Fix stale Gradle task names in CLAUDE.md (verifyPlugin, qodanaScan)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.

2 participants