From 91bc5d1ce1a960296fca93ed93c59ed2957fd92e Mon Sep 17 00:00:00 2001 From: azerr Date: Wed, 3 Apr 2024 13:55:56 +0200 Subject: [PATCH] fix: LSP progress support loses some ProgressParams Fixes #195 Signed-off-by: azerr --- docs/LSPSupport.md | 2 +- docs/images/lsp-support/progress.png | Bin 7005 -> 21000 bytes .../features/progress/LSPProgressManager.java | 85 +++++++++++------- 3 files changed, 55 insertions(+), 32 deletions(-) diff --git a/docs/LSPSupport.md b/docs/LSPSupport.md index 5e523e140..cf029b2f1 100644 --- a/docs/LSPSupport.md +++ b/docs/LSPSupport.md @@ -109,7 +109,7 @@ Current state of [Window Features]( https://microsoft.github.io/language-server- [$/progress](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#progress) is implemented with `Background Tasks`. -Here a sample with [Rust Analyzer](https://rust-analyzer.github.io/): +Here a sample with [Eclipse JDT Language Server](https://github.com/eclipse-jdtls/eclipse.jdt.ls): ![$/progress](./images/lsp-support/progress.png) diff --git a/docs/images/lsp-support/progress.png b/docs/images/lsp-support/progress.png index 925fbff73db1dee668d61a0e5060b9397457780f..2647a2d45a40f35386283cbae83e0073d4560b49 100644 GIT binary patch literal 21000 zcmcG$2Ut^GoA(<<#RiC?NEeXaq<2ty@4c!>3BC8CBE3uR(gFwpsi7m%2{oZ61f+&y z=p6zlJkLAdoSE~U_sp4ZKCX*vXYZ^<*50hW_I>|<|2q*HYVrj4$?pRI00Kn?87%wjz21DHDhMShW6rf_5avisG%leJ#8vvjx?!m>o+qnIE&I*QZ0KjAS z>)#u5Ry5uKfM&L$%o`nVGYksotb=Z4x|}DDy;1P&);&dz8L3Aa%6-+rFI#Bif6h)v zQ2lVunr(30WAse%E87}uzq}HR$e!-^aGf7i8OkjEasp!I71S;jRdjCYGK9Xk^^*H$ zkCiqg>&2I%XEry+hv>TXu5#xMb0h-J>{}IV73bBHBh7~Q?9o}~k|REZN>VRyV*~*5 z6s}1BdeK39y?IG1bnAM1@9$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An{7{HIm}cmH zm4i{es$0#=+|{b@;g;5yLyAJTfMa| zW)vCckYdNI#0`cY2@mdUClQYXr@1y++>&=!hguwV^lQ^B{U>PF6SMpJT-gYe415eH1pxCh8Vmdbkl1O+q-g;ko$mS~eB?$!eKCHN*M`|)74>zpui}!Cn%+DLf3#Hp zSgR{TJ>V7eU@>gdKV)LVa>%^@LbwyS_l%!`-tO*)Q@Tm*Dt{sqewvAlit?l*o{H&EPyPO(UN&M3 z8fVx>5W^K9;Bn5rC*yaUgyH4V45B6=PKioNb$rK}U)|q2OE70BTaBDLCv9Ln8T7IaDjpE@ zw_&U@hE#QR*?#w2xOJO;?!83@_c`y>xbH2|>I&T_CYg!mBqWom-TfCj`d5PbzpD|V z4nDUeGvYV?HP!Q9Elz#OMCP6j4aI&$K$8tTts{i04r%K7Rj5v`X3CJgpU9K diff --git a/src/main/java/com/redhat/devtools/lsp4ij/features/progress/LSPProgressManager.java b/src/main/java/com/redhat/devtools/lsp4ij/features/progress/LSPProgressManager.java index e320f3434..d2a1f6a34 100644 --- a/src/main/java/com/redhat/devtools/lsp4ij/features/progress/LSPProgressManager.java +++ b/src/main/java/com/redhat/devtools/lsp4ij/features/progress/LSPProgressManager.java @@ -59,12 +59,7 @@ public void connect(final LanguageServer languageServer, LanguageServerWrapper l public CompletableFuture createProgress(final @NotNull WorkDoneProgressCreateParams params) { if (!isDisposed()) { String token = getToken(params.getToken()); - LSPProgressInfo progress = progressMap.get(token); - if (progress != null) { - // An LSP progress already exists with this token, cancel it. - progress.cancel(); - } - progressMap.put(token, new LSPProgressInfo(token)); + getOrCreateProgressInfo(token); } return CompletableFuture.completedFuture(null); } @@ -72,8 +67,8 @@ public CompletableFuture createProgress(final @NotNull WorkDoneProgressCre private void createTask(LSPProgressInfo progressInfo) { String token = progressInfo.getToken(); if (isProgressAlive(progressInfo)) { - // The progress has been done, cancelled, or the manager has been disposed, - // /don't create background task. + // The progress has been done, cancelled, or the manager has been disposed. + // --> don't create background task. progressMap.remove(token); return; } @@ -90,7 +85,7 @@ public void run(@NotNull ProgressIndicator indicator) { // The user has clicked on cancel icon of the progress bar. progressMap.remove(token); if (languageServer != null) { - // Cancel the LSP progress on language server side.. + // Cancel the LSP progress on language server side. final var workDoneProgressCancelParams = new WorkDoneProgressCancelParams(); workDoneProgressCancelParams.setToken(token); languageServer.cancelProgress(workDoneProgressCancelParams); @@ -109,7 +104,7 @@ public void run(@NotNull ProgressIndicator indicator) { } if (progressNotification != null) { WorkDoneProgressKind kind = progressNotification.getKind(); - switch(kind) { + switch (kind) { case begin -> // 'begin' has been notified begin((WorkDoneProgressBegin) progressNotification, indicator); case report -> // 'report' has been notified @@ -157,36 +152,64 @@ private void updateProgressIndicator(@Nullable String message, * @param params the {@link ProgressParams} used for the progress notification */ public void notifyProgress(final @NotNull ProgressParams params) { - if (isDisposed()) { + if (params.getValue() == null || params.getToken() == null || isDisposed()) { return; } - String token = getToken(params.getToken()); - LSPProgressInfo progress = progressMap.get(token); - if (progress == null) { - // may happen if the server does not wait on the return value of the future of createProgress + var value = params.getValue(); + if (value.isRight()) { + // TODO: Partial Result Progress + // https://microsoft.github.io/language-server-protocol/specifications/specification-current/#partialResults return; } - var value = params.getValue(); - if (value == null || !value.isLeft()) { + + if (!value.isLeft()) { return; } + + // Work Done Progress + // https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workDoneProgress WorkDoneProgressNotification progressNotification = value.getLeft(); - if (progressNotification != null) { - // Add the progress notification - progress.addProgressNotification(progressNotification); - switch (progressNotification.getKind()) { - case begin -> { - // 'begin' progress - WorkDoneProgressBegin begin = (WorkDoneProgressBegin) progressNotification; - progress.setTitle(begin.getTitle()); - progress.setCancellable(begin.getCancellable() != null && begin.getCancellable()); - // The IJ task is created on 'begin' and not on 'create' to initialize - // the Task with the 'begin' title. - createTask(progress); - } - case end -> progress.setDone(true); + WorkDoneProgressKind kind = progressNotification.getKind(); + if (kind == null) { + return; + } + String token = getToken(params.getToken()); + LSPProgressInfo progress = progressMap.get(token); + if (progress == null) { + // The server is not spec-compliant and reports progress using server-initiated progress but didn't + // call window/workDoneProgress/create beforehand. In that case, we check the 'kind' field of the + // progress data. If the 'kind' field is 'begin', we set up a progress reporter anyway. + if (kind != WorkDoneProgressKind.begin) { + return; + } + progress = getOrCreateProgressInfo(token); + } + + // Add the progress notification + progress.addProgressNotification(progressNotification); + switch (progressNotification.getKind()) { + case begin -> { + // 'begin' progress + WorkDoneProgressBegin begin = (WorkDoneProgressBegin) progressNotification; + progress.setTitle(begin.getTitle()); + progress.setCancellable(begin.getCancellable() != null && begin.getCancellable()); + // The IJ task is created on 'begin' and not on 'create' to initialize + // the Task with the 'begin' title. + createTask(progress); } + case end -> progress.setDone(true); + } + } + + @NotNull + private synchronized LSPProgressInfo getOrCreateProgressInfo(String token) { + LSPProgressInfo progress = progressMap.get(token); + if (progress != null) { + return progress; } + progress = new LSPProgressInfo(token); + progressMap.put(token, progress); + return progress; } private static String getToken(Either token) {