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 169843 Details for
Bug 305694
[hotbug][Code Assist] Namespace not supported - no proposal after "new" keyword
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
More updates to thie patch
patchFor305694-3 (text/plain), 20.03 KB, created by
Chris Jaun
on 2010-05-25 11:26:14 EDT
(
hide
)
Description:
More updates to thie patch
Filename:
MIME Type:
Creator:
Chris Jaun
Created:
2010-05-25 11:26:14 EDT
Size:
20.03 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.wst.jsdt.core >Index: src/org/eclipse/wst/jsdt/internal/codeassist/CompletionEngine.java >=================================================================== >RCS file: /cvsroot/webtools/org.eclipse.jsdt/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/CompletionEngine.java,v >retrieving revision 1.67 >diff -u -r1.67 CompletionEngine.java >--- src/org/eclipse/wst/jsdt/internal/codeassist/CompletionEngine.java 16 Apr 2010 18:32:11 -0000 1.67 >+++ src/org/eclipse/wst/jsdt/internal/codeassist/CompletionEngine.java 25 May 2010 15:25:26 -0000 >@@ -83,6 +83,7 @@ > import org.eclipse.wst.jsdt.internal.compiler.ast.ConstructorDeclaration; > import org.eclipse.wst.jsdt.internal.compiler.ast.Expression; > import org.eclipse.wst.jsdt.internal.compiler.ast.FieldDeclaration; >+import org.eclipse.wst.jsdt.internal.compiler.ast.FieldReference; > import org.eclipse.wst.jsdt.internal.compiler.ast.ImportReference; > import org.eclipse.wst.jsdt.internal.compiler.ast.Initializer; > import org.eclipse.wst.jsdt.internal.compiler.ast.InstanceOfExpression; >@@ -623,7 +624,13 @@ > flatEnclosingTypeNames = CharOperation.concatWith(acceptedType.enclosingTypeNames, '.'); > typeName = CharOperation.concat(flatEnclosingTypeNames, simpleTypeName, '.'); > } >- char[] fullyQualifiedName = CharOperation.concat(packageName, typeName, '.'); >+ >+ // only need to combine package and type name if the name is not already qualified >+ // in most cases, if not all, it will already be in qualified state >+ char[] fullyQualifiedName = typeName; >+ if(CharOperation.indexOf('.', typeName) < 0) { >+ fullyQualifiedName = CharOperation.concat(packageName, typeName, '.'); >+ } > > if (this.knownTypes.containsKey(fullyQualifiedName)) continue next; > >@@ -1150,7 +1157,12 @@ > relevance += computeRelevanceForQualification(isQualified); > relevance += computeRelevanceForClass(); > relevance += computeRelevanceForException(simpleTypeName); >- >+ >+ // put proposals that have '_' at the start of their final segment down the list >+ char[] lastSegment = CharOperation.lastSegment(completionName, '.'); >+ if(CharOperation.indexOf('_', lastSegment) == 0) { >+ relevance--; >+ } > this.noProposal = false; > if(!this.requestor.isIgnored(CompletionProposal.TYPE_REF)) { > createTypeProposal(packageName, typeName, modifiers, accessibility, completionName, relevance); >@@ -1641,67 +1653,81 @@ > long completionPosition = access.nameSourcePosition; > setSourceRange((int) (completionPosition >>> 32), (int) completionPosition); > >- this.completionToken = access.token; > >- if (qualifiedBinding.problemId() == ProblemReasons.NotFound) { >- // complete method members with missing return type >- // class X { >- // Missing f() {return null;} >- // void foo() { >- // f().| >- // } >- // } >- if (this.assistNodeInJavadoc == 0 && >- (this.requestor.isAllowingRequiredProposals(CompletionProposal.FIELD_REF, CompletionProposal.TYPE_REF) || >- this.requestor.isAllowingRequiredProposals(CompletionProposal.METHOD_REF, CompletionProposal.TYPE_REF))) { >- ProblemMethodBinding problemMethodBinding = (ProblemMethodBinding) qualifiedBinding; >- findFieldsAndMethodsFromMissingReturnType( >- problemMethodBinding.selector, >- problemMethodBinding.parameters, >- scope, >- access, >- insideTypeAnnotation); >- } >+ >+// this.assistNodeIsClass = true; >+// this.assistNodeIsConstructor = true; >+ >+ // can be the start of a qualified type name >+ if (qualifiedBinding == null) { >+ >+ this.completionToken = computeToken(access); >+ setSourceRange((int) (completionPosition >>> 32) - (this.completionToken.length - access.token.length), (int) completionPosition); >+ >+ ObjectVector typesFound = new ObjectVector(); >+ findTypesAndPackages(this.completionToken, scope, typesFound); > } else { >- if (!access.isInsideAnnotation) { >- if (!this.requestor.isIgnored(CompletionProposal.KEYWORD)) { >- findKeywords(this.completionToken, new char[][]{Keywords.NEW}, false, false); >+ this.completionToken = access.token; >+ if (qualifiedBinding.problemId() == ProblemReasons.NotFound) { >+ // complete method members with missing return type >+ // class X { >+ // Missing f() {return null;} >+ // void foo() { >+ // f().| >+ // } >+ // } >+ if (this.assistNodeInJavadoc == 0 && >+ (this.requestor.isAllowingRequiredProposals(CompletionProposal.FIELD_REF, CompletionProposal.TYPE_REF) || >+ this.requestor.isAllowingRequiredProposals(CompletionProposal.METHOD_REF, CompletionProposal.TYPE_REF))) { >+ ProblemMethodBinding problemMethodBinding = (ProblemMethodBinding) qualifiedBinding; >+ findFieldsAndMethodsFromMissingReturnType( >+ problemMethodBinding.selector, >+ problemMethodBinding.parameters, >+ scope, >+ access, >+ insideTypeAnnotation); > } >- >- findFieldsAndMethods( >- this.completionToken, >- ((TypeBinding) qualifiedBinding), >- scope, >- access, >- scope, >- access.isStatic, >- false, >- access.receiver instanceof SuperReference, >- null, >- null, >- null, >- false); >- if (qualifiedBinding instanceof FunctionTypeBinding) { >- FunctionTypeBinding functionTypeBinding = (FunctionTypeBinding) qualifiedBinding; >- if (functionTypeBinding.functionBinding!=null && functionTypeBinding.functionBinding.isConstructor()) >- { >- ReferenceBinding declaringClass = (ReferenceBinding)functionTypeBinding.functionBinding.returnType; >- findFieldsAndMethods( >- this.completionToken, >- declaringClass, >- scope, >- access, >- scope, >- true, >- false, >- access.receiver instanceof SuperReference, >- null, >- null, >- null, >- false); >+ } else { >+ if (!access.isInsideAnnotation) { >+ if (!this.requestor.isIgnored(CompletionProposal.KEYWORD)) { >+ findKeywords(this.completionToken, new char[][]{Keywords.NEW}, false, false); >+ } >+ >+ findFieldsAndMethods( >+ this.completionToken, >+ ((TypeBinding) qualifiedBinding), >+ scope, >+ access, >+ scope, >+ access.isStatic, >+ false, >+ access.receiver instanceof SuperReference, >+ null, >+ null, >+ null, >+ false); >+ if (qualifiedBinding instanceof FunctionTypeBinding) { >+ FunctionTypeBinding functionTypeBinding = (FunctionTypeBinding) qualifiedBinding; >+ if (functionTypeBinding.functionBinding!=null && functionTypeBinding.functionBinding.isConstructor()) >+ { >+ ReferenceBinding declaringClass = (ReferenceBinding)functionTypeBinding.functionBinding.returnType; >+ findFieldsAndMethods( >+ this.completionToken, >+ declaringClass, >+ scope, >+ access, >+ scope, >+ true, >+ false, >+ access.receiver instanceof SuperReference, >+ null, >+ null, >+ null, >+ false); >+ >+ } > > } >- > } > } > } >@@ -5879,7 +5905,7 @@ > // char[] pkg = CharOperation.subarray(sourceType.sourceName, 0, index); > char[] simpleName = CharOperation.subarray(sourceType.sourceName, index+1, sourceType.sourceName.length); > >- if (!CharOperation.prefixEquals(token, simpleName, false) >+ if (!CharOperation.prefixEquals(token, simpleName, false) && !CharOperation.prefixEquals(token, sourceType.sourceName, false) > && !(this.options.camelCaseMatch && CharOperation.camelCaseMatch(token, simpleName))) continue ; > > } else if (!CharOperation.prefixEquals(token, sourceType.sourceName, false) >@@ -7357,10 +7383,7 @@ > } > > public static char[] createNonGenericTypeSignature(char[] qualifiedPackageName, char[] qualifiedTypeName) { >- return Signature.createCharArrayTypeSignature( >- CharOperation.concat( >- qualifiedPackageName, >- CharOperation.replaceOnCopy(qualifiedTypeName, '.', '$'), '.'), true); >+ return Signature.createCharArrayTypeSignature(CharOperation.replaceOnCopy(qualifiedTypeName, '.', '$'), true); > } > public static char[] createTypeSignature(char[] qualifiedPackageName, char[] qualifiedTypeName) { > char[] name = new char[qualifiedTypeName.length]; >@@ -7720,5 +7743,22 @@ > > return result; > } >+ >+ private char[] computeToken(FieldReference field) { >+ char[] currentToken = field.token; >+ boolean addDot = false; >+ if(currentToken != null && currentToken.length == 0) >+ addDot = true; >+ if(field.receiver != null) { >+ if(field.receiver instanceof SingleNameReference) { >+ currentToken = CharOperation.concat(((SingleNameReference)field.receiver).token, currentToken, '.'); >+ } else if(field.receiver instanceof FieldReference) { >+ currentToken = CharOperation.concat(computeToken((FieldReference) field.receiver), currentToken, '.'); >+ } >+ } >+ if(addDot) >+ currentToken = CharOperation.append(currentToken, '.'); >+ return currentToken; >+ } > > } >Index: src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnMemberAccess.java >=================================================================== >RCS file: /cvsroot/webtools/org.eclipse.jsdt/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnMemberAccess.java,v >retrieving revision 1.6 >diff -u -r1.6 CompletionOnMemberAccess.java >--- src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnMemberAccess.java 25 Aug 2009 17:58:20 -0000 1.6 >+++ src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnMemberAccess.java 25 May 2010 15:25:26 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2008 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -32,6 +32,7 @@ > * which should be replaced by the completion. > */ > >+import org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode; > import org.eclipse.wst.jsdt.internal.compiler.ast.Expression; > import org.eclipse.wst.jsdt.internal.compiler.ast.FieldReference; > import org.eclipse.wst.jsdt.internal.compiler.ast.MessageSend; >@@ -100,4 +101,8 @@ > throw new CompletionNodeFound(this, this.receiverType, scope); > // array types are passed along to find the length field > } >+ >+ public TypeBinding resolveForAllocation(BlockScope scope, ASTNode location) { >+ throw new CompletionNodeFound(this, scope); >+ } > } >Index: src/org/eclipse/wst/jsdt/internal/core/SearchableEnvironment.java >=================================================================== >RCS file: /cvsroot/webtools/org.eclipse.jsdt/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SearchableEnvironment.java,v >retrieving revision 1.22 >diff -u -r1.22 SearchableEnvironment.java >--- src/org/eclipse/wst/jsdt/internal/core/SearchableEnvironment.java 23 Nov 2009 20:38:09 -0000 1.22 >+++ src/org/eclipse/wst/jsdt/internal/core/SearchableEnvironment.java 25 May 2010 15:25:26 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2009 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -432,25 +432,34 @@ > } else { > excludePath = null; > } >- int lastDotIndex = CharOperation.lastIndexOf('.', prefix); >+ >+ //int lastDotIndex = CharOperation.lastIndexOf('.', prefix); >+ // just use the simple name field to hold the full type name > char[] qualification, simpleName; >- if (lastDotIndex < 0) { >- qualification = null; >- if (camelCaseMatch) { >- simpleName = prefix; >- } else { >- simpleName = CharOperation.toLowerCase(prefix); >- } >+ qualification = null; >+ if (camelCaseMatch) { >+ simpleName = prefix; > } else { >- qualification = CharOperation.subarray(prefix, 0, lastDotIndex); >- if (camelCaseMatch) { >- simpleName = CharOperation.subarray(prefix, >- lastDotIndex + 1, prefix.length); >- } else { >- simpleName = CharOperation.toLowerCase(CharOperation >- .subarray(prefix, lastDotIndex + 1, prefix.length)); >- } >+ simpleName = CharOperation.toLowerCase(prefix); > } >+ >+// if (lastDotIndex < 0 || true) { >+// qualification = null; >+// if (camelCaseMatch) { >+// simpleName = prefix; >+// } else { >+// simpleName = CharOperation.toLowerCase(prefix); >+// } >+// } else { >+// qualification = CharOperation.subarray(prefix, 0, lastDotIndex); >+// if (camelCaseMatch) { >+// simpleName = CharOperation.subarray(prefix, >+// lastDotIndex + 1, prefix.length); >+// } else { >+// simpleName = CharOperation.toLowerCase(CharOperation >+// .subarray(prefix, lastDotIndex + 1, prefix.length)); >+// } >+// } > > IProgressMonitor progressMonitor = new IProgressMonitor() { > boolean isCanceled = false; >Index: src/org/eclipse/wst/jsdt/internal/core/index/DiskIndex.java >=================================================================== >RCS file: /cvsroot/webtools/org.eclipse.jsdt/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/index/DiskIndex.java,v >retrieving revision 1.4 >diff -u -r1.4 DiskIndex.java >--- src/org/eclipse/wst/jsdt/internal/core/index/DiskIndex.java 29 Oct 2007 16:50:38 -0000 1.4 >+++ src/org/eclipse/wst/jsdt/internal/core/index/DiskIndex.java 25 May 2010 15:25:26 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2007 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -52,7 +52,7 @@ > private int bufferIndex, bufferEnd; // used when reading from the file into the streamBuffer > private int streamEnd; // used when writing data from the streamBuffer to the file > >-public static final String SIGNATURE= "INDEX VERSION 1.121"; //$NON-NLS-1$ >+public static final String SIGNATURE= "INDEX VERSION 1.122"; //$NON-NLS-1$ > private static final char[] SIGNATURE_CHARS = SIGNATURE.toCharArray(); > public static boolean DEBUG = false; > >Index: src/org/eclipse/wst/jsdt/internal/core/search/indexing/AbstractIndexer.java >=================================================================== >RCS file: /cvsroot/webtools/org.eclipse.jsdt/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/indexing/AbstractIndexer.java,v >retrieving revision 1.12 >diff -u -r1.12 AbstractIndexer.java >--- src/org/eclipse/wst/jsdt/internal/core/search/indexing/AbstractIndexer.java 23 Nov 2009 20:38:09 -0000 1.12 >+++ src/org/eclipse/wst/jsdt/internal/core/search/indexing/AbstractIndexer.java 25 May 2010 15:25:26 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2009 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -100,6 +100,10 @@ > packageName == null ? CharOperation.NO_CHAR : packageName); > > addIndexEntry(TYPE_DECL, indexKey); >+ >+ // add a second key that includes the package name >+ indexKey = TypeDeclarationPattern.createIndexKey(modifiers, CharOperation.concat(packageName, name, '.'), packageName, enclosingTypeNames, secondary); >+ addIndexEntry(TYPE_DECL, indexKey); > } > public void addTypeReference(char[] typeName) { > if (typeName!=null) >Index: src/org/eclipse/wst/jsdt/internal/core/search/matching/TypeDeclarationPattern.java >=================================================================== >RCS file: /cvsroot/webtools/org.eclipse.jsdt/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/TypeDeclarationPattern.java,v >retrieving revision 1.15 >diff -u -r1.15 TypeDeclarationPattern.java >--- src/org/eclipse/wst/jsdt/internal/core/search/matching/TypeDeclarationPattern.java 23 Nov 2009 20:38:09 -0000 1.15 >+++ src/org/eclipse/wst/jsdt/internal/core/search/matching/TypeDeclarationPattern.java 25 May 2010 15:25:26 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2009 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -145,7 +145,7 @@ > if (simpleName!=null && (index=CharOperation.lastIndexOf('.',simpleName)) >0) > { > pkg=CharOperation.subarray(simpleName, 0, index); >- simpleName=CharOperation.subarray(simpleName, index+1, simpleName.length); >+// simpleName=CharOperation.subarray(simpleName, index+1, simpleName.length); > } > > this.pkg = isCaseSensitive() ? pkg : CharOperation.toLowerCase(pkg); >@@ -232,8 +232,8 @@ > return false; > > // check package - exact match only >- if (this.pkg != null && !CharOperation.equals(this.pkg, pattern.pkg, isCaseSensitive())) >- return false; >+ //if (this.pkg != null && !CharOperation.equals(this.pkg, pattern.pkg, isCaseSensitive())) >+ //return false; > > // check enclosingTypeNames - exact match only > if (this.enclosingTypeNames != null) { >#P org.eclipse.wst.jsdt.ui >Index: src/org/eclipse/wst/jsdt/internal/ui/text/java/LazyJavaTypeCompletionProposal.java >=================================================================== >RCS file: /cvsroot/webtools/org.eclipse.jsdt/plugins/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/LazyJavaTypeCompletionProposal.java,v >retrieving revision 1.13 >diff -u -r1.13 LazyJavaTypeCompletionProposal.java >--- src/org/eclipse/wst/jsdt/internal/ui/text/java/LazyJavaTypeCompletionProposal.java 24 Mar 2010 19:08:24 -0000 1.13 >+++ src/org/eclipse/wst/jsdt/internal/ui/text/java/LazyJavaTypeCompletionProposal.java 25 May 2010 15:25:27 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2009 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -39,7 +39,7 @@ > */ > public class LazyJavaTypeCompletionProposal extends LazyJavaCompletionProposal { > /** Triggers for types. Do not modify. */ >- protected static final char[] TYPE_TRIGGERS= new char[] { '.', '\t', '[', '(', ' ' }; >+ protected static final char[] TYPE_TRIGGERS= new char[] { '\t', '[', '(', ' ' }; > /** Triggers for types in javadoc. Do not modify. */ > protected static final char[] JDOC_TYPE_TRIGGERS= new char[] { '#', '}', ' ', '.' }; > >@@ -84,10 +84,10 @@ > if (fProposal.getKind() == CompletionProposal.TYPE_REF && fInvocationContext.getCoreContext().isInJsdocText()) > return getSimpleTypeName(); > >- String qualifiedTypeName= getQualifiedTypeName(); >- if (qualifiedTypeName.indexOf('.') == -1) >- // default package - no imports needed >- return qualifiedTypeName; >+ String qualifiedTypeName= replacement; >+// if (qualifiedTypeName.indexOf('.') == -1) >+// // default package - no imports needed >+// return qualifiedTypeName; > > /* > * If the user types in the qualification, don't force import rewriting on him - insert the >@@ -339,7 +339,7 @@ > */ > protected String computeSortString() { > // try fast sort string to avoid display string creation >- return getSimpleTypeName() + Character.MIN_VALUE + getQualifiedTypeName(); >+ return getQualifiedTypeName(); > } > > /*
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 305694
:
161887
|
161888
|
168827
|
168831
|
169730
| 169843