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
9 * IBM Corporation - initial API and implementation
10 ******************************************************************************/
11 package net.sourceforge.phpdt.core;
14 * Common protocol for Java elements that support source code assist and code
17 * This interface is not intended to be implemented by clients.
20 public interface ICodeAssist {
23 * Performs code completion at the given offset position in this compilation unit,
24 * reporting results to the given completion requestor. The <code>offset</code>
25 * is the 0-based index of the character, after which code assist is desired.
26 * An <code>offset</code> of -1 indicates to code assist at the beginning of this
29 * @param offset the given offset position
30 * @param requestor the given completion requestor
31 * @exception JavaModelException if code assist could not be performed. Reasons include:<ul>
32 * <li>This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li>
33 * <li> The position specified is < -1 or is greater than this compilation unit's
34 * source length (INDEX_OUT_OF_BOUNDS)
37 * @exception IllegalArgumentException if <code>requestor</code> is <code>null</code>
40 void codeComplete(int offset, ICompletionRequestor requestor)
41 throws JavaModelException;
43 * Performs code selection on the given selected text in this compilation unit,
44 * reporting results to the given selection requestor. The <code>offset</code>
45 * is the 0-based index of the first selected character. The <code>length</code>
46 * is the number of selected characters.
48 * @param offset the given offset position
49 * @param length the number of selected characters
51 * @exception JavaModelException if code resolve could not be performed. Reasons include:
52 * <li>This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li>
53 * <li> The range specified is not within this element's
54 * source range (INDEX_OUT_OF_BOUNDS)
58 IJavaElement[] codeSelect(int offset, int length) throws JavaModelException;
61 * Performs code completion at the given offset position in this compilation unit,
62 * reporting results to the given completion requestor. The <code>offset</code>
63 * is the 0-based index of the character, after which code assist is desired.
64 * An <code>offset</code> of -1 indicates to code assist at the beginning of this
67 * @param offset the given offset position
68 * @param requestor the given completion requestor
70 * @exception JavaModelException if code assist could not be performed. Reasons include:<ul>
71 * <li>This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li>
72 * <li> The position specified is < -1 or is greater than this compilation unit's
73 * source length (INDEX_OUT_OF_BOUNDS)
76 * @exception IllegalArgumentException if <code>requestor</code> is <code>null</code>
77 * @deprecated - use codeComplete(int, ICompletionRequestor) instead
79 // void codeComplete(int offset, ICodeCompletionRequestor requestor)
80 // throws JavaModelException;