Giter Club home page Giter Club logo

Comments (4)

KronicDeth avatar KronicDeth commented on July 20, 2024

There are 3 ways to create modules:

Using Right-click menu

  1. Right-click a directory, such as the lib directory made by mix new
  2. Select New from the context menu
  3. Select Elixir File from the submenu
  4. Enter the module name MyModule
  5. Click OK
  6. MyModule.ex will open with the Module stub

Use App Menu

  1. Select the File Menu from the application menu
  2. Select the New... action from the File Menu
  3. Select Elixir File from the submenu
  4. Enter the module name MyModule
  5. Click OK
  6. MyModule.ex will open with the Module stub

By file extension

  1. Right-click a directory, such as the lib directory made by mix new
  2. Select New from the context menu
  3. Select File from the submenu
  4. Enter the file name with a .ex extension my_module.ex
  5. Click OK
  6. 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.

prodev42 avatar prodev42 commented on July 20, 2024

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.

KronicDeth avatar KronicDeth commented on July 20, 2024

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.

KronicDeth avatar KronicDeth commented on July 20, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.