5a5ccf0a03
1) Allow the PMD context menu on any File type, not just *.java. 2) Modify some places which check for a .java extension to _not_ do so. 3) Modify some places to check with the PMDEngine whether a File "applies" (e.g. is it for a Language which is understood by PMD and are there any Rules in the RuleSet for that Language). Expand the Rule table to have a Language column in the 1st column. The table setup in this plugin/SWT still *sucks* as bad I remember it being the last time I added columns. With these changes I can get both JS and XML Rules to work. Violations show up, and for JS, I can be brought to the proper line number in the code! Also fixed and issue with this plugin looking for a "maxViolations" property on the Rules, which given PMD 5.0 changes to require a propery to exist to ask for a value... needed some tweaking to first check for the value on the Rule. More verbose, but a safer API than the Wild West style of pre-5.0. The Rule Editor needs some work to account for the new structure of Rules in PMD 5.0. Currently any Rule it creates causes things to blow up due to missing Language. Easy enough to fix, but it's just the 1st of several things needing to be corrected. git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@6742 51baf565-9d33-0410-a72c-fc3788e3496d
395 lines
15 KiB
XML
395 lines
15 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<?eclipse version="3.2"?>
|
|
<plugin>
|
|
|
|
<extension-point id="rulesets" name="rulesets" schema="schema/rulesets.exsd"/>
|
|
|
|
<extension
|
|
point="org.eclipse.help.toc">
|
|
<toc
|
|
file="toc.xml"
|
|
primary="true">
|
|
</toc>
|
|
</extension>
|
|
|
|
<extension
|
|
id="pmdMarker"
|
|
name="%marker.pmd"
|
|
point="org.eclipse.core.resources.markers">
|
|
<super
|
|
type="org.eclipse.core.resources.problemmarker">
|
|
</super>
|
|
<persistent
|
|
value="true">
|
|
</persistent>
|
|
<attribute
|
|
name="rulename">
|
|
</attribute>
|
|
</extension>
|
|
|
|
<extension
|
|
id="pmdTaskMarker"
|
|
name="%marker.task"
|
|
point="org.eclipse.core.resources.markers">
|
|
<super
|
|
type="net.sourceforge.pmd.eclipse.plugin.pmdMarker">
|
|
</super>
|
|
<super
|
|
type="org.eclipse.core.resources.taskmarker">
|
|
</super>
|
|
<persistent
|
|
value="true">
|
|
</persistent>
|
|
</extension>
|
|
|
|
<extension
|
|
id="pmdDFAMarker"
|
|
name="%marker.dfa"
|
|
point="org.eclipse.core.resources.markers">
|
|
<super type="org.eclipse.core.resources.problemmarker"/>
|
|
<persistent value="false"/>
|
|
</extension>
|
|
|
|
<extension
|
|
id="pmdBuilder"
|
|
name="%builder.name"
|
|
point="org.eclipse.core.resources.builders">
|
|
<builder>
|
|
<run
|
|
class="net.sourceforge.pmd.eclipse.runtime.builder.PMDBuilder">
|
|
</run>
|
|
</builder>
|
|
</extension>
|
|
|
|
<extension
|
|
id="pmdNature"
|
|
name="%nature.name"
|
|
point="org.eclipse.core.resources.natures">
|
|
<runtime>
|
|
<run
|
|
class="net.sourceforge.pmd.eclipse.runtime.builder.PMDNature">
|
|
</run>
|
|
</runtime>
|
|
<builder
|
|
id="net.sourceforge.pmd.eclipse.plugin.pmdBuilder">
|
|
</builder>
|
|
<requires-nature
|
|
id="org.eclipse.jdt.core.javanature">
|
|
</requires-nature>
|
|
</extension>
|
|
|
|
<extension
|
|
id="pmdPreferencePages"
|
|
name="PMDPreferencePages"
|
|
point="org.eclipse.ui.preferencePages">
|
|
<page
|
|
name="%preferences.pmd"
|
|
class="net.sourceforge.pmd.eclipse.ui.preferences.GeneralPreferencesPage"
|
|
id="net.sourceforge.pmd.eclipse.ui.preferences.generalPreferencesPage">
|
|
</page>
|
|
<page
|
|
name="%preferences.rulesets"
|
|
category="net.sourceforge.pmd.eclipse.ui.preferences.generalPreferencesPage"
|
|
class="net.sourceforge.pmd.eclipse.ui.preferences.PMDPreferencePage"
|
|
id="net.sourceforge.pmd.eclipse.ui.preferences.pmdPreferencePage">
|
|
</page>
|
|
|
|
<page name="Ruleset preferences - BR" category="net.sourceforge.pmd.ui.preferences.generalPreferencesPage" class="net.sourceforge.pmd.eclipse.ui.preferences.br.PMDPreferencePage" id="net.sourceforge.pmd.ui.preferences.pmdPreferencePage">
|
|
</page>
|
|
|
|
<page
|
|
name="%preferences.cpd"
|
|
category="net.sourceforge.pmd.eclipse.ui.preferences.generalPreferencesPage"
|
|
class="net.sourceforge.pmd.eclipse.ui.preferences.CPDPreferencePage"
|
|
id="net.sourceforge.pmd.eclipse.ui.preferences.cpdPreferencePage">
|
|
</page>
|
|
</extension>
|
|
|
|
<extension
|
|
point="org.eclipse.ui.ide.markerResolution">
|
|
<markerResolutionGenerator
|
|
markerType="net.sourceforge.pmd.eclipse.plugin.pmdMarker"
|
|
class="net.sourceforge.pmd.eclipse.ui.quickfix.PMDResolutionGenerator">
|
|
</markerResolutionGenerator>
|
|
</extension>
|
|
|
|
<extension
|
|
id="pmdPropertyPage"
|
|
name="PMD Property Page"
|
|
point="org.eclipse.ui.propertyPages">
|
|
<page
|
|
objectClass="org.eclipse.core.resources.IProject"
|
|
adaptable="true"
|
|
name="%properties.pmd"
|
|
nameFilter="*"
|
|
class="net.sourceforge.pmd.eclipse.ui.properties.PMDPropertyPage"
|
|
id="net.sourceforge.pmd.eclipse.ui.properties.pmdPropertyPage">
|
|
</page>
|
|
</extension>
|
|
|
|
<extension
|
|
id="pmdPopupMenus"
|
|
name="PMD Popup Menus"
|
|
point="org.eclipse.ui.popupMenus">
|
|
<objectContribution
|
|
objectClass="org.eclipse.core.resources.IProject"
|
|
adaptable="true"
|
|
nameFilter="*"
|
|
id="net.sourceforge.pmd.eclipse.ui.pmdProjectContribution">
|
|
<menu
|
|
label="%menu.pmd"
|
|
path="additions"
|
|
id="pmd.menu">
|
|
<separator
|
|
name="group">
|
|
</separator>
|
|
</menu>
|
|
<action
|
|
label="%action.checkpmd"
|
|
icon="icons/pmd-icon-16.gif"
|
|
class="net.sourceforge.pmd.eclipse.ui.actions.PMDCheckAction"
|
|
menubarPath="pmd.menu/group"
|
|
enablesFor="+"
|
|
id="net.sourceforge.pmd.eclipse.ui.pmdPopupCheckProjectAction">
|
|
</action>
|
|
<action
|
|
label="%action.clearpmd"
|
|
icon="icons/pmd-icon-16.gif"
|
|
class="net.sourceforge.pmd.eclipse.ui.actions.PMDRemoveMarkersAction"
|
|
menubarPath="pmd.menu/group"
|
|
enablesFor="+"
|
|
id="net.sourceforge.pmd.eclipse.ui.pmdRemoveMarkersAction">
|
|
</action>
|
|
<action
|
|
label="%action.checkcpd"
|
|
icon="icons/pmd-icon-16.gif"
|
|
class="net.sourceforge.pmd.eclipse.ui.actions.CPDCheckProjectAction"
|
|
menubarPath="pmd.menu/group"
|
|
enablesFor="1"
|
|
id="net.sourceforge.pmd.eclipse.ui.cpdCheckProjectAction">
|
|
</action>
|
|
<action
|
|
label="%action.clearreviews"
|
|
icon="icons/pmd-icon-16.gif"
|
|
class="net.sourceforge.pmd.eclipse.ui.actions.ClearReviewsAction"
|
|
menubarPath="pmd.menu/group"
|
|
enablesFor="+"
|
|
id="net.sourceforge.pmd.eclipse.ui.pmdClearReviewsAction">
|
|
</action>
|
|
<action
|
|
label="%action.generatereport"
|
|
icon="icons/pmd-icon-16.gif"
|
|
class="net.sourceforge.pmd.eclipse.ui.actions.GenerateReportAction"
|
|
menubarPath="pmd.menu/group"
|
|
enablesFor="1"
|
|
id="net.sourceforge.pmd.eclipse.ui.generateReportAction">
|
|
</action>
|
|
</objectContribution>
|
|
<objectContribution
|
|
objectClass="org.eclipse.core.resources.IFolder"
|
|
adaptable="true"
|
|
nameFilter="*"
|
|
id="net.sourceforge.pmd.eclipse.ui.pmdFolderContribution">
|
|
<menu
|
|
label="%menu.pmd"
|
|
path="additions"
|
|
id="pmd.menu">
|
|
<separator
|
|
name="group">
|
|
</separator>
|
|
</menu>
|
|
<action
|
|
label="%action.checkpmd"
|
|
icon="icons/pmd-icon-16.gif"
|
|
class="net.sourceforge.pmd.eclipse.ui.actions.PMDCheckAction"
|
|
menubarPath="pmd.menu/group"
|
|
enablesFor="+"
|
|
id="net.sourceforge.pmd.eclipse.ui.pmdFolderCheckProjectAction">
|
|
</action>
|
|
<action
|
|
label="%action.clearpmd"
|
|
icon="icons/pmd-icon-16.gif"
|
|
class="net.sourceforge.pmd.eclipse.ui.actions.PMDRemoveMarkersAction"
|
|
menubarPath="pmd.menu/group"
|
|
enablesFor="+"
|
|
id="net.sourceforge.pmd.eclipse.ui.pmdRemoveMarkersAction">
|
|
</action>
|
|
<action
|
|
label="%action.clearreviews"
|
|
icon="icons/pmd-icon-16.gif"
|
|
class="net.sourceforge.pmd.eclipse.ui.actions.ClearReviewsAction"
|
|
menubarPath="pmd.menu/group"
|
|
enablesFor="+"
|
|
id="net.sourceforge.pmd.eclipse.ui.pmdClearReviewsAction">
|
|
</action>
|
|
</objectContribution>
|
|
<objectContribution
|
|
objectClass="org.eclipse.core.resources.IFile"
|
|
adaptable="true"
|
|
nameFilter="*"
|
|
id="net.sourceforge.pmd.eclipse.ui.pmdFileContribution">
|
|
<menu
|
|
label="%menu.pmd"
|
|
path="additions"
|
|
id="pmd.menu">
|
|
<separator
|
|
name="group">
|
|
</separator>
|
|
</menu>
|
|
<action
|
|
label="%action.checkpmd"
|
|
icon="icons/pmd-icon-16.gif"
|
|
class="net.sourceforge.pmd.eclipse.ui.actions.PMDCheckAction"
|
|
menubarPath="pmd.menu/group"
|
|
enablesFor="+"
|
|
id="net.sourceforge.pmd.eclipse.ui.pmdCheckFileAction">
|
|
</action>
|
|
<action
|
|
label="%action.clearpmd"
|
|
icon="icons/pmd-icon-16.gif"
|
|
class="net.sourceforge.pmd.eclipse.ui.actions.PMDRemoveMarkersAction"
|
|
menubarPath="pmd.menu/group"
|
|
enablesFor="+"
|
|
id="net.sourceforge.pmd.eclipse.ui.pmdRemoveMarkersAction">
|
|
</action>
|
|
<action
|
|
label="%action.ast"
|
|
icon="icons/pmd-icon-16.gif"
|
|
class="net.sourceforge.pmd.eclipse.ui.actions.PMDGenerateASTAction"
|
|
menubarPath="pmd.menu/group"
|
|
enablesFor="+"
|
|
id="net.sourceforge.pmd.eclipse.ui.pmdGenerateAstAction">
|
|
</action>
|
|
<action
|
|
label="%action.clearreviews"
|
|
icon="icons/pmd-icon-16.gif"
|
|
class="net.sourceforge.pmd.eclipse.ui.actions.ClearReviewsAction"
|
|
menubarPath="pmd.menu/group"
|
|
enablesFor="+"
|
|
id="net.sourceforge.pmd.eclipse.ui.pmdClearReviewsAction">
|
|
</action>
|
|
</objectContribution>
|
|
<viewerContribution
|
|
id="net.sourceforge.pmd.eclipse.ui.pmdTaskListContribution"
|
|
targetID="org.eclipse.ui.views.TaskList">
|
|
<action
|
|
class="net.sourceforge.pmd.eclipse.ui.actions.PMDRemoveMarkersAction"
|
|
icon="icons/pmd-icon-16.gif"
|
|
id="net.sourceforge.pmd.eclipse.ui.pmdRemoveAllMarkersAction"
|
|
label="%action.clearall"
|
|
menubarPath="additions">
|
|
</action>
|
|
</viewerContribution>
|
|
<viewerContribution
|
|
id="net.sourceforge.pmd.eclipse.ui.pmdVioaltionViewContribution"
|
|
targetID="net.sourceforge.pmd.eclipse.ui.views.ViolationView">
|
|
<action
|
|
class="net.sourceforge.pmd.eclipse.ui.actions.PMDRemoveMarkersAction"
|
|
icon="icons/pmd-icon-16.gif"
|
|
id="net.sourceforge.pmd.eclipse.ui.pmdRemoveAllMarkersAction"
|
|
label="%action.clearall"
|
|
menubarPath="additions">
|
|
</action>
|
|
</viewerContribution>
|
|
<viewerContribution
|
|
id="net.sourceforge.pmd.eclipse.ui.pmdOutlineContribution"
|
|
targetID="net.sourceforge.pmd.eclipse.ui.views.violationOutline">
|
|
<action
|
|
label="%action.clearreviews"
|
|
icon="icons/pmd-icon-16.gif"
|
|
class="net.sourceforge.pmd.eclipse.ui.actions.ClearReviewsAction"
|
|
menubarPath="additions"
|
|
id="net.sourceforge.pmd.eclipse.ui.pmdClearReviewsAction"/>
|
|
</viewerContribution>
|
|
<objectContribution
|
|
adaptable="true"
|
|
objectClass="org.eclipse.jdt.core.IMethod"
|
|
nameFilter="*"
|
|
id="net.sourceforge.pmd.eclipse.ui.pmdMethodContribution">
|
|
</objectContribution>
|
|
<objectContribution
|
|
adaptable="false"
|
|
id="net.sourceforge.pmd.eclipse.ui.pmdOverviewContribution"
|
|
objectClass="net.sourceforge.pmd.eclipse.ui.model.AbstractPMDRecord">
|
|
<action
|
|
class="net.sourceforge.pmd.eclipse.ui.actions.PMDRemoveMarkersAction"
|
|
enablesFor="+"
|
|
icon="icons/pmd-icon-16.gif"
|
|
id="net.sourceforge.pmd.eclipse.ui.pmdRemoveMarkersAction"
|
|
label="%action.clearpmd"
|
|
menubarPath="additions"/>
|
|
</objectContribution>
|
|
<objectContribution
|
|
adaptable="false"
|
|
id="net.sourceforge.pmd.eclipse.ui.pmdOverviewContribution"
|
|
objectClass="net.sourceforge.pmd.eclipse.ui.model.PackageRecord">
|
|
<action
|
|
class="net.sourceforge.pmd.eclipse.ui.actions.PMDCheckAction"
|
|
enablesFor="+"
|
|
icon="icons/pmd-icon-16.gif"
|
|
id="net.sourceforge.pmd.eclipse.ui.pmdPackageCheckProjectAction"
|
|
label="%action.checkpmd"
|
|
menubarPath="additions"/>
|
|
</objectContribution>
|
|
<objectContribution
|
|
adaptable="false"
|
|
id="net.sourceforge.pmd.eclipse.ui.pmdOverviewContribution"
|
|
objectClass="net.sourceforge.pmd.eclipse.ui.model.FileRecord">
|
|
<action
|
|
class="net.sourceforge.pmd.eclipse.ui.actions.PMDCheckAction"
|
|
enablesFor="+"
|
|
icon="icons/pmd-icon-16.gif"
|
|
id="net.sourceforge.pmd.eclipse.ui.pmdFileCheckProjectAction"
|
|
label="%action.checkpmd"
|
|
menubarPath="additions"/>
|
|
</objectContribution>
|
|
</extension>
|
|
|
|
<extension
|
|
id="pmdViews"
|
|
point="org.eclipse.ui.views">
|
|
<category
|
|
name="%view.category"
|
|
id="net.sourceforge.pmd.eclipse.ui.views">
|
|
</category>
|
|
<view
|
|
allowMultiple="false"
|
|
icon="icons/icon_outline.gif"
|
|
class="net.sourceforge.pmd.eclipse.ui.views.ViolationOutline"
|
|
category="net.sourceforge.pmd.eclipse.ui.views"
|
|
name="%view.outline"
|
|
id="net.sourceforge.pmd.eclipse.ui.views.violationOutline"/>
|
|
<view
|
|
allowMultiple="false"
|
|
icon="icons/icon_overview.gif"
|
|
class="net.sourceforge.pmd.eclipse.ui.views.ViolationOverview"
|
|
category="net.sourceforge.pmd.eclipse.ui.views"
|
|
name="%view.overview"
|
|
id="net.sourceforge.pmd.eclipse.ui.views.violationOverview"/>
|
|
<view
|
|
allowMultiple="false"
|
|
icon="icons/pmd-icon-16.gif"
|
|
class="net.sourceforge.pmd.eclipse.ui.views.DataflowView"
|
|
category="net.sourceforge.pmd.eclipse.ui.views"
|
|
name="%view.dataflowview"
|
|
id="net.sourceforge.pmd.eclipse.ui.views.dataflowView"/>
|
|
<view
|
|
allowMultiple="false"
|
|
category="net.sourceforge.pmd.eclipse.ui.views"
|
|
class="net.sourceforge.pmd.eclipse.ui.views.CPDView"
|
|
icon="icons/icon_cpd.gif"
|
|
id="net.sourceforge.pmd.eclipse.ui.views.CPDView"
|
|
name="%view.cpd"/>
|
|
</extension>
|
|
|
|
<extension
|
|
point="org.eclipse.ui.perspectives">
|
|
<perspective
|
|
icon="icons/pmd-icon-16.gif"
|
|
class="net.sourceforge.pmd.eclipse.ui.views.PMDPerspective"
|
|
name="%view.perspective"
|
|
id="net.sourceforge.pmd.eclipse.ui.views.pmdPerspective"/>
|
|
</extension>
|
|
|
|
</plugin>
|