daddykotex / smithy4s-code-generation

Preview Smithy4s code generation
https://morning-bird-7081.fly.dev/
MIT License
7 stars 1 forks source link

Add syntax highlighting #25

Open ghostbuster91 opened 5 months ago

ghostbuster91 commented 5 months ago

Hi, thanks for this great project.

One thing that would be very useful for me is the syntax highlighting for the generated code (could be also for smithy, but the former one is more important).

I wonder if you have already thought about it. I am willing to work on it, but didn't want to double any potential work that might have already been put into that.

Let me know if you have any ideas how to implement it or maybe you know of some limitations that such feature should obey.

There seem to be quite a few libraries to chose from: https://blog.logrocket.com/exploring-best-syntax-highlighting-libraries/ with highligth.js being the most popular.

Also, given that left-hand-side is actually an editor maybe it would be a good idea to just replace the current input-form with something more capable like Monaco or codemirror. Wdyt?

daddykotex commented 5 months ago

It's a great idea. I definitely thought about it but did not work on that at all. Feel free to pick it up if you want to.

As for guidance, I don't have anything specific in mind. The only thing I'd ask is that we have two separate PRs:

  1. one where syntax highlighting is enabled on the code viewer side
  2. one where an in-browser editor like monaco is enabled on the code editor side

The two will probably be implemented using npm dependencies directly, like @kubukoz did for https://github.com/daddykotex/smithy4s-code-generation/pull/16

I'll be happy to review and help for the PR if you push you're changes in a branch I can see and contribute to when you get to it

again, thank you very much

kubukoz commented 5 months ago

I second the request to have separate PRs. We should also bikeshed monaco vs other editors.