fix(fold): Occasional NPE in LSP4IntellIJ

This commit is contained in:
FalsePattern 2023-07-31 14:26:36 +02:00 committed by FalsePattern
parent e9b69646f2
commit d18ca32b9b
Signed by: falsepattern
GPG key ID: FDF7126A9E124447
2 changed files with 10 additions and 1 deletions

View file

@ -7,7 +7,10 @@
### Fixed ### Fixed
#### Highlighting #### Highlighting
Last token in file not getting highlighted - Last token in file not getting highlighted
#### Folding
- Occasional NPE in LSP4IntellIJ
## [0.2.0] ## [0.2.0]

View file

@ -93,4 +93,10 @@ public class ZLSRequestManager extends DefaultRequestManager {
LOG.warn(e); LOG.warn(e);
getWrapper().crashed(e); getWrapper().crashed(e);
} }
@Override
public CompletableFuture<List<FoldingRange>> foldingRange(FoldingRangeRequestParams params) {
var future = super.foldingRange(params);
return future == null ? null : future.thenApply((range) -> range == null ? Collections.emptyList() : range);
}
} }