Skip to content

Commit

Permalink
Check if Internal Erlang SDK home path exists for SDK for New Project
Browse files Browse the repository at this point in the history
  • Loading branch information
KronicDeth committed Jun 16, 2023
1 parent 246d95f commit bfce886
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* [#3263](https://github.com/KronicDeth/intellij-elixir/pull/3263) - [@KronicDeth](https://github.com/KronicDeth)
* Exclude `.elixir_ls` directory when configuring new `Project`s.
If the `.elixir_ls` directory is included the `.beam` it produces can interfere with normal `StubIndex`.
* [#3271](https://github.com/KronicDeth/intellij-elixir/pull/3271) - [@KronicDeth](https://github.com/KronicDeth)
* Check if Internal Erlang SDK home path exists for SDK for New Project.

## v15.0.1

Expand Down
1 change: 1 addition & 0 deletions resources/META-INF/changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ <h1>v15.0.2</h1>
<p>If the <code>.elixir_ls</code> directory is included the <code>.beam</code> it produces can interfere
with normal <code>StubIndex</code>.</p>
</li>
<li>Check if Internal Erlang SDK home path exists for SDK for New Project.</li>
</ul>
</li>
</ul>
Expand Down
19 changes: 13 additions & 6 deletions src/org/elixir_lang/new_project_wizard/Step.kt
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,20 @@ private fun validateAndGetSdkValidationMessage(
return if (sdk == null) {
JavaUiBundle.message("title.no.jdk.specified")
} else {
if (Elixir.elixirSdkHasErlangSdk(sdk)) {
try {
sdkModel.apply(null, true)
val internalErlangSdk = Elixir.elixirSdkToErlangSdk(sdk)

null
} catch (e: ConfigurationException) {
e.message ?: e.title
if (internalErlangSdk != null) {
if (internalErlangSdk.homeDirectory != null) {
try {
sdkModel.apply(null, true)

null
} catch (e: ConfigurationException) {
e.message ?: e.title
}
} else {
"Internal Erlang SDK (${internalErlangSdk.name} home directory (${internalErlangSdk.homePath}) " +
"does not exists. Did you uninstall it?"
}
} else {
"Internal Erlang SDK is not in Elixir SDK. Set it before picking this Elixir SDK."
Expand Down

0 comments on commit bfce886

Please sign in to comment.