TextMate-based syntax highlighting in custom code-style panel
Hi JetBrains,
Our IJ plugin contributes a `langCodeStyleSettingsProvider` extension to provide the user with some specific options under Editor > Code Style and also a code preview that's supposed to be syntax-colored. As panel, we use a `TabbedLanguageCodeStylePanel` which, in turn, has one custom tab based on `OptionTreeWithPreviewPanel`. Please see here for a minimal working sample (run `./gradlew runWebstorm`).
Although we set the correct custom `Language` where appropriate, and also a seemingly valid TextMate-based `SyntaxHighlighter` via a factory, we can't get syntax highlighting to work in the preview editor (whether a project is already opened or not). By contrast, coloring is working in a regular editor (see upload id 2024_12_03_MahznN2ro2RdXvrZnxz9Fd).
What I've noticed is that a `ParserDefinition` seems to be missing in `PFFI.trySetupPsiForFile` in the case of the preview only, leading to the return value of `CSAP.createFileFromText` referring to a plain-text type.
Could you please elaborate on how to enable syntax highlighting for the code preview?
Best regards,
Tim
Please sign in to leave a comment.
Please let me know if you need more information to help me out here. I have collected some technical facts during hours-long debugging.