Ejemplo n.º 1
0
        public PerformanceAnalysisDisableByCommentQuickFix(UnityPerformanceInvocationWarning performanceHighlighting)
        {
            var range    = performanceHighlighting.CalculateRange();
            var document = range.Document;
            var solution = document.TryGetSolution();

            if (solution == null)
            {
                return;
            }

            var psiSourceFile = document.GetPsiSourceFile(solution);
            var file          = psiSourceFile?.GetTheOnlyPsiFile(CSharpLanguage.Instance);

            if (file == null)
            {
                return;
            }

            var node = file.FindNodeAt(range);

            myMethodDeclaration = node?.GetContainingNode <IMethodDeclaration>();

            if (myMethodDeclaration != null)
            {
                myBulbAction = new PerformanceAnalysisDisableByCommentBulbAction(myMethodDeclaration);
            }
        }
Ejemplo n.º 2
0
 public MoveCostlyInvocationQuickFix(UnityPerformanceInvocationWarning warning) :
     base(warning.InvocationExpression?.GetContainingNode <IClassDeclaration>(), warning.InvocationExpression)
 {
 }
Ejemplo n.º 3
0
 public AddPerformanceAnalysisDisableCommentQuickFix([NotNull] UnityPerformanceInvocationWarning performanceHighlighting)
     : base(performanceHighlighting.InvocationExpression)
 {
 }