Switched to Eclipse 2.1 development; eliminated JTidy package => now standalone plugin
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / codeassist / complete / CompletionOnLocalName.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2001, 2002 International Business Machines Corp. and others.
3  * All rights reserved. This program and the accompanying materials 
4  * are made available under the terms of the Common Public License v0.5 
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v05.html
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  ******************************************************************************/
11 package net.sourceforge.phpdt.internal.codeassist.complete;
12
13 import net.sourceforge.phpdt.internal.compiler.ast.Expression;
14 import net.sourceforge.phpdt.internal.compiler.ast.LocalDeclaration;
15 import net.sourceforge.phpdt.internal.compiler.lookup.BlockScope;
16 import net.sourceforge.phpdt.internal.compiler.util.CharOperation;
17
18
19 public class CompletionOnLocalName extends LocalDeclaration {
20         private static final char[] FAKENAMESUFFIX = " ".toCharArray(); //$NON-NLS-1$
21         public char[] realName;
22         public CompletionOnLocalName(Expression expr,char[] name, int sourceStart, int sourceEnd){
23                 super(expr, CharOperation.concat(name, FAKENAMESUFFIX), sourceStart, sourceEnd);
24                 this.realName = name;
25         }
26         
27         public void resolve(BlockScope scope) {
28                 super.resolve(scope);
29                 
30                 throw new CompletionNodeFound(this, scope);
31         }
32         public String toString(int tab) {
33                 String s = tabString(tab);
34                 s += "<CompleteOnLocalName:"; //$NON-NLS-1$
35                 if (type != null) s += type.toString() + " "; //$NON-NLS-1$
36                 s += new String(realName);
37                 if (initialization != null) s += " = " + initialization.toStringExpression(); //$NON-NLS-1$
38                 s += ">"; //$NON-NLS-1$
39                 return s;
40         }       
41 }
42