parse static method
The index of content, the file at path, and its parse errors, each
with its offset.
Implementation
static ({DartFileIndex index, List<String> errors}) parse(
String path,
String content,
) {
final result = parseString(content: content, throwIfDiagnostics: false);
return (
index: _indexOf(path, result.unit),
errors: [
for (final error in result.errors)
'${error.message} (at ${error.offset})',
],
);
}