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

Counterintuitive language management #67

Open
jsotuyod opened this issue Jun 7, 2023 · 0 comments
Open

Counterintuitive language management #67

jsotuyod opened this issue Jun 7, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@jsotuyod
Copy link
Member

jsotuyod commented Jun 7, 2023

Language controls in the toolbar only sets the language used to parse / syntax color the editor:

image

But the XPath autocomplete / actual rule language is managed separately down here:

image

it's fixed upon creation. So if I change the language in the toolbar, the editor will immediately respond, but the XPath editor will continue working on the previous language until I manually click on the "+" to create a new rule for the current language.

This is particularly bad considering that the XPath expression will match against the current code regardless of the target language, so I can write an expression, have it work, but then upon exporting it, have it published for a separate language.

I think the most intuitive thing would be to drop the language from the xpath editor, and have it bound to always match the language set in the code editor.

To Reproduce
Steps to reproduce the behavior:

  1. Launch the designer from pmd designer
  2. Notice the current language. If Java switch to XML. If not Java, switch to Java.
  3. Notice the editor automatically matches the new language.
  4. Notice the rule tab says "java/NewRule" or "xml/NewRule", and this is a mismatch to the current editor language.
  5. Click "+" to add a new rule tab, which should now be "java/NewRule" or "xml/NewRule", this time matching the current editor language.
  6. In the "java/NewRule" editor, notice it suggests to autocomplete with Java AST nodes.
  7. Write any valid expression for the current editor language into both rules. Notice they match regardless of current language.
  8. Try and export both "working" rules for the current editor language. Notice them being exported for either "java" or "xml" accordingly.
@jsotuyod jsotuyod added the bug Something isn't working label Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant