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

Ability to make the "..." pattern configurable? #4

Open
asser-dk opened this issue Aug 2, 2022 · 2 comments
Open

Ability to make the "..." pattern configurable? #4

asser-dk opened this issue Aug 2, 2022 · 2 comments

Comments

@asser-dk
Copy link

asser-dk commented Aug 2, 2022

I was wondering how you would feel about adding an option to configure the "..." pattern to our own liking?

This is mainly useful for users with IDE's that offer syntax highlighting and sql command executions directly from their IDE (like Rider). The "..." is seen as a syntax error. If we had the ability to change the pattern to maybe a comment (eg. /*...*/) we could still leverage these features :)

Edit: The "..." pattern also causes all my bulk insert statements to show up as errors in the Rider's error/problem list and it just adds a lot of clutter.

The benefits here are pretty much only Quality of Life improvements

@ejball
Copy link
Member

ejball commented Aug 4, 2022

A configurable pattern would be challenging, but I would not object to adding support for /*...*/.

@asser-dk
Copy link
Author

asser-dk commented Aug 4, 2022

Without having thoroughly read the code it seems like one would "just" have to change the pattern in this line:

static readonly Regex s_valuesClauseRegex = new Regex(
@"\b[vV][aA][lL][uU][eE][sS]\s*(\(.*?\))\s*\.\.\.", RegexOptions.CultureInvariant | RegexOptions.Singleline | RegexOptions.RightToLeft);

So that the last part (\.\.\.) could optionally be a regex you supply yourself. But support for a /*...*/

I could try fiddling with it a bit and send a PR one of these days :)

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

No branches or pull requests

2 participants