本文整理汇总了Java中consulo.annotations.RequiredReadAction类的典型用法代码示例。如果您正苦于以下问题:Java RequiredReadAction类的具体用法?Java RequiredReadAction怎么用?Java RequiredReadAction使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RequiredReadAction类属于consulo.annotations包,在下文中一共展示了RequiredReadAction类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAccessModifier
import consulo.annotations.RequiredReadAction; //导入依赖的package包/类
@RequiredReadAction
private static CSharpAccessModifier getAccessModifier(MsilMethodEntry second)
{
if(second.hasModifier(MsilTokens.PRIVATE_KEYWORD))
{
return CSharpAccessModifier.PRIVATE;
}
else if(second.hasModifier(MsilTokens.PUBLIC_KEYWORD))
{
return CSharpAccessModifier.PUBLIC;
}
else if(second.hasModifier(MsilTokens.ASSEMBLY_KEYWORD) && second.hasModifier(MsilTokens.PROTECTED_KEYWORD))
{
return CSharpAccessModifier.PROTECTED_INTERNAL;
}
else if(second.hasModifier(MsilTokens.ASSEMBLY_KEYWORD))
{
return CSharpAccessModifier.INTERNAL;
}
else if(second.hasModifier(MsilTokens.PROTECTED_KEYWORD))
{
return CSharpAccessModifier.PROTECTED;
}
return CSharpAccessModifier.PUBLIC;
}
示例2: MsilPropertyAsCSharpPropertyDeclaration
import consulo.annotations.RequiredReadAction; //导入依赖的package包/类
@RequiredReadAction
public MsilPropertyAsCSharpPropertyDeclaration(PsiElement parent, MsilPropertyEntry variable, List<Pair<DotNetXXXAccessor, MsilMethodEntry>> pairs)
{
super(parent, getAdditionalModifiers(variable, pairs), variable);
myAccessors = buildAccessors(this, pairs);
myTypeForImplementValue = NullableLazyValue.of(() ->
{
String nameFromBytecode = getVariable().getNameFromBytecode();
String typeBeforeDot = StringUtil.getPackageName(nameFromBytecode);
SomeType someType = SomeTypeParser.parseType(typeBeforeDot, nameFromBytecode);
if(someType != null)
{
return new DummyType(getProject(), MsilPropertyAsCSharpPropertyDeclaration.this, someType);
}
return null;
});
}
示例3: MsilMethodAsCSharpLikeMethodDeclaration
import consulo.annotations.RequiredReadAction; //导入依赖的package包/类
@RequiredReadAction
public MsilMethodAsCSharpLikeMethodDeclaration(PsiElement parent, @NotNull CSharpModifier[] modifiers, MsilMethodEntry methodEntry)
{
super(parent, methodEntry);
myModifierList = new MsilModifierListToCSharpModifierList(modifiers, this, methodEntry.getModifierList());
myReturnTypeRefValue = NotNullLazyValue.createValue(() -> MsilToCSharpUtil.extractToCSharp(myOriginal.getReturnTypeRef(), myOriginal));
myParameterTypeRefsValue = NotNullLazyValue.createValue(() ->
{
DotNetTypeRef[] parameters = myOriginal.getParameterTypeRefs();
DotNetTypeRef[] refs = new DotNetTypeRef[parameters.length];
for(int i = 0; i < parameters.length; i++)
{
refs[i] = MsilToCSharpUtil.extractToCSharp(parameters[i], myOriginal);
}
return refs;
});
}
示例4: buildVisitor
import consulo.annotations.RequiredReadAction; //导入依赖的package包/类
@NotNull
@Override
public PsiElementVisitor buildVisitor(@NotNull final ProblemsHolder holder, boolean isOnTheFly)
{
return new CSharpElementVisitor()
{
@Override
@RequiredReadAction
public void visitEmptyStatement(CSharpEmptyStatementImpl statement)
{
PsiElement parent = statement.getParent();
if(parent instanceof CSharpBlockStatementImpl)
{
holder.registerProblem(statement, null, "Unnecessary Semicolon", new RemoveSemicolonFix(statement));
}
}
};
}
示例5: getUsingStatements
import consulo.annotations.RequiredReadAction; //导入依赖的package包/类
@RequiredReadAction
@NotNull
@Override
public CSharpUsingListChild[] getUsingStatements()
{
List<CSharpUsingListChild> listChildren = new SmartList<>();
for(String usingListChild : myUsingNamespaceChildren)
{
GlobalSearchScope resolveScope = myContext.getResolveScope();
DotNetNamespaceAsElement namespace = DotNetPsiSearcher.getInstance(getProject()).findNamespace(usingListChild, resolveScope);
if(namespace != null)
{
listChildren.add(new CSharpLightUsingNamespaceStatementBuilder(namespace, resolveScope));
}
}
return ContainerUtil.toArray(listChildren, CSharpUsingListChild.ARRAY_FACTORY);
}
示例6: checkImpl
import consulo.annotations.RequiredReadAction; //导入依赖的package包/类
@RequiredReadAction
@Nullable
@Override
public HighlightInfoFactory checkImpl(@NotNull CSharpLanguageVersion languageVersion, @NotNull CSharpHighlightContext highlightContext, @NotNull CSharpLocalVariable element)
{
if(element.getInitializer() != null)
{
return null;
}
if(isUnused(element))
{
CompilerCheckBuilder builder = newBuilder(element.getNameIdentifier(), formatElement(element));
if(!(element.getParent() instanceof CSharpForeachStatementImpl))
{
builder.addQuickFix(new DeleteLocalVariable(element));
}
return builder;
}
return null;
}
示例7: isConstant
import consulo.annotations.RequiredReadAction; //导入依赖的package包/类
@RequiredReadAction
@Contract("null -> false")
public static boolean isConstant(@Nullable PsiElement expression)
{
if(expression instanceof CSharpConstantExpressionImpl)
{
return true;
}
if(expression instanceof CSharpPrefixExpressionImpl)
{
return ((CSharpPrefixExpressionImpl) expression).getOperatorElement().getOperatorElementType() == CSharpTokens.MINUS && isConstant(((CSharpPrefixExpressionImpl) expression).getExpression
());
}
return false;
}
示例8: toTypeRefImpl
import consulo.annotations.RequiredReadAction; //导入依赖的package包/类
@RequiredReadAction
@NotNull
@Override
public DotNetTypeRef toTypeRefImpl(boolean resolveFromInitializer)
{
DotNetTypeRef typeRef = toTypeRefImpl0(resolveFromInitializer);
if(hasModifier(CSharpModifier.REF))
{
return new CSharpRefTypeRef(getProject(), CSharpRefTypeRef.Type.ref, typeRef);
}
else if(hasModifier(CSharpModifier.OUT))
{
return new CSharpRefTypeRef(getProject(), CSharpRefTypeRef.Type.out, typeRef);
}
return typeRef;
}
示例9: checkImpl
import consulo.annotations.RequiredReadAction; //导入依赖的package包/类
@RequiredReadAction
@Nullable
@Override
public HighlightInfoFactory checkImpl(@NotNull CSharpLanguageVersion languageVersion, @NotNull CSharpHighlightContext highlightContext, @NotNull CSharpReferenceExpression element)
{
CSharpReferenceExpression.ResolveToKind kind = element.kind();
if(kind == CSharpReferenceExpression.ResolveToKind.TYPE_LIKE || kind == CSharpReferenceExpression.ResolveToKind.THIS)
{
return null;
}
// qualifier of another expression
if(element.getParent() instanceof CSharpReferenceExpression)
{
return null;
}
PsiElement psiElement = element.resolve();
return psiElement instanceof CSharpTypeDeclaration ? newBuilder(element, formatElement(psiElement)) : null;
}
示例10: createHighlightUsagesHandler
import consulo.annotations.RequiredReadAction; //导入依赖的package包/类
@Nullable
@Override
@RequiredReadAction
public HighlightUsagesHandlerBase createHighlightUsagesHandler(Editor editor, PsiFile file)
{
int offset = TargetElementUtil.adjustOffset(file, editor.getDocument(), editor.getCaretModel().getOffset());
PsiElement target = file.findElementAt(offset);
if(target != null && target.getNode().getElementType() == CSharpDocTokenType.XML_NAME)
{
CSharpDocTagImpl docTag = PsiTreeUtil.getParentOfType(target, CSharpDocTagImpl.class);
if(docTag == null)
{
return null;
}
return new CSharpDocTagHighlightUsagesHandler(editor, file, docTag);
}
return null;
}
示例11: resolveResult
import consulo.annotations.RequiredReadAction; //导入依赖的package包/类
@RequiredReadAction
@NotNull
@Override
protected DotNetTypeResolveResult resolveResult()
{
CSharpLightTypeDeclarationBuilder builder = new CSharpLightTypeDeclarationBuilder(myScope);
builder.withParentQName("System");
builder.withName("ArrayImpl[" + CSharpTypeRefPresentationUtil.buildText(myInnerTypeRef, myScope) + "]");
builder.addModifier(DotNetModifier.PUBLIC);
builder.addExtendType(new CSharpTypeRefByQName(myScope, "System.Array"));
if(myDimensions == 0)
{
builder.addExtendType(new CSharpGenericWrapperTypeRef(myScope.getProject(), new CSharpTypeRefByQName(myScope, DotNetTypes.System.Collections.Generic.IEnumerable$1), myInnerTypeRef));
builder.addExtendType(new CSharpGenericWrapperTypeRef(myScope.getProject(), new CSharpTypeRefByQName(myScope, DotNetTypes.System.Collections.Generic.IList$1), myInnerTypeRef));
}
addIndexMethodWithType(DotNetTypes.System.Int32, builder, myScope, myDimensions, myInnerTypeRef);
addIndexMethodWithType(DotNetTypes.System.UInt32, builder, myScope, myDimensions, myInnerTypeRef);
addIndexMethodWithType(DotNetTypes.System.Int64, builder, myScope, myDimensions, myInnerTypeRef);
addIndexMethodWithType(DotNetTypes.System.UInt64, builder, myScope, myDimensions, myInnerTypeRef);
return new ArrayResolveResult(builder, myDimensions, myInnerTypeRef);
}
示例12: getRightExpression
import consulo.annotations.RequiredReadAction; //导入依赖的package包/类
@Nullable
@RequiredReadAction
public DotNetExpression getRightExpression()
{
PsiElement operatorElement = getOperatorElement();
PsiElement nextSibling = operatorElement.getNextSibling();
while(nextSibling != null)
{
if(nextSibling instanceof DotNetExpression)
{
return (DotNetExpression) nextSibling;
}
nextSibling = nextSibling.getNextSibling();
}
return null;
}
示例13: resolveTypeForParameter
import consulo.annotations.RequiredReadAction; //导入依赖的package包/类
@NotNull
@RequiredReadAction
public static DotNetTypeRef resolveTypeForParameter(CSharpLambdaExpressionImpl target, int parameterIndex)
{
CSharpLambdaResolveResult leftTypeRef = resolveLeftLambdaTypeRef(target);
if(leftTypeRef == null)
{
return DotNetTypeRef.ERROR_TYPE;
}
if(leftTypeRef == CSharpUndefinedLambdaResolveResult.INSTANCE)
{
return DotNetTypeRef.UNKNOWN_TYPE;
}
DotNetTypeRef[] leftTypeParameters = leftTypeRef.getParameterTypeRefs();
DotNetTypeRef typeRef = ArrayUtil2.safeGet(leftTypeParameters, parameterIndex);
return ObjectUtil.notNull(typeRef, DotNetTypeRef.ERROR_TYPE);
}
示例14: getParameterName
import consulo.annotations.RequiredReadAction; //导入依赖的package包/类
@RequiredReadAction
private static String getParameterName(DotNetVariable variable)
{
if(variable instanceof DotNetParameter)
{
return variable.getName();
}
String name = variable.getName();
assert name != null;
char ch = name.charAt(0);
if(Character.isUpperCase(ch))
{
return StringUtil.decapitalize(name);
}
else if(ch == '_')
{
return name.substring(1, name.length());
}
return name;
}
示例15: findExtensionMethodGroupByName
import consulo.annotations.RequiredReadAction; //导入依赖的package包/类
@RequiredReadAction
@Nullable
@Override
public CSharpElementGroup<CSharpMethodDeclaration> findExtensionMethodGroupByName(@NotNull String name)
{
Map<String, CSharpElementGroup<PsiElement>> map = myOtherCollectorValue.getValue().toMap();
if(map == null)
{
return null;
}
CSharpElementGroup<PsiElement> elementGroup = map.get(name);
if(elementGroup == null)
{
return null;
}
return filterElementGroupToExtensionGroup(elementGroup);
}