Open jakepurple13 opened 7 months ago
You should use html
as xml
may not be supported. XML is like HTML but not supported at the moment.
Its very hard to develop a code editor or syntax highlighter that works with all languages and is small, If you are looking for something special you may have to write it.
I'm getting the same thing when I use HTML:
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Missing language for extension :
at com.wakaztahir.codeeditor.prettify.parser.Prettify.getLangFromExtension(Prettify.kt:137)
at com.wakaztahir.codeeditor.prettify.parser.Prettify.getLexerForExtension(Prettify.kt:404)
at com.wakaztahir.codeeditor.prettify.parser.Prettify$CreateSimpleLexer.decorate(Prettify.kt:792)
at com.wakaztahir.codeeditor.prettify.PrettifyParser.parse(PrettifyParser.kt:25)
at com.wakaztahir.codeeditor.prettify.PrettifyParser.parse(PrettifyParser.kt:18)
at com.wakaztahir.codeeditor.utils.AnnotationKt.parseCodeAsAnnotatedString(Annotation.kt:21)
at com.wakaztahir.codeeditor.utils.AnnotationKt.parseCodeAsAnnotatedString(Annotation.kt:30)
Could you please try using the Enum instead of extension, I'm pretty sure it contains HTML
entry. Otherwise you can use extension default-markup
This will probably succeed.
XML extension should succeed as well. Could you try using the enum if that doesn't work, please let me know. https://github.com/Qawaz/compose-code-editor/blob/5b3cb2c9f4340b1a7aa7053f6acdbb2e926d71a4/codeeditor/src/commonMain/kotlin/com/wakaztahir/codeeditor/model/CodeLang.kt#L25
That is what I'm doing.
val parsedCode = remember(svgText, language) {
parseCodeAsAnnotatedString(
parser = parser,
theme = theme,
lang = CodeLang.XML,
code = svgText
)
}
And it still crashes. Even when using HTML.
I'm trying to show XML but I keep running into: