Skip to content
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

Matchlocator dom #871

Closed

Conversation

mickaelistria
Copy link

No description provided.

@mickaelistria mickaelistria marked this pull request as draft October 4, 2024 14:02
@mickaelistria mickaelistria force-pushed the matchlocator-dom branch 4 times, most recently from cd9d648 to 97d6f5b Compare October 8, 2024 07:13
mickaelistria and others added 24 commits October 15, 2024 11:09
binding issues regarding generics

Signed-off-by: Rob Stryker <[email protected]>

Fixes ASTConverter15JLS4Test.test0071

Signed-off-by: Rob Stryker <[email protected]>

More fixes to test0070 and test0071

Signed-off-by: Rob Stryker <[email protected]>

Cleanup

Signed-off-by: Rob Stryker <[email protected]>
If you type a `.` at the `|` with DOM-based completion enabled,
then it used to generate an Exception related to DOM translation.
Now, it won't generate that error.

```java
public class MyClass {
  void myMethod(int a, String b|) {

  }
}
```

I think this might fix a test case.

Signed-off-by: David Thompson <[email protected]>
Fixes ASTConverterEitherOrMultiPatternTest.test005
The expression "if (number instanceof Long n)" should be
PatternInstanceOfExpression and not plain InstanceOfExpression.
Record static fields are part of the body declarations not of the record
components.
Signed-off-by: David Thompson <[email protected]>
Signed-off-by: Rob Stryker <[email protected]>

Cleanup
eg. mark "`String`" as wrong because it doesn't take type arguments in
the following code:

```java
String<List> asdf = "";
```

This also fixes the quickfix.

Signed-off-by: David Thompson <[email protected]>
Fixes ASTConverter_RecordPattern_Test.testBug575250
Signed-off-by: Rob Stryker <[email protected]>

Null protection

Signed-off-by: Rob Stryker <[email protected]>

More problem marker messaging

Signed-off-by: Rob Stryker <[email protected]>

Various problem messaging fixes

Signed-off-by: Rob Stryker <[email protected]>

Fix test0610

Signed-off-by: Rob Stryker <[email protected]>

Problem messaging cleanup

Signed-off-by: Rob Stryker <[email protected]>

Fix part of test test0695 - dont show advanced constucts in dom if compliance is below first allowed use

Signed-off-by: Rob Stryker <[email protected]>

More messaging fixes

Signed-off-by: Rob Stryker <[email protected]>

Remove whitespace from some ranges

Signed-off-by: Rob Stryker <[email protected]>
datho7561 and others added 23 commits October 15, 2024 11:24
eg. completion at the `|`

```java
public class HelloWorld {

    public static void main(String... args) {
        HelloWorld.|
    }
}
```

Handles static methods and members, as well as `this`, `super` and `class`.

Signed-off-by: David Thompson <[email protected]>
Fixes eclipse-jdt#865

Signed-off-by: David Thompson <[email protected]>
Fill in method arguments with best guesses of the values,
using the existing mechanism.

- Refactor binding collection logic to filter out non-static members
  when applicable

Closes eclipse-jdt#868

Signed-off-by: David Thompson <[email protected]>
- I broke Gayan's existing support in my previous patches (sorry Gayan), this PR fixes it
- Support completing right after `@`
- Improve annotation parameter completion

Signed-off-by: David Thompson <[email protected]>
- Fix some low hanging completion test errors

Signed-off-by: David Thompson <[email protected]>
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]>

Cleanup

Signed-off-by: Rob Stryker <[email protected]>
Introduce a subclass of JavacFileManager that is capable of caching and
sharing jar contents.
Also ensure some references are removed from context upon usage to
encourage garbage collection.

Note that JDK content is still duplicated as it's using another
filemanager that seems harder to configure, using direct call to
`PlatformUtils.lookupPlatformDescription().getFileManager()`.
Also note that the cached entries only get disposed when all
filemanagers are closed/GCed.
Extra strategy in MatchLocator to use DOM, and tweaks in various
Locators to properly handle DOM. Tests in JavaSearchTests help a lot
(currently ~130/270 passing)

It basically clones and adapt some methods and adapt them to DOM,
A new flag is introduced to decide the strategy.

Done-ish (often with remaining issues)
* FieldLocator
* LocalVariableLocator
* MethodLocator
* SuperTypeReferenceLocator
* TypeDeclarationLocator
* TypeParameterLocator
* TypeReferenceLocator
TODO:
* AndLocator
* ModuleLocator
* PackageDeclarationLocator
* PackageReferenceLocator
* OrLocator
* VariableLocator

# Conflicts:
#	org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaSearchTests.java
#	org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/FieldLocator.java
#	org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/LocalVariableLocator.java
#	org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java
#	org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchingNodeSet.java
#	org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java
#	org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.java
#	org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PatternLocator.java
#	org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferenceLocator.java
#	org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeParameterLocator.java
#	org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java
@mickaelistria
Copy link
Author

This was merged ~2 weeks ago.

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.

5 participants