Comments (4)
There are 3 ways to create modules:
Using Right-click menu
- Right-click a directory, such as the
lib
directory made bymix new
- Select
New
from the context menu - Select
Elixir File
from the submenu - Enter the module name
MyModule
- Click
OK
- MyModule.ex will open with the Module stub
Use App Menu
- Select the File Menu from the application menu
- Select the
New...
action from the File Menu - Select
Elixir File
from the submenu - Enter the module name
MyModule
- Click
OK
- MyModule.ex will open with the Module stub
By file extension
- Right-click a directory, such as the
lib
directory made bymix new
- Select
New
from the context menu - Select
File
from the submenu - Enter the file name with a
.ex
extensionmy_module.ex
- Click
OK
- my_module.ex will open with no content and you'll have to fill it in yourself.
You'll notice that in the first and second steps that use the New Elixir File action, the file name and module name exactly match, which doesn't actually follow mix's convention of underscored for file names and Elixir's convention of CamelCase for modules, so if you use the first two method, I'd recommend renaming the file to underscored, my_module.ex
, manually. There are already issues open to fix the naming so it follows conventions: #19 and #20.
If you just create the file with the correct file extension you'll be able to name the module however you like.
from intellij-elixir.
Thanks but I think I did not state my question clearly.
I just installed a fresh copy of IntellJ IDE. Next I installed your plugin. Can you teach me how to configure/set it up for Elixir?For example, do I have to setup something in Project Settings or Platform Settings? Do I have to install Erlang Plugin?Do I have to setup SDK path? What do I have to do in order to start editing .ex files and run/debug them in the IDE?
I think this guy is asking the same question on stackoverflow ->
http://stackoverflow.com/questions/27730087/new-elixir-project-in-intellij
from intellij-elixir.
There are no Project settings or Platform settings. intellij-elixir doesn't currently require intellij-erlang, although it will probably eventually to leverage the debugger and so intellij-erlang can parse the Erlang code for dependencies (like cowboy for phoenix) and the standard library while intellij-elixir can handle the References between Erlang and Elixir code. There is no SDK path as no features that depend on the Elixir itself exist yet. There is no way to run and debug them in the IDE at this time.
The features that do exist are syntax highlighting and partial support for grammar as outlined in the Features section of the README along with a few Inspections and Quick Fixes where intellij-elixir's grammar can be more forgiving than elixirc
's and will allow you to correct errors that would break the compile.
The README really does document all the current features. There just aren't a lot of them.
The current way intellij-elixir can be used is to create files the steps I outlined above and anything involving running code you'll need to use the Terminal pane in Intellij and drop into iex
or invoke mix
yourself. Don't misunderstand, I do want all those things you mention in intellij-elixir, but I need to get the grammar completed first.
from intellij-elixir.
@prodev42, you'll want to upgrade to v0.3.0 when it appears in the Jetbrains plugin repository or grab it from the releases here on Github: it includes better New > Elixir File support, including transforming Foo.Bar into foo/bar.ex
. See the README for usage information.
from intellij-elixir.
Related Issues (20)
- com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: Read access is allowed from inside read-action (see Application.runReadAction()); see https://jb.gg/ij-platform-threading for details, Current thread: Thread[AWT-EventQueue-0,6,main] 1791123227 (EventQueue.isDispatchThread()=true), SystemEventQueueThread: (same) at com.intellij.util.concurrency.ThreadingAssertions.createThreadAccessException(ThreadingAssertions.java:149)
- No decompiled source function with name (:eredis_sub.punsubscribe) at org.elixir_lang.beam.psi.impl.ModuleImpl.setMirror(ModuleImpl.kt:103)
- Intellij 2024.1 Support HOT 3
- com.intellij.diagnostic.PluginException: No display name specified in plugin descriptor XML file for configurable org.elixir_lang.facet.configurable.Project;, specify it using 'displayName' or 'key' attribute to avoid necessity to load the configurable class when Settings dialog is opened [Plugin: org.elixir_lang] at com.intellij.openapi.options.ex.ConfigurableWrapper.getDisplayName(ConfigurableWrapper.java:156)
- unable to get stub builder for file with file = file:///Users/sg/.asdf/installs/elixir/1.14.5-otp-25/lib/elixir/lib/kernel.ex, file type = org.elixir_lang.ElixirFileType@74c58c7c, indexed file type = org.elixir_lang.ElixirFileType@74c58c7c, , stubBindingRoot = PsiPlainTextFileImpl, languages = [TEXT], fileTypes = [Elixir], files = [PsiPlainTextFileImpl], roots = [], indexingInfo = indexing timestamp = 1684767701000, binary = false, byte size = 175616, char size = 175612, isTooLarge = true at com.intellij.psi.stubs.StubProcessingHelperBase.handleNonPsiStubs(StubProcessingHelperBase.java:122)
- cr
- Intellij freezes when using plugin.
- java.util.concurrent.ExecutionException: com.ericsson.otp.erlang.OtpErlangExit: {undef,[{int,interpreted,[],[]},{'Elixir.IntelliJElixir.Debugger.Server',handle_call,3,[{file,"/private/var/folders/82/ml58sd892l1889x_57thjlbc0000gp/T/intellij_elixir1/debugger/lib/intellij_elixir/debugger/server.ex"},{line,166}]},{gen_server,try_handle_call,4,[{file,"gen_server.erl"},{line,1131}]},{gen_server,handle_msg,6,[{file,"gen_server.erl"},{line,1160}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,241}]}]} at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
- com.intellij.diagnostic.PluginException: No display name specified in plugin descriptor XML file for configurable org.elixir_lang.facet.configurable.Project;, specify it using 'displayName' or 'key' attribute to avoid necessity to load the configurable class when Settings dialog is opened [Plugin: org.elixir_lang] at com.intellij.openapi.options.ex.ConfigurableWrapper.getDisplayName(ConfigurableWrapper.java:156)
- com.intellij.diagnostic.PluginException: No display name specified in plugin descriptor XML file for configurable org.elixir_lang.facet.configurable.Project;, specify it using 'displayName' or 'key' attribute to avoid necessity to load the configurable class when Settings dialog is opened [Plugin: org.elixir_lang] at com.intellij.openapi.options.ex.ConfigurableWrapper.getDisplayName(ConfigurableWrapper.java:156)
- psiElement is not instance of requiredClass.
- com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: Read access is allowed from inside read-action (see Application.runReadAction()); see https://jb.gg/ij-platform-threading for details, Current thread: Thread[AWT-EventQueue-0,6,main] 867164883 (EventQueue.isDispatchThread()=true), SystemEventQueueThread: (same) at com.intellij.util.concurrency.ThreadingAssertions.createThreadAccessException(ThreadingAssertions.java:149)
- java.lang.NullPointerException: getContainingDirectory(...) must not be null at org.elixir_lang.exunit.configuration.ProducerKt.workingDirectory(Producer.kt:202)
- com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: Read access is allowed from inside read-action (see Application.runReadAction()); see https://jb.gg/ij-platform-threading for details, Current thread: Thread[AWT-EventQueue-0,6,main] 2049114663 (EventQueue.isDispatchThread()=true), SystemEventQueueThread: (same) at com.intellij.util.concurrency.ThreadingAssertions.createThreadAccessException(ThreadingAssertions.java:149)
- com.intellij.diagnostic.PluginException: Non-idempotent computation: it returns different results when invoked multiple times or on different threads:, 3 != 2, which is length of CachedValue dependencies: [PSI_MOD_COUNT_OPTIMIZATION, UNMATCHED_UNQUALIFIED_NO_ARGUMENTS_CALL, UNMATCHED_UNQUALIFIED_NO_PARENTHESES_CALL] and [UNMATCHED_UNQUALIFIED_NO_ARGUMENTS_CALL, UNMATCHED_UNQUALIFIED_NO_PARENTHESES_CALL], where values are org.elixir_lang.psi.__module__.Reference(UNMATCHED_UNQUALIFIED_NO_ARGUMENTS_CALL:null) and org.elixir_lang.psi.__module__.Reference(UNMATCHED_UNQUALIFIED_NO_ARGUMENTS_CALL:null), , Recomputation gives com.intellij.util.CachedValueBase$Data@14cf032e which is equivalent to 'fresh' [Plugin: org.elixir_lang] at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:23)
- com.intellij.diagnostic.PluginException: Non-idempotent computation: it returns different results when invoked multiple times or on different threads:, 3 != 2, which is length of CachedValue dependencies: [PSI_MOD_COUNT_OPTIMIZATION, UNMATCHED_UNQUALIFIED_NO_ARGUMENTS_CALL, UNMATCHED_UNQUALIFIED_NO_PARENTHESES_CALL] and [UNMATCHED_UNQUALIFIED_NO_ARGUMENTS_CALL, UNMATCHED_UNQUALIFIED_NO_PARENTHESES_CALL], where values are org.elixir_lang.psi.__module__.Reference(UNMATCHED_UNQUALIFIED_NO_ARGUMENTS_CALL:null) and org.elixir_lang.psi.__module__.Reference(UNMATCHED_UNQUALIFIED_NO_ARGUMENTS_CALL:null), , Recomputation gives com.intellij.util.CachedValueBase$Data@4d4fa38 which is equivalent to 'fresh' [Plugin: org.elixir_lang] at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:23)
- Bubble notification of crash in PHPStorm
- com.intellij.diagnostic.PluginException: No display name specified in plugin descriptor XML file for configurable org.elixir_lang.facet.sdks.erlang.Configurable;, specify it using 'displayName' or 'key' attribute to avoid necessity to load the configurable class when Settings dialog is opened [Plugin: org.elixir_lang] at com.intellij.openapi.options.ex.ConfigurableWrapper.getDisplayName(ConfigurableWrapper.java:156)
- No decompiled source function with name (String.to_atom) at org.elixir_lang.beam.psi.impl.ModuleImpl.setMirror(ModuleImpl.kt:103)
- Don't know if Mix.Dep option `allow_pre` is important for determining location of dependency at org.elixir_lang.mix.Dep$Companion.from(Dep.kt:57)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from intellij-elixir.