getErrors method

Future<ErrorsResult> getErrors(
  1. String? file
)

Return the errors associated with the given file. If the errors for the given file have not yet been computed, or the most recently computed errors for the given file are out of date, then the response for this request will be delayed until they have been computed. If some or all of the errors for the file cannot be computed, then the subset of the errors that can be computed will be returned and the response will contain an error to indicate why the errors could not be computed. If the content of the file changes after this request was received but before a response could be sent, then an error of type CONTENT_MODIFIED will be generated.

This request is intended to be used by clients that cannot asynchronously apply updated error information. Clients that can apply error information as it becomes available should use the information provided by the 'analysis.errors' notification.

If a request is made for a file which does not exist, or which is not currently subject to analysis (e.g. because it is not associated with any analysis root specified to analysis.setAnalysisRoots), an error of type GET_ERRORS_INVALID_FILE will be generated.

Implementation

Future<ErrorsResult> getErrors(String? file) {
  final Map m = {'file': file};
  return _call('analysis.getErrors', m).then(ErrorsResult.parse);
}