Esempio 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);
            }
        }
Esempio n. 2
0
 public MoveCostlyInvocationQuickFix(UnityPerformanceInvocationWarning warning) :
     base(warning.InvocationExpression?.GetContainingNode <IClassDeclaration>(), warning.InvocationExpression)
 {
 }
Esempio n. 3
0
 public AddPerformanceAnalysisDisableCommentQuickFix([NotNull] UnityPerformanceInvocationWarning performanceHighlighting)
     : base(performanceHighlighting.InvocationExpression)
 {
 }