public override bool IsAvailable(IUserDataHolder cache) { if (_range == null || !ValidUtils.Valid(_range.First) || !ValidUtils.Valid(_range.Last)) { return(false); } var treeRange = AdjustTreeRange(_range); if (treeRange != null) { return(treeRange.First.Parent == treeRange.Last.Parent); } return(false); }
protected override ICreationTarget GetTarget() { if (!ValidUtils.Valid(Reference)) { return(null); } var node = Reference.GetTreeNode(); var @class = node.GetContainingNode <IClassLikeDeclaration>()?.DeclaredElement; if (@class == null) { return(null); } return(new TypeTarget(@class, node)); }
public IEnumerable <IntentionAction> CreateBulbItems() { var api = myAttribute.GetSolution().GetComponent <UnityApi>(); var typeDeclaration = myAttribute.GetContainingTypeDeclaration(); var field = myAttribute.GetFieldsByAttribute().FirstOrDefault(); if (field == null) { return(EmptyList <IntentionAction> .Enumerable); } if (ValidUtils.Valid(typeDeclaration) && typeDeclaration.DeclaredName != SharedImplUtil.MISSING_DECLARATION_NAME && !api.IsUnityType(typeDeclaration.DeclaredElement) && CouldBeSerializedField(field)) { return(new MakeSerializable(typeDeclaration).ToQuickFixIntentions()); } return(EmptyList <IntentionAction> .Enumerable); }
public override bool IsAvailable(IUserDataHolder cache) { return(ValidUtils.Valid(myMethodDeclaration)); }
public override bool IsAvailable(IUserDataHolder cache) => ValidUtils.Valid(myWarningCreationExpression);
public override bool IsAvailable(IUserDataHolder cache) { return(ValidUtils.Valid(myExpression)); }
public override bool IsAvailable(IUserDataHolder cache) => ValidUtils.Valid(myLiteral);
public override bool IsAvailable(IUserDataHolder cache) { return(ValidUtils.Valid(myInvocationExpression) && (IsExpressionStatement() || IsInvocationInitializer()) && !myExpression.ContainsPreprocessorDirectives()); }
public bool IsAvailable(IUserDataHolder cache) => ValidUtils.Valid(myAttribute);
public override bool IsAvailable(IUserDataHolder cache) { return(myIsValid && ValidUtils.Valid(myLiteral)); }
public override bool IsAvailable(IUserDataHolder cache) { return(myNewArgument != null && ValidUtils.Valid(myInvocation) && ValidUtils.Valid(myNewArgument)); }
public override bool IsAvailable(IUserDataHolder cache) { var treeNode = TryGetContextTreeNode(); return(treeNode != null?ValidUtils.Valid(treeNode) : base.IsAvailable(cache)); }
public override bool IsAvailable(IUserDataHolder cache) => myNewArgument != null && base.IsAvailable(cache) && ValidUtils.Valid(myNewArgument);
public bool IsAvailable(IUserDataHolder cache) => ValidUtils.Valid(myMethodDeclaration);