@@ -928,24 +928,32 @@ impl Application {
928 Call::MethodCall(helix_lsp::jsonrpc::MethodCall {
928 Call::MethodCall(helix_lsp::jsonrpc::MethodCall {
929 method, params, id, ..
929 method, params, id, ..
931− let call = match MethodCall::parse(&method, params) {
931+ let reply = match MethodCall::parse(&method, params) {
933 Err(helix_lsp::Error::Unhandled) => {
932 Err(helix_lsp::Error::Unhandled) => {
934− error!("Language Server: Method not found {}", method);
934+ "Language Server: Method {} not found in request {}",
935− return;
935+ method, id
937+ Err(helix_lsp::jsonrpc::Error {
938+ code: helix_lsp::jsonrpc::ErrorCode::MethodNotFound,
939+ message: format!("Method not found: {}", method),
937 Err(err) => {
943 Err(err) => {
938 log::error!(
944 log::error!(
939− "received malformed method call from Language Server: {}: {}",
945+ "Language Server: Received malformed method call {} in request {}: {}",
943− return;
950+ Err(helix_lsp::jsonrpc::Error {
951+ code: helix_lsp::jsonrpc::ErrorCode::ParseError,
952+ message: format!("Malformed method call: {}", method),
947− let reply = match call {
948− MethodCall::WorkDoneProgressCreate(params) => {
956+ Ok(MethodCall::WorkDoneProgressCreate(params)) => {
949 self.lsp_progress.create(server_id, params.token);
957 self.lsp_progress.create(server_id, params.token);
951 let editor_view = self
959 let editor_view = self
@@ -959,7 +967,7 @@ impl Application {
960 Ok(serde_json::Value::Null)
968 Ok(serde_json::Value::Null)
962− MethodCall::ApplyWorkspaceEdit(params) => {
970+ Ok(MethodCall::ApplyWorkspaceEdit(params)) => {
963 apply_workspace_edit(
971 apply_workspace_edit(
964 &mut self.editor,
972 &mut self.editor,
965 helix_lsp::OffsetEncoding::Utf8,
973 helix_lsp::OffsetEncoding::Utf8,
@@ -972,13 +980,13 @@ impl Application {
972 failed_change: None,
980 failed_change: None,
975− MethodCall::WorkspaceFolders => {
983+ Ok(MethodCall::WorkspaceFolders) => {
976 let language_server =
984 let language_server =
977 self.editor.language_servers.get_by_id(server_id).unwrap();
985 self.editor.language_servers.get_by_id(server_id).unwrap();
979 Ok(json!(language_server.workspace_folders()))
987 Ok(json!(language_server.workspace_folders()))
981− MethodCall::WorkspaceConfiguration(params) => {
989+ Ok(MethodCall::WorkspaceConfiguration(params)) => {
982 let result: Vec<_> = params
990 let result: Vec<_> = params