From b122e11f194ff950f4ebf79174861bdc0c570df4 Mon Sep 17 00:00:00 2001 From: Alexey Gopachenko Date: Mon, 15 Feb 2010 13:38:18 +0300 Subject: [PATCH] PHP persistent injections --- plugins/IntelliLang/IntelliLangJava.iml | 1 + .../src/LanguageInjectionConfiguration.xml | 14 ++++++++ .../src/META-INF/intellilang-php-support.xml | 9 +++++ plugins/IntelliLang/src/META-INF/plugin.xml | 1 + .../inject/php/PhpLanguageInjectionSupport.java | 41 ++++++++++++++++++++++ 5 files changed, 66 insertions(+) create mode 100644 plugins/IntelliLang/src/META-INF/intellilang-php-support.xml create mode 100644 plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/php/PhpLanguageInjectionSupport.java diff --git a/plugins/IntelliLang/IntelliLangJava.iml b/plugins/IntelliLang/IntelliLangJava.iml index e6aaec1b47..33f4ef671d 100644 --- a/plugins/IntelliLang/IntelliLangJava.iml +++ b/plugins/IntelliLang/IntelliLangJava.iml @@ -20,6 +20,7 @@ + diff --git a/plugins/IntelliLang/src/LanguageInjectionConfiguration.xml b/plugins/IntelliLang/src/LanguageInjectionConfiguration.xml index 40a0e91778..fd31db12b0 100644 --- a/plugins/IntelliLang/src/LanguageInjectionConfiguration.xml +++ b/plugins/IntelliLang/src/LanguageInjectionConfiguration.xml @@ -405,4 +405,18 @@ + diff --git a/plugins/IntelliLang/src/META-INF/intellilang-php-support.xml b/plugins/IntelliLang/src/META-INF/intellilang-php-support.xml new file mode 100644 index 0000000000..74cbdb02c2 --- /dev/null +++ b/plugins/IntelliLang/src/META-INF/intellilang-php-support.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/plugins/IntelliLang/src/META-INF/plugin.xml b/plugins/IntelliLang/src/META-INF/plugin.xml index 08fc53463f..987b6c0618 100644 --- a/plugins/IntelliLang/src/META-INF/plugin.xml +++ b/plugins/IntelliLang/src/META-INF/plugin.xml @@ -10,6 +10,7 @@ com.intellij.javaee com.intellij.modules.xml org.intellij.groovy + com.jetbrains.php Sascha Weinreuter diff --git a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/php/PhpLanguageInjectionSupport.java b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/php/PhpLanguageInjectionSupport.java new file mode 100644 index 0000000000..244756cef8 --- /dev/null +++ b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/php/PhpLanguageInjectionSupport.java @@ -0,0 +1,41 @@ +/* + * Copyright 2000-2010 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.intellij.plugins.intelliLang.inject.php; + +import com.intellij.psi.PsiElement; +import com.jetbrains.php.lang.patterns.PhpPatterns; +import com.jetbrains.php.lang.psi.elements.PhpPsiElement; +import org.intellij.plugins.intelliLang.inject.AbstractLanguageInjectionSupport; +import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; + +public class PhpLanguageInjectionSupport extends AbstractLanguageInjectionSupport { + @NonNls private static final String SUPPORT_ID = "php"; + + @NotNull + public String getId() { + return SUPPORT_ID; + } + + @NotNull + public Class[] getPatternClasses() { + return new Class[] {PhpPatterns.class}; + } + + public boolean useDefaultInjector(final PsiElement host) { + return host instanceof PhpPsiElement; + } +} -- 2.11.4.GIT