129
|
1 /*******************************************************************************
|
|
2 * Copyright (c) 2006, 2007 IBM Corporation and others.
|
|
3 * All rights reserved. This program and the accompanying materials
|
|
4 * are made available under the terms of the Eclipse Public License v1.0
|
|
5 * which accompanies this distribution, and is available at
|
|
6 * http://www.eclipse.org/legal/epl-v10.html
|
|
7 *
|
|
8 * Contributors:
|
|
9 * IBM Corporation - initial API and implementation
|
|
10 * Port to the D programming language:
|
|
11 * Frank Benoit <benoit@tionex.de>
|
|
12 *******************************************************************************/
|
|
13 module dwtx.jface.text.quickassist.IQuickAssistProcessor;
|
|
14
|
131
|
15 import dwtx.jface.text.quickassist.QuickAssistAssistant; // packageimport
|
|
16 import dwtx.jface.text.quickassist.IQuickAssistAssistant; // packageimport
|
|
17 import dwtx.jface.text.quickassist.IQuickAssistAssistantExtension; // packageimport
|
|
18 import dwtx.jface.text.quickassist.IQuickAssistInvocationContext; // packageimport
|
|
19 import dwtx.jface.text.quickassist.IQuickFixableAnnotation; // packageimport
|
|
20
|
|
21
|
129
|
22 import dwt.dwthelper.utils;
|
|
23
|
|
24 import dwtx.jface.text.contentassist.ICompletionProposal;
|
|
25 import dwtx.jface.text.source.Annotation;
|
|
26
|
|
27
|
|
28 /**
|
|
29 * Quick assist processor for quick fixes and quick assists.
|
|
30 * <p>
|
|
31 * A processor can provide just quick fixes, just quick assists
|
|
32 * or both.
|
|
33 * </p>
|
|
34 * <p>
|
|
35 * This interface can be implemented by clients.</p>
|
|
36 *
|
|
37 * @since 3.2
|
|
38 */
|
|
39 public interface IQuickAssistProcessor {
|
|
40
|
|
41 /**
|
|
42 * Returns the reason why this quick assist processor
|
|
43 * was unable to produce any completion proposals.
|
|
44 *
|
|
45 * @return an error message or <code>null</code> if no error occurred
|
|
46 */
|
|
47 String getErrorMessage();
|
|
48
|
|
49 /**
|
|
50 * Tells whether this processor has a fix for the given annotation.
|
|
51 * <p>
|
|
52 * <strong>Note:</strong> This test must be fast and optimistic i.e. it is OK to return
|
|
53 * <code>true</code> even though there might be no quick fix.
|
|
54 * </p>
|
|
55 *
|
|
56 * @param annotation the annotation
|
|
57 * @return <code>true</code> if the assistant has a fix for the given annotation
|
|
58 */
|
|
59 bool canFix(Annotation annotation);
|
|
60
|
|
61 /**
|
|
62 * Tells whether this assistant has assists for the given invocation context.
|
|
63 *
|
|
64 * @param invocationContext the invocation context
|
|
65 * @return <code>true</code> if the assistant has a fix for the given annotation
|
|
66 */
|
|
67 bool canAssist(IQuickAssistInvocationContext invocationContext);
|
|
68
|
|
69 /**
|
|
70 * Returns a list of quick assist and quick fix proposals for the
|
|
71 * given invocation context.
|
|
72 *
|
|
73 * @param invocationContext the invocation context
|
|
74 * @return an array of completion proposals or <code>null</code> if no proposals are available
|
|
75 */
|
|
76 ICompletionProposal[] computeQuickAssistProposals(IQuickAssistInvocationContext invocationContext);
|
|
77
|
|
78 }
|