prql icon indicating copy to clipboard operation
prql copied to clipboard

Single quote syntax highlighting in Playground

Open nicot opened this issue 3 years ago • 3 comments

Single quote syntax highlighting isn't working the same way double quote syntax highlighting works in the playground:

Screenshot 2023-02-22 at 9 45 02 AM

Single quotes don't mess up parsing though. I think that the double quote syntax highlighting is a bit better, and it'd be great to swap the single quote highlighting to be the same as the double quote one.

nicot avatar Feb 22 '23 16:02 nicot

Yes agree, the playground syntax highlighting could do with some work. Contributions very welcome — the file is at https://github.com/PRQL/prql/blob/14f6e7180cd8e10ddea8ecbae731b044fdd758d6/playground/src/workbench/prql-syntax.js

max-sixty avatar Feb 22 '23 16:02 max-sixty

Another question is whether single quote syntax should be allowed?

The disadvantage is that people write queries differently and then there are disagreements and bickering about style, and more to be covered by style guides and best practices. An alternative would be to only support double quotes.

vanillajonathan avatar Feb 23 '23 13:02 vanillajonathan

@vanillajonathan we'd need a strong reason to change the current approach of allowing both. I don't think we have a good reason to change.

(and we should have that discussion on a separate issue)

max-sixty avatar Feb 23 '23 17:02 max-sixty