Open nojaf opened 1 month ago
Interesting! This is a bit hairy because you'd need to detect anything that's invalid and goes into JSX. This example detects variants because of the uppercased initial letter, but anything goes here really. I guess the easiest way to go about it is to see if we already track the context that it's a JSX element for the parent of this expression that fails, and if so, special case the errors and produce code actions.
It'd be good to explore as many scenarios for things to paste in there as you can think of, and see what errors are produced today. That should reveal some sort of theme for us to work with.
So, I just pasted some JSX:
And of course,
Nummer
is just text and not a thing so I getWould be great if I had a code fix to change
Nummer
to{React.string(``Nummer``)}
.@zth does this seem reasonable? Could I detect I'm inside jsx (
<th>
) and just wrap everything until</th>
?Curious to hear your thoughts!