-
Notifications
You must be signed in to change notification settings - Fork 0
Is this a dead repo? #12
Comments
Hi, Yeah, I guess plugin would need to be updated to the latest version of IDEA, since there were some incompatible changes. I've been meaning to get around to it at some point, but I haven't found the time. Given IDEA's analysis of SQL and decent tests, I've noticed that even I don't really miss the plugin. 😄 But if you wish to bring the plugin up to speed with latest IDEA versions, I'll certainly merge PR's and release a new version. And I think I'll find the time to fix the plugin at some point anyway, there's just been a lot of other priorities lately. |
No worries. I can't make any promises as I haven't worked with an Intellij plugin before, but if I find some free time I might poke at it. Assuming it's more infrastructure vs logic I think that would be doable. If you don't mind me asking, how do you have your IDEA doing SQL analysis? Just in the query console or in the actual Java code? The Java code is where I'm not currently getting any syntax highlighting and would like the autocomplete ability. |
Oh, the automatic SQL analysis thing is something that I should fix in Dalesbred. It's still possible to get it working by manually configuring it, but it used to work without any extra work. So let me digress a bit. Generally it's possible to let IDEA know that a string parameter of a method is actually some language supported by IDEA by adding At some point IDEA even realized that if an annotation is annotated with @Language("SQL")
@Retention(RetentionPolicy.CLASS)
@Target({ METHOD, FIELD, PARAMETER, LOCAL_VARIABLE })
public @interface SQL {
} and every method taking SQL is annotated with it: public @NotNull <T> List<T> findAll(@NotNull RowMapper<T> rowMapper, @NotNull @SQL String sql, Object... args) Unfortunately at some point this stopped working in IDEA, so I should drop using the SQL-annotation and just use But to get back to the point, you can actually get it working right now. Since not all methods in all libraries are annotated by their authors, IDEA allows users to specify that "this string parameter is actually this language". Just write a call to the method, place the cursor on the parameter and then press alt-enter to get the intention actions: Press enter on "Inject language or reference" and then select the correct language from the list. Afterwards IDEA remembers that the given parameter is of the selected language wherever you use it so you only need to do this once per called method. Autocomplete, refactoring, analysis etc. all work right inside the string literal, which is really nice. |
I just released Dalesbred But of course the above tips are generally useful when dealing with your own code and other third party libraries. |
Looks like this isn't doing anything in
IntelliJ IDEA 2021.1.1 (Ultimate Edition)
The text was updated successfully, but these errors were encountered: