Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ui] New rule designer pending issues #12

Open
19 of 21 tasks
jsotuyod opened this issue Nov 6, 2017 · 7 comments
Open
19 of 21 tasks

[ui] New rule designer pending issues #12

jsotuyod opened this issue Nov 6, 2017 · 7 comments

Comments

@jsotuyod
Copy link
Member

jsotuyod commented Nov 6, 2017

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

  • (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
  • 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.
  • 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.
  • The scopes tab should hide away leaf Scopes that are empty
  • 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.
  • The property edition dialog doesn't handle additionnal configuration like min and max for numeric descriptors

Visual

  • The scopes tab has a small visual glitch on the final "s", at least on my machine
    image
  • 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

  • Automatically reparse the code when the Source panel contents change. Removing the need for the "Refresh AST" button (via #1137)
  • 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
  • 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
  • Right click on Source panel -> locate in AST
  • 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...
  • 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

  • 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)
  • 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)
  • 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).
  • Save a number of snippets as test cases and edit them/ check that the XPath rule verifies all of them
  • Exporting the XPath rule doesn't include the version property, so all rules are exported as 1.0
@oowekyala
Copy link
Member

Another feature: add a properties tab to the XPath panel, to enable XPath developers to define properties and test them

@rsoesemann
Copy link
Member

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?

@oowekyala
Copy link
Member

@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

@rsoesemann
Copy link
Member

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.

@jsotuyod
Copy link
Member Author

@up2go-rsoesemann FYI current 6.0 snapshots do include the new designer.

@oowekyala
Copy link
Member

@jsotuyod By the way, where are snapshot installation archives uploaded, if they're available? I still use 5.8.1 ^^

@jsotuyod
Copy link
Member Author

@oowekyala builds from master are automatically published to SF: https://sourceforge.net/projects/pmd/files/pmd/6.0.0-SNAPSHOT/

@adangel adangel transferred this issue from pmd/pmd Mar 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants