intellij-community
intellij-community copied to clipboard
Fix identifier highlight in injected languages.
Identifier highlighting was disabled for single-line editors, which accounts for injected languages inside single-line Java string literals. According to git blame, the original intention of this was to disable identifier highlighting in dialog editors, so I switched the check to explicitly check that.
My use case is that I'm developing a plugin which makes use of a MultiHostInjector for a DSL spread across multiple Java string literals. It would significantly improve UX if identifier highlighting was possible in this use case. I could not find any clean workaround which doesn't involve modifying IntelliJ in this way. Besides, I consider this a bug and it's nice to get it fixed :)
Before the fix:
After the fix:
Hi @Earthcomputer , Thank you for your contribution. Could you create a YouTrack issue for this as well? That way it becomes part of the release notes and such.
Hi, sorry for the delay, I've been away. I can take a look this evening.
I addressed the review, and made a YouTrack issue: https://youtrack.jetbrains.com/issue/IDEA-346533/Identifier-highlighting-doesnt-work-in-single-line-language-injections
Hello, sorry for the delay. Could you squash the two commits into one? That makes it easier to apply the changes to our internal repository.
@BasLeijdekkers done