public VariableNotAssignedInspection(RubberduckParserState state) : base(state) { }
protected override IQuickFix QuickFix(RubberduckParserState state) { return(new ReplaceObsoleteCommentMarkerQuickFix()); }
public SpecifyExplicitPublicModifierQuickFix(RubberduckParserState state) : base(typeof(ImplicitPublicMemberInspection)) { _state = state; }
public static IEnumerable <Declaration> GetTestModules(this RubberduckParserState state) { return(state.AllUserDeclarations.Where(item => item.DeclarationType == DeclarationType.ProceduralModule && item.Annotations.Any(pta => pta.Annotation is TestModuleAnnotation))); }
public CodePaneRefactorRenameCommand(IVBE vbe, RubberduckParserState state, IMessageBox messageBox) : base(vbe) { _state = state; _messageBox = messageBox; }
public static IEnumerable <TestMethod> GetAllTests(RubberduckParserState state) { return(GetTestModuleProcedures(state) .Where(item => IsTestMethod(state, item)) .Select(item => new TestMethod(item))); }
public static bool IsTestMethod(RubberduckParserState state, Declaration item) { return(!state.AllUserDeclarations.Any(d => d.DeclarationType == DeclarationType.Parameter && Equals(d.ParentScopeDeclaration, item)) && item.Annotations.Any(pta => pta.Annotation is TestMethodAnnotation)); }
public OptionBaseZeroInspection(RubberduckParserState state) : base(state, CodeInspectionSeverity.Hint) { }
public ObsoleteTypeHintInspection(RubberduckParserState state) : base(state, CodeInspectionSeverity.Suggestion) { }
public override bool EvaluateCanExecute(RubberduckParserState state) { return(state != null && state.Status >= ParserState.ResolvedDeclarations && state.Status < ParserState.Error); }
protected override IInspection InspectionUnderTest(RubberduckParserState state) { return(new OnLocalErrorInspection(state)); }
public ImplicitVariantReturnTypeInspection(RubberduckParserState state) : base(state) { }
public ImplicitActiveSheetReferenceInspection(VBE vbe, RubberduckParserState state) : base(state) { _hostApp = vbe.HostApplication(); }
public static IEnumerable <Declaration> FindTestInitializeMethods(QualifiedModuleName module, RubberduckParserState state) { return(GetTestModuleProcedures(state) .Where(m => m.QualifiedName.QualifiedModuleName == module && m.Annotations.Any(a => a.AnnotationType == AnnotationType.TestInitialize))); }
public SetExplicitVariantReturnTypeQuickFix(RubberduckParserState state) : base(typeof(ImplicitVariantReturnTypeInspection)) { _state = state; }
public IllegalAnnotationInspection(RubberduckParserState state) : base(state, CodeInspectionSeverity.Error) { Listener = new IllegalAttributeAnnotationsListener(state); }
public override bool EvaluateCanExecute(RubberduckParserState state) { return(state != null && Command.CanExecute(null)); }
public IllegalAttributeAnnotationsListener(RubberduckParserState state) { _state = state; }
public static IEnumerable <TestMethod> GetTests(IVBE vbe, IVBComponent component, RubberduckParserState state) { if (component == null || component.IsWrappingNullReference) { return(Enumerable.Empty <TestMethod>()); } // apparently, sometimes it thinks the components are different but knows the modules are the same // if the modules are the same, then the component is the same as far as we are concerned return(GetAllTests(state) .Where(test => state.ProjectsProvider.Component(test.Declaration).HasEqualCodeModule(component))); }
public ProjectExplorerRefactorRenameCommand(IVBE vbe, RubberduckParserState state, IMessageBox msgBox) : base(vbe) { _state = state; _msgBox = msgBox; }
public static IEnumerable <Declaration> FindTestCleanupMethods(QualifiedModuleName module, RubberduckParserState state) { return(GetTestModuleProcedures(state) .Where(m => m.QualifiedName.QualifiedModuleName == module && m.Annotations.Any(pta => pta.Annotation is TestCleanupAnnotation))); }
public OptionExplicitInspection(RubberduckParserState state) : base(state) { Listener = new MissingOptionExplicitListener(); }
public ParameterCanBeByValInspectionResult(IInspection inspection, RubberduckParserState state, Declaration target, ParserRuleContext context, QualifiedMemberName qualifiedName) : base(inspection, qualifiedName.QualifiedModuleName, context, target) { _state = state; }
public EncapsulateFieldPresenterFactory(IVBE vbe, RubberduckParserState state, IRefactoringDialog <EncapsulateFieldViewModel> view) { _vbe = vbe; _view = view; _state = state; }
public EmptyIfBlockInspection(RubberduckParserState state) : base(state, CodeInspectionSeverity.DoNotShow) { }
public EncapsulatePublicFieldInspection(RubberduckParserState state) : base(state, CodeInspectionSeverity.Suggestion) { _wrapperFactory = new CodePaneWrapperFactory(); }
private ToDoExplorerViewModel ArrangeViewModel(RubberduckParserState state, IConfigurationService <Configuration> configService) { return(new ToDoExplorerViewModel(state, configService, null, GetMockedUiDispatcher(), null)); }
public ParameterNotUsedInspection(RubberduckParserState state) : base(state) { }
public async Task <IEnumerable <IInspectionResult> > FindIssuesAsync(RubberduckParserState state, CancellationToken token) { if (state == null || !state.AllUserDeclarations.Any()) { return(new IInspectionResult[] { }); } token.ThrowIfCancellationRequested(); state.OnStatusMessageUpdate(RubberduckUI.CodeInspections_Inspecting); var allIssues = new ConcurrentBag <IInspectionResult>(); token.ThrowIfCancellationRequested(); var config = _configService.Read(); UpdateInspectionSeverity(config); token.ThrowIfCancellationRequested(); var parseTreeInspections = _inspections .Where(inspection => inspection.Severity != CodeInspectionSeverity.DoNotShow) .OfType <IParseTreeInspection>() .ToArray(); token.ThrowIfCancellationRequested(); foreach (var listener in parseTreeInspections.Select(inspection => inspection.Listener)) { listener.ClearContexts(); } // Prepare ParseTreeWalker based inspections var passes = Enum.GetValues(typeof(CodeKind)).Cast <CodeKind>(); foreach (var parsePass in passes) { try { WalkTrees(config, state, parseTreeInspections.Where(i => i.TargetKindOfCode == parsePass), parsePass); } catch (Exception e) { LogManager.GetCurrentClassLogger().Warn(e); } } token.ThrowIfCancellationRequested(); var inspectionsToRun = _inspections.Where(inspection => inspection.Severity != CodeInspectionSeverity.DoNotShow && RequiredLibrariesArePresent(inspection, state) && RequiredHostIsPresent(inspection)); token.ThrowIfCancellationRequested(); try { await Task.Run(() => RunInspectionsInParallel(inspectionsToRun, allIssues, token)); } catch (AggregateException exception) { if (exception.Flatten().InnerExceptions.All(ex => ex is OperationCanceledException)) { //This eliminates the stack trace, but for the cancellation, this is irrelevant. throw exception.InnerException ?? exception; } LogManager.GetCurrentClassLogger().Error(exception); } catch (OperationCanceledException) { throw; } catch (Exception e) { LogManager.GetCurrentClassLogger().Error(e); } // should be "Ready" state.OnStatusMessageUpdate(RubberduckUI.ResourceManager.GetString("ParserState_" + state.Status, CultureInfo.CurrentUICulture)); return(allIssues); }
public UnderscoreInPublicClassModuleMemberInspection(RubberduckParserState state) : base(state) { }