Skip to content

Commit 1878f2d

Browse files
committed
2025.3
1 parent dc93605 commit 1878f2d

File tree

28 files changed

+372
-193
lines changed

28 files changed

+372
-193
lines changed

README.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,11 @@ Table of Contents[![Backers on Open Collective](https://opencollective.com/intel
233233
* [Time](#time)
234234
* [Visibility](#visibility)
235235
* [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)
236241
* [Installation](#installation)
237242
* [Stable releases](#stable-releases)
238243
* [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
57615766
</tbody>
57625767
</table>
57635768

5769+
## Experimental Features
5770+
5771+
As we develop new functionality that requires additional testing and feedback, we offer an opt-in system for Experimental Features via the `Elixir Experimental Settings` page.
5772+
5773+
You can view the currently available Experimental Features by navigating to `Languages & Frameworks` and selecting `Elixir Experimental Settings`, which is marked with the [BETA icon](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).
5774+
5775+
![Elixir Experimental Settings UI](/screenshots/experimental/elixir-experimental-settings-ui.png)
5776+
5777+
### ~H Sigil HTML Injection Support
5778+
5779+
**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+
![~H shows as a string](/screenshots/experimental/h-sigil-html-before.png?raw=true "Shown as a string")
5788+
5789+
**After enabling ~H Sigil HTML Injection:**
5790+
5791+
![~H now shows with HTML injection](/screenshots/experimental/h-sigil-html.png?raw=true "HTML injection for autocomplete and syntax highlighting for the ~H sigil")
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.
5815+
5816+
![Settings | Languages & Frameworks | Elixir Experimental Settings](/screenshots/experimental/elixir-experimental-settings-ui.png?raw=true "Elixir Experimental Settings UI")
5817+
5818+
> [!NOTE]
5819+
> 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+
![How to remove the green background for Injected languge support](/screenshots/experimental/disable-injection-green-background.png?raw=true "Color Settings")
5841+
57645842
## Installation
57655843

57665844
### Stable releases

build.gradle

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ subprojects {
7070
create(providers.gradleProperty("platformType"), providers.gradleProperty("platformVersion"))
7171

7272
bundledPlugins providers.gradleProperty("platformBundledPlugins").map { it.split(',').toList() }
73-
7473
bundledModules providers.gradleProperty("platformBundledModules").map { it.split(',').toList() }
7574

7675
instrumentationTools()
@@ -89,8 +88,8 @@ subprojects {
8988
java.srcDir 'tests'
9089
}
9190
}
92-
9391
}
92+
9493
sourceSets {
9594
main {
9695
java.srcDirs 'src', 'gen'
@@ -182,9 +181,8 @@ tasks.withType(RunIdeTask).configureEach {
182181
// Set JVM arguments
183182
jvmArguments.addAll(["-Didea.debug.mode=true", "-Didea.is.internal=true", "-Dlog4j2.debug=true", "-Dlogger.org=TRACE", "-XX:+AllowEnhancedClassRedefinition", "-XXHotswapAgent=fatjar"])
184183

185-
186184
// Set system properties to debug log
187-
systemProperty "idea.log.debug.categories", "org.elixir_lang:all"
185+
systemProperty "idea.log.debug.categories", "org.elixir_lang"
188186

189187
// Set the maximum heap size
190188
maxHeapSize = "7g"
@@ -421,8 +419,7 @@ task stopQuoter(type: Exec, dependsOn: releaseQuoter) {
421419
}
422420

423421
runIde {
424-
systemProperty "idea.log.debug.categories", "org.elixir_lang:all"
425-
systemProperty "org.elixir_lang.statusBar.enabled", "true"
422+
systemProperty "idea.log.debug.categories", "org.elixir_lang"
426423
// When wanting to disable EDT slow assertion..
427424
// systemProperty "ide.slow.operations.assertion", "true"
428425

@@ -440,6 +437,7 @@ runIde {
440437
//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.
441438
jvmArgs "-Didea.debug.mode=true", "-XX:+AllowEnhancedClassRedefinition", "-Didea.is.internal=true", "-Dlog4j2.debug=true", "-Dlogger.org=TRACE", "-Didea.ProcessCanceledException=disabled"
442439
maxHeapSize = "7g"
440+
autoReload = false
443441
// get from runIdeWorkingDirectory
444442
if (project.hasProperty("runIdeWorkingDirectory") && !project.property("runIdeWorkingDirectory").isEmpty()) {
445443
workingDir = file(project.property("runIdeWorkingDirectory"))

gradle.properties

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pluginVersion=22.0.0
66
vendorName=Elle Imhoff
77
vendorEmail=[email protected]
88
# https://youtrack.jetbrains.com/articles/IDEA-A-2100661899/IntelliJ-IDEA-2024.1-241.14494.240-build-Release-Notes
9-
pluginSinceBuild=243.21565.180
9+
pluginSinceBuild=253.22441.1
1010
pluginUntilBuild=
1111
#pluginVerificationIDEAVersions="251.26927.53"
1212
#pluginVerificationRubyMineVersions="251.26927.47"
@@ -56,7 +56,7 @@ runIdeCompatiblePlugins=
5656
# We need com.intellij.java to compile JPS, and markdown.
5757
# @todo fix org.intellij.intelliLang
5858
platformBundledPlugins=org.intellij.plugins.markdown,com.intellij.java
59-
platformBundledModules=intellij.platform.langInjection
59+
platformBundledModules=intellij.platform.langInjection,intellij.spellchecker
6060

6161
# Gradle Releases -> https://github.com/gradle/gradle/releases
6262
# 8.5 is set because newer versions have weird run time caching issues, even with caching turned off.
@@ -78,6 +78,7 @@ kotlin.daemon.jvmargs=-Xmx7906m
7878
# Gradle Configuration Cache - https://docs.gradle.org/current/userguide/configuration_cache.html
7979
# Gradle Build Cache - https://docs.gradle.org/current/userguide/build_cache.html
8080
# Parallel Gradle Builds - https://docs.gradle.org/current/userguide/performance.html#parallel_execution
81-
org.gradle.configuration-cache=true
82-
org.gradle.caching=true
81+
org.gradle.configuration-cache=false
82+
org.gradle.caching=false
8383
org.gradle.parallel=false
84+
#org.gradle.daemon=false

jps-builder/tests/org/elixir_lang/jps/BuildResult.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package org.elixir_lang.jps;
22

3-
import com.intellij.openapi.util.text.StringUtil;
4-
import com.intellij.util.Function;
53
import org.jetbrains.annotations.NotNull;
64
import org.jetbrains.jps.incremental.MessageHandler;
75
import org.jetbrains.jps.incremental.messages.BuildMessage;
@@ -10,6 +8,7 @@
108

119
import java.util.ArrayList;
1210
import java.util.List;
11+
import java.util.stream.Collectors;
1312

1413
/**
1514
* Created by zyuyou on 15/7/17.
@@ -56,9 +55,16 @@ public boolean isSuccessful(){
5655
}
5756

5857
public void assertSuccessful(){
59-
Function<BuildMessage, String> toStringFunction = StringUtil.createToStringFunction(BuildMessage.class);
60-
Assert.assertTrue("Build failed. \nErrors:\n" + StringUtil.join(myErrorMessages, toStringFunction, "\n") +
61-
"\nInfo messages:\n" + StringUtil.join(myInfoMessages, toStringFunction, "\n"), isSuccessful());
58+
String errors = myErrorMessages.stream()
59+
.map(BuildMessage::toString)
60+
.collect(Collectors.joining("\n"));
61+
62+
String infos = myInfoMessages.stream()
63+
.map(BuildMessage::toString)
64+
.collect(Collectors.joining("\n"));
65+
66+
Assert.assertTrue("Build failed. \nErrors:\n" + errors +
67+
"\nInfo messages:\n" + infos, isSuccessful());
6268
}
6369

6470
@NotNull

resources/META-INF/optional/org.elixir_lang-withIntellijLang.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66

77
<extensions defaultExtensionNs="com.intellij">
88
<multiHostInjector implementation="org.elixir_lang.injection.markdown.Injector"/>
9-
<multiHostInjector
10-
id="org.elixir_lang.injection.ElixirSigilInjector"
11-
implementation="org.elixir_lang.injection.ElixirSigilInjector"/>
9+
<multiHostInjector implementation="org.elixir_lang.injection.ElixirSigilInjector"/>
1210
</extensions>
13-
1411
</idea-plugin>

resources/META-INF/plugin.xml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@
44
<vendor email="[email protected]">Elle Imhoff</vendor>
55

66
<!-- please see http://confluence.jetbrains.com/display/IDEADEV/Build+Number+Ranges for description -->
7-
<idea-version since-build="243.21565.180"/>
7+
<idea-version since-build="253.22441.1"/>
88

99
<!-- please see http://confluence.jetbrains.com/display/IDEADEV/Plugin+Compatibility+with+IntelliJ+Platform+Products
1010
on how to target different products -->
11+
<depends>com.intellij.modules.platform</depends>
1112
<depends>com.intellij.modules.lang</depends>
13+
<depends>com.intellij.modules.xml</depends>
1214
<depends>org.intellij.plugins.markdown</depends>
1315
<depends config-file="rich-platform-plugin.xml" optional="true">com.intellij.modules.java</depends>
16+
<depends config-file="optional/org.elixir_lang-withIntellijLang.xml" optional="true">org.intellij.intelliLang</depends>
1417

1518
<extensionPoints>
1619
<extensionPoint qualifiedName="org.elixir_lang.packageManager" interface="org.elixir_lang.PackageManager"
@@ -22,11 +25,12 @@
2225
</extensions>
2326

2427
<extensions defaultExtensionNs="com.intellij">
25-
<registryKey key="org.elixir_lang.injection.enableLiteralSigilInjection"
26-
defaultValue="false"
27-
description="Enables literal sigil injection, which allows the Elixir sigil ~S to work. WARNING: THIS IS CURRENTLY BUGGY AND CAUSING ISSUES WITH ~s"/>
2828

29-
<!-- <errorHandler implementation="org.elixir_lang.errorreport.Submitter"/>-->
29+
<!-- Status Bar Widget -->
30+
<statusBarWidgetFactory
31+
id="ElixirSdkStatus"
32+
implementation="org.elixir_lang.status_bar_widget.ElixirSdkStatusWidgetFactory"/>
33+
3034
<errorHandler implementation="com.intellij.diagnostic.JetBrainsMarketplaceErrorReportSubmitter"/>
3135

3236
<!-- `openProjectProcessor` for Small IDEs -->
@@ -90,6 +94,12 @@
9094
<fileType name="Elixir Script" implementationClass="org.elixir_lang.ElixirScriptFileType" fieldName="INSTANCE"
9195
language="Elixir" extensions="exs"/>
9296

97+
<projectConfigurable
98+
parentId="language.elixir"
99+
displayName="Elixir Experimental Settings"
100+
id="org.elixir_lang.settings.ElixirExperimentalSettingsConfigurable"
101+
instance="org.elixir_lang.settings.ElixirExperimentalSettingsConfigurable"/>
102+
93103
<!-- Facet -->
94104
<applicationConfigurable id="language.elixir.sdks.elixir"
95105
parentId="language.elixir"
@@ -273,7 +283,6 @@
273283

274284
<lang.documentationProvider implementationClass="org.elixir_lang.documentation.ElixirDocumentationProvider"
275285
language="Elixir"/>
276-
<multiHostInjector implementation="org.elixir_lang.injection.markdown.Injector"/>
277286

278287
<!-- Dialyzer -->
279288
<globalInspection displayName="Dialyzer based inspections (Elixir)" shortName="Dialyzer"
@@ -303,7 +312,7 @@
303312
</group>
304313
<group id="LangElixir.HelpActions">
305314
<separator/>
306-
<action id="Elixir.Help" class="org.elixir_lang.action.HelpAction" text="IntelliJ Elixir Help"/>
315+
<action id="Elixir.Help" class="org.elixir_lang.action.HelpAction" text="IntelliJ Elixir Help" icon="AllIcons.Windows.Help" />
307316
<separator/>
308317
<add-to-group group-id="HelpMenu" anchor="before" relative-to-action="ProductivityGuide"/>
309318
</group>

resources/colorSchemes/ElixirDarcula.xml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@
184184
</option>
185185
<option name="ELIXIR_SIGIL_UPPER_H">
186186
<value>
187-
<option name="FOREGROUND" value="5BB347" />
188187
</value>
189188
</option>
190189
<option name="ELIXIR_SIGIL_LOWER_I">
@@ -278,9 +277,9 @@
278277
</value>
279278
</option>
280279
<option name="ELIXIR_SIGIL_LOWER_R">
281-
<value>
282-
<option name="FOREGROUND" value="4749B3" />
283-
</value>
280+
<!-- <value>-->
281+
<!-- <option name="FOREGROUND" value="4749B3" />-->
282+
<!-- </value>-->
284283
</option>
285284
<option name="ELIXIR_SIGIL_UPPER_R">
286285
<value>

resources/colorSchemes/ElixirDefault.xml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@
184184
</option>
185185
<option name="ELIXIR_SIGIL_UPPER_H">
186186
<value>
187-
<option name="FOREGROUND" value="99186C" />
188187
</value>
189188
</option>
190189
<option name="ELIXIR_SIGIL_LOWER_I">
@@ -278,9 +277,9 @@
278277
</value>
279278
</option>
280279
<option name="ELIXIR_SIGIL_LOWER_R">
281-
<value>
282-
<option name="FOREGROUND" value="569918" />
283-
</value>
280+
<!-- <value>-->
281+
<!-- <option name="FOREGROUND" value="569918" />-->
282+
<!-- </value>-->
284283
</option>
285284
<option name="ELIXIR_SIGIL_UPPER_R">
286285
<value>

settings.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
2-
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0'
2+
id 'org.gradle.toolchains.foojay-resolver-convention' version '1.0.0'
33
}
44
rootProject.name = 'intellij-elixir'
55
include 'jps-shared'
6-
include 'jps-builder'
6+
include 'jps-builder'

src/org/elixir_lang/action/DeleteAllSdksAction.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import com.intellij.notification.NotificationType
55
import com.intellij.openapi.actionSystem.ActionUpdateThread
66
import com.intellij.openapi.actionSystem.AnAction
77
import com.intellij.openapi.actionSystem.AnActionEvent
8-
import com.intellij.openapi.application.writeAction
8+
import com.intellij.openapi.application.edtWriteAction
99
import com.intellij.openapi.diagnostic.Logger
1010
import com.intellij.openapi.project.Project
1111
import com.intellij.openapi.projectRoots.ProjectJdkTable
@@ -73,7 +73,7 @@ class DeleteAllSdksAction : AnAction() {
7373
val sdksRemoved = runWithModalProgressBlocking(project, "Removing All Elixir/Erlang SDKs") {
7474
var removedCount = 0
7575

76-
writeAction {
76+
edtWriteAction {
7777
LOG.info("Starting removal of ${allTargetSdks.size} SDK(s) and associated libraries")
7878

7979
for (sdk in allTargetSdks) {

0 commit comments

Comments
 (0)