intellij-plugin-v4
intellij-plugin-v4 copied to clipboard
Add warning to "ANTLR Preview" pane for grammars with actions
A warning should appear in the "ANTLR Preview" pane if it uses rules that contain an action. People never read "readme's". See this StackOverflow question.
People never read "readme's.
Sometimes they read but you are right, it should be uderstandable without readme. It makes sense to add a warning about actions and sematics predicates using together with plugin.
Where should this morning appear? There's not much room in the GUI input area.
I'm not sure what the window is called, but it's under the LHS of the ANTLR Preview pane, under the radio buttons "Input" and "File", and under the MLE window for text input: it's a fixed window for text output for parse errors. Note, it has issues in itself: it's fixed in size to display 3 lines, although it does have a scroll bar. Even if I undock the entire ANTLR Preview pane and resize the window, it's still three lines. To do anything with it, I have to select all text and copy the text into Emacs to work with it. But, this seems the right area to place all warnings and errors.
Hmm... Maybe it should just replace the morning that I have now about having to select a rule to get started. On the other hand I just added something to the documentation for https://github.com/antlr/intellij-plugin-v4/issues/519 so maybe I should work on some of the bugs before release instead?
Here's a proposal:
![image](https://user-images.githubusercontent.com/281528/165624909-3d8e4180-716c-40aa-9515-58e11d353839.png)
The message WARNING: predicates and actions are not run by this interpreter. Results may vary from the actual generated parser!
will appear only once per input (even if there are multiple actions matched).
Also, the error console is now resizable:
![image](https://user-images.githubusercontent.com/281528/165625047-0a4c071f-33f2-4322-b052-cf6f998f8762.png)
Without the resize, it was difficult to see anything, especially for plsql where it would output huge sets of symbols the parser would be expecting. This looks better, although I am not a fan of line wrapping (optional?).
I am not a fan of line wrapping (optional?).
The current version already works like this. Would you rather see a horizontal scrollbar?
Can you toggle between wrapping and scrolling with a right mouse click popup context menu or something? Not a priority though. I can select, copy, paste the text in emacs for searching, saving, etc.
Does it make sense to use IDEA notifications, maybe it looks more natively and expected, see https://www.jetbrains.com/help/idea/notifications.html
Hi guys, sorry for the delay. Just getting back to this. Notifications API could make sense, but then they have to make sure that that tab is open. Perhaps it's better just to toss that note into the console for antlr shown here.