language_injection.md: minor edits

This commit is contained in:
Yann Cébron 2024-02-05 13:54:43 +01:00
parent 3b2d64f969
commit 852f1ea9d4

View File

@ -1,7 +1,7 @@
<!-- Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
# Language Injection
<!-- Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
<link-summary>Injecting a language into different language elements.</link-summary>
<tldr>
@ -135,7 +135,7 @@ For instance, injecting SQLite into Python code is specified by the following op
Inside an injection, the following tags can be used:
| XML Tag | Description |
|---------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `<display-name>` | A short name for the injection. |
| `<place>` | The element pattern that defines where an injection will take place. The content is wrapped in `![CDATA[...]]`. |
| `<prefix>` and `<suffix>` | Static content that is wrapped around the injected code, e.g., to make it a valid expression. For example, to a CSS color specification inside a string, it can be wrapped with the prefix `div { color:` and the suffix `;}` to make it a valid CSS expression. |
@ -312,4 +312,4 @@ To control delegation of formatting to containing file, implement [`InjectedForm
## Injection Highlighting
To suppress highlighting from <control>Code | Injected language fragment</control> setting in <ui-path>Preferences | Editor | Color Scheme | General</ui-path>, injection host must implement [`InjectionBackgroundSuppressor`](%gh-ic%/platform/analysis-impl/src/com/intellij/psi/impl/source/tree/injected/InjectionBackgroundSuppressor.java).
To suppress highlighting from <control>Code | Injected language fragment</control> setting in <ui-path>Settings | Editor | Color Scheme | General</ui-path>, injection host must implement [`InjectionBackgroundSuppressor`](%gh-ic%/platform/analysis-impl/src/com/intellij/psi/impl/source/tree/injected/InjectionBackgroundSuppressor.java).