don't format files with syntax errors (#766)

* don't format files with syntax errors

* Remove showMessage

Co-authored-by: Auguste Rame <19855629+SuperAuguste@users.noreply.github.com>
This commit is contained in:
Techatrix
2022-11-19 00:49:59 +01:00
committed by GitHub
parent 40167a5b52
commit f09ffb63db

View File

@@ -2098,6 +2098,10 @@ fn formattingHandler(server: *Server, writer: anytype, id: types.RequestId, req:
return try respondGeneric(writer, id, null_result_response);
};
if (handle.tree.errors.len != 0) {
return try respondGeneric(writer, id, null_result_response);
}
const formatted = try handle.tree.render(server.allocator);
defer server.allocator.free(formatted);