Skip to content

Commit

Permalink
More robust handling of the 'WorkspaceConfiguration' request
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp-M committed Sep 7, 2022
1 parent c183d15 commit 7ebd685
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions helix-term/src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ impl Application {
let result: Vec<_> = params
.items
.iter()
.map(|item| {
.filter_map(|item| {
let mut config = language_server.config()?;
// TODO check for scope_uri (below) necessary?
// let mut config = match &item.scope_uri {
Expand All @@ -805,8 +805,11 @@ impl Application {
// .config()?,
// };
if let Some(section) = item.section.as_ref() {
for part in section.split('.') {
config = config.get(part)?;
// for some reason some lsps send an empty string (observed in 'vscode-eslint-language-server')
if section != "" {
for part in section.split('.') {
config = config.get(part)?;
}
}
}
Some(config)
Expand Down

0 comments on commit 7ebd685

Please sign in to comment.