Bot releases are hidden (Show)
Published by KronicDeth over 5 years ago
StackOverflowError
s for use
calls that that refer back to the same Module.
StackOverflowError
. A reproduction case shows that they are called by Phoenix Web
modules where one function containing quote
block use
s the same module again, such as an admin_view
depending on the base view
through use App.Web, :view
. When the use App.Web, :view
is resolving, the defmacro __using__
is re-entered as is the admin_view
because there was no tracking of already visited PsiElement
s. The fix is to track the visited elements and not re-enter the visited elements so that admin_view
is skipped and the other call definition clauses can be checked to find view
.Published by KronicDeth over 5 years ago
Published by KronicDeth over 5 years ago
readNameSet
needed to be greater than 10
kiex
had confusing directory structure which made it hard to select the correct SDK Home Path.
ESpec
template was missing.
targets
is used in mix
deps.
organization
is used in mix
deps.
readAction
around Document
rebar3
deps were not supported.
kiex
is ~/.kiex/elixirs/elixir-VERSION/lib/elixir
as that contains the true lib
and bin
directory, but users may select other directories by mistake, so doing the following adjustments:
bin
home path to lib/elixir
.elixirs/elixir-VERSION
home path to elixirs/elixir-VERSION/lib/elixir
.ELIXIR_MODULE
modules in DirectoryConfigurator
. This matches the manual steps of opening the OTP apps as separate directories after opening the root of the project.
ELIXIR_MODULE
s:
ELIXIR_MODULE
*.iml
filesELIXIR_MODULE
entries root project's modules.xml
file.doOpenProject
will trigger DirectoryProjectConfigurator
s to be run, which will setup the project and run DirectoryConfigurator
to attach the apps
OTP apps and Elixir facets.
nameSet
size to 15
to support geo
. geo
has 13 String.Chars
implementations. - @KronicDeth
SdkType
. I keep confusing it with its replacement org.elixir_lang.sdk.elixir.Type
!ebin
paths when validation. Prevents selecting false HomePaths for kiex
.resources
. 🤦♂️ - @KronicDeth
targets
when calculating Dep
path. - @KronicDeth
organization
when calculating Dep
path. - @KronicDeth
rebar.config
deps that are name only. - @KronicDeth
containingFile
for QualifiableAlias
maxScope
for getReference
. Prevents cache capturing maxScope
, which can vary based on invocation. - @KronicDeth
Create new project before attaching it in Small IDEs.
When attaching a directory to a project during startup, saving is disallowed, so the attached directory only has a workspace.xml
in its .idea
when the attach is attempted. Attaching requires the .idea/*.iml
Module file, so the attaching fails, saying the directory is an unsupported format.
Experimentation showed that manually attaching the directory also did not work, but opening the directory in a separate window, then opening and attaching it again would make the directory have the full project files. To mimic this manual process:
doOpenProject
are copiedTested to work when upgrading from 10.4.0 to 10.5.0-pre in Rubymine when no project was already open.
Check if project can be attached instead of if RubyMine
Although GoLand supports attaching projects, it doesn't work for non-Go projects, so it is also excluded. How the support appears in each non-IntelliJ IDEA is shown below:
IDE | Works? | |
---|---|---|
Android Studio | YES | Android Studio is built on top of IntelliJ, so it has full multi-Module support. It is not Small IDE. |
CLion | NO | No Attach to Project support to multiple module support. |
DataGrip | No | DataGrip doesn't have a Project View and doesn't support Attach to Project. You can still run tests if you directly open the file. |
GoLand | NO | Modules show up, but independent projects are not attached as in other Small IDEs, so disabled. In general, the Go settings, like Test Runners always win, so it is recommended to not use GoLand at all for Elixir development. |
PHPStorm | YES | The projects are listed in Directories. The Languages & Frameworks > Elixir shows all 3 projects. Right-clicking on the marked Test directory will not show the Elixir Run Configuration, Python ones win, but subdirectories and *_test.exs will show up in the context menu. |
PyCharm | YES | The root project is listed in Project. app/* projects are listed listed as Project Dependencies of the root Project. The Languages & Frameworks > Elixir shows all 3 projects. Right-clicking on the marked Test directory will not show the Elixir Run Configuration, Python ones win, but subdirectories and *_test.exs will show up in the context menu. |
Rider | No | Solution system is separate from Project system. |
Rubymine | YES | The projects are listed in Project Structure. The Languages & Frameworks > Elixir shows all 3 projects. Right-clicking on the marked Test directory will not show the Elixir Run Configuration, Python ones win, but subdirectories and *_test.exs will show up in the context menu. |
WebStorm | NO | No Attach to Project support or multiple module support. |
Don't count Android Studio as a Small IDE. It includes Project Structure menu with multiple-language, multiple-Module per Project support from IntelliJ.
Published by KronicDeth over 5 years ago
Published by KronicDeth over 5 years ago
Published by KronicDeth over 5 years ago
Published by KronicDeth over 5 years ago
Published by KronicDeth over 5 years ago
Published by KronicDeth over 5 years ago
Published by KronicDeth over 5 years ago
Published by KronicDeth over 5 years ago
Published by KronicDeth over 5 years ago
Published by KronicDeth over 5 years ago
Published by KronicDeth over 5 years ago
Published by KronicDeth over 5 years ago
Published by KronicDeth over 5 years ago
Published by KronicDeth over 5 years ago
Published by KronicDeth over 5 years ago
espec
support
runReadAction
*_test.exs
files exist.*_spec.exs
files exist.UnqualifiedNoArgumentCall.quote
identifier.text
in runReadAction
. - @KronicDeth
CONTRIBUTING.md
- @nschulzke
mix espec
The mix espec
task gets a special type of Run Configuration, Elixir Mix Espec
. Using this Run Configuration type instead, of the basic Elixir Mix
Run Configuration will cause the IDE to attach a special formatter to mix espec
, so that you get the standard graphical tree of Test Results.
The Run pane will show Test Results. If there is a compilation error before or during mix espec
, it will be shown as a test failure. If the compilation failure is in a _spec.exs
file can it can be inferred from the stacktrace, the compilation error will show up as a test failure in that specific module.
If you override the default formatters you will need to add the following code to your spec_helper.exs
.
If you override formatters similar to below
ESpec.configure fn(config) ->
config.formatters ...
ESpec.configure fn(config) ->
config.formatters [
{ESpec.Formatters.Json, %{out_path: "results.json"}},
{ESpec.Formatters.Html, %{out_path: "results.html"}},
{ESpec.Formatters.Doc, %{details: true, out_path: "results.txt"}},
{ESpec.Formatters.Doc, %{details: true, diff_enabled?: false, out_path: "results-no-diff.txt"}},
{ESpec.CustomFormatter, %{a: 1, b: 2}},
]
end
Replace them with code that checks for the graphical formatter TeamCityESpecFormatter
and uses only it when available.
ESpec.configure fn(config) ->
config.formatters(if Code.ensure_loaded?(TeamCityESpecFormatter) do
[{TeamCityESpecFormatter, %{}}]
else
...
end)
end
ESpec.configure fn(config) ->
config.formatters(if Code.ensure_loaded?(TeamCityESpecFormatter) do
[{TeamCityESpecFormatter, %{}}]
else
[
{ESpec.Formatters.Json, %{out_path: "results.json"}},
{ESpec.Formatters.Html, %{out_path: "results.html"}},
{ESpec.Formatters.Doc, %{details: true, out_path: "results.txt"}},
{ESpec.Formatters.Doc, %{details: true, diff_enabled?: false, out_path: "results-no-diff.txt"}},
{ESpec.CustomFormatter, %{a: 1, b: 2}},
]
end)
end
mix espce
Run Configurations ManuallyRun > Edit Configurations...
Click +
Select "Elixir Mix ESpec"
Fill in the "mix espec
arguments" with the argument(s) to pass to mix espec
. Normally, this will be list of *_spec.exs
files, relative to the "Working directory".
NOTE: Unlike mix test
, mix espec
does not support directories as arguments.
(Optionally) fill in "elixir
arguments" with the arguments to elixir
before it runs mix test
.
(Optionally) fill in "erl
arguments"with the arguments to
erlbefore it runs
elixir`.
Fill in the "Working directory"
...
button(Optionally) click the ...
button on the "Environment variables" line to add environment variables.
Click "OK" to save the Run Configuration and close the dialog
With the Run Configuration defined you can either Run or Debug the mix espec
s
mix test
taskmix test
sWhile you can create Elixir Mix ESpec
run configurations manually using the Run > Edit Configurations...
menu, it is probably more convenient to use the context menu.
mix espec
Run Configurations from contextThe context menu must know that the the directory, file, or line you are right-clicking is a test. It does this by checking if the current directory or an ancestor is marked as a Test Sources Root and contains or is a *_spec.exs
file(s)
espec
directory is marked as a Test Sources Rootespec
directory is green. If it is, it is likely a Test Sources Root. This color may differ in different themes, so to be sure you can check the context menutest
directory.If "Unmark as Test Sources Root" is shown, then the directory is already configured correctly, and create from context will work.
If "Test Sources Root" is shown, then the directory need to be configured by clicking that entry
mix espec
Run Configurations from directoryRight-click the directory in the Project pane
Click "Run Mix ExUnit", which will both create the Run Configuration and Run it.
Alternatively, you can use keyboard shortcuts
Ctrl+Shift+R
will create the Run Configuration and Run it.mix espec
Run Configurations from fileAlternatively, you can use keyboard shortcuts
Ctrl+Shift+R
will create the Run Configuration and Run it.Finally, you can use the editor tabs
Right-click the editor tab for the test file you want to run
Click "Run Mix ESpec", which will both create the Run Configuration and Run it.
mix espec
Run Configurations from lineIf you want to be able to run a single test, you can create a Run Configuration for a line in that test
Right-click a line in the test file
Click "Run Mix ESpec", which will both create the Run Configuration and Run it.
Alternatively, you can use keyboard shortcuts
Ctrl+Shift+R
will create the Run Configuration and Run it.Published by KronicDeth over 5 years ago
Published by KronicDeth over 5 years ago