@@ -928,24 +928,32 @@ impl Application {
928928 Call::MethodCall(helix_lsp::jsonrpc::MethodCall {
929929 method, params, id, ..
930930 }) => {
931− let call = match MethodCall::parse(&method, params) {
932− Ok(call) => call,
931+ let reply = match MethodCall::parse(&method, params) {
933932 Err(helix_lsp::Error::Unhandled) => {
934− error!("Language Server: Method not found {}", method);
935− return;
933+ error!(
934+ "Language Server: Method {} not found in request {}",
935+ method, id
936+ );
937+ Err(helix_lsp::jsonrpc::Error {
938+ code: helix_lsp::jsonrpc::ErrorCode::MethodNotFound,
939+ message: format!("Method not found: {}", method),
940+ data: None,
941+ })
936942 }
937943 Err(err) => {
938944 log::error!(
939− "received malformed method call from Language Server: {}: {}",
945+ "Language Server: Received malformed method call {} in request {}: {}",
940946 method,
947+ id,
941948 err
942949 );
943− return;
950+ Err(helix_lsp::jsonrpc::Error {
951+ code: helix_lsp::jsonrpc::ErrorCode::ParseError,
952+ message: format!("Malformed method call: {}", method),
953+ data: None,
954+ })
944955 }
945− };
946−
947− let reply = match call {
948− MethodCall::WorkDoneProgressCreate(params) => {
956+ Ok(MethodCall::WorkDoneProgressCreate(params)) => {
949957 self.lsp_progress.create(server_id, params.token);
950958
951959 let editor_view = self
@@ -959,7 +967,7 @@ impl Application {
959967
960968 Ok(serde_json::Value::Null)
961969 }
962− MethodCall::ApplyWorkspaceEdit(params) => {
970+ Ok(MethodCall::ApplyWorkspaceEdit(params)) => {
963971 apply_workspace_edit(
964972 &mut self.editor,
965973 helix_lsp::OffsetEncoding::Utf8,
@@ -972,13 +980,13 @@ impl Application {
972980 failed_change: None,
973981 }))
974982 }
975− MethodCall::WorkspaceFolders => {
983+ Ok(MethodCall::WorkspaceFolders) => {
976984 let language_server =
977985 self.editor.language_servers.get_by_id(server_id).unwrap();
978986
979987 Ok(json!(language_server.workspace_folders()))
980988 }
981− MethodCall::WorkspaceConfiguration(params) => {
989+ Ok(MethodCall::WorkspaceConfiguration(params)) => {
982990 let result: Vec<_> = params
983991 .items
984992 .iter()