コード例 #1
0
        public AddDiscardAttributeQuickFix(IBurstHighlighting burstHighlighting)
        {
            myMethodDeclaration = burstHighlighting?.Node?.GetContainingNode <IMethodDeclaration>();

            if (myMethodDeclaration != null)
            {
                myBulbAction = new AddDiscardAttributeBulbAction(myMethodDeclaration);
            }
        }
コード例 #2
0
        public IEnumerable <IntentionAction> CreateBulbItems()
        {
            var identifier        = myDataProvider.GetSelectedElement <ITreeNode>() as ICSharpIdentifier;
            var methodDeclaration = MethodDeclarationNavigator.GetByNameIdentifier(identifier);

            if (methodDeclaration == null)
            {
                return(EmptyList <IntentionAction> .Instance);
            }

            if (!UnityCallGraphUtil.IsSweaCompleted(mySwa))
            {
                return(EmptyList <IntentionAction> .Instance);
            }

            var bulbAction     = new AddDiscardAttributeBulbAction(methodDeclaration);
            var processKind    = UnityCallGraphUtil.GetProcessKindForGraph(mySwa);
            var isBurstContext = myBurstContextProvider.HasContext(methodDeclaration, processKind);

            return(isBurstContext
                ? bulbAction.ToContextActionIntentions()
                : EmptyList <IntentionAction> .Instance);
        }