Language Injection Settings dialog: Generic Python
Use this dialog to configure an injection rule that injects a language into Python string literals.
The dialog opens when you click Add on the Language Injections settings page and select Generic Python, or when you select a Python injection in the list and click
Edit.
Item | Description |
|---|---|
Name | The name of the injection. |
Language | The language to be injected.
The prefix and suffix are optional. |
Places Patterns | In this field, type the rules that define the context where you want IntelliJ IDEA recognize literals as injections. In addition to the platform patterns, such as
The To combine conditions, use Examples: Inject a language into string literals that start with
pyStringLiteralMatches("^\\s*SELECT\\s")
Inject a language into the first argument of any call to a function or method named
pyLiteralExpression().and(pyArgument("execute", 0))
Inject a language into the first argument of the
pyModuleFunctionArgument("run_query", 0, "db_utils")
Inject a language into the first argument of the
pyMethodArgument("query", 0, "myapp.db.Repository")
Multiple patterns You can define multiple place patterns for a single injection rule. The injection activates if any of the patterns match (they are combined with OR logic). Add each pattern on a separate line. |
Advanced | In this area, optionally specify additional settings to narrow the context where the injection rule is applicable and thus to enable more fine-grained control over the injection process.
|