Skip to content

How to make IntelliJ IDEA support spEL check #3

Description

@tri5m

IntelliJ IDEA setting:

  1. setting->Editor->Language Injections
  2. Click the Import button below the list
  3. import xml file, content:
<LanguageInjectionConfiguration>
    <injection language="SpEL" injector-id="java">
        <display-name>TuCache (io.github.tri5m.tucache.core.annotation)</display-name>
        <value-pattern>\#\{(.*?)\}</value-pattern>
        <place><![CDATA[psiMethod().withName("key").withParameters().definedInClass("io.github.tri5m.tucache.core.annotation.TuCache")]]></place>
        <place><![CDATA[psiMethod().withName("value").withParameters().definedInClass("io.github.tri5m.tucache.core.annotation.TuCache")]]></place>
    </injection>
    <injection language="SpEL" injector-id="java">
        <display-name>TuCache.condition (io.github.tri5m.tucache.core.annotation)</display-name>
        <place><![CDATA[psiMethod().withName("condition").withParameters().definedInClass("io.github.tri5m.tucache.core.annotation.TuCache")]]></place>
    </injection>
    <injection language="SpEL" injector-id="java">
        <display-name>TuCacheClear (io.github.tri5m.tucache.core.annotation)</display-name>
        <value-pattern>\#\{(.*?)\}</value-pattern>
        <place disabled="true"><![CDATA[psiMethod().withName("condition").withParameters().definedInClass("org.springframework.cache.annotation.CacheEvict")]]></place>
        <place disabled="true"><![CDATA[psiMethod().withName("condition").withParameters().definedInClass("org.springframework.cache.annotation.CachePut")]]></place>
        <place disabled="true"><![CDATA[psiMethod().withName("condition").withParameters().definedInClass("org.springframework.cache.annotation.Cacheable")]]></place>
        <place disabled="true"><![CDATA[psiMethod().withName("key").withParameters().definedInClass("io.github.tri5m.tucache.core.annotation.TuCache")]]></place>
        <place><![CDATA[psiMethod().withName("key").withParameters().definedInClass("io.github.tri5m.tucache.core.annotation.TuCacheClear")]]></place>
        <place disabled="true"><![CDATA[psiMethod().withName("key").withParameters().definedInClass("org.springframework.cache.annotation.CacheEvict")]]></place>
        <place disabled="true"><![CDATA[psiMethod().withName("key").withParameters().definedInClass("org.springframework.cache.annotation.CachePut")]]></place>
        <place disabled="true"><![CDATA[psiMethod().withName("key").withParameters().definedInClass("org.springframework.cache.annotation.Cacheable")]]></place>
        <place><![CDATA[psiMethod().withName("keys").withParameters().definedInClass("io.github.tri5m.tucache.core.annotation.TuCacheClear")]]></place>
        <place disabled="true"><![CDATA[psiMethod().withName("unless").withParameters().definedInClass("org.springframework.cache.annotation.CachePut")]]></place>
        <place disabled="true"><![CDATA[psiMethod().withName("unless").withParameters().definedInClass("org.springframework.cache.annotation.Cacheable")]]></place>
        <place disabled="true"><![CDATA[psiMethod().withName("value").withParameters().definedInClass("io.github.tri5m.tucache.core.annotation.TuCache")]]></place>
        <place><![CDATA[psiMethod().withName("value").withParameters().definedInClass("io.github.tri5m.tucache.core.annotation.TuCacheClear")]]></place>
    </injection>
    <injection language="SpEL" injector-id="java">
        <display-name>TuCacheClear.condition (io.github.tri5m.tucache.core.annotation)</display-name>
        <place><![CDATA[psiMethod().withName("condition").withParameters().definedInClass("io.github.tri5m.tucache.core.annotation.TuCacheClear")]]></place>
    </injection>
</LanguageInjectionConfiguration>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions