Highlight SQL inside JDBC calls
Deraen opened this issue · 1 comments
Deraen commented
https://github.com/krisajenkins/vim-clojure-sql
But we might be able to detect next.jdbc and clojure.java.jdbc calls and highlight parameters for those using SQL syntax.
axvr commented
It's a good idea, but I think a separate plugin like the one you linked to is the best place for something like this. I just can't see a way of implementing it nicely (believe me, I did try).
The main problem is that we don't want to highlight SQL keywords in any random string, so we need to check if the outer function is a JDBC (or next.jdbc) call, but this wouldn't be reliable because:
- The JDBC function could be wrapped by a custom function, so we completely fail to detect it.
- The function may have been referred in. (So we need to match on the non-fully-qualified-symbols too.)
- A user defined function may happen to have the same name as the non-fully-qualified symbols we check for.
Just to name a few...
I'm going to close this for now, but I'm happy to reopen it if anyone finds a reliable way of integrating this.