コード例 #1
0
        /// <summary>
        /// Gets the actions for changing the highlight options for StyleCop rules.
        /// </summary>
        /// <param name="highlighting">
        /// The current highlighting.
        /// </param>
        /// <param name="solution">
        /// The solution.
        /// </param>
        /// <param name="highlightingRange">
        /// The current highlighting range.
        /// </param>
        /// <param name="sourceFile">
        /// The file.
        /// </param>
        /// <returns>
        /// The available actions.
        /// </returns>
        public IEnumerable <JB::JetBrains.Util.Pair <IBulbAction, BulbMenuItemViewDescription> > GetActions(
            IHighlighting highlighting, ISolution solution, DocumentRange highlightingRange, IPsiSourceFile sourceFile)
        {
            StyleCopHighlightingBase violation = highlighting as StyleCopHighlightingBase;

            if (violation == null)
            {
                yield break;
            }

            string ruleId      = violation.CheckId;
            string highlightId = HighlightingRegistering.GetHighlightID(ruleId);

            ChangeStyleCopRuleAction changeStyleCopRuleAction = new ChangeStyleCopRuleAction(
                this.highlightingSettingsManager, this.settingsStore, highlightId, this.commonIconsComponent)
            {
                Text =
                    "Inspection Options for \"" + violation.ToolTip
                    + "\""
            };

            yield return
                (JB::JetBrains.Util.Pair.Of <IBulbAction, BulbMenuItemViewDescription>(
                     changeStyleCopRuleAction,
                     new BulbMenuItemViewDescription(AnchorsForConfigureHighlightingSubmenu.ConfigureItem, BulbThemedIcons.DisableBulb.Id, changeStyleCopRuleAction.Text)));
        }
コード例 #2
0
        /// <summary>
        /// Gets the actions for changing the highlight options for StyleCop rules.
        /// </summary>
        /// <param name="highlighting">
        /// The current highlighting.
        /// </param>
        /// <param name="highlightingRange">
        /// The current highlighting range.
        /// </param>
        /// <param name="sourceFile">
        /// The file.
        /// </param>
        /// <param name="configureAnchor">The anchor for configuration items</param>
        /// <returns>
        /// The available actions.
        /// </returns>
        public IEnumerable <IntentionAction> GetActions(IHighlighting highlighting, DocumentRange highlightingRange, IPsiSourceFile sourceFile,
                                                        IAnchor configureAnchor)
        {
            StyleCopHighlightingBase violation = highlighting as StyleCopHighlightingBase;

            if (violation == null)
            {
                yield break;
            }

            string ruleId      = violation.CheckId;
            string highlightId = HighlightingRegistering.GetHighlightID(ruleId);

            ChangeStyleCopRuleAction changeStyleCopRuleAction = new ChangeStyleCopRuleAction(
                this.highlightingSettingsManager,
                this.settingsStore,
                highlightId,
                this.commonIconsComponent)
            {
                Text = "Inspection Options for \"" + violation.ToolTip + "\""
            };

            yield return
                (new IntentionAction(changeStyleCopRuleAction, changeStyleCopRuleAction.Text, BulbThemedIcons.ContextAction.Id, IntentionsAnchors.ContextActionsAnchor));
        }
コード例 #3
0
        /// <summary>
        /// Initializes a new instance of the StyleCopQuickFixBase class that can handle <see cref="StyleCopHighlightingBase"/> .
        /// </summary>
        /// <param name="highlight">
        /// <see cref="StyleCopHighlightingBase"/> that has been detected.
        /// </param>
        /// <param name="initialise">
        /// This value is not used, its only purpose is to differentiate the method signature.
        /// </param>
        protected StyleCopQuickFixBase(StyleCopHighlightingBase highlight, bool initialise)
        {
            this.Highlighting = highlight;

            this.InitialiseIfRequired();
        }
コード例 #4
0
 /// <summary>
 /// Initializes a new instance of the SuppressStyleCopQuickFix class that can handle.
 /// </summary>
 /// <param name="highlight">
 /// <see cref="StyleCopHighlightingWarning"/> that has been detected.
 /// </param>
 /// <param name="initialise">
 /// True to initialize.
 /// </param>
 protected SuppressStyleCopQuickFix(StyleCopHighlightingBase highlight, bool initialise)
 {
     this.Highlighting = highlight;
     this.InitialiseBulbItems();
 }
コード例 #5
0
 /// <summary>
 /// Initializes a new instance of the SuppressStyleCopQuickFix class that can handle.
 /// </summary>
 /// <param name="highlight">
 /// <see cref="StyleCopHighlightingBase"/> that has been detected.
 /// </param>
 public SuppressStyleCopQuickFix(StyleCopHighlighting highlight)
 {
     this.highlighting = highlight;
     this.InitialiseBulbItems();
 }
コード例 #6
0
        /// <summary>
        /// Initializes a new instance of the StyleCopQuickFixBase class that can handle <see cref="StyleCopHighlightingBase"/> .
        /// </summary>
        /// <param name="highlight">
        /// <see cref="StyleCopHighlightingBase"/> that has been detected.
        /// </param>
        private StyleCopQuickFixBase(StyleCopHighlightingBase highlight)
        {
            this.Highlighting = highlight;

            this.InitialiseIfRequired();
        }