Skip to content

Commit

Permalink
Move to o.e.j.i.codeassist to allow package private access
Browse files Browse the repository at this point in the history
- set completionToken as before

Signed-off-by: David Thompson <[email protected]>
  • Loading branch information
datho7561 committed Jan 23, 2025
1 parent 6a9559c commit 647981d
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
import org.eclipse.jdt.core.CompletionRequestor;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.WorkingCopyOwner;
import org.eclipse.jdt.internal.codeassist.DOMCompletionEngine;
import org.eclipse.jdt.internal.codeassist.ICompletionEngine;
import org.eclipse.jdt.internal.codeassist.ICompletionEngineProvider;
import org.eclipse.jdt.internal.core.SearchableEnvironment;
import org.eclipse.jdt.internal.javac.completion.DOMCompletionEngine;

public class DOMCompletionEngineProvider implements ICompletionEngineProvider {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Contributors:
* Gayan Perera - initial API and implementation
*******************************************************************************/
package org.eclipse.jdt.internal.javac.completion;
package org.eclipse.jdt.internal.codeassist;

import java.util.Arrays;
import java.util.Optional;
Expand Down Expand Up @@ -46,11 +46,9 @@
import org.eclipse.jdt.core.dom.StringLiteral;
import org.eclipse.jdt.core.dom.TypeDeclaration;
import org.eclipse.jdt.core.dom.VariableDeclaration;
import org.eclipse.jdt.internal.codeassist.DOMCodeSelector;
import org.eclipse.jdt.internal.codeassist.ExpectedTypes;
import org.eclipse.jdt.internal.codeassist.DOMCompletionEngine.Bindings;
import org.eclipse.jdt.internal.codeassist.impl.AssistOptions;
import org.eclipse.jdt.internal.compiler.parser.RecoveryScanner;
import org.eclipse.jdt.internal.javac.completion.DOMCompletionEngine.Bindings;

class DOMCompletionContext extends CompletionContext {
private final int offset;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package org.eclipse.jdt.internal.javac.completion;
package org.eclipse.jdt.internal.codeassist;

import java.lang.annotation.Target;
import java.util.ArrayDeque;
Expand Down Expand Up @@ -92,6 +92,7 @@
import org.eclipse.jdt.core.dom.MethodInvocation;
import org.eclipse.jdt.core.dom.MethodRef;
import org.eclipse.jdt.core.dom.Modifier;
import org.eclipse.jdt.core.dom.Modifier.ModifierKeyword;
import org.eclipse.jdt.core.dom.ModuleDeclaration;
import org.eclipse.jdt.core.dom.Name;
import org.eclipse.jdt.core.dom.NameQualifiedType;
Expand Down Expand Up @@ -123,18 +124,11 @@
import org.eclipse.jdt.core.dom.VariableDeclaration;
import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
import org.eclipse.jdt.core.dom.VariableDeclarationStatement;
import org.eclipse.jdt.core.dom.Modifier.ModifierKeyword;
import org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants;
import org.eclipse.jdt.core.search.IJavaSearchConstants;
import org.eclipse.jdt.core.search.SearchEngine;
import org.eclipse.jdt.core.search.SearchPattern;
import org.eclipse.jdt.core.search.TypeNameMatchRequestor;
import org.eclipse.jdt.internal.codeassist.CompletionEngine;
import org.eclipse.jdt.internal.codeassist.DOMCodeSelector;
import org.eclipse.jdt.internal.codeassist.ExpectedTypes;
import org.eclipse.jdt.internal.codeassist.ICompletionEngine;
import org.eclipse.jdt.internal.codeassist.InternalCompletionProposal;
import org.eclipse.jdt.internal.codeassist.RelevanceConstants;
import org.eclipse.jdt.internal.codeassist.impl.AssistOptions;
import org.eclipse.jdt.internal.codeassist.impl.Keywords;
import org.eclipse.jdt.internal.compiler.lookup.TypeConstants;
Expand Down Expand Up @@ -467,6 +461,7 @@ public void complete(org.eclipse.jdt.internal.compiler.env.ICompilationUnit sour
// var completionContext = new DOMCompletionContext(this.offset, completeAfter.toCharArray(),
// computeEnclosingElement(), defaultCompletionBindings::stream, expectedTypes, this.toComplete);
var completionContext = new DOMCompletionContext(this.unit, this.modelUnit, this.textContent, this.offset, this.assistOptions, defaultCompletionBindings);
this.nestedEngine.completionToken = completionContext.getToken();
this.requestor.acceptContext(completionContext);

this.expectedTypes = completionContext.expectedTypes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Contributors:
* Red Hat Inc. - initial API and implementation
*******************************************************************************/
package org.eclipse.jdt.internal.javac.completion;
package org.eclipse.jdt.internal.codeassist;

import org.eclipse.jdt.core.dom.IMethodBinding;
import org.eclipse.jdt.core.dom.ITypeBinding;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package org.eclipse.jdt.internal.javac.completion;
package org.eclipse.jdt.internal.codeassist;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Contributors:
* Gayan Perera - initial API and implementation
*******************************************************************************/
package org.eclipse.jdt.internal.javac.completion;
package org.eclipse.jdt.internal.codeassist;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package org.eclipse.jdt.internal.javac.completion;
package org.eclipse.jdt.internal.codeassist;

import java.util.List;
import java.util.function.Consumer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package org.eclipse.jdt.internal.javac.completion;
package org.eclipse.jdt.internal.codeassist;

import org.eclipse.jdt.core.CompletionContext;
import org.eclipse.jdt.core.Signature;
import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.internal.codeassist.CompletionEngine;
import org.eclipse.jdt.internal.codeassist.InternalCompletionProposal;
import org.eclipse.jdt.internal.core.NameLookup;

class DOMInternalCompletionProposal extends InternalCompletionProposal {
Expand Down Expand Up @@ -106,6 +104,7 @@ protected void setModuleName(char[] moduleName) {
super.setModuleName(moduleName);
}

@Override
public boolean isConstructor() {
return this.isConstructor;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,13 @@
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package org.eclipse.jdt.internal.javac.completion;
package org.eclipse.jdt.internal.codeassist;

import java.util.Objects;

import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.core.dom.ITypeBinding;
import org.eclipse.jdt.core.dom.PrimitiveType;
import org.eclipse.jdt.internal.codeassist.CompletionEngine;
import org.eclipse.jdt.internal.codeassist.ExpectedTypes;
import org.eclipse.jdt.internal.codeassist.RelevanceConstants;
import org.eclipse.jdt.internal.codeassist.impl.AssistOptions;

/**
Expand Down

0 comments on commit 647981d

Please sign in to comment.