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

Proposing a more flexible lexing framework #3537

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mattulbrich
Copy link
Member

@mattulbrich mattulbrich commented Jan 17, 2025

Intended Change

The syntax highlighting framework in the issue dialog makes the cursor jump around a lot. It does not support KeY files for the moment.

Plan

  • Make the "JavaDocument" language-independent
  • Implement a corr. Java lexer
  • Implement a corr. KeY parser
  • Document the changes
  • (optional) Make sure the realtime colour update works with the Java version since that may be configured at runtime

The code is there can be reused from other places.

Type of pull request

  • Refactoring (behaviour should not change or only minimally change). Actually improvements in the error editor windows.
  • New feature (non-breaking change which adds functionality)
  • There are changes to the (Java) code
  • There are minor improvements in the UI

Ensuring quality

  • I made sure that introduced/changed code is well documented (javadoc and inline comments).
  • I have tested the feature as follows: tried it out.

The contributions within this pull request are licensed under GPLv2 (only) for inclusion in KeY.

@mattulbrich mattulbrich added JML Parser GUI KeY Parser Feature New feature or request Error Reporting Missing file/position info for parse errors, uncaught errors, wrong/unclear messages, ... labels Jan 17, 2025
@mattulbrich mattulbrich self-assigned this Jan 17, 2025
@wadoon
Copy link
Member

wadoon commented Jan 18, 2025

There was a branch (weigl/editor or so), where I had robust editors on the RSyntaxArea component.

@mattulbrich Should/Does the highlighting respect the current JML active (conditional) tags?

@wadoon wadoon added this to the v2.12.4 milestone Jan 18, 2025
@wadoon
Copy link
Member

wadoon commented Jan 18, 2025

One thing I could find here:

https://git.key-project.org/key/key/-/merge_requests/341

I also found the integrative swing editor with support PSDBG on branch weigl/Scripts.

@mattulbrich
Copy link
Member Author

@mattulbrich Should/Does the highlighting respect the current JML active (conditional) tags?

The highlighting machinery is the one currently used by the component to display java source code in KeY.
I must admit that I do not know. ... Moreover, perhaps syntax highlighting should not depend on that after all, at least debatable.

@mattulbrich
Copy link
Member Author

One thing I could find here: https://git.key-project.org/key/key/-/merge_requests/341
I also found the integrative swing editor with support PSDBG on branch weigl/Scripts.

The editor looks nice from the picture! However, on Friday we were pretty sure that we did not want to integrate an editor into the current swing UI. If an editor ... then as a plugin to whatever VSCode or such with decent feedback into the prover UI.

This is really lightweight syntax highlighting for a few bits within KeY.

The current solution lacked highlighting for KeY and made the cursor jump annoyingly in the exception recovery dialog.

@wadoon
Copy link
Member

wadoon commented Jan 20, 2025

@mattulbrich Should/Does the highlighting respect the current JML active (conditional) tags?

The highlighting machinery is the one currently used by the component to display java source code in KeY. I must admit that I do not know. ... Moreover, perhaps syntax highlighting should not depend on that after all, at least debatable.

If it is inside of the KeY. I see the potential for recognizing errors quickly. For standalone editors, I would say it should be configurable.

@wadoon
Copy link
Member

wadoon commented Jan 20, 2025

One thing I could find here: https://git.key-project.org/key/key/-/merge_requests/341
I also found the integrative swing editor with support PSDBG on branch weigl/Scripts.

The editor looks nice from the picture! However, on Friday we were pretty sure that we did not want to integrate an editor into the current swing UI. If an editor ... then as a plugin to whatever VSCode or such with decent feedback into the prover UI.

This is really lightweight syntax highlighting for a few bits within KeY.

The current solution lacked highlighting for KeY and made the cursor jump annoyingly in the exception recovery dialog.

  1. The "ide" (editor) is standalone and written Kotlin/JavaFX.

    The advantage of using just Java is that we can reuse our grammar easily.

    I once also thought, to reuse JEdit or Netbeans.

  2. weigl/Scripts branch contains an RSyntaxArea (Swing) editor and a direct integration into KeY using the docking framework. I got annoyed by the exploding complexity of the UI, and I don't find this as a suitable idea anymore.

  3. I am also the author of the vscode-jml plugin. But this is rather a hack. The problem is the following: Every editor has a Java mode. Now you want to extend this for JML comments. And at this point the complexity starts, ... In Emacs, I was not able to achieve something useful.

  4. On my pipeline is also the next version of vscode plugin, which uses LSP for the highlighting.

@KeYProject KeYProject deleted a comment from codecov bot Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Error Reporting Missing file/position info for parse errors, uncaught errors, wrong/unclear messages, ... Feature New feature or request GUI JML Parser KeY Parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants