Allow client to respond to workspace/configuration with null values
This is allowed per the spec if the client doesn't know about the configuration we've requested.
This commit is contained in:
parent
76c1fac9c3
commit
adc4bb5406
@ -177,6 +177,11 @@ pub fn new(root_path: AbsPathBuf) -> Self {
|
||||
|
||||
pub fn update(&mut self, json: serde_json::Value) {
|
||||
log::info!("Config::update({:#})", json);
|
||||
|
||||
if json.is_null() {
|
||||
return;
|
||||
}
|
||||
|
||||
let data = ConfigData::from_json(json);
|
||||
|
||||
self.with_sysroot = data.withSysroot;
|
||||
|
@ -468,6 +468,8 @@ fn on_notification(&mut self, not: Notification) -> Result<()> {
|
||||
}
|
||||
(None, Some(mut configs)) => {
|
||||
if let Some(json) = configs.get_mut(0) {
|
||||
// Note that json can be null according to the spec if the client can't
|
||||
// provide a configuration. This is handled in Config::update below.
|
||||
let mut config = this.config.clone();
|
||||
config.update(json.take());
|
||||
this.update_configuration(config);
|
||||
|
Loading…
Reference in New Issue
Block a user