davesnx / styled-ppx

Type-safe styled components for ReScript, Melange and native with type-safe CSS
https://styled-ppx.vercel.app
BSD 2-Clause "Simplified" License
402 stars 33 forks source link

Improvement for locations in both code-gen and error reporting #456

Closed davesnx closed 8 months ago

davesnx commented 8 months ago

Fixes partially https://github.com/davesnx/styled-ppx/issues/448

vercel[bot] commented 8 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **styled-ppx** | ⬜️ Ignored ([Inspect](https://vercel.com/davesnx/styled-ppx/FuYmGC237Sqiudm4cmxdcofTbsNZ)) | [Visit Preview](https://styled-ppx-git-fix-locations-davesnx.vercel.app) | | Mar 20, 2024 8:20pm |
davesnx commented 8 months ago

After this PR the locations don't look exactly I would like it to, but they are close enough:

+  File "input.re", lines 10-11, characters 6-36:
+  10 | ......|
+  11 |     text-decoration: $(cosas).
+  Error: This expression has type [> `underlin ]
+         but an expression was expected of type
+           [< `inherit_
+            | `initial
+            | `lineThrough
+            | `none
+            | `overline
+            | `underline
+            | `unset
+            | `var of string
+            | `varDefault of string * string ]
+         The second variant type does not allow tag(s) `underlin
+  [1]

The reamaining work to make them perfect is to make sure css_lexer and css_parser respect whitespaces and use loc in menhir properly

github-actions[bot] commented 8 months ago

New nightly version has been published to the NPM registry: @davesnx/styled-ppx@0.54.2-fe02806.0. Install it with npm install @davesnx/styled-ppx@nightly or npm install @davesnx/styled-ppx@0.54.2-fe02806.0.