|
| 1 | +diff --git a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/TextDocumentServiceImpl.java b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/TextDocumentServiceImpl.java |
| 2 | +index 7a5a5f40e4f9..85c223130e32 100644 |
| 3 | +--- a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/TextDocumentServiceImpl.java |
| 4 | ++++ b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/TextDocumentServiceImpl.java |
| 5 | +@@ -128,6 +128,7 @@ |
| 6 | + import org.eclipse.lsp4j.DocumentSymbol; |
| 7 | + import org.eclipse.lsp4j.DocumentSymbolParams; |
| 8 | + import org.eclipse.lsp4j.FoldingRange; |
| 9 | ++import org.eclipse.lsp4j.FoldingRangeCapabilities; |
| 10 | + import org.eclipse.lsp4j.FoldingRangeKind; |
| 11 | + import org.eclipse.lsp4j.FoldingRangeRequestParams; |
| 12 | + import org.eclipse.lsp4j.Hover; |
| 13 | +@@ -160,6 +161,7 @@ |
| 14 | + import org.eclipse.lsp4j.SignatureHelpParams; |
| 15 | + import org.eclipse.lsp4j.SignatureInformation; |
| 16 | + import org.eclipse.lsp4j.SymbolInformation; |
| 17 | ++import org.eclipse.lsp4j.TextDocumentClientCapabilities; |
| 18 | + import org.eclipse.lsp4j.TextDocumentContentChangeEvent; |
| 19 | + import org.eclipse.lsp4j.TextDocumentEdit; |
| 20 | + import org.eclipse.lsp4j.TextEdit; |
| 21 | +@@ -1638,7 +1640,12 @@ public CompletableFuture<List<FoldingRange>> foldingRange(FoldingRangeRequestPar |
| 22 | + if (source == null) { |
| 23 | + return CompletableFuture.completedFuture(Collections.emptyList()); |
| 24 | + } |
| 25 | +- final boolean lineFoldingOnly = client.getNbCodeCapabilities().getClientCapabilities().getTextDocument().getFoldingRange().getLineFoldingOnly() == Boolean.TRUE; |
| 26 | ++ ClientCapabilities clientCapabilities = client.getNbCodeCapabilities() |
| 27 | ++ .getClientCapabilities(); |
| 28 | ++ TextDocumentClientCapabilities textDocumentCapabilities = clientCapabilities != null ? clientCapabilities.getTextDocument() : null; |
| 29 | ++ FoldingRangeCapabilities foldingRangeCapabilities = textDocumentCapabilities != null ? textDocumentCapabilities.getFoldingRange() : null; |
| 30 | ++ Boolean lineFoldingOnlyCapability = foldingRangeCapabilities != null ? foldingRangeCapabilities.getLineFoldingOnly() : null; |
| 31 | ++ final boolean lineFoldingOnly = lineFoldingOnlyCapability == Boolean.TRUE; |
| 32 | + CompletableFuture<List<FoldingRange>> result = new CompletableFuture<>(); |
| 33 | + try { |
| 34 | + source.runUserActionTask(cc -> { |
0 commit comments