Skip to content

Conversation

cole-h
Copy link
Contributor

@cole-h cole-h commented Apr 17, 2023

I noticed these two were missing, so I figured we should add them for completeness.

Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't notice the duplication before but I think we should collapse these patterns where "Only the first argument is SQL" into one pattern and change the (#eq? @_query "query") part to (#match? @_query "^query(_as|_scalar|_scalar_unchecked)?$") to match them all more concisely

@the-mikedavis the-mikedavis added the A-language-support Area: Support for programming/text languages label Apr 17, 2023
@cole-h
Copy link
Contributor Author

cole-h commented Apr 17, 2023

Sounds like a good idea.

However, my lisp skills are fairly low, and I don't currently have the time (or desire) to improve them to make that change. Would you be opposed to merging this as-is and then having someone file a follow-up PR that does improve this situation?

@archseer
Copy link
Member

It seems more effort to open yet another PR than to just do the replacement @the-mikedavis gave you? Remove other queries, then replace (#eq? @_query "query") with (#match? @_query "^query(_as|_scalar|_scalar_unchecked)?$") should be possible to do without having to understand lisp :)

@cole-h
Copy link
Contributor Author

cole-h commented Apr 19, 2023

Oh, sorry! That shows my lisp knowledge -- it sounded more involved than some simple replacements 😅

I've hopefully addressed that in 041b116.

@archseer archseer merged commit 6dd5054 into helix-editor:master Apr 27, 2023
@cole-h cole-h deleted the sqlx-query branch April 27, 2023 12:25
Triton171 pushed a commit to Triton171/helix that referenced this pull request Jun 18, 2023
…tor#6793)

* Highlight sqlx's `query_scalar{,_unchecked}` macros as SQL

* Update injections.scm

* fixup copy-pasta
wes-adams pushed a commit to wes-adams/helix that referenced this pull request Jul 4, 2023
…tor#6793)

* Highlight sqlx's `query_scalar{,_unchecked}` macros as SQL

* Update injections.scm

* fixup copy-pasta
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 2024
…tor#6793)

* Highlight sqlx's `query_scalar{,_unchecked}` macros as SQL

* Update injections.scm

* fixup copy-pasta
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants