eclipse-jdtls / eclipse.jdt.ls

Java language server
1.76k stars 392 forks source link

`completionItem/resolve` doesn't generate a method stub for bogus text #255

Open fbricon opened 7 years ago

fbricon commented 7 years ago

When requesting completion at the end of a random string in a document, the server returns a completionItem for a method. e.g: After typing aaaaa in SomeClass.java

Result: {
    "isIncomplete": false,
    "items": [
        {
            "label": "aaaaa() : void",
            "kind": 3,
            "detail": "SomeClass",
            "sortText": "999999371",
            "insertText": "aaaaa",
            "data": {
                "decl_signature": "Lfoo.bar.SomeClass;",
                "signature": "()V",
                "name": "aaaaa",
                "pid": "0",
                "rid": "15",
                "uri": "file:/Users/me/path/to/foo/bar/SomeClass.java"
            }
        }
    ]
}

This should not return a CompletionItem at all.

fbricon commented 7 years ago

So in Eclipse, a stub of a private method is actually returned, but in jdt.ls, the completionItem resolution doesn't return that method stub.

fbricon commented 5 years ago

The completionItem is no longer returned. Which is fine for now, but ultimately, when we want the completion item to be automatically insert a method stub, we'll need it. Also, in order for that completion stub to work, we'll need to always return incomplete results, so that the server returns updated completion items as you keep typing.