KronicDeth / intellij-elixir

Elixir plugin for JetBrain's IntelliJ Platform (including Rubymine)
Other
1.84k stars 154 forks source link

The error message "Valid pattern for Elixir module is dot sequences of aliases [regex]" would be better in human language, for instance, "Elixir module name should be a dot-sequence of alphanumerics aliases, each starting with a capital letter". #191

Closed gsriniv1 closed 8 years ago

gsriniv1 commented 9 years ago

I am a newbie. Cannot even create a hello world!

When I create File / New elixir file, whatever I type, it says not a valid module name.

for example i used the file name hello.world.exs - and it is not acceptable. I can't make out why the file name does not match the regexp displayed.

Please help. thanks, siren

KronicDeth commented 9 years ago

The New Elixir file expects an Alias for the Module name, so you want to enter the name as Hello.World if you want a file called hello/world.ex that compiles to Hello.World.beam.

hello.world.exs doesn't really follow the naming convention adopted by the Elixir community. The . in a Module Alias is usually converted to a directory level on the file system for the .ex or .exs file and only flattened into the .beam name because that's how the VM and Erlang expect to load beams on a load path.

gsriniv1 commented 9 years ago

Thanks a bunch. I got thru that hurdle. If I may impose on you for the next step - of actually running the program:

I get this error message when I try to run this:

/Users/srini/elixir-1.0.5/bin/elixir "" world.ex No file named

The contents of world.ex are trivial - one line IO.puts("Hello")

PS - Please note the location of the elixir - this is the soft link technique I learnt from one of the other posts.

KronicDeth commented 9 years ago

Why do you have the empty string, "" before the file name?

RajaSrinivasan commented 9 years ago

I did not add that. I don't know.

I am a little more elixir literate now. I am revisiting IntelliJ as the IDE for elixir (instead of TextWrangler and Terminal).

Now, I am able to create projects, import mix projects. Still the editor does not appear language sensitive. When I go to default settings, I don't seem to have an option for Elixir under "Editor\Code style". Am I missing some other setting?

screen shot 2015-10-03 at 5 50 13 am

KronicDeth commented 9 years ago

Code Style is a feature of IntelliJ plugins, but it doesn't just happen when the lexer and parser are written. Code Style doesn't exist for Intellij Elixir yet.

There is syntax highlighting and the parser will mark invalid code with errors using the red squiggle underline.

Code formatter is already in the backlog as #98 and the Code Style settings you're looking for are already in the backlog as #99. Please comment on #98 or #99 if you want additional features for either the Code formatter or the Code Style settings.

singalen commented 8 years ago

Just ran into the same module name problem. Could the plugin suggest the default name, or just not ask for it at all, if it's strictly determined by project folders?

KronicDeth commented 8 years ago

@singalen there is no default name for modules; your request doesn't make sense.

singalen commented 8 years ago

Let me rephrase it more clearly: figuring out that a module name should start with a capital is a problem for beginner who missed it.

The error message "Valid pattern for Elixir module is dot sequences of aliases [regex]" would be better in human language, for instance, "Elixir module name should be a dot-sequence of alphanumerics aliases, each starting with a capital letter".