pmd-designer
pmd-designer copied to clipboard
[ui] New rule designer pending issues
This is a placeholder issue to keep track of the different smaller issues / nice to haves we find as we work on the new rule designer. None of these are blocking issues, they are small improvements to usability and user experience.
Usability
- [x] (PR #1053) Clicking on the AST or Scopes produces the Source panel to scroll to show the selected scope / node. However, if clicking again the already selected node, no scroll happens. When using both panels this means there is no easy way to jump from the scope back to the AST node or viceversa. Also selection highlighting is not reset, which is particularly visible when selecting the
SourceFileScope
- [x] When selecting a field or variable from a Scope, the highlighting of selection works fine, but the code panel scrolls to the last occurrence instead of to the declaration.
- [x] The designer doesn't remember the language last used. This means that unless using Java 9, the last code will be reloaded, but parsed using a different grammar.
- [x] The scopes tab should hide away leaf Scopes that are empty
- [x] XML ASTs are currently very messy, since eg line breaks are parsed as a separate text node and displayed in the TreeView. There is also a virtual root node (named document) that is displayed but ignored by the XPath engine, which makes XPath rules confusing to write.
- [x] The property edition dialog doesn't handle additionnal configuration like
min
andmax
for numeric descriptors
Visual
- [x] The scopes tab has a small visual glitch on the final "s", at least on my machine
- [x] Upon opening the designer and clicking the language dropdown, it is shown at an incorrect location, floating over the source editor. Future displays of the dropdown show correctly.
Ideas
- [x] Automatically reparse the code when the Source panel contents change. Removing the need for the "Refresh AST" button (via #1137)
- [x] Automatically match AST nodes as we edit the XPath editor (via #1137)
- [ ] Right click on the AST -> generate XPath to this node, as an easier starting point for new rules
- [x] Right click on the AST -> generate ASCII, which lets you select a part of the tree and generates an ascii representation of the tree, with the attributes you want. This would make it easier to describe an AST without ambiguity, to communicate on github issues
- [x] Right click on Source panel -> locate in AST
- [x] ~Better defaults on which nodes are expanded by default on the AST panel.~ We currently show all nodes expanded by default, but this means we usually need to scroll to get to anything other than imports. Maybe we can be smarter on this...
- Not a problem of the designer, mainly a problem of the AST being too verbose. pmd/pmd#1888 improves the situation
- [x] Showing matched nodes on the source panel (with a box outline, like IntelliJ does). This should be in addition to other style rules already applied (syntax coloring / usages form scopes / selected node from the AST).
Features
- [x] Setting up the auxclasspath. We currently include the
typeof()
info as part of the XPath Attributes, but these will only be non-null if using JRE / PMD classes. We need to be able to set it up manually. (via #1159) - [x] Add a properties tab to the XPath panel, to enable XPath developers to define properties and test them (via #801)
- [ ] Allow testing of the violation suppress Regex and XPath. (This is already kindof supported, the properties panel can be used for that even though these properties are not mentioned)
- [x] Code completion when writing an XPath query (considering valid node types for the language, or better, the successors of a node permitted by the grammar) (via #1182).
- [x] Save a number of snippets as test cases and edit them/ check that the XPath rule verifies all of them
- [x] Exporting the XPath rule doesn't include the
version
property, so all rules are exported as 1.0
Another feature: add a properties tab to the XPath panel, to enable XPath developers to define properties and test them
If I download the 6.0 snapshot how do I start the new designer from the command line? Is there already a documentation page for it?
@up2go-rsoesemann I think the snapshot doesn't have the new designer yet, the PR is still pending (#711)
Until the PR is merged, I guess you could still checkout the branch from my fork and build from source if you have the time. To launch the app from there, you need to edit the startup script so that it launches the class n.s.pmd.util.fxdesigner.Designer
as main class
Then I wait until it was merged in and 6.0 is released. I was just eager to play around with the great piece of UI.
@up2go-rsoesemann FYI current 6.0 snapshots do include the new designer.
@jsotuyod By the way, where are snapshot installation archives uploaded, if they're available? I still use 5.8.1 ^^
@oowekyala builds from master are automatically published to SF: https://sourceforge.net/projects/pmd/files/pmd/6.0.0-SNAPSHOT/