Skip to content

Use CompletionItemLabelDetails from LSP4J 0.20.0 for detailed completion list#116

Open
trustytrojan wants to merge 2 commits into
GroovyLanguageServer:masterfrom
trustytrojan:completion-item-label-details
Open

Use CompletionItemLabelDetails from LSP4J 0.20.0 for detailed completion list#116
trustytrojan wants to merge 2 commits into
GroovyLanguageServer:masterfrom
trustytrojan:completion-item-label-details

Conversation

@trustytrojan
Copy link
Copy Markdown
Contributor

@trustytrojan trustytrojan commented May 22, 2026

  • Bump LSP4J to 0.20.0
  • Remove org.eclipse.lsp4j.jsonrpc as an explicit dependency as to let org.eclipse.lsp4j itself require the version of org.eclipse.lsp4j.jsonrpc it needs
  • Use CompletionItemLabelDetails object to set detail to the argument list of methods and description to the return type of methods and the types of properties/fields. This allows for a nicer looking completion menu showing much more information about methods/properties/fields at a glance in VS Code. (This also brings the completion menu to parity with Eclipse JDT LS.)
  • Modify test cases to check CompletionItemLabelDetails objects
  • Use CompletionItemLabelDetails for class/type completions to show the package of each class as the description field. The package name shows up in the same place that method/field/variable types do.

Visual demonstration

With the following class available in scope, below are screenshots of the completion menu after typing new TestClass().:

class TestClass {
    int aInt = 3
    byte aByte = 4
    String aString = "hello"
    abstract def aMethod()
    abstract float anotherMethod(short a, double b)
    abstract List aThirdMethod(x)
}

Before

image

After

image

@trustytrojan trustytrojan changed the title Use CompletionItemLabelDetails from LSP4J 0.20.0 for detailed method/property completion menu Use CompletionItemLabelDetails from LSP4J 0.20.0 for detailed completion list May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant