123456789101112131415161718192021222324252627282930313233343536373839(*
* SPDX-FileCopyrightText: 2024 The Forester Project Contributors AND The RedPRL Development Team
*
* SPDX-License-Identifier: GPL-3.0-or-later OR Apache-2.0 WITH LLVM-exception
*
*)openForester_frontendopenstructmoduleL=Lsp.TypesmoduleRPC=Jsonrpcend(* TODO: set up json conversions for forester config*)letcompute(params:L.DidChangeConfigurationParams.t)=matchparams.settingswith|`Assocxs->beginmatchList.assoc_opt"configuration_file"xswith|Some(`Stringf)->begintryletconfig=Config_parser.parse_forest_config_filefinLsp_state.modify@@funstate->{statewithforest={state.forestwithconfig=config}}with|_->Eio.traceln"failed to parse configuration file"end|_->Eio.traceln"invalid value for configuration_file"(* RPC.Response.Error.raise *)(* ( *)(* RPC.Response.Error.make *)(* ~code: InvalidRequest *)(* ~message: "invalid value for configuration_file" *)(* () *)(* ) *)end|json->Eio.traceln"unknown configuration value %a"Yojson.Safe.ppjson