-
Notifications
You must be signed in to change notification settings - Fork 1
Remove access to CompletionEngine.completionToken
#1128
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
base: dom-with-javac
Are you sure you want to change the base?
Remove access to CompletionEngine.completionToken
#1128
Conversation
|
What does it fix? |
|
We cannot access CompletionEngine.completionToken if we are outside of the codeassist package, due to the current access level of the field. If we want to move the DOMCompletionEngine to the javac fragment, we will either need to change the access level or not access the field. |
|
My thoughts:
|
|
AFAICT the reason to move DomCompletionEngine to javac fragment is to make it possible to use our work with o.e.jdt.core bundle from I-build without modification. |
|
After adding @robstryker 's PR, I'm having second thoughts on the implementation he used. We need to subclass |
f29724f to
6336a21
Compare
|
@mickaelistria if you have some time, could you please take a look at this PR? This is a prerequisite for #1129, since when we move DOMCompletionEngine to the javac fragment we won't be able to access CompletionEngine internals. |
Couldn't we just put the DOMCompletionEngine in the same package (even if moved into fragment)? That's already what we're doing for Bindings. |
You're right; we could do that. However, I still think it's important to decouple from CompletionEngine as much as possible. Many of the methods we are reusing from CompletionEngine are trivial to re-implement (e.g. they return a constant int). Other methods that we are currently reusing from CompletionEngine only work properly if the CompletionParser has been invoked and bunch of internal state has been populated, so we shouldn't be using them if we want correct results. If we rely too much on modifying the internal state of the nested CompletionEngine, the code becomes difficult to read and follow. For instance, I believe it's more clear what's happening when a static helper method calculates a list of completion results given some parameters than when we set a bunch fields on the nested completion engine then invoke a non-static method. |
|
I think decoupling is eventually nice, but it's not a requirement and it's certainly more work. So IMO, at the moment, let's just use the same package. We may rework the coupling later when needed. |
|
If we decouple from CompletionEngine now, we prevent adding more coupling to the CompletionEngine in the short term. The more coupling we have, the harder it will be to decouple. This PR fully decouples from the CompletionEngine; the work is already completed. |
|
The proposed decoupling requires change in upstream APIs. The methods such as |
9c17bb6 to
4516c31
Compare
Signed-off-by: Rob Stryker <[email protected]>
- Remove `JavacFileObject`, use file objects from file manager Signed-off-by: David Thompson <[email protected]>
eg. try completion at the `|` for the following cases:
```java
public Foo {
|
}
```
```java
public Foo {
toStr|
}
```
Closes eclipse-jdt#859
Signed-off-by: David Thompson <[email protected]>
- Filter out private variables and methods from parent classes - Filter out non-static variables and methods when completing inside a static method - Distinguish between field completion and local variable completion (these have different icons in Eclipse) - Set flags (eg. `public`, `protected`, `final`) for the completion items (these have different icons in Eclipse) Fixes eclipse-jdt#861 Signed-off-by: David Thompson <[email protected]>
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]>
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]>
c906abc to
b53a413
Compare
08ec5cf to
10fe71a
Compare
c2b9da2 to
c640bdc
Compare
1bb87f3 to
197281f
Compare
dfa9534 to
686b029
Compare
43ddedd to
6545d02
Compare
1a69e37 to
786a635
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
No description provided.