You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(This is using version PMD 7.0.0.v20230502-1028-rc2)
The message regarding a specific marker/violation only shows placeholders in the "Show details..." dialog.
The message is rendered properly (with placeholders filled in) when hovering on the marker in the editor and in the "Violation Outline" table, but not in the "Show details..." dialog.
I've tried to track the problem as follows:
The view with the table that works is produced by ViolationOutline
@Overridepublicvoidrun() {
RuleselectedRule = getSelectedViolationRule();
if (selectedRule != null) {
RuleDialogruleDialog = newRuleDialog(shell, selectedRule, false);
ruleDialog.open();
}
}
/** * Returns the rule from the first selected violation. */publicRulegetSelectedViolationRule() {
Rulerule = null;
try {
IMarker[] markers = getSelectedViolations();
if (markers != null) {
rule = PMDPlugin.getDefault().getPreferencesManager().getRuleSet()
.getRuleByName(MarkerUtil.ruleNameFor(markers[0]));
}
} catch (RuntimeExceptione) {
logErrorByKey(StringKeys.ERROR_RUNTIME_EXCEPTION, e);
}
returnrule;
}
The information in the dialog is based uses the general Rule, not the specific IMarker. I get the impressing the RuleDialog was meant for another purpose: the rule editor, and that it's now deprecated anyway.
A workaround to fix this might be to create a fake Rule that has the actual message from the specific marker (similar to what FakeRuleViolation seems to do).
The text was updated successfully, but these errors were encountered:
adangel
added a commit
to adangel/pmd-eclipse-plugin
that referenced
this issue
May 13, 2023
This dialog can be opened from the problem view context menu.
The same dialog is used for the marker properties view.
The same dialog is opened from the outline view.
Fixespmd#178
adangel
added a commit
to adangel/pmd-eclipse-plugin
that referenced
this issue
May 13, 2023
(This is using version PMD 7.0.0.v20230502-1028-rc2)
The message regarding a specific marker/violation only shows placeholders in the "Show details..." dialog.
The message is rendered properly (with placeholders filled in) when hovering on the marker in the editor and in the "Violation Outline" table, but not in the "Show details..." dialog.
I've tried to track the problem as follows:
ViolationOutline
ViolationOutlinePageBR
ShowRuleAction
RuleDialog
, filled with theselectedRule
The interpolated message seems to be in the actual
IMarker
, which is why theViolationOutlinePageBR
and the markers in general seem to work.However, I think the problem is that the dialog uses
Rule
, instead of using theIMarker
. SeeShowRuleAction.getSelectedViolationRule()
:The information in the dialog is based uses the general
Rule
, not the specificIMarker
. I get the impressing theRuleDialog
was meant for another purpose: the rule editor, and that it's now deprecated anyway.A workaround to fix this might be to create a fake
Rule
that has the actual message from the specific marker (similar to whatFakeRuleViolation
seems to do).The text was updated successfully, but these errors were encountered: