Skip to content

Fix some qualified type relevances#1377

Draft
datho7561 wants to merge 1065 commits into
eclipse-jdtls:dom-with-javacfrom
datho7561:fix-some-qualified-type-relevances
Draft

Fix some qualified type relevances#1377
datho7561 wants to merge 1065 commits into
eclipse-jdtls:dom-with-javacfrom
datho7561:fix-some-qualified-type-relevances

Conversation

@datho7561
Copy link
Copy Markdown

It wasn't counting qualified types in case statements as qualified, for instance.

Rob Stryker and others added 30 commits April 2, 2025 09:39
Signed-off-by: Rob Stryker <stryker@redhat.com>
Signed-off-by: Snjezana Peco <snjezana.peco@redhat.com>
Signed-off-by: Snjezana Peco <snjezana.peco@redhat.com>
This is new Java 23 syntax.
This PR should make 6 new tests pass
(mostly from the java 23 completion suite)
This PR also incorporates
eclipse-jdt#3479,
I forget specifically why, but it's needed.

- Fixes to the javac AST converter
  - I did a hack in the converter to recover the following case,
    since javac doesn't handle it currently:

```java
import module

public class HelloWorld {
}
```

- Adjust module completion relevance based on if it's required by the current
  module

Signed-off-by: David Thompson <davthomp@redhat.com>
Complete type and method parameters after `@param` in Javadoc preceeding
type and method declarations

Signed-off-by: David Thompson <davthomp@redhat.com>
when underlying VarSymbol is error
For Blocks and Lambdas
* unused variables
* unqualified access
* switch from internal classes to api
This causes 6 regerssions because 'possible this escape' is now
reported.

Signed-off-by: David Thompson <davthomp@redhat.com>
- fix a bug related to ordering of tag names
- get `@param| ` completion to work as expected
- use `DOMCompletionUtil.findParent` instead of only checking the direct
  parent when calculating the node to use as context for completion
  (in the case of nodes within `Javadoc`)
- split out `MemberRef` and `MethodRef` to their own completion cases
  - for now these are stubs
- move the logic for type completion for `@see` and `@link` under the
  TagElement section, as it should be handled differently than the
  "default completion":
  - improve handling of qualified references
  - for the time being, suggest nothing when completing a type from a
    specific module.
    i.e. `@see java.base/java.util.|` no longer gives any results.

Signed-off-by: David Thompson <davthomp@redhat.com>
Note that there are two code paths: one through `MemberRef` and
another through an `@link` or `@see` `TagElement`.
This is because the AST conversion tests expect the following to be a
`TextElement` instead of a `MemberRef`:

```java
/**
 * @see MyClass#
 */
```

(and also:)

```java
/**
 * @see #
 */
```

However, the completion tests expect completion for MyClass' members to
work in this case.

Fixes eclipse-jdt#1103

Signed-off-by: David Thompson <davthomp@redhat.com>
* Type parameters
* Annotations
* Relevance
* Support type restriction for SwitchCase
* Support for QualifiedType
* Fix CompletionContext.getExpectedTypesSignatures()
@datho7561
Copy link
Copy Markdown
Author

it regressed; I'll need to figure out why:

PASS:    org.eclipse.jdt.core.tests.model.CompletionTests.testCatchClauseExceptionRef13
FAILURE: org.eclipse.jdt.core.tests.dom.ASTConverterTestAST8_2.test0602
        "\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040" should have a binding
FAILURE: org.eclipse.jdt.core.tests.model.CompletionTests3.testBug575397b

        ----------- Expected ------------
        Thread.State[TYPE_REF]{State, , LThread$State;, null, null, 49}
        ------------ but was ------------
        Thread.State[TYPE_REF]{State, , LThread$State;, null, null, 51}
        ---------------------- ----------
         expected:<...State;, null, null, [49]}> but was:<...State;, null, null, [51]}>
FAILURE: org.eclipse.jdt.core.tests.model.CompletionTests.testBug343476a

        ----------- Expected ------------
        ZZZString[FIELD_REF]{ZZZString, Ltest.CompletionAfterCase2;, Ljava.lang.String;, ZZZString, null, 84}
        ------------ but was ------------
        ZZZString[FIELD_REF]{ZZZString, Ltest.CompletionAfterCase2;, Ljava.lang.String;, ZZZString, null, 86}
        ---------------------- ----------
         expected:<..., ZZZString, null, 8[4]}> but was:<..., ZZZString, null, 8[6]}>

Total failures: 3085
Total passes: 7213
New failures: 3
New passes: 1

@datho7561 datho7561 force-pushed the fix-some-qualified-type-relevances branch from 7f19ad0 to 4dafcdf Compare April 8, 2025 18:18
@datho7561
Copy link
Copy Markdown
Author

Fixes 1, breaks 1

It wasn't counting qualified types in case statements as qualified,
for instance.

Signed-off-by: David Thompson <davthomp@redhat.com>
@datho7561 datho7561 force-pushed the fix-some-qualified-type-relevances branch from 4dafcdf to 0ae2a07 Compare April 8, 2025 18:22
@robstryker robstryker force-pushed the dom-with-javac branch 3 times, most recently from b1b4e0e to 309f390 Compare September 8, 2025 20:48
@robstryker robstryker force-pushed the dom-with-javac branch 2 times, most recently from 5738537 to 9962d57 Compare December 2, 2025 20:28
@robstryker robstryker force-pushed the dom-with-javac branch 2 times, most recently from dd7aa18 to fbe5e1a Compare March 6, 2026 18:59
@robstryker robstryker force-pushed the dom-with-javac branch 2 times, most recently from 2fcc4f8 to b7970ce Compare April 23, 2026 17:03
@robstryker robstryker force-pushed the dom-with-javac branch 2 times, most recently from 86c88a2 to 4ccbd95 Compare May 7, 2026 17:06
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.

6 participants