astrada/ppx_bs_css

How did you implement the suggestion feature?

dylanirlbeck opened this issue · 2 comments

I'm curious how you implemented the "suggestion" (i.e. "Did you mean ___?") feature since I don't see it in the code. Thanks in advance!

color_typo

Well, it'a feature of the OCaml compiler (colors and formatting are a customization of BuckleScript). bs-css has a value named yellow that's in scope, the compiler does a minimum distance search to propose the hint.

Awesome, thanks. I see now the PPX transforms these into values (rather than just operating on strings) so you get those free compiler benefits.