Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilos Kleint2011-01-21 12:51:42 +0000
committerMilos Kleint2011-01-21 12:51:42 +0000
commit6c3e285768be609782919baee025bc57e9c1716d (patch)
treefbfbecff1de5a2482c4ac66f8eca987a1f3912e7
parent190eef4e8de3ea5399cb6d01fa07a85fde6267b7 (diff)
downloadm2e-core-6c3e285768be609782919baee025bc57e9c1716d.tar.gz
m2e-core-6c3e285768be609782919baee025bc57e9c1716d.tar.xz
m2e-core-6c3e285768be609782919baee025bc57e9c1716d.zip
have the discover marker resolution appear as quickfix proposal in both cases currently used.
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomQuickAssistProcessor.java31
1 files changed, 20 insertions, 11 deletions
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomQuickAssistProcessor.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomQuickAssistProcessor.java
index c536a975..c6daf15f 100644
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomQuickAssistProcessor.java
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomQuickAssistProcessor.java
@@ -114,17 +114,9 @@ public class PomQuickAssistProcessor implements IQuickAssistProcessor {
else if (hint.equals(IMavenConstants.EDITOR_HINT_NOT_COVERED_MOJO_EXECUTION)) {
proposals.add(new LifecycleMappingProposal(context, mark, PluginExecutionAction.ignore));
proposals.add(new LifecycleMappingProposal(context, mark, PluginExecutionAction.execute));
- } else {
- //when no direct proposals, try looking for any registered marker resolutions and wrap them.
- //not to be the default behaviour, marker resolutions have different ui/behaviour
- //TODO we might consider moving all proposals to this scheme eventually.. need
- // to remember not wrapping instances of ICompletionProposal and correctly set the context.
- if (IDE.getMarkerHelpRegistry().hasResolutions(mark.getMarker())) {
- IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry().getResolutions(mark.getMarker());
- for (IMarkerResolution res : resolutions) {
- proposals.add(new MarkerResolutionProposal(res, mark.getMarker()));
- }
- }
+ extractedFromMarkers(proposals, mark);
+ } else if (hint.equals(IMavenConstants.EDITOR_HINT_UNKNOWN_PACKAGING)){
+ extractedFromMarkers(proposals, mark);
}
}
}
@@ -140,6 +132,23 @@ public class PomQuickAssistProcessor implements IQuickAssistProcessor {
return null;
}
+ private void extractedFromMarkers(List<ICompletionProposal> proposals, MarkerAnnotation mark) {
+ //try looking for any additional registered marker resolutions and wrap them.
+ //not to be the default behaviour, marker resolutions have different ui/behaviour
+ //TODO we might consider moving all proposals to this scheme eventually.. need
+ // to remember not wrapping instances of ICompletionProposal and correctly set the context (but how do you set context
+ // to something not created by you?? possible memory leak.
+ if (IDE.getMarkerHelpRegistry().hasResolutions(mark.getMarker())) {
+ IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry().getResolutions(mark.getMarker());
+ for (IMarkerResolution res : resolutions) {
+ //sort of weak condition, but can't think of anything else that would filter our explicitly declared ones..
+ if (!res.getClass().getName().contains("org.eclipse.m2e.editor.xml")) {
+ proposals.add(new MarkerResolutionProposal(res, mark.getMarker()));
+ }
+ }
+ }
+ }
+
public String getErrorMessage() {
return null;
}

Back to the top