Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to make IntelliJ IDEA support spEL check #3

Open
tri5m opened this issue Nov 16, 2022 · 0 comments
Open

How to make IntelliJ IDEA support spEL check #3

tri5m opened this issue Nov 16, 2022 · 0 comments

Comments

@tri5m
Copy link
Owner

tri5m commented Nov 16, 2022

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>
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

No branches or pull requests

1 participant