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

Syntax highlighting breaks if a trigger is at the end of a template string #17

Open
ZachHaber opened this issue Oct 17, 2023 · 2 comments

Comments

@ZachHaber
Copy link

Whenever a sql-lit highlighted template has an sql-lit trigger at the end of the template, it thinks that there's a new start to a template:

const column = sql`DB_META`

image
image

@thebearingedge
Copy link
Owner

Thanks for the report! A couple of regressions were introduced in an attempt to enhance the extension. Will update you when I have time.

@thebearingedge
Copy link
Owner

Ok, I don't believe this is a regression, just a bug. Because sql` is a begin capture trigger, it will need to appear once on a given line, like so:

const migrations = {
  async up() {
    sql`
      DB_META
    `
  },
  async down() {
    sql`
      sql
    `
  }
}

code

This prevents the begin capture from matching the 2nd sql`, since textmate matchers only capture patterns on a single line. It's a workaround for sure, and probably needs to be documented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants