diff --git a/codan/org.eclipse.cdt.codan.ui/plugin.xml b/codan/org.eclipse.cdt.codan.ui/plugin.xml
index c1284b72bb7..c56460c3cf4 100644
--- a/codan/org.eclipse.cdt.codan.ui/plugin.xml
+++ b/codan/org.eclipse.cdt.codan.ui/plugin.xml
@@ -102,12 +102,11 @@
-
-
+ markerType="org.eclipse.cdt.core.problem">
diff --git a/codan/org.eclipse.cdt.codan.ui/schema/codanMarkerResolution.exsd b/codan/org.eclipse.cdt.codan.ui/schema/codanMarkerResolution.exsd
index 4cdbf233f09..c9c9ca64135 100644
--- a/codan/org.eclipse.cdt.codan.ui/schema/codanMarkerResolution.exsd
+++ b/codan/org.eclipse.cdt.codan.ui/schema/codanMarkerResolution.exsd
@@ -7,7 +7,6 @@
Extension point to plugin quick fix for codan markers
-
@@ -65,10 +64,11 @@
-
+
- Problem id of the problem for which quick fix is defined
+ Problem id of the problem for which quick fix is defined.
+If this is not codan problem (for example gcc error), it can be ommitted. Message pattern must be used in this case.
diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/CodanProblemMarkerResolutionGenerator.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/CodanProblemMarkerResolutionGenerator.java
index 7065ad299ab..73fc4665b56 100644
--- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/CodanProblemMarkerResolutionGenerator.java
+++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/CodanProblemMarkerResolutionGenerator.java
@@ -48,7 +48,7 @@ public class CodanProblemMarkerResolutionGenerator implements
readExtensions();
}
String id = marker.getAttribute(IMarker.PROBLEM, null);
- if (id == null)
+ if (id == null && resolutions.get(null) == null)
return new IMarkerResolution[0];
String message = marker.getAttribute(IMarker.MESSAGE, ""); //$NON-NLS-1$
Collection collection = resolutions.get(id);
@@ -62,7 +62,8 @@ public class CodanProblemMarkerResolutionGenerator implements
continue;
}
if (res.res instanceof AbstractCodanCMarkerResolution) {
- if (!((AbstractCodanCMarkerResolution)res.res).isApplicable(marker))
+ if (!((AbstractCodanCMarkerResolution) res.res)
+ .isApplicable(marker))
continue;
}
list.add(res.res);
@@ -97,7 +98,9 @@ public class CodanProblemMarkerResolutionGenerator implements
IConfigurationElement configurationElement) {
if (configurationElement.getName().equals("resolution")) { //$NON-NLS-1$
String id = configurationElement.getAttribute("problemId"); //$NON-NLS-1$
- if (id == null) {
+ String messagePattern = configurationElement
+ .getAttribute("messagePattern"); //$NON-NLS-1$
+ if (id == null && messagePattern == null) {
CodanUIActivator.log("Extension for " + EXTENSION_POINT_NAME //$NON-NLS-1$
+ " problemId is not defined"); //$NON-NLS-1$
return;
@@ -110,8 +113,6 @@ public class CodanProblemMarkerResolutionGenerator implements
CodanUIActivator.log(e);
return;
}
- String messagePattern = configurationElement
- .getAttribute("messagePattern"); //$NON-NLS-1$
if (messagePattern != null) {
try {
Pattern.compile(messagePattern);
diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/AbstractCodanCMarkerResolution.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/AbstractCodanCMarkerResolution.java
index c3105776732..9fd08787230 100644
--- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/AbstractCodanCMarkerResolution.java
+++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/AbstractCodanCMarkerResolution.java
@@ -230,4 +230,20 @@ public abstract class AbstractCodanCMarkerResolution implements
IIndex index = CCorePlugin.getIndexManager().getIndex(cProject);
return index;
}
+
+ /**
+ * @param marker
+ * @return
+ */
+ public String getProblemId(IMarker marker) {
+ return CodanProblemMarker.getProblemId(marker);
+ }
+
+ /**
+ * @param marker
+ * @return
+ */
+ public String getProblemMessage(IMarker marker) {
+ return CodanProblemMarker.getMessage(marker);
+ }
}