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;
13 import net.sourceforge.phpdt.core.compiler.IProblem;
16 * A completion requestor accepts results as they are computed and is aware
17 * of source positions to complete the various different results.
19 * This interface may be implemented by clients.
25 public interface ICompletionRequestor {
27 * Code assist notification of an anonymous type declaration completion.
28 * @param superTypePackageName Name of the package that contains the super type of this
29 * new anonymous type declaration .
31 * @param superTypeName Name of the super type of this new anonymous type declaration.
33 * @param parameterPackageNames Names of the packages in which the parameter types are declared.
34 * Should contain as many elements as parameterTypeNames.
36 * @param parameterTypeNames Names of the parameters types.
37 * Should contain as many elements as parameterPackageNames.
39 * @param completionName The completion for the anonymous type declaration.
40 * Can include zero, one or two brackets. If the closing bracket is included,
41 * then the cursor should be placed before it.
43 * @param modifiers The modifiers of the constructor.
45 * @param completionStart The start position of insertion of the name of this new anonymous type declaration.
47 * @param completionEnd The end position of insertion of the name of this new anonymous type declaration.
49 * @param relevance The relevance of the completion proposal
50 * It is a positive integer which are used for determine if this proposal is more relevant than another proposal.
51 * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance
54 * NOTE - All package and type names are presented in their readable form:
55 * Package names are in the form "a.b.c".
56 * Base types are in the form "int" or "boolean".
57 * Array types are in the qualified form "M[]" or "int[]".
58 * Nested type names are in the qualified form "A.M".
59 * The default package is represented by an empty array.
61 * NOTE: parameter names can be retrieved from the source model after the user selects a specific method.
63 void acceptAnonymousType(
64 char[] superTypePackageName,
66 char[][] parameterPackageNames,
67 char[][] parameterTypeNames,
68 char[][] parameterNames,
69 char[] completionName,
75 * Code assist notification of a class completion.
77 * @param packageName Declaring package name of the class.
78 * @param className Name of the class.
79 * @param completionName The completion for the class. Can include ';' for imported classes.
80 * @param modifiers The modifiers of the class.
81 * @param completionStart The start position of insertion of the name of the class.
82 * @param completionEnd The end position of insertion of the name of the class.
83 * @param relevance The relevance of the completion proposal
84 * It is a positive integer which are used for determine if this proposal is more relevant than another proposal.
85 * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance
88 * NOTE - All package and type names are presented in their readable form:
89 * Package names are in the form "a.b.c".
90 * Nested type names are in the qualified form "A.M".
91 * The default package is represented by an empty array.
96 char[] completionName,
102 * Code assist notification of a compilation error detected during completion.
103 * @param error Only problems which are categorized as non-syntax errors are notified to the
104 * requestor, warnings are silently ignored.
105 * In case an error got signalled, no other completions might be available,
106 * therefore the problem message should be presented to the user.
107 * The source positions of the problem are related to the source where it was
108 * detected (might be in another compilation unit, if it was indirectly requested
109 * during the code assist process).
110 * Note: the problem knows its originating file name.
112 void acceptError(IProblem error);
114 * Code assist notification of a field completion.
116 * @param declaringTypePackageName Name of the package in which the type that contains this field is declared.
117 * @param declaringTypeName Name of the type declaring this new field.
118 * @param name Name of the field.
119 * @param typePackageName Name of the package in which the type of this field is declared.
120 * @param typeName Name of the type of this field.
121 * @param completionName The completion for the field.
122 * @param modifiers The modifiers of this field.
123 * @param completionStart The start position of insertion of the name of this field.
124 * @param completionEnd The end position of insertion of the name of this field.
125 * @param relevance The relevance of the completion proposal
126 * It is a positive integer which are used for determine if this proposal is more relevant than another proposal.
127 * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance
130 * NOTE - All package and type names are presented in their readable form:
131 * Package names are in the form "a.b.c".
132 * Base types are in the form "int" or "boolean".
133 * Array types are in the qualified form "M[]" or "int[]".
134 * Nested type names are in the qualified form "A.M".
135 * The default package is represented by an empty array.
138 char[] declaringTypePackageName,
139 char[] declaringTypeName,
141 char[] typePackageName,
143 char[] completionName,
149 * Code assist notification of an interface completion.
151 * @param packageName Declaring package name of the interface.
152 * @param className Name of the interface.
153 * @param completionName The completion for the interface. Can include ';' for imported interfaces.
154 * @param modifiers The modifiers of the interface.
155 * @param completionStart The start position of insertion of the name of the interface.
156 * @param completionEnd The end position of insertion of the name of the interface.
157 * @param relevance The relevance of the completion proposal
158 * It is a positive integer which are used for determine if this proposal is more relevant than another proposal.
159 * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance
162 * NOTE - All package and type names are presented in their readable form:
163 * Package names are in the form "a.b.c".
164 * Nested type names are in the qualified form "A.M".
165 * The default package is represented by an empty array.
167 void acceptInterface(
169 char[] interfaceName,
170 char[] completionName,
176 * Code assist notification of a keyword completion.
177 * @param keywordName The keyword source.
178 * @param completionStart The start position of insertion of the name of this keyword.
179 * @param completionEnd The end position of insertion of the name of this keyword.
180 * @param relevance The relevance of the completion proposal
181 * It is a positive integer which are used for determine if this proposal is more relevant than another proposal.
182 * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance
185 void acceptKeyword(char[] keywordName, int completionStart, int completionEnd, int relevance);
187 * Code assist notification of a label completion.
189 * @param labelName The label source.
190 * @param completionStart The start position of insertion of the name of this label.
191 * @param completionEnd The end position of insertion of the name of this label.
192 * @param relevance The relevance of the completion proposal
193 * It is a positive integer which are used for determine if this proposal is more relevant than another proposal.
194 * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance
197 void acceptLabel(char[] labelName, int completionStart, int completionEnd, int relevance);
199 * Code assist notification of a local variable completion.
201 * @param name Name of the new local variable.
202 * @param typePackageName Name of the package in which the type of this new local variable is declared.
203 * @param typeName Name of the type of this new local variable.
204 * @param modifiers The modifiers of this new local variable.
205 * @param completionStart The start position of insertion of the name of this new local variable.
206 * @param completionEnd The end position of insertion of the name of this new local variable.
207 * @param relevance The relevance of the completion proposal
208 * It is a positive integer which are used for determine if this proposal is more relevant than another proposal.
209 * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance
212 * NOTE - All package and type names are presented in their readable form:
213 * Package names are in the form "a.b.c".
214 * Base types are in the form "int" or "boolean".
215 * Array types are in the qualified form "M[]" or "int[]".
216 * Nested type names are in the qualified form "A.M".
217 * The default package is represented by an empty array.
219 void acceptLocalVariable(
221 char[] typePackageName,
228 * Code assist notification of a method completion.
230 * @param declaringTypePackageName Name of the package in which the type that contains this new method is declared.
231 * @param declaringTypeName Name of the type declaring this new method.
232 * @param selector Name of the new method.
233 * @param parameterPackageNames Names of the packages in which the parameter types are declared.
234 * Should contain as many elements as parameterTypeNames.
235 * @param parameterTypeNames Names of the parameters types.
236 * Should contain as many elements as parameterPackageNames.
237 * @param returnTypePackageName Name of the package in which the return type is declared.
238 * @param returnTypeName Name of the return type of this new method, should be <code>null</code> for a constructor.
239 * @param completionName The completion for the method. Can include zero, one or two brackets. If the closing bracket is included, then the cursor should be placed before it.
240 * @param modifiers The modifiers of this new method.
241 * @param completionStart The start position of insertion of the name of this new method.
242 * @param completionEnd The end position of insertion of the name of this new method.
243 * @param relevance The relevance of the completion proposal
244 * It is a positive integer which are used for determine if this proposal is more relevant than another proposal.
245 * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance
248 * NOTE - All package and type names are presented in their readable form:
249 * Package names are in the form "a.b.c".
250 * Base types are in the form "int" or "boolean".
251 * Array types are in the qualified form "M[]" or "int[]".
252 * Nested type names are in the qualified form "A.M".
253 * The default package is represented by an empty array.
255 * NOTE: parameter names can be retrieved from the source model after the user selects a specific method.
258 char[] declaringTypePackageName,
259 char[] declaringTypeName,
261 char[][] parameterPackageNames,
262 char[][] parameterTypeNames,
263 char[][] parameterNames,
264 char[] returnTypePackageName,
265 char[] returnTypeName,
266 char[] completionName,
273 * Code assist notification of a method completion.
275 * @param declaringTypePackageName Name of the package in which the type that contains this new method is declared.
276 * @param declaringTypeName Name of the type declaring this new method.
277 * @param selector Name of the new method.
278 * @param parameterPackageNames Names of the packages in which the parameter types are declared.
279 * Should contain as many elements as parameterTypeNames.
280 * @param parameterTypeNames Names of the parameters types.
281 * Should contain as many elements as parameterPackageNames.
282 * @param returnTypePackageName Name of the package in which the return type is declared.
283 * @param returnTypeName Name of the return type of this new method, should be <code>null</code> for a constructor.
284 * @param completionName The completion for the method. Can include zero, one or two brackets. If the closing bracket is included, then the cursor should be placed before it.
285 * @param modifiers The modifiers of this new method.
286 * @param completionStart The start position of insertion of the name of this new method.
287 * @param completionEnd The end position of insertion of the name of this new method.
288 * @param relevance The relevance of the completion proposal
289 * It is a positive integer which are used for determine if this proposal is more relevant than another proposal.
290 * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance
293 * NOTE - All package and type names are presented in their readable form:
294 * Package names are in the form "a.b.c".
295 * Base types are in the form "int" or "boolean".
296 * Array types are in the qualified form "M[]" or "int[]".
297 * Nested type names are in the qualified form "A.M".
298 * The default package is represented by an empty array.
300 * NOTE: parameter names can be retrieved from the source model after the user selects a specific method.
302 void acceptMethodDeclaration(
303 char[] declaringTypePackageName,
304 char[] declaringTypeName,
306 char[][] parameterPackageNames,
307 char[][] parameterTypeNames,
308 char[][] parameterNames,
309 char[] returnTypePackageName,
310 char[] returnTypeName,
311 char[] completionName,
317 * Code assist notification of a modifier completion.
319 * @param modifierName The new modifier.
320 * @param completionStart The start position of insertion of the name of this new modifier.
321 * @param completionEnd The end position of insertion of the name of this new modifier.
322 * @param relevance The relevance of the completion proposal
323 * It is a positive integer which are used for determine if this proposal is more relevant than another proposal.
324 * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance
327 void acceptModifier(char[] modifierName, int completionStart, int completionEnd, int relevance);
329 * Code assist notification of a package completion.
331 * @param packageName The package name.
332 * @param completionName The completion for the package. Can include '.*;' for imports.
333 * @param completionStart The start position of insertion of the name of this new package.
334 * @param completionEnd The end position of insertion of the name of this new package.
335 * @param relevance The relevance of the completion proposal
336 * It is a positive integer which are used for determine if this proposal is more relevant than another proposal.
337 * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance
340 * NOTE - All package names are presented in their readable form:
341 * Package names are in the form "a.b.c".
342 * The default package is represented by an empty array.
346 char[] completionName,
351 * Code assist notification of a type completion.
353 * @param packageName Declaring package name of the type.
354 * @param typeName Name of the type.
355 * @param completionName The completion for the type. Can include ';' for imported types.
356 * @param completionStart The start position of insertion of the name of the type.
357 * @param completionEnd The end position of insertion of the name of the type.
358 * @param relevance The relevance of the completion proposal
359 * It is a positive integer which are used for determine if this proposal is more relevant than another proposal.
360 * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance
363 * NOTE - All package and type names are presented in their readable form:
364 * Package names are in the form "a.b.c".
365 * Nested type names are in the qualified form "A.M".
366 * The default package is represented by an empty array.
371 char[] completionName,
377 * Code assist notification of a variable name completion.
379 * @param typePackageName Name of the package in which the type of this variable is declared.
380 * @param typeName Name of the type of this variable.
381 * @param name Name of the variable.
382 * @param completionName The completion for the variable.
383 * @param completionStart The start position of insertion of the name of this variable.
384 * @param completionEnd The end position of insertion of the name of this variable.
385 * @param relevance The relevance of the completion proposal
386 * It is a positive integer which are used for determine if this proposal is more relevant than another proposal.
387 * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance
390 * NOTE - All package and type names are presented in their readable form:
391 * Package names are in the form "a.b.c".
392 * Base types are in the form "int" or "boolean".
393 * Array types are in the qualified form "M[]" or "int[]".
394 * Nested type names are in the qualified form "A.M".
395 * The default package is represented by an empty array.
397 void acceptVariableName(
398 char[] typePackageName,
401 char[] completionName,