-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
analyzer-technical-debtarea-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.dart-model-analyzer-packageIssues related to package:analyzerIssues related to package:analyzer
Description
In the code review discussions for https://dart-review.googlesource.com/c/sdk/+/445803, some concerns were raised about the nomenclature used. We decided to go ahead with the CL as is, but keep the discussion about nomenclature open and adjust the names later. I'm opening this issue as a place to have the nomenclature discussion. Once we reach a conclusion I'll make a CL changing the names to whatever we agree on.
For reference, the new API for diagnostic reporting looks like this:
diagnosticReporter.report(
diagnosticCode
.withArguments(...) // omitted if diagnostic takes no arguments
.withContextMessages(contextMessages) // may be omitted
.at(astNode),
);
For comparison, the old API looks like this:
diagnosticReporter.atNode(
astNode,
diagnosticCode,
arguments: [...], // omitted if diagnostic takes no arguments
contextMessages: contextMessages, // may be omitted
);
The names introduced in the CL that we might want to reconsider are:
report
: extension method onDiagnosticReporter
that reports a diagnostic using the new APIwithArguments
: getter implemented by some diagnostic codes that allows specifying template arguments.- A suggested alternative was
invoke
, since we might want some of the parameters to be things other than template arguments (e.g. context messages for diagnostics that should always have them).
- A suggested alternative was
LocatableDiagnosticImpl
: type returned bywithArguments
.- A suggested alternative was
DiagnosticCodeCallHasArguments
.
- A suggested alternative was
DiagnosticWithoutArguments
: mixin for diagnostic codes that don't take arguments.- A suggested alternative was
DiagnosticCodeCallNoArguments
.
- A suggested alternative was
LocatableDiagnostic
: interface shared byLocatableDiagnosticImpl
andDiagnosticWithoutArguments
.- A suggested alternative was
DiagnosticCodeCall
.
- A suggested alternative was
withContextMessages
: method onLocatableDiagnostic
that attaches context messages.atOffset
: method onLocatableDiagnostic
that attaches an offset and length.at
: method onLocatableDiagnostic
that attaches an offset and length based on anAstNode
orToken
.LocatedDiagnostic
: type returned byatOffset
andat
, and accepted byreport
.
@scheglov, @bwilkerson, @johnniwinther, @srawlins, what do you think?
Metadata
Metadata
Assignees
Labels
analyzer-technical-debtarea-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.dart-model-analyzer-packageIssues related to package:analyzerIssues related to package:analyzer