forked from eclipse-jdt/eclipse.jdt.core
-
Notifications
You must be signed in to change notification settings - Fork 1
Don't parse conflicting types together #1525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mickaelistria
wants to merge
1,208
commits into
eclipse-jdtls:dom-with-javac
Choose a base branch
from
mickaelistria:distinct-parse
base: dom-with-javac
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Don't parse conflicting types together #1525
mickaelistria
wants to merge
1,208
commits into
eclipse-jdtls:dom-with-javac
from
mickaelistria:distinct-parse
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- do not erase bodies of methods in anonymous classes and class
statements
- this is over-permissive at this point,
we'll need to refine it later
Signed-off-by: David Thompson <[email protected]>
eg. completion at `|` should yield VALUEABLE_1 and properly filter out
eg. methods and non-static/final fields.
```java
public class DemoClass {
void thisMethod() {
int i = 12;
switch (i) {
case MyInner.|
}
}
public static class MyInner {
final static int VALUEABLE_1 = 1;
}
}
```
Fixes 1 case, improves a few others so that only
the relevance numbers are wrong.
Signed-off-by: David Thompson <[email protected]>
eg. completion at `_` should not suggest `ExceptionA`
```java
try {
throw new Exception();
} catch (ExceptionA | _ ) {
// handle error
}
```
Fix some relevance constants related to this case.
Should fix at least 2 tests.
Signed-off-by: David Thompson <[email protected]>
Signed-off-by: Rob Stryker <[email protected]>
Signed-off-by: Rob Stryker <[email protected]>
Signed-off-by: Rob Stryker <[email protected]>
Signed-off-by: Rob Stryker <[email protected]>
Signed-off-by: Rob Stryker <[email protected]>
…rgument01 and others Signed-off-by: Rob Stryker <[email protected]>
Signed-off-by: Rob Stryker <[email protected]>
Signed-off-by: Rob Stryker <[email protected]>
Signed-off-by: Rob Stryker <[email protected]>
Signed-off-by: Rob Stryker <[email protected]> Fix many regressions in previously successful tests Signed-off-by: Rob Stryker <[email protected]> Fix regression in org.eclipse.jdt.core.tests.dom.ASTConverterTestAST3_2 test0666 Signed-off-by: Rob Stryker <[email protected]> Fix regressions in completion Signed-off-by: Rob Stryker <[email protected]>
…n try-with-resources Signed-off-by: Rob Stryker <[email protected]>
…(num) Signed-off-by: Rob Stryker <[email protected]>
Signed-off-by: David Thompson <[email protected]>
Version range seems incorrect, I suspect that's the root cause Signed-off-by: David Thompson <[email protected]>
- Use `$` to separate inner class and outer class in IType key Signed-off-by: David Thompson <[email protected]>
Reconciling or other routines may receive a CompletionFailure in some -more or less valid- cases. Instead of letting the exception bubble up to user land, we simply log it and continue anyway.
- consolidate logic for `CatchClause` into one place
- figure out which types are thrown in the body of the try statement,
prioritize them
- figure out which types are already caught, deprioritize them
("uninteresting bindings")
- handle bug related to classes declared with type declaration statements
- their bindings are still wrong, so that needs work
Signed-off-by: David Thompson <[email protected]>
eg. ```java pub| ``` eg. ```java package test; import java.util.List; abst| ``` - Detect that aren't connected to a type declaration using the text content of the CU - Apply the rules regarding which modifiers prevent others from being used - Prevent statement-like keywords in import or package declarations Signed-off-by: David Thompson <[email protected]>
eg.
```java
switch (i) {
cas|
}
```
Signed-off-by: David Thompson <[email protected]>
Signed-off-by: David Thompson <[email protected]>
- Add a bunch more statement-like keywords - Handle completion for `default` in switch statements and expressions Should fix around 43 cases Signed-off-by: David Thompson <[email protected]>
- Completion for `new`, `final`, `true`, `false`, and `null` keywords - Improve logic for checking if only expression-like keywords should be suggested - Prevent default completions in switches without a case label/default label Signed-off-by: David Thompson <[email protected]>
Signed-off-by: Rob Stryker <[email protected]>
Signed-off-by: Rob Stryker <[email protected]>
Signed-off-by: Rob Stryker <[email protected]>
Signed-off-by: Rob Stryker <[email protected]>
This makes the result consistent with what's done with `return`, but inconsistent with what's done upstream. Signed-off-by: David Thompson <[email protected]>
Author
|
This cause some other issues, this patch needs some more work |
This case now works the same as it does upstream:
```java
package dev.datho7561.utils;
/**
* Outer.Inn|
*/
public class Main {
}
class Outer {
class Inner {
}
}
```
There is a bug in jdt.ui which makes it not work in practice though.
It tries to import `Inner`, despite the fact that it's in the same
package and no "additional completion" is provided.
Signed-off-by: David Thompson <[email protected]>
- [x] TODO: test case Fixes eclipse-jdt#1433 Signed-off-by: David Thompson <[email protected]>
bb4fca8 to
dc716e1
Compare
dc716e1 to
21ded52
Compare
Author
|
This is supposed to fix a few cases, such as JavaSearchTests.testTypeOccurrences1; but it currently doesn't. |
21ded52 to
d218bbc
Compare
73d28b4 to
aa8f401
Compare
4082278 to
ebc593c
Compare
11c94f4 to
99440ba
Compare
6dc0d95 to
25a5a08
Compare
b1b4e0e to
309f390
Compare
685330d to
959d707
Compare
2dbfcc7 to
6e1fd32
Compare
0b01689 to
87ead9e
Compare
6d23874 to
c8f8d92
Compare
055e846 to
18452eb
Compare
411dfec to
ac3eb19
Compare
5738537 to
9962d57
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.