Remove outdated diagnostics check (#1106)

This commit is contained in:
Auguste Rame 2023-04-03 13:42:22 -04:00 committed by GitHub
parent b970dd20a3
commit ace6d7f32b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -754,8 +754,7 @@ fn handleConfiguration(server: *Server, json: std.json.Value) error{OutOfMemory}
fn openDocumentHandler(server: *Server, notification: types.DidOpenTextDocumentParams) Error!void { fn openDocumentHandler(server: *Server, notification: types.DidOpenTextDocumentParams) Error!void {
const handle = try server.document_store.openDocument(notification.textDocument.uri, try server.document_store.allocator.dupeZ(u8, notification.textDocument.text)); const handle = try server.document_store.openDocument(notification.textDocument.uri, try server.document_store.allocator.dupeZ(u8, notification.textDocument.text));
if (server.client_capabilities.supports_publish_diagnostics) blk: { if (server.client_capabilities.supports_publish_diagnostics) {
if (!std.process.can_spawn) break :blk;
const diagnostics = try diagnostics_gen.generateDiagnostics(server, handle); const diagnostics = try diagnostics_gen.generateDiagnostics(server, handle);
server.sendNotification("textDocument/publishDiagnostics", diagnostics); server.sendNotification("textDocument/publishDiagnostics", diagnostics);
} }
@ -771,8 +770,7 @@ fn changeDocumentHandler(server: *Server, notification: types.DidChangeTextDocum
try server.document_store.refreshDocument(handle.uri, new_text); try server.document_store.refreshDocument(handle.uri, new_text);
if (server.client_capabilities.supports_publish_diagnostics) blk: { if (server.client_capabilities.supports_publish_diagnostics) {
if (!std.process.can_spawn) break :blk;
const diagnostics = try diagnostics_gen.generateDiagnostics(server, handle.*); const diagnostics = try diagnostics_gen.generateDiagnostics(server, handle.*);
server.sendNotification("textDocument/publishDiagnostics", diagnostics); server.sendNotification("textDocument/publishDiagnostics", diagnostics);
} }
@ -913,8 +911,7 @@ pub fn hoverHandler(server: *Server, request: types.HoverParams) Error!?types.Ho
const response = hover_handler.hover(server, source_index, handle); const response = hover_handler.hover(server, source_index, handle);
// TODO: Figure out a better solution for comptime interpreter diags // TODO: Figure out a better solution for comptime interpreter diags
if (server.client_capabilities.supports_publish_diagnostics) blk: { if (server.client_capabilities.supports_publish_diagnostics) {
if (!std.process.can_spawn) break :blk;
const diagnostics = try diagnostics_gen.generateDiagnostics(server, handle.*); const diagnostics = try diagnostics_gen.generateDiagnostics(server, handle.*);
server.sendNotification("textDocument/publishDiagnostics", diagnostics); server.sendNotification("textDocument/publishDiagnostics", diagnostics);
} }