Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 283328 Details for
Bug 469324
[Content assist] auto-completion adds wrong type arguments
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
more token locations in CompletionContext
file_469324.txt (text/plain), 2.10 KB, created by
Julian Honnen
on 2020-06-18 03:19:48 EDT
(
hide
)
Description:
more token locations in CompletionContext
Filename:
MIME Type:
Creator:
Julian Honnen
Created:
2020-06-18 03:19:48 EDT
Size:
2.10 KB
patch
obsolete
>diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java >index ca7cf66..50d9194 100644 >--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java >+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java >@@ -145,6 +145,7 @@ > import org.eclipse.jdt.internal.compiler.ast.ImportReference; > import org.eclipse.jdt.internal.compiler.ast.Initializer; > import org.eclipse.jdt.internal.compiler.ast.InstanceOfExpression; >+import org.eclipse.jdt.internal.compiler.ast.Invocation; > import org.eclipse.jdt.internal.compiler.ast.Javadoc; > import org.eclipse.jdt.internal.compiler.ast.JavadocImplicitTypeReference; > import org.eclipse.jdt.internal.compiler.ast.JavadocQualifiedTypeReference; >@@ -1933,6 +1934,16 @@ > } > } > } >+ >+ if (context.getTokenLocation() == 0) { >+ if (astNodeParent instanceof Invocation) { >+ context.setTokenLocation(CompletionContext.TL_IN_INVOCATION); >+ } else if (astNodeParent instanceof TypeDeclaration) { >+ context.setTokenLocation(CompletionContext.TL_IN_TYPE_DECLARATION); >+ } else if (astNodeParent instanceof FieldDeclaration || astNodeParent instanceof LocalDeclaration || astNodeParent instanceof Assignment ) { >+ context.setTokenLocation(CompletionContext.TL_IN_ASSIGNMENT); >+ } >+ } > } > > void checkCancel() { >diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/CompletionContext.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/CompletionContext.java >index 11b441e..7932f3c 100644 >--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/CompletionContext.java >+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/CompletionContext.java >@@ -87,6 +87,10 @@ > */ > public static final int TL_IN_IMPORT = 8; > >+ public static final int TL_IN_TYPE_DECLARATION = 16; >+ public static final int TL_IN_INVOCATION = 32; >+ public static final int TL_IN_ASSIGNMENT = 64; >+ > /** > * The completion token is unknown. > * @since 3.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 469324
: 283328