|
71 | 71 | import org.eclipse.lsp4j.Command; |
72 | 72 | import org.eclipse.lsp4j.CompletionItem; |
73 | 73 | import org.eclipse.lsp4j.CompletionItemDefaults; |
| 74 | +import org.eclipse.lsp4j.CompletionItemLabelDetails; |
74 | 75 | import org.eclipse.lsp4j.CompletionOptions; |
75 | 76 | import org.eclipse.lsp4j.ExecuteCommandOptions; |
76 | 77 | import org.eclipse.lsp4j.ExecuteCommandParams; |
@@ -283,9 +284,7 @@ private boolean isDeprecated() { |
283 | 284 | @Override |
284 | 285 | public StyledString getStyledDisplayString(IDocument document, int offset, BoldStylerProvider boldStylerProvider) { |
285 | 286 | String rawString = getDisplayString(); |
286 | | - StyledString res = isDeprecated() |
287 | | - ? new StyledString(rawString, StyleUtil.DEPRECATE) |
288 | | - : new StyledString(rawString); |
| 287 | + StyledString res = getStyledDisplayString(); |
289 | 288 | if (offset > bestOffset) { |
290 | 289 | try { |
291 | 290 | String subString = getDocumentFilter(offset).toLowerCase(); |
@@ -324,10 +323,19 @@ public String getDisplayString() { |
324 | 323 |
|
325 | 324 | @Override |
326 | 325 | public StyledString getStyledDisplayString() { |
327 | | - if (Boolean.TRUE.equals(item.getDeprecated())) { |
328 | | - return new StyledString(getDisplayString(), StyleUtil.DEPRECATE); |
| 326 | + StyledString ss = isDeprecated() |
| 327 | + ? new StyledString(getDisplayString(), StyleUtil.DEPRECATE) |
| 328 | + : new StyledString(getDisplayString()); |
| 329 | + CompletionItemLabelDetails labelDetails = item.getLabelDetails(); |
| 330 | + if (labelDetails != null) { |
| 331 | + if (labelDetails.getDetail() != null) { |
| 332 | + ss.append(new StyledString(labelDetails.getDetail(), StyledString.QUALIFIER_STYLER)); |
| 333 | + } |
| 334 | + if (labelDetails.getDescription() != null) { |
| 335 | + ss.append(' ' + labelDetails.getDescription(), StyledString.DECORATIONS_STYLER); |
| 336 | + } |
329 | 337 | } |
330 | | - return new StyledString(getDisplayString()); |
| 338 | + return ss; |
331 | 339 | } |
332 | 340 |
|
333 | 341 | @Override |
|
0 commit comments