inline_sql_syntax icon indicating copy to clipboard operation
inline_sql_syntax copied to clipboard

Enhanced auto-syntax highlighting

Open sepsol opened this issue 3 years ago • 3 comments

Currently, the extension automatically detects strings starting with certain words as sql syntax but this wouldn't work if the string first starts with tabs, spaces, and line breaks and then has those words. It'd be great if it could skip whitespace characters and check the first valid word for syntax highlighting.

sepsol avatar Apr 20 '22 19:04 sepsol

It would be even nicer if we could set our own regexp/startswith config. For instance, the keyword "WITH" should trigger highlighting too.

ShimShamSam avatar May 25 '22 15:05 ShimShamSam

TextMate does not support multiple line matches, so this could be a significant change, but desirable as I start queries with `\n

RLaursen avatar Jun 14 '22 20:06 RLaursen

I ran into the issue with WITH today as well, and would love it if that were on the list of SQL-start keywords. This also matches up nicely with the recently-submitted issue https://github.com/barklan/inline_sql_syntax/issues/109, regarding whitespace at the beginning of the string before a magic keyword. We regularly put a large inline query at the start of the next line, so having whitespace be ignored (and recognizing WITH) would save us a whole lot of --sql sprinkled everywhere.

macnewbold avatar Apr 25 '23 19:04 macnewbold