-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Dart syntax higlighting #1478
Comments
@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
|
|
@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 |
It seems that not all languages are included in the default Prism configuration. You may need to explicitly import Dart support I think syntax highlighting for Dart code would greatly help many Flutter developers in their daily work 🚀🙏 |
Agreed. I don't have the time at the moment to work on this fix, but I still would love to see it as continue is still my chosen LLM tool during development. |
@JaredEzz Here is a workaround I am using right now, it is not exactly what you need but much better than having zero highlights :) Here is my system prompt:
Basically the trick is to force the LLM to format Dart code using TypeScript markdown. They have a lot of similar syntax so the highlights look quite good. ScreenshotTested on Gemma 2 9B IT and Llama 3.1 8B Instruct. |
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
The text was updated successfully, but these errors were encountered: