Comments (4)
Seems slightly similar to what @snjeza reported in #2014 (comment) . It's worth checking if the calls to completion return all the overloads, and if so, we should be able to figure out why signature help isn't displaying all of them.
from eclipse.jdt.ls.
The problem is here :
We get the declaring type based on the specific method that is selected (eg. for test.speed()
, even though test
is a Car
, speed()
is declared in Vehicle
. From there we only discover the super classes of Vehicle
, which are MovingObject
, and java.lang.Object
. Once we get to :
we do get speed(int)
, speed(int, int)
from the completion engine, but we dismiss them because Car
is not in declaringTypeNames
.
I think we need to revisit this logic because it is definitely broken. The name comparison is there because completion invocation within the parameter "area" was always a bit buggy and we had to dismiss some odd values, but computing subtypes (in addition to supertypes) could get expensive. Do we need to compute the types at all or can we just go by the rule of "accept any method whose name matches".
from eclipse.jdt.ls.
As a note the following is now an issue for signature help :
Test.java
package test1;
public class Test {
public String[] getQuestions(boolean onlyMultipleChoice) {
return null;
}
public String[] getQuestions() {
return null;
}
}
Exam.java
package test1;
public class Exam extends Test {
public String[] getQuestions(int number) {
return null;
}
}
Main.java
package test1;
public class Main {
public void doStuff() {
Test ex = new Test();
((Exam) ex).getQuestions(|)
}
public String[] getQuestions(int number, String section, boolean multiple) {
return null;
}
}
It's an improvement over the issue of missing overloads.
from eclipse.jdt.ls.
As a note the following is now an issue for signature help
Ah, that might be the reason why declaring type is preserved. Let's file an issue first.
from eclipse.jdt.ls.
Related Issues (20)
- "final" modifier not added to exception multi-catch block variable HOT 5
- no autocompletions or hints for referenced libraries. HOT 4
- Run as CLI (ex: ci, format all, check for format, pre-commit) HOT 3
- How to configure order for organize imports (lsp-java emacs)
- Problems to compile project in Eclipse HOT 3
- References within decompiled classes may fail to resolve
- How to properly set excludedMarkerTypes / what's the correct value HOT 5
- Code actions & file paste event handling in Unnamed classes HOT 1
- Paste event handler responds slowly under certain circumstances HOT 2
- Fail to compile Java 21 unnamed class HOT 3
- Some package-private classes failed to be resolved until any dummy change made
- Signature help may include same-named methods that are not on the declaring class hierarchy
- [need info] [jdtls-extension] [Java 17] Problem with debug adapter in neovim using jdtls and microsoft/vcvode-java-test and microsoft/java-debug HOT 8
- No repository found at https://download.eclipse.org/eclipse/updates/4.31/R-4.31-202402290520 HOT 3
- Java formatting options provided as initializationOptions.settings.java.format.settings.url are ignored HOT 5
- [Feature] Support git worktrees along workspace folders
- typeDefinition returns null instead of an empty list HOT 3
- UnsupportedOperationException: org.eclipse.lsp4j.services.TextDocumentService.diagnostic HOT 2
- Exception occurred after sending textDocument/completion request. HOT 6
- saving non-Java file under source folder leads to rebuild HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eclipse.jdt.ls.