use of com.intellij.util.text.SemVer in project intellij-plugins by JetBrains.
the class TsLintLanguageService method parseResults.
@Nullable
private static List<TsLinterError> parseResults(@NotNull JSLanguageServiceAnswer answer, @NotNull String path) {
final JsonObject element = answer.getElement();
final JsonElement error = element.get("error");
if (error != null) {
return Collections.singletonList(new TsLinterError(error.getAsString()));
}
final JsonElement body = parseBody(element);
if (body == null)
return null;
final String version = element.get("version").getAsString();
final SemVer tsLintVersion = SemVer.parseFromText(version);
final boolean isZeroBased = TsLintOutputJsonParser.isVersionZeroBased(tsLintVersion);
final TsLintOutputJsonParser parser = new TsLintOutputJsonParser(path, body, isZeroBased);
return ContainerUtil.newArrayList(parser.getErrors());
}
Aggregations