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] Removes the need for RefreshAST #1137

Merged
merged 10 commits into from May 26, 2018

Conversation

2 participants
@akshatbahety
Contributor

akshatbahety commented May 23, 2018

Removes the need for RefreshAST
The code is parsed automatically as the user types it in the editor Area.

@oowekyala

Parser updates make the cursor jump to the xpath area. Remove the following line

https://github.com/pmd/pmd/blob/master/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/XPathPanelController.java#L212

Also, format your code using formatter settings that respect our checkstyle config. Import order makes your build fail. I can send you my formatter config as a base if you want

@oowekyala oowekyala added the in:ui label May 23, 2018

@oowekyala oowekyala self-assigned this May 23, 2018

@oowekyala oowekyala added this to the 6.4.0 milestone May 23, 2018

@oowekyala

Since you removed the RefreshAST button, there's currently no way to trigger the evaluation of the XPath expression apart from editing the source code. You'll have to use very similar logic in the XPathPanelController to have the MainDesignerController evaluate the XPath expression when the XPath expression changes. This shouldn't take you very long. Pay attention to the fact, that we want to ignore the XPath exceptions in the same way we ignore the parse exceptions... For now. We also don't want to reparse the source code, just evaluate the expression

Btw merge master, I pushed a commit relating to XPath evaluation exceptions, enabling them to be correctly forwarded to the event log. You'll need it.

Show outdated Hide outdated ...rc/main/java/net/sourceforge/pmd/util/fxdesigner/EventLogController.java
Show outdated Hide outdated ...ain/java/net/sourceforge/pmd/util/fxdesigner/SourceEditorController.java
@@ -63,14 +63,6 @@
<bottom>
<ToolBar id="main-toolbar" prefHeight="40.0" prefWidth="200.0" BorderPane.alignment="CENTER">
<items>
<Button fx:id="refreshASTButton" maxHeight="22.0" minHeight="22.0" mnemonicParsing="true" prefHeight="20.0" text="_Refresh AST">

This comment has been minimized.

@oowekyala

oowekyala May 25, 2018

Member

I think we could now have a tiny title label before each choicebox in the toolbar, eg "Language version:" and "XPath version:". Try how that looks and keep it if it's pretty

@oowekyala

oowekyala May 25, 2018

Member

I think we could now have a tiny title label before each choicebox in the toolbar, eg "Language version:" and "XPath version:". Try how that looks and keep it if it's pretty

@oowekyala

Cool! I hope this can be ready tonight

The bug you talked about, with XPath results not being updated when the expression area is cleared, seems to disappear when the refresh rate of the XPath expression is high enough (eg 100 ms delay). You'll still need to add a call to invalidateResults(false); at the following location so that everything updates fine:

https://github.com/pmd/pmd/pull/1137/files#diff-5a88a67e48e676e637a4eb84ec17ab53R200

@oowekyala oowekyala merged commit b63321a into pmd:master May 26, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

oowekyala added a commit that referenced this pull request May 26, 2018

@oowekyala

This comment has been minimized.

Show comment
Hide comment
@oowekyala

oowekyala May 26, 2018

Member

@akshatbahety Merged! Congrats :)

Member

oowekyala commented May 26, 2018

@akshatbahety Merged! Congrats :)

@jsotuyod jsotuyod referenced this pull request May 28, 2018

Open

[ui] New rule designer pending issues #714

8 of 20 tasks complete

@oowekyala oowekyala added this to Done in Rule Designer Jun 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment