Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellij Idea Dart SQL Injection

Intellij Idea has this feature called Language Injection, which allows you to have syntax highlighting for one language into another, such as having syntax highlighting for SQL inside a String when editing a java file.

I want to allow this to work with Dart, i.e. allow me to syntax highlight Strings with SQL in Dart automatically when I call a certain function. However this is not possible, as the only languages it allows injection FROM are those:

language inject

Is it possible to allow injections in a dart (or just for the sake of it any custom language), and if it isn't what resources can I look into for writing a plugin to do this, or modifying the existing built-in IntelliLang plugin?

EDIT:

I'm very well aware that it can be done manually for each string by pressing alt+enter, selecting inject language or reference and selecting sql, but this is unnecessarily tedious

like image 949
DannyM Avatar asked Dec 09 '25 17:12

DannyM


1 Answers

See the comments here: https://youtrack.jetbrains.com/issue/WEB-38875

Here are some quotes:

currently we only support injection by comment for the string literal on the next line.

It's possible to write a custom IntelliJ / WebStorm plugin with MultiHostInjector implementation that would support any custom annotation or whatever syntax for injection in Dart string literals.

like image 142
Konstantin Annikov Avatar answered Dec 12 '25 06:12

Konstantin Annikov