Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single-quotes break formatting #29

Closed
macintacos opened this issue Aug 26, 2024 · 2 comments
Closed

Single-quotes break formatting #29

macintacos opened this issue Aug 26, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@macintacos
Copy link

Hello! Just started using this plugin, thanks for your work here.

The parser seems to break when you provide a single quote with no "closing" single-quote. I put "closing" in quotes because, in the context I was trying to use it (writing a comment) a "closing" quote doesn't make sense.

A screenshot is better to show you what's going on:

CleanShot 2024-08-26 at 14 44 41@2x

test:
    @echo "This is a valid justfile"

    # This is a comment with a quote because it's a part of a contraction
    @echo "Everything after this shows green text like a string, until I put another single-quote character."

    @echo "I will go ahead and do it here ' even though it doesn't really matter uh oh"
    @echo There is it again!'

    @echo Okay it is gone now.

It seems like GitHub also struggles rendering this (I reported something similar in the just repo a while ago here: casey/just#1626)

@nefrob nefrob added the bug Something isn't working label Aug 28, 2024
@nefrob
Copy link
Owner

nefrob commented Aug 28, 2024

Quotes in comments definitely shouldn't break like shown above. Solving for single quotes within strings might not be possible in textmate grammars but worth investigating. I would think escaping the character would work as intended, ex. @echo "single \' quote".

@nefrob
Copy link
Owner

nefrob commented Oct 6, 2024

@macintacos this should be resolved. See the above code block in your comment now highlights as expected.

@nefrob nefrob closed this as completed Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants
@macintacos @nefrob and others