register method

  1. @override
void register(
  1. PluginRegistry registry
)
override

Registers analysis rules, quick fixes, and assists.

Implementation

@override
void register(PluginRegistry registry) {
  registry.registerWarningRule(MissingThrowsAnnotation());
  registry.registerFixForRule(
    MissingThrowsAnnotation.code,
    MissingThrowsAnnotationFix.new,
  );

  registry.registerWarningRule(NoTryCatch());
  registry.registerFixForRule(
    NoTryCatch.code,
    NoTryCatchWithDefaultFix.new,
  );
  registry.registerFixForRule(
    NoTryCatch.code,
    NoTryCatchFix.new,
  );
  registry.registerFixForRule(NoTryCatch.code, AddAwaitFix.new);
  registry.registerFixForRule(NoTryCatch.code, AnnotateCallerFix.new);
  registry.registerFixForRule(
    NoTryCatch.code,
    AddToThrowsAnnotationFix.new,
  );

  registry.registerWarningRule(NotExhaustiveTryCatch());
  registry.registerFixForRule(
    NotExhaustiveTryCatch.code,
    NotExhaustiveTryCatchDefaultFix.new,
  );
  registry.registerFixForRule(
    NotExhaustiveTryCatch.code,
    NotExhaustiveTryCatchFix.new,
  );
  registry.registerFixForRule(
    NotExhaustiveTryCatch.code,
    AddToThrowsAnnotationFix.new,
  );

  registry.registerWarningRule(ThrowsAnnotationMismatch());
  registry.registerFixForRule(
    ThrowsAnnotationMismatch.code,
    ThrowsAnnotationMismatchFix.new,
  );

  registry.registerWarningRule(IntroducedThrowsInOverride());
  registry.registerFixForRule(
    IntroducedThrowsInOverride.code,
    AddToOverriddenThrowsFix.new,
  );
  registry.registerFixForRule(
    IntroducedThrowsInOverride.code,
    NoTryCatchFix.new,
  );

  registry.registerWarningRule(UnusedThrowsAnnotation());
  registry.registerFixForRule(
    UnusedThrowsAnnotation.code,
    UnusedThrowsAnnotationFix.new,
  );

  registry.registerAssist(AddThrowsAnnotationAssist.new);
  registry.registerAssist(AddEmptyThrowsAnnotationAssist.new);
  registry.registerAssist(SpecifyThrowsErrorsAssist.new);
}