mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
intellilang support for python (work in progress)
This commit is contained in:
15
python/IntelliLang-python/IntelliLang-python.iml
Normal file
15
python/IntelliLang-python/IntelliLang-python.iml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="core-api" />
|
||||
<orderEntry type="module" module-name="IntelliLang" />
|
||||
<orderEntry type="module" module-name="python" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
|
||||
<idea-plugin version="2">
|
||||
<extensions defaultExtensionNs="org.intellij.intelliLang">
|
||||
<languageSupport implementation="com.jetbrains.python.intelliLang.PyLanguageInjectionSupport"/>
|
||||
</extensions>
|
||||
<extensions defaultExtensionNs="com.intellij">
|
||||
<patterns.patternClass className="com.jetbrains.python.patterns.PythonPatterns" alias="py"/>
|
||||
</extensions>
|
||||
</idea-plugin>
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.jetbrains.python.intelliLang;
|
||||
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.jetbrains.python.patterns.PythonPatterns;
|
||||
import com.jetbrains.python.psi.PyElement;
|
||||
import org.intellij.plugins.intelliLang.inject.AbstractLanguageInjectionSupport;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
public class PyLanguageInjectionSupport extends AbstractLanguageInjectionSupport {
|
||||
@NonNls private static final String SUPPORT_ID = "python";
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getId() {
|
||||
return SUPPORT_ID;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Class[] getPatternClasses() {
|
||||
return new Class[] { PythonPatterns.class };
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean useDefaultInjector(PsiElement host) {
|
||||
return host instanceof PyElement;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user