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

Formatting does not work when there is the '\z' escape sequence in a string. #613

Closed
DasOhmoff opened this issue Oct 27, 2022 · 4 comments · Fixed by #634
Closed

Formatting does not work when there is the '\z' escape sequence in a string. #613

DasOhmoff opened this issue Oct 27, 2022 · 4 comments · Fixed by #634
Labels
bug Something isn't working external This issue relies on an external factor
Milestone

Comments

@DasOhmoff
Copy link

DasOhmoff commented Oct 27, 2022

Hey 👋, thank your for your nice work!

When using this nice formatter, I noticed that there is an issue when using the \z escape sequence in strings. This is a feature since lua 5.2. From Lua 5.2 Reference Manual:

The escape sequence '\z' skips the following span of white-space characters, including line breaks; it is particularly useful to break and indent a long literal string into multiple lines without adding the newlines and spaces into the string contents.

When I try to format the following code:

  use({
    "nvim-telescope/telescope-fzf-native.nvim",
    run = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && \z
           cmake --build build --config Release && \z
           cmake --install build --prefix build",
  })

I get the following error:

error: could not format file C:\Users\Adam\VimFiles\lua/packages.lua: error parsing: error occurred while tokenizing: unclosed string at line 29, column 11

It would be nice to fix this issue.
Thank you for your help :)

@JohnnyMorganz
Copy link
Owner

This looks like a bug in the parser crate that we use: https://github.com/Kampfkarren/full-moon

@JohnnyMorganz JohnnyMorganz added external This issue relies on an external factor bug Something isn't working labels Oct 27, 2022
@DasOhmoff
Copy link
Author

Ah ok I see. Will you raise an issue there or so?

@JohnnyMorganz
Copy link
Owner

Yah: Kampfkarren/full-moon#251

@DasOhmoff
Copy link
Author

Ah, perfect thanks :) 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working external This issue relies on an external factor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants