[BUG] Issue with mixing up syntax colors during work
Describe the bug During work in PyCharm I'm encountering issue with randomly changed colors in middle of the sentence - please see attached screenshot. This also affects double click on words/sentences as it offset selection for few positions to right
Steps To Reproduce Steps to reproduce the behavior:
- Work and wait until issue occurs - sorry, I can't be more precise
Expected behavior Syntax highlight should be consistent
Screenshots/ Videos
Logs None - just realized that LSP Consoles doesn't populate in PyCharm :(
Additional context Add any other context about the problem here.
Desktop (please complete the following information):
- PyCharm 2025.1.2
- RobotCode Version 1.4 (but was reproduced in earlier versions)
- OS: Windows
- Python Version 3.9.5
- RobotFramework Version 5.0.1
If you close the file and open it again, are the colors normal again? Does this happen every time when you edit the file? Can you please remove the square brackets from the testcase/keyword names and see what happens then?
The TextMate Parser (that's the part that does the colors) of IntelliJ/PyCharm doesn't support everything that a TextMate Parser should support, or sometimes behaves differently than, for example, the TextMate Parser of VSCode and other tools does. I thought I had already found and fixed all the issues, but apparently not yet. We need to somehow figure out what's causing it.
Hello again. I've removed square brackets but it didn't change anything. I'm still getting same issue. Reopening file does help, but not for long. This is tricky as sometimes I can work normally for like 30 minutes and nothing happens and other times this issue appears every 5-10 minutes. I might be wrong but I have a feeling that this issue occurs more often when I have split editor window (with around 5 files on both sides) and I'm constantly switching between left and right section. To sum up: "If you close the file and open it again, are the colors normal again?" -> Yes, it helps for few minutes ;) "Does this happen every time when you edit the file?" -> yes, considering that I'm not able to finish working on file within minutes "Can you please remove the square brackets from the testcase/keyword names and see what happens then?" -> I did. Nothing changed
Also what I've observed - when this issue occurs all error messages (like "variable not found) jumps to random places. I'll try to capture that on screenshot if needed.
One more remark - it looks like it appears mostly when I change indentation (after pasting something). When I set proper indentation editor needs to recolor keyword.
I was just copying this keyword from different case and keyword name was pasted with indentation. Maybe worth mentioning - I've used key combination shift + TAB to remove gap. (Yes, I'm back with square brackets as they are needed in my current project, but I've mention before that these doesn't stops this issue from happening) Also I've run PyCharm in both regular user mode and as an Admin
Please feel free to ask more question, I'll do my best to answer them thoroughly, but for now I'm going back to VS Code as I need to finish my current task ;)