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

Include interpolated SQL strings in Scala injection queries #9428

Merged
merged 3 commits into from
Jan 28, 2024

Conversation

jpaju
Copy link
Contributor

@jpaju jpaju commented Jan 25, 2024

Matches SQL strings from (at least) three popular Scala database libraries:

Injection query matches this kind of syntax:

val query1 = sql"SELECT foo FROM bar WHERE baz IS NOT NULL"

For some reason the injection query does not reliably work for multiline strings:
image

I'm not sure whether this is a problem with tree-sitter-scala, tree-sitter-sql, Helix, or the injection query itself. Helix shows identical subtrees for query1 and query2. To my understanding it should thus highlight them equally.

Nevertheless having some highlighting for inline SQL is an improvement to existing.

@the-mikedavis the-mikedavis added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. A-language-support Area: Support for programming/text languages labels Jan 26, 2024
Co-authored-by: Kirawi <67773714+kirawi@users.noreply.github.com>
@the-mikedavis the-mikedavis added S-waiting-on-review Status: Awaiting review from a maintainer. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 27, 2024
@archseer archseer merged commit 9978d42 into helix-editor:master Jan 28, 2024
6 checks passed
@jpaju jpaju deleted the scala-injection-sql branch January 28, 2024 09:14
dgkf pushed a commit to dgkf/helix that referenced this pull request Jan 30, 2024
…itor#9428)

* Change Scala injection queries to include SQL strings

* Include block comments in comment injection

* Change #match predicate to #any-of

Co-authored-by: Kirawi <67773714+kirawi@users.noreply.github.com>

---------

Co-authored-by: Kirawi <67773714+kirawi@users.noreply.github.com>
postsolar pushed a commit to postsolar/helix that referenced this pull request Apr 4, 2024
…itor#9428)

* Change Scala injection queries to include SQL strings

* Include block comments in comment injection

* Change #match predicate to #any-of

Co-authored-by: Kirawi <67773714+kirawi@users.noreply.github.com>

---------

Co-authored-by: Kirawi <67773714+kirawi@users.noreply.github.com>
mtoohey31 pushed a commit to mtoohey31/helix that referenced this pull request Jun 2, 2024
…itor#9428)

* Change Scala injection queries to include SQL strings

* Include block comments in comment injection

* Change #match predicate to #any-of

Co-authored-by: Kirawi <67773714+kirawi@users.noreply.github.com>

---------

Co-authored-by: Kirawi <67773714+kirawi@users.noreply.github.com>
Vulpesx pushed a commit to Vulpesx/helix that referenced this pull request Jun 7, 2024
…itor#9428)

* Change Scala injection queries to include SQL strings

* Include block comments in comment injection

* Change #match predicate to #any-of

Co-authored-by: Kirawi <67773714+kirawi@users.noreply.github.com>

---------

Co-authored-by: Kirawi <67773714+kirawi@users.noreply.github.com>
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 2024
…itor#9428)

* Change Scala injection queries to include SQL strings

* Include block comments in comment injection

* Change #match predicate to #any-of

Co-authored-by: Kirawi <67773714+kirawi@users.noreply.github.com>

---------

Co-authored-by: Kirawi <67773714+kirawi@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-support Area: Support for programming/text languages S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants