1 /*******************************************************************************
2 * Copyright (c) 2000, 2003 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.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 of
17 * 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.
29 * @param superTypePackageName
30 * Name of the package that contains the super type of this new
31 * anonymous type declaration .
33 * @param superTypeName
34 * Name of the super type of this new anonymous type declaration.
36 * @param parameterPackageNames
37 * Names of the packages in which the parameter types are
38 * declared. Should contain as many elements as
41 * @param parameterTypeNames
42 * Names of the parameters types. Should contain as many elements
43 * as parameterPackageNames.
45 * @param completionName
46 * The completion for the anonymous type declaration. Can include
47 * zero, one or two brackets. If the closing bracket is included,
48 * then the cursor should be placed before it.
51 * The modifiers of the constructor.
53 * @param completionStart
54 * The start position of insertion of the name of this new
55 * anonymous type declaration.
57 * @param completionEnd
58 * The end position of insertion of the name of this new
59 * anonymous type declaration.
62 * The relevance of the completion proposal It is a positive
63 * integer which are used for determine if this proposal is more
64 * relevant than another proposal. This value can only be used
65 * for compare relevance. A proposal is more relevant than
66 * another if his relevance value is higher.
68 * NOTE - All package and type names are presented in their readable form:
69 * Package names are in the form "a.b.c". Base types are in the form "int"
70 * or "boolean". Array types are in the qualified form "M[]" or "int[]".
71 * Nested type names are in the qualified form "A.M". The default package is
72 * represented by an empty array.
74 * NOTE: parameter names can be retrieved from the source model after the
75 * user selects a specific method.
77 void acceptAnonymousType(char[] superTypePackageName, char[] superTypeName,
78 char[][] parameterPackageNames, char[][] parameterTypeNames,
79 char[][] parameterNames, char[] completionName, int modifiers,
80 int completionStart, int completionEnd, int relevance);
83 * Code assist notification of a class completion.
86 * Declaring package name of the class.
89 * @param completionName
90 * The completion for the class. Can include ';' for imported
93 * The modifiers of the class.
94 * @param completionStart
95 * The start position of insertion of the name of the class.
96 * @param completionEnd
97 * The end position of insertion of the name of the class.
99 * The relevance of the completion proposal It is a positive
100 * integer which are used for determine if this proposal is more
101 * relevant than another proposal. This value can only be used
102 * for compare relevance. A proposal is more relevant than
103 * another if his relevance value is higher.
105 * NOTE - All package and type names are presented in their readable form:
106 * Package names are in the form "a.b.c". Nested type names are in the
107 * qualified form "A.M". The default package is represented by an empty
110 void acceptClass(char[] packageName, char[] className,
111 char[] completionName, int modifiers, int completionStart,
112 int completionEnd, int relevance);
115 * Code assist notification of a compilation error detected during
119 * Only problems which are categorized as non-syntax errors are
120 * notified to the requestor, warnings are silently ignored. In
121 * case an error got signalled, no other completions might be
122 * available, therefore the problem message should be presented
123 * to the user. The source positions of the problem are related
124 * to the source where it was detected (might be in another
125 * compilation unit, if it was indirectly requested during the
126 * code assist process). Note: the problem knows its originating
129 void acceptError(IProblem error);
132 * Code assist notification of a field completion.
134 * @param declaringTypePackageName
135 * Name of the package in which the type that contains this field
137 * @param declaringTypeName
138 * Name of the type declaring this new field.
141 * @param typePackageName
142 * Name of the package in which the type of this field is
145 * Name of the type of this field.
146 * @param completionName
147 * The completion for the field.
149 * The modifiers of this field.
150 * @param completionStart
151 * The start position of insertion of the name of this field.
152 * @param completionEnd
153 * The end position of insertion of the name of this field.
155 * The relevance of the completion proposal It is a positive
156 * integer which are used for determine if this proposal is more
157 * relevant than another proposal. This value can only be used
158 * for compare relevance. A proposal is more relevant than
159 * another if his relevance value is higher.
161 * NOTE - All package and type names are presented in their readable form:
162 * Package names are in the form "a.b.c". Base types are in the form "int"
163 * or "boolean". Array types are in the qualified form "M[]" or "int[]".
164 * Nested type names are in the qualified form "A.M". The default package is
165 * represented by an empty array.
167 void acceptField(char[] declaringTypePackageName, char[] declaringTypeName,
168 char[] name, char[] typePackageName, char[] typeName,
169 char[] completionName, int modifiers, int completionStart,
170 int completionEnd, int relevance);
173 * Code assist notification of an interface completion.
176 * Declaring package name of the interface.
178 * Name of the interface.
179 * @param completionName
180 * The completion for the interface. Can include ';' for imported
183 * The modifiers of the interface.
184 * @param completionStart
185 * The start position of insertion of the name of the interface.
186 * @param completionEnd
187 * The end position of insertion of the name of the interface.
189 * The relevance of the completion proposal It is a positive
190 * integer which are used for determine if this proposal is more
191 * relevant than another proposal. This value can only be used
192 * for compare relevance. A proposal is more relevant than
193 * another if his relevance value is higher.
195 * NOTE - All package and type names are presented in their readable form:
196 * Package names are in the form "a.b.c". Nested type names are in the
197 * qualified form "A.M". The default package is represented by an empty
200 void acceptInterface(char[] packageName, char[] interfaceName,
201 char[] completionName, int modifiers, int completionStart,
202 int completionEnd, int relevance);
205 * Code assist notification of a keyword completion.
208 * The keyword source.
209 * @param completionStart
210 * The start position of insertion of the name of this keyword.
211 * @param completionEnd
212 * The end position of insertion of the name of this keyword.
214 * The relevance of the completion proposal It is a positive
215 * integer which are used for determine if this proposal is more
216 * relevant than another proposal. This value can only be used
217 * for compare relevance. A proposal is more relevant than
218 * another if his relevance value is higher.
220 void acceptKeyword(char[] keywordName, int completionStart,
221 int completionEnd, int relevance);
224 * Code assist notification of a label completion.
228 * @param completionStart
229 * The start position of insertion of the name of this label.
230 * @param completionEnd
231 * The end position of insertion of the name of this label.
233 * The relevance of the completion proposal It is a positive
234 * integer which are used for determine if this proposal is more
235 * relevant than another proposal. This value can only be used
236 * for compare relevance. A proposal is more relevant than
237 * another if his relevance value is higher.
239 void acceptLabel(char[] labelName, int completionStart, int completionEnd,
243 * Code assist notification of a local variable completion.
246 * Name of the new local variable.
247 * @param typePackageName
248 * Name of the package in which the type of this new local
249 * variable is declared.
251 * Name of the type of this new local variable.
253 * The modifiers of this new local variable.
254 * @param completionStart
255 * The start position of insertion of the name of this new local
257 * @param completionEnd
258 * The end position of insertion of the name of this new local
261 * The relevance of the completion proposal It is a positive
262 * integer which are used for determine if this proposal is more
263 * relevant than another proposal. This value can only be used
264 * for compare relevance. A proposal is more relevant than
265 * another if his relevance value is higher.
267 * NOTE - All package and type names are presented in their readable form:
268 * Package names are in the form "a.b.c". Base types are in the form "int"
269 * or "boolean". Array types are in the qualified form "M[]" or "int[]".
270 * Nested type names are in the qualified form "A.M". The default package is
271 * represented by an empty array.
273 void acceptLocalVariable(char[] name, char[] typePackageName,
274 char[] typeName, int modifiers, int completionStart,
275 int completionEnd, int relevance);
278 * Code assist notification of a method completion.
280 * @param declaringTypePackageName
281 * Name of the package in which the type that contains this new
282 * method is declared.
283 * @param declaringTypeName
284 * Name of the type declaring this new method.
286 * Name of the new method.
287 * @param parameterPackageNames
288 * Names of the packages in which the parameter types are
289 * declared. Should contain as many elements as
290 * parameterTypeNames.
291 * @param parameterTypeNames
292 * Names of the parameters types. Should contain as many elements
293 * as parameterPackageNames.
294 * @param returnTypePackageName
295 * Name of the package in which the return type is declared.
296 * @param returnTypeName
297 * Name of the return type of this new method, should be
298 * <code>null</code> for a constructor.
299 * @param completionName
300 * The completion for the method. Can include zero, one or two
301 * brackets. If the closing bracket is included, then the cursor
302 * should be placed before it.
304 * The modifiers of this new method.
305 * @param completionStart
306 * The start position of insertion of the name of this new
308 * @param completionEnd
309 * The end position of insertion of the name of this new method.
311 * The relevance of the completion proposal It is a positive
312 * integer which are used for determine if this proposal is more
313 * relevant than another proposal. This value can only be used
314 * for compare relevance. A proposal is more relevant than
315 * another if his relevance value is higher.
317 * NOTE - All package and type names are presented in their readable form:
318 * Package names are in the form "a.b.c". Base types are in the form "int"
319 * or "boolean". Array types are in the qualified form "M[]" or "int[]".
320 * Nested type names are in the qualified form "A.M". The default package is
321 * represented by an empty array.
323 * NOTE: parameter names can be retrieved from the source model after the
324 * user selects a specific method.
326 void acceptMethod(char[] declaringTypePackageName,
327 char[] declaringTypeName, char[] selector,
328 char[][] parameterPackageNames, char[][] parameterTypeNames,
329 char[][] parameterNames, char[] returnTypePackageName,
330 char[] returnTypeName, char[] completionName, int modifiers,
331 int completionStart, int completionEnd, int relevance);
334 * Code assist notification of a method completion.
336 * @param declaringTypePackageName
337 * Name of the package in which the type that contains this new
338 * method is declared.
339 * @param declaringTypeName
340 * Name of the type declaring this new method.
342 * Name of the new method.
343 * @param parameterPackageNames
344 * Names of the packages in which the parameter types are
345 * declared. Should contain as many elements as
346 * parameterTypeNames.
347 * @param parameterTypeNames
348 * Names of the parameters types. Should contain as many elements
349 * as parameterPackageNames.
350 * @param returnTypePackageName
351 * Name of the package in which the return type is declared.
352 * @param returnTypeName
353 * Name of the return type of this new method, should be
354 * <code>null</code> for a constructor.
355 * @param completionName
356 * The completion for the method. Can include zero, one or two
357 * brackets. If the closing bracket is included, then the cursor
358 * should be placed before it.
360 * The modifiers of this new method.
361 * @param completionStart
362 * The start position of insertion of the name of this new
364 * @param completionEnd
365 * The end position of insertion of the name of this new method.
367 * The relevance of the completion proposal It is a positive
368 * integer which are used for determine if this proposal is more
369 * relevant than another proposal. This value can only be used
370 * for compare relevance. A proposal is more relevant than
371 * another if his relevance value is higher.
373 * NOTE - All package and type names are presented in their readable form:
374 * Package names are in the form "a.b.c". Base types are in the form "int"
375 * or "boolean". Array types are in the qualified form "M[]" or "int[]".
376 * Nested type names are in the qualified form "A.M". The default package is
377 * represented by an empty array.
379 * NOTE: parameter names can be retrieved from the source model after the
380 * user selects a specific method.
382 void acceptMethodDeclaration(char[] declaringTypePackageName,
383 char[] declaringTypeName, char[] selector,
384 char[][] parameterPackageNames, char[][] parameterTypeNames,
385 char[][] parameterNames, char[] returnTypePackageName,
386 char[] returnTypeName, char[] completionName, int modifiers,
387 int completionStart, int completionEnd, int relevance);
390 * Code assist notification of a modifier completion.
392 * @param modifierName
394 * @param completionStart
395 * The start position of insertion of the name of this new
397 * @param completionEnd
398 * The end position of insertion of the name of this new
401 * The relevance of the completion proposal It is a positive
402 * integer which are used for determine if this proposal is more
403 * relevant than another proposal. This value can only be used
404 * for compare relevance. A proposal is more relevant than
405 * another if his relevance value is higher.
407 void acceptModifier(char[] modifierName, int completionStart,
408 int completionEnd, int relevance);
411 * Code assist notification of a package completion.
415 * @param completionName
416 * The completion for the package. Can include '.*;' for imports.
417 * @param completionStart
418 * The start position of insertion of the name of this new
420 * @param completionEnd
421 * The end position of insertion of the name of this new package.
423 * The relevance of the completion proposal It is a positive
424 * integer which are used for determine if this proposal is more
425 * relevant than another proposal. This value can only be used
426 * for compare relevance. A proposal is more relevant than
427 * another if his relevance value is higher.
429 * NOTE - All package names are presented in their readable form: Package
430 * names are in the form "a.b.c". The default package is represented by an
433 void acceptPackage(char[] packageName, char[] completionName,
434 int completionStart, int completionEnd, int relevance);
437 * Code assist notification of a type completion.
440 * Declaring package name of the type.
443 * @param completionName
444 * The completion for the type. Can include ';' for imported
446 * @param completionStart
447 * The start position of insertion of the name of the type.
448 * @param completionEnd
449 * The end position of insertion of the name of the type.
451 * The relevance of the completion proposal It is a positive
452 * integer which are used for determine if this proposal is more
453 * relevant than another proposal. This value can only be used
454 * for compare relevance. A proposal is more relevant than
455 * another if his relevance value is higher.
457 * NOTE - All package and type names are presented in their readable form:
458 * Package names are in the form "a.b.c". Nested type names are in the
459 * qualified form "A.M". The default package is represented by an empty
462 void acceptType(char[] packageName, char[] typeName, char[] completionName,
463 int completionStart, int completionEnd, int relevance);
466 * Code assist notification of a variable name completion.
468 * @param typePackageName
469 * Name of the package in which the type of this variable is
472 * Name of the type of this variable.
474 * Name of the variable.
475 * @param completionName
476 * The completion for the variable.
477 * @param completionStart
478 * The start position of insertion of the name of this variable.
479 * @param completionEnd
480 * The end position of insertion of the name of this variable.
482 * The relevance of the completion proposal It is a positive
483 * integer which are used for determine if this proposal is more
484 * relevant than another proposal. This value can only be used
485 * for compare relevance. A proposal is more relevant than
486 * another if his relevance value is higher.
488 * NOTE - All package and type names are presented in their readable form:
489 * Package names are in the form "a.b.c". Base types are in the form "int"
490 * or "boolean". Array types are in the qualified form "M[]" or "int[]".
491 * Nested type names are in the qualified form "A.M". The default package is
492 * represented by an empty array.
494 void acceptVariableName(char[] typePackageName, char[] typeName,
495 char[] name, char[] completionName, int completionStart,
496 int completionEnd, int relevance);