1
/*******************************************************************************
2
* Copyright (c) 2000, 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
9
* IBM Corporation - initial API and implementation
11
*******************************************************************************/
12
package org.eclipse.cdt.ui.text;
14
import org.eclipse.core.runtime.CoreException;
16
import org.eclipse.cdt.core.model.ITranslationUnit;
19
* Interface to be implemented by contributors to the extension point
20
* <code>org.eclipse.cdt.ui.quickFixProcessors</code>.
24
public interface IQuickFixProcessor {
26
* Returns <code>true</code> if the processor has proposals for the given problem. This test should be an
27
* optimistic guess and be very cheap.
29
* @param unit the compilation unit
30
* @param problemId the problem Id. The id is of a problem of the problem type(s) this processor specified in
31
* the extension point.
32
* @return <code>true</code> if the processor has proposals for the given problem
34
boolean hasCorrections(ITranslationUnit unit, int problemId);
37
* Collects corrections or code manipulations for the given context.
39
* @param context Defines current compilation unit, position and a shared AST
40
* @param locations Problems are the current location.
41
* @return the corrections applicable at the location or <code>null</code> if no proposals
43
* @throws CoreException CoreException can be thrown if the operation fails
45
ICCompletionProposal[] getCorrections(IInvocationContext context,
46
IProblemLocation[] locations) throws CoreException;