Open JaredEzz opened 3 weeks ago
@JaredEzz We use react-markdown to render code blocks and other markdown with comes with built-in highlight-js. Highlight-js has a default set of included languages which apparently must not include Dart.
One possible solution would be to default to a similar language that is included, by making an override map here: https://github.com/continuedev/continue/blob/preview/gui/src/components/markdown/StyledMarkdownPreview.tsx#L141-L145
@sestinj thanks. Dart is included in the highlight.js supported languages here.. why would it require an override map? https://github.com/highlightjs/highlight.js/blob/main/SUPPORTED_LANGUAGES.md
If continue is using the default minified web build, it could require extra work. I'll start there
Note: The languages available will depend on how you've built or are included the library in your app. For example our default minified web build includes only ~40 popular languages. See Getting the Library and Importing the Library in the README for examples of how to load additional/specific languages.
continuedev/continue/gui/src/components/markdown/StyledCode.tsx
seems to be the culprit, since there's no direct highlight.js imports but instead using react-syntax-highlighter which supports languages like Dart. Not sure what the issue is here, could use some help.
@sestinj
@conorhastings you might have some input here too, to see if the usage is incorrect
Yes you're right, I forgot that I switched to react-syntax-highlighter. But not clear yet why Dart wouldn't be working, it's supported by prism (https://prismjs.com/#supported-languages), though maybe it's another case of a minified build
Validations
Problem
Other languages have syntax highlighting in the Continue response that make reading and using the response much more helpful.
Dart (and I'm sure other languages) do not have this support
The expected code highlighting would look something like this
Solution
Add support for Dart and other languages for syntax highlighting in the response