Closed 0xjac closed 3 weeks ago
Not sure why it doesn't work, it seems to work just fine in my sandbox.
I've added the conf
to the list of extensions handled by TextVisitor, it seems to work (but you'll lose all the other highlightings for conf files provided by other plugins)
I guess adding a configurable list of extensions shouldn't be too hard. Also a better way would be to expose an extension point so that other plugins can plug themselves to this plugin and efine their own visitors, but I am skeptical on how many would actually try to do this.
I'll add this to my backlog anyway, can't hurt to try somehting new.
Describe the bug
I opened my sway configuration file. It's a plain text file (detected as such by JetBrains) with a
.conf
extension. (Similar to this) and no color highlighting takes place.If I add a
.md
extension, then it works fine (besides the broken MD syntax). If I add a.txt
it also does not work.I have enabled the settings to parse text files.
To Reproduce
Settings
→Editor
→Color Highlighter
, expandText Settings
, and tickParse Colors in Text Files
.theme.conf
) with your JetBrains IDE.Expected Behavior
When opening a file associated to the plaintext type, colors should be highlighted regardless of the file extension.
I believe the issue comes from the TextVisitor, here. I'm not familiar with Kotlin and I don't know why it doesn't work with a
.txt
extension.Maybe the visitor should check for both a (configurable ?) set of extensions or whether the
PsiFile
is an instance ofPsiPlainTextFile
, similar to what theJavaVisitor
does.Environment
Screenshots