You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+78Lines changed: 78 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -233,6 +233,11 @@ Table of Contents[
234
234
* [Visibility](#visibility)
235
235
* [Call to Element](#call-to-element)
236
+
* [Experimental Features](#experimental-features)
237
+
* [~H Sigil HTML Injection](#h-sigil-html-injection-support)
238
+
* [How to enable ~H sigil HTML Injection](#how-to-enable-h-sigil-html-injection)
239
+
* [Providing feedback and reporting issues for the ~H Sigil HTML Injection Experimental Feature](#providing-feedback-and-reporting-issues-for-the-h-sigil-html-injection-experimental-feature))
240
+
* [Removing the green background for Injected language fragments](#removing-the-green-background-for-injected-language-fragments)
236
241
* [Installation](#installation)
237
242
* [Stable releases](#stable-releases)
238
243
* [Inside IDE using JetBrains repository](#inside-ide-using-jetbrains-repository)
@@ -5761,6 +5766,79 @@ The Visibility icons indicated whether the element is usable outside its definin
YoucanviewthecurrentlyavailableExperimentalFeaturesbynavigatingto `Languages & Frameworks` andselecting `ElixirExperimentalSettings`, whichismarkedwiththe [BETAicon](https://plugins.jetbrains.com/docs/intellij/settings-guide.html#l6vycg_378). Alternatively, you can access it directly via [Settings | Languages & Frameworks | Elixir Experimental Settings](jetbrains://Idea/settings?name=Languages+%26+Frameworks--Elixir+Experimental+Settings).
**Experimental Feature – available from version 2024.3+ (243.21565.180) and later**
5780
+
5781
+
When working with Phoenix Live View templates within the IntelliJ Elixir plugin, you'll notice that sigils such as `~H` are rendered as strings, which means that out of the box there is no HTML syntax highlighting or autocomplete when working with Phoenix Live View, which is used for writing HEEx templates inside source files. `HEEx` is a HTML-aware and component-friendly extension of Elixir Embedded language, this can make editing templates tedious.
5782
+
5783
+
This Experimental Feature introduces preliminary HTML injection support within `~H` sigils, enabling HTML syntax highlighting and autocomplete.
5784
+
5785
+
**Before, you would see this rendered as a string:**
5786
+
5787
+

5788
+
5789
+
**After enabling ~H Sigil HTML Injection:**
5790
+
5791
+

5792
+
5793
+
> [!TIP]
5794
+
> The [Phoenix LiveView Documentation on sigil_H](https://hexdocs.pm/phoenix_live_view/1.0.3/Phoenix.Component.html#sigil_H/2) is a fantastic resource for understanding how the `~H` sigil works.
5795
+
5796
+
**Note:** Elixir code completion within HTML attributes is not yet supported.
5797
+
5798
+
However, it does open the door, thanks to [MultihostInjector](https://plugins.jetbrains.com/docs/intellij/language-injection.html#multihostinjector), we could possibly mix HTML+Elixir, allowing autocomplete of Elixir within HTML.. if anyone is daring enough to wrangle the MultihostInjector API!
5799
+
5800
+
#### IntelliLang Plugin Requirement
5801
+
5802
+
This functionality has a dependency on the [IntelliLang](https://plugins.jetbrains.com/plugin/13374-intellilang) plugin, which comes bundled with both IntelliJ Community/Ultimate, and other IDEs.
5803
+
5804
+
However this is marked as an optional dependency for the plugin, and does not need to be enabled if you are not using the functionality. THe code won't run, and you won't see injections.
5805
+
5806
+
More information about [Language Injections](https://www.jetbrains.com/help/idea/using-language-injections.html) is available in the IntelliJ IDEA documentation.
5807
+
5808
+
#### How to Enable ~H Sigil HTML Injection
5809
+
5810
+
To enable support for HTML syntax highlighting and autocomplete:
5811
+
5812
+
1. Open [Settings](https://www.jetbrains.com/help/idea/configure-project-settings.html).
5813
+
2. Navigate to [Settings | Languages & Frameworks | Elixir Experimental Settings](jetbrains://Idea/settings?name=Languages+%26+Frameworks--Elixir+Experimental+Settings).
5814
+
3. Enable the **~H Sigil HTML Injection** feature.
> This Experimental Feature is currently enabled on a **per-project** basis. We are considering adding application-level support or enabling it by default in future versions based on feedback
5820
+
5821
+
#### Providing feedback and reporting issues for the ~H Sigil HTML Injection Experimental Feature
5822
+
5823
+
Have feedback or encountered issues? Please share your thoughts, Exception Stacktraces on the dedicated [**\[Experimental Feature\] ~H Sigil HTML Injection #3678**](https://github.com/KronicDeth/intellij-elixir/issues/3678).
5824
+
5825
+
#### Removing the Green Background for Injected Language Fragments
5826
+
5827
+
By default, IntelliLang highlights injected content with a green background, which can be changed by within [Color Scheme settings](https://www.jetbrains.com/help/idea/settings-colors-and-fonts.html).
5828
+
5829
+
However, note that this change will apply to **all injected language fragments**, not just `~H` sigils HTML injections.
5830
+
5831
+
> We are investigating the use of [InjectionBackgroundSuppressor](https://github.com/JetBrains/intellij-community/blob/idea/243.21565.193/platform/analysis-impl/src/com/intellij/psi/impl/source/tree/injected/InjectionBackgroundSuppressor.java) to selectively disable background highlighting, but this is still a work in progress.
5832
+
5833
+
If you're okay with disabling the background for all injections:
5834
+
5835
+
1. Open [Settings](https://www.jetbrains.com/help/idea/configure-project-settings.html).
5836
+
2. Navigate to [Settings | Editor | Color Scheme | General](jetbrains://Idea/settings?name=Editor--Color+Scheme).
5837
+
3. Under the `Code` section, find `Injected Language Fragment`.
5838
+
4. Uncheck **Background** or change the colour to your preference.
5839
+
5840
+

//This disables the throwing of ProcessCanceledException, which is typically used to cancel long-running processes in IntelliJ IDEA. Disabling it can be useful in certain debugging scenarios.
0 commit comments