Skip to content

Use CompletionItemLabelDetails from LSP4J 0.20.0 for detailed method/property completion menu#116

Open
trustytrojan wants to merge 1 commit into
GroovyLanguageServer:masterfrom
trustytrojan:completion-item-label-details
Open

Use CompletionItemLabelDetails from LSP4J 0.20.0 for detailed method/property completion menu#116
trustytrojan wants to merge 1 commit into
GroovyLanguageServer:masterfrom
trustytrojan:completion-item-label-details

Conversation

@trustytrojan
Copy link
Copy Markdown
Contributor

  • 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 CompletionItemLabelDetail 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.)

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

… completion menu for property/method access
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