Strange editor behavior
Answered
I am creating custom language plugin for IntelliJ.
I implemented syntax highlighting and it works fine.
Tokens tree is built correctly too but when I type unexpected token something strange happens.
For example backspace key doesn't erase character. What is more interesting for me is that I can erase this incorrect character using shift, arrow and backspace.
Second example of strange behaving is total code editor crashing.
Any ideas what I do wrong? How to process invalid tokens?
My repository: here
Please sign in to leave a comment.
Hi,
Could you please provide the test project with the file containing reproduced error with the exact step of how to reproduce it (like put caret here, type <something>, press backspace)?
Yes. Create file.eo and start typing upper case letters. Do it fast and somewhere leave spaces and other symbols. Don't forget to insert new lines. I just did it in chaotic order.
By the way, I fixed the problem, trouble was in processing BAD_CHARACTER. I added it in my grammar and it solved the problem. Anyway I think behavior of IDEA was strange
Hi Stepa,
As I asked, please provide me with the project I can checkout or open without any manual files creation.
Unfortunately, our time is limited, and from my experience creating the project and files to reproduce errors can be not obvious.
As you asked. Project with incorrect .eo file
https://github.com/yasamprom/issue5632746422290
I'm sorry but the plugin project doesn't compile:
The expected state is:
Please resolve or automate building the missing parts.
it is already automated. I specified in README.md what is parser. It is package with generated classes. You may generate classes from EO.g4 (Right click -> generate antlr recognizer). You need ANTLR 4 plugin for this option to be available.
It is not automated as it requires manual steps like installing the plugin, adding new directories, and moving files to these directories. It would be automated if sources were generated when I execute the runIde task. Consider using Gradle ANTLR Plugin to automate these steps (I'm not familiar with it and not 100% sure it does the same as manual sources generation).
I did what is described in README and it still doesn't compile and I don't see the issue.
As you see, I have to spend time configuring your project which should never happen. Please understand that we should focus on solving actual issues, not struggling with configuring and executing projects as we have limited time to help all developers.
If the Gradle ANTLR Plugin is not a way to go, then please do all steps that are required to run the plugin and commit them to some temporal branch in your project repository. Make sure that it works after fresh checkout.