本文整理汇总了Java中com.intellij.psi.augment.PsiAugmentProvider类的典型用法代码示例。如果您正苦于以下问题:Java PsiAugmentProvider类的具体用法?Java PsiAugmentProvider怎么用?Java PsiAugmentProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PsiAugmentProvider类属于com.intellij.psi.augment包,在下文中一共展示了PsiAugmentProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getAnnotations
import com.intellij.psi.augment.PsiAugmentProvider; //导入依赖的package包/类
@Override
@NotNull
public PsiAnnotation[] getAnnotations() {
final PsiAnnotation[] own = getStubOrPsiChildren(JavaStubElementTypes.ANNOTATION, PsiAnnotation.ARRAY_FACTORY);
final List<PsiAnnotation> ext = PsiAugmentProvider.collectAugments(this, PsiAnnotation.class);
return ArrayUtil.mergeArrayAndCollection(own, ext, PsiAnnotation.ARRAY_FACTORY);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:PsiModifierListImpl.java
示例2: JavaCoreApplicationEnvironment
import com.intellij.psi.augment.PsiAugmentProvider; //导入依赖的package包/类
public JavaCoreApplicationEnvironment(Disposable parentDisposable) {
super(parentDisposable);
registerFileType(JavaClassFileType.INSTANCE, "class");
registerFileType(JavaFileType.INSTANCE, "java");
registerFileType(ArchiveFileType.INSTANCE, "jar;zip");
addExplicitExtension(FileTypeFileViewProviders.INSTANCE, JavaClassFileType.INSTANCE, new ClassFileViewProviderFactory());
addExplicitExtension(BinaryFileStubBuilders.INSTANCE, JavaClassFileType.INSTANCE, new ClassFileStubBuilder());
addExplicitExtension(LanguageASTFactory.INSTANCE, JavaLanguage.INSTANCE, new CoreJavaASTFactory());
addExplicitExtension(LanguageParserDefinitions.INSTANCE, JavaLanguage.INSTANCE, new JavaParserDefinition());
addExplicitExtension(LanguageConstantExpressionEvaluator.INSTANCE, JavaLanguage.INSTANCE, new PsiExpressionEvaluator());
registerExtensionPoint(Extensions.getRootArea(), ClsStubBuilderFactory.EP_NAME, ClsStubBuilderFactory.class);
registerExtensionPoint(Extensions.getRootArea(), PsiAugmentProvider.EP_NAME, PsiAugmentProvider.class);
registerExtensionPoint(Extensions.getRootArea(), JavaMainMethodProvider.EP_NAME, JavaMainMethodProvider.class);
addExtension(ClsStubBuilderFactory.EP_NAME, new DefaultClsStubBuilderFactory());
myApplication.registerService(PsiPackageImplementationHelper.class, new CorePsiPackageImplementationHelper());
myApplication.registerService(EmptySubstitutor.class, new EmptySubstitutorImpl());
myApplication.registerService(JavaDirectoryService.class, createJavaDirectoryService());
myApplication.registerService(JavaVersionService.class, new JavaVersionService());
addExplicitExtension(ItemPresentationProviders.INSTANCE, PsiPackage.class, new PackagePresentationProvider());
addExplicitExtension(ItemPresentationProviders.INSTANCE, PsiClass.class, new ClassPresentationProvider());
addExplicitExtension(ItemPresentationProviders.INSTANCE, PsiMethod.class, new MethodPresentationProvider());
addExplicitExtension(ItemPresentationProviders.INSTANCE, PsiField.class, new FieldPresentationProvider());
addExplicitExtension(ItemPresentationProviders.INSTANCE, PsiLocalVariable.class, new VariablePresentationProvider());
addExplicitExtension(ItemPresentationProviders.INSTANCE, PsiParameter.class, new VariablePresentationProvider());
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:33,代码来源:JavaCoreApplicationEnvironment.java
示例3: calcModifiers
import com.intellij.psi.augment.PsiAugmentProvider; //导入依赖的package包/类
private ModifierCache calcModifiers()
{
Set<String> modifiers = calcExplicitModifiers();
modifiers.addAll(calcImplicitModifiers(modifiers));
if(!modifiers.contains(PUBLIC) && !modifiers.contains(PROTECTED) && !modifiers.contains(PRIVATE))
{
modifiers.add(PACKAGE_LOCAL);
}
PsiFile file = getContainingFile();
return new ModifierCache(file, PsiAugmentProvider.transformModifierProperties(this, file.getProject(), modifiers));
}
开发者ID:consulo,项目名称:consulo-java,代码行数:12,代码来源:PsiModifierListImpl.java
示例4: getAnnotations
import com.intellij.psi.augment.PsiAugmentProvider; //导入依赖的package包/类
@Override
@NotNull
public PsiAnnotation[] getAnnotations()
{
final PsiAnnotation[] own = getStubOrPsiChildren(JavaStubElementTypes.ANNOTATION, PsiAnnotation.ARRAY_FACTORY);
final List<PsiAnnotation> ext = PsiAugmentProvider.collectAugments(this, PsiAnnotation.class);
return ArrayUtil.mergeArrayAndCollection(own, ext, PsiAnnotation.ARRAY_FACTORY);
}
开发者ID:consulo,项目名称:consulo-java,代码行数:9,代码来源:PsiModifierListImpl.java
示例5: getAllFields
import com.intellij.psi.augment.PsiAugmentProvider; //导入依赖的package包/类
@NotNull
private PsiField[] getAllFields()
{
List<PsiField> own = myClass.getOwnFields();
List<PsiField> ext = PsiAugmentProvider.collectAugments(myClass, PsiField.class);
return ArrayUtil.mergeCollections(own, ext, PsiField.ARRAY_FACTORY);
}
开发者ID:consulo,项目名称:consulo-java,代码行数:8,代码来源:ClassInnerStuffCache.java
示例6: getAllMethods
import com.intellij.psi.augment.PsiAugmentProvider; //导入依赖的package包/类
@NotNull
private PsiMethod[] getAllMethods()
{
List<PsiMethod> own = myClass.getOwnMethods();
List<PsiMethod> ext = PsiAugmentProvider.collectAugments(myClass, PsiMethod.class);
return ArrayUtil.mergeCollections(own, ext, PsiMethod.ARRAY_FACTORY);
}
开发者ID:consulo,项目名称:consulo-java,代码行数:8,代码来源:ClassInnerStuffCache.java
示例7: getAllInnerClasses
import com.intellij.psi.augment.PsiAugmentProvider; //导入依赖的package包/类
@NotNull
private PsiClass[] getAllInnerClasses()
{
List<PsiClass> own = myClass.getOwnInnerClasses();
List<PsiClass> ext = PsiAugmentProvider.collectAugments(myClass, PsiClass.class);
return ArrayUtil.mergeCollections(own, ext, PsiClass.ARRAY_FACTORY);
}
开发者ID:consulo,项目名称:consulo-java,代码行数:8,代码来源:ClassInnerStuffCache.java
示例8: JavaCoreApplicationEnvironment
import com.intellij.psi.augment.PsiAugmentProvider; //导入依赖的package包/类
public JavaCoreApplicationEnvironment(Disposable parentDisposable) {
super(parentDisposable);
registerFileType(JavaClassFileType.INSTANCE, "class");
registerFileType(JavaFileType.INSTANCE, "java");
registerFileType(JarArchiveFileType.INSTANCE, "jar");
addExplicitExtension(FileTypeFileViewProviders.INSTANCE, JavaClassFileType.INSTANCE, new ClassFileViewProviderFactory());
addExplicitExtension(BinaryFileStubBuilders.INSTANCE, JavaClassFileType.INSTANCE, new ClassFileStubBuilder());
addExplicitExtension(LanguageParserDefinitions.INSTANCE, JavaLanguage.INSTANCE, new JavaParserDefinition());
addExplicitExtension(LanguageConstantExpressionEvaluator.INSTANCE, JavaLanguage.INSTANCE, new PsiExpressionEvaluator());
registerExtensionPoint(Extensions.getRootArea(), PsiAugmentProvider.EP_NAME, PsiAugmentProvider.class);
registerExtensionPoint(Extensions.getRootArea(), JavaMainMethodProvider.EP_NAME, JavaMainMethodProvider.class);
myApplication.registerService(PsiPackageImplementationHelper.class, new CorePsiPackageImplementationHelper());
myApplication.registerService(EmptySubstitutor.class, new EmptySubstitutorImpl());
myApplication.registerService(JavaDirectoryService.class, createJavaDirectoryService());
myApplication.registerService(JavaVersionService.class, new JavaVersionService());
addExplicitExtension(ItemPresentationProviders.INSTANCE, PsiJavaPackage.class, new PackagePresentationProvider());
addExplicitExtension(ItemPresentationProviders.INSTANCE, PsiClass.class, new ClassPresentationProvider());
addExplicitExtension(ItemPresentationProviders.INSTANCE, PsiMethod.class, new MethodPresentationProvider());
addExplicitExtension(ItemPresentationProviders.INSTANCE, PsiField.class, new FieldPresentationProvider());
addExplicitExtension(ItemPresentationProviders.INSTANCE, PsiLocalVariable.class, new VariablePresentationProvider());
addExplicitExtension(ItemPresentationProviders.INSTANCE, PsiParameter.class, new VariablePresentationProvider());
}
开发者ID:consulo,项目名称:consulo-java,代码行数:30,代码来源:JavaCoreApplicationEnvironment.java
示例9: getAllFields
import com.intellij.psi.augment.PsiAugmentProvider; //导入依赖的package包/类
@NotNull
private PsiField[] getAllFields() {
List<PsiField> own = myClass.getOwnFields();
List<PsiField> ext = PsiAugmentProvider.collectAugments(myClass, PsiField.class);
return ArrayUtil.mergeCollections(own, ext, PsiField.ARRAY_FACTORY);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:ClassInnerStuffCache.java
示例10: getAllMethods
import com.intellij.psi.augment.PsiAugmentProvider; //导入依赖的package包/类
@NotNull
private PsiMethod[] getAllMethods() {
List<PsiMethod> own = myClass.getOwnMethods();
List<PsiMethod> ext = PsiAugmentProvider.collectAugments(myClass, PsiMethod.class);
return ArrayUtil.mergeCollections(own, ext, PsiMethod.ARRAY_FACTORY);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:ClassInnerStuffCache.java
示例11: getAllInnerClasses
import com.intellij.psi.augment.PsiAugmentProvider; //导入依赖的package包/类
@NotNull
private PsiClass[] getAllInnerClasses() {
List<PsiClass> own = myClass.getOwnInnerClasses();
List<PsiClass> ext = PsiAugmentProvider.collectAugments(myClass, PsiClass.class);
return ArrayUtil.mergeCollections(own, ext, PsiClass.ARRAY_FACTORY);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:ClassInnerStuffCache.java
示例12: testLombokVal
import com.intellij.psi.augment.PsiAugmentProvider; //导入依赖的package包/类
public void testLombokVal() {
PlatformTestUtil.registerExtension(PsiAugmentProvider.EP_NAME, new PsiAugmentProvider() {
@NotNull
@Override
public <Psi extends PsiElement> List<Psi> getAugments(@NotNull PsiElement element, @NotNull Class<Psi> type) {
return Collections.<Psi>emptyList();
}
@Nullable
@Override
protected PsiType inferType(PsiTypeElement typeElement) {
final PsiElement parent = typeElement.getParent();
if (parent instanceof PsiLocalVariable && ((PsiLocalVariable)parent).getInitializer() != null ||
parent instanceof PsiParameter && ((PsiParameter)parent).getDeclarationScope() instanceof PsiForeachStatement) {
final String text = typeElement.getText();
if (LOMBOK_VAL_SHORT_NAME.equals(text) || LOMBOK_VAL_FQN.equals(text)) {
final PsiJavaCodeReferenceElement referenceElement = typeElement.getInnermostComponentReferenceElement();
if (referenceElement != null) {
final PsiElement resolve = referenceElement.resolve();
if (resolve instanceof PsiClass) {
if (parent instanceof PsiLocalVariable) {
final PsiExpression initializer = ((PsiVariable)parent).getInitializer();
assertNotNull(initializer);
final PsiType initializerType = initializer.getType();
if (initializer instanceof PsiNewExpression) {
final PsiJavaCodeReferenceElement reference = ((PsiNewExpression)initializer).getClassOrAnonymousClassReference();
if (reference != null) {
final PsiReferenceParameterList parameterList = reference.getParameterList();
if (parameterList != null) {
final PsiTypeElement[] elements = parameterList.getTypeParameterElements();
if (elements.length == 1 && elements[0].getType() instanceof PsiDiamondType) {
return TypeConversionUtil.erasure(initializerType);
}
}
}
}
return initializerType;
}
final PsiForeachStatement foreachStatement = (PsiForeachStatement)((PsiParameter)parent).getDeclarationScope();
assertNotNull(foreachStatement);
final PsiExpression iteratedValue = foreachStatement.getIteratedValue();
if (iteratedValue != null) {
return JavaGenericsUtil.getCollectionItemType(iteratedValue);
}
}
}
}
}
return null;
}
}, myTestRootDisposable);
myFixture.addClass("package lombok; public @interface val{}");
myFixture.testHighlighting(false, false, false, getTestName(false) + ".java");
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:55,代码来源:PsiAugmentProviderTest.java
示例13: getAllFields
import com.intellij.psi.augment.PsiAugmentProvider; //导入依赖的package包/类
private PsiField[] getAllFields() {
final List<PsiField> own = myClass.getOwnFields();
final List<PsiField> ext = PsiAugmentProvider.collectAugments(myClass, PsiField.class);
return ArrayUtil.mergeCollections(own, ext, PsiField.ARRAY_FACTORY);
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:6,代码来源:ClassInnerStuffCache.java
示例14: getAllMethods
import com.intellij.psi.augment.PsiAugmentProvider; //导入依赖的package包/类
private PsiMethod[] getAllMethods() {
final List<PsiMethod> own = myClass.getOwnMethods();
final List<PsiMethod> ext = PsiAugmentProvider.collectAugments(myClass, PsiMethod.class);
return ArrayUtil.mergeCollections(own, ext, PsiMethod.ARRAY_FACTORY);
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:6,代码来源:ClassInnerStuffCache.java
示例15: getAllInnerClasses
import com.intellij.psi.augment.PsiAugmentProvider; //导入依赖的package包/类
private PsiClass[] getAllInnerClasses() {
final List<PsiClass> own = myClass.getOwnInnerClasses();
final List<PsiClass> ext = PsiAugmentProvider.collectAugments(myClass, PsiClass.class);
return ArrayUtil.mergeCollections(own, ext, PsiClass.ARRAY_FACTORY);
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:6,代码来源:ClassInnerStuffCache.java
注:本文中的com.intellij.psi.augment.PsiAugmentProvider类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论