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 41327 Details for
Bug 141518
IEvaluationContext.newVariable is not considered when doing codecomplete.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
The fix probably looks like this patch
patch001.txt (text/plain), 3.70 KB, created by
David Audel
on 2006-05-12 12:12:15 EDT
(
hide
)
Description:
The fix probably looks like this patch
Filename:
MIME Type:
Creator:
David Audel
Created:
2006-05-12 12:12:15 EDT
Size:
3.70 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: eval/org/eclipse/jdt/internal/eval/EvaluationContext.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/EvaluationContext.java,v >retrieving revision 1.53 >diff -u -r1.53 EvaluationContext.java >--- eval/org/eclipse/jdt/internal/eval/EvaluationContext.java 29 Mar 2006 02:57:52 -0000 1.53 >+++ eval/org/eclipse/jdt/internal/eval/EvaluationContext.java 12 May 2006 16:09:48 -0000 >@@ -10,19 +10,25 @@ > *******************************************************************************/ > package org.eclipse.jdt.internal.eval; > >+import java.util.Locale; > import java.util.Map; > >+import org.eclipse.core.resources.IMarker; > import org.eclipse.jdt.core.CompletionRequestor; > import org.eclipse.jdt.core.IJavaProject; > import org.eclipse.jdt.core.compiler.*; >+import org.eclipse.jdt.core.eval.ICodeSnippetRequestor; > import org.eclipse.jdt.internal.codeassist.CompletionEngine; > import org.eclipse.jdt.internal.codeassist.ISelectionRequestor; > import org.eclipse.jdt.internal.codeassist.SelectionEngine; > import org.eclipse.jdt.internal.compiler.ClassFile; > import org.eclipse.jdt.internal.compiler.IProblemFactory; >+import org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader; >+import org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException; > import org.eclipse.jdt.internal.compiler.env.IBinaryType; > import org.eclipse.jdt.internal.compiler.env.ICompilationUnit; > import org.eclipse.jdt.internal.compiler.env.INameEnvironment; >+import org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory; > import org.eclipse.jdt.internal.compiler.problem.ProblemSeverities; > import org.eclipse.jdt.internal.compiler.util.SuffixConstants; > import org.eclipse.jdt.internal.core.SearchableEnvironment; >@@ -98,6 +104,20 @@ > * set of options used to configure the code assist engine. > */ > public void complete(char[] codeSnippet, int completionPosition, SearchableEnvironment environment, CompletionRequestor requestor, Map options, IJavaProject project) { >+ try { >+ IRequestor requestor2 = new IRequestor() { >+ public boolean acceptClassFiles(ClassFile[] classFiles, char[] codeSnippetClassName) { >+ // Do nothing >+ return true; >+ } >+ public void acceptProblem(CategorizedProblem problem, char[] fragmentSource, int fragmentKind) { >+ // Do nothing >+ } >+ }; >+ this.evaluateVariables(environment, options, requestor2, new DefaultProblemFactory(Locale.getDefault())); >+ } catch (InstallException e) { >+ // Do nothing >+ } > final char[] className = "CodeSnippetCompletion".toCharArray(); //$NON-NLS-1$ > final CodeSnippetToCuMapper mapper = new CodeSnippetToCuMapper( > codeSnippet, >@@ -126,6 +146,25 @@ > } > }; > CompletionEngine engine = new CompletionEngine(environment, mapper.getCompletionRequestor(requestor), options, project); >+ >+ if (this.installedVars != null) { >+ IBinaryType binaryType = this.getRootCodeSnippetBinary(); >+ if (binaryType != null) { >+ engine.lookupEnvironment.cacheBinaryType(binaryType, null /*no access restriction*/); >+ } >+ >+ ClassFile[] classFiles = installedVars.classFiles; >+ for (int i = 0; i < classFiles.length; i++) { >+ ClassFile classFile = classFiles[i]; >+ IBinaryType binary = null; >+ try { >+ binary = new ClassFileReader(classFile.getBytes(), null); >+ } catch (ClassFormatException e) { >+ e.printStackTrace(); // Should never happen since we compiled this type >+ } >+ engine.lookupEnvironment.cacheBinaryType(binary, null /*no access restriction*/); >+ } >+ } > engine.complete(sourceUnit, mapper.startPosOffset + completionPosition, 0); > } > /**
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 141518
:
41327
|
50801