ignatov / intellij-erlang Goto Github PK
View Code? Open in Web Editor NEWErlang IDE
Home Page: https://www.jetbrains.com/help/idea/2018.2/getting-started-with-erlang.html
License: Other
Erlang IDE
Home Page: https://www.jetbrains.com/help/idea/2018.2/getting-started-with-erlang.html
License: Other
If press ctrl+space on blank line it shows bunch of variants. if press it in the middle of the word it shows completion for keywords only.
On both Linux CentOS and OSX Mountain Lion, when attempting to add Erlang SDK, get an error saying that "Cannot Detect SDK Version" - "Probably SDK installed in '/opt/local/installs/erlang' is corrupt"
The version is not corrupt, works just fine.
The problem went away, when selected ' /opt/local/installs/erlang/lib/erlang/' instead. Without explicit documentation of such, it is difficult to know and guess that this is the directory that needs to be provided in order for it to work.
settings doesn't have effect. Example - unchecking setting 'Space around assignment" doest actually reformat that way.
Another point this option is not really correct regarding erlang syntax because of
X=<<"a">>.
is syntactically illegal. So having in unchecked will introduce compilation errors for
X = <<"a">>.
When I try to "create a project from source" and give it my Elang application directory as an input Idea claims that it finds nothing familiar in there.
P.S. Excited to see you plugin grow into a full-fledged language support. Keep up the good work.
Just like RubyMine, I'm pretty sure you know exactly what I mean :)
I wish support was added for:
r.
This should be shown as a syntax error.
-module(foo).
.
Resolve, rename, go to declaration, safe delete.
Imagine that we have the following record definitions:
-record(nrec0, {name = "nested0"}).
-record(nrec1, {name = "nested1", nrec0=#nrec0{}}).
-record(nrec2, {name = "nested2", nrec1=#nrec1{}}).
Since R14 it is allowed to write:
N2 = #nrec2{},
"nested0" = N2#nrec2.nrec1#nrec1.nrec0#nrec0.name,
N0n = N2#nrec2.nrec1#nrec1.nrec0#nrec0{name = "nested0a"},
But the second and all the following '#' are highlighted as errors.
All this examples will be "detabbed".
-module(format_errors).
-export([comprehension/0,
record/0]).
-spec f/1 :: (atom()) ->
atom().
comprehension() ->
[X ||
Y <- [1,2,3],
X <- Y
].
record() ->
#x{
a = 1,
b = 2
}.
When you define a fun as fun M:F/A then it is highlighted as error. If we have:
-module(mod1).
-export([func1/0]).
func1() -> ok.
Then:
-module(mod2).
func2() -> ok.
error_here() ->
F1 = fun mod1:func2/0, % no error here (probably because func2 is defined in this module), but it should be since no func2 in mod1.
F2 = fun mod1:func1/0. % func1/0 is highlighted as error, but it should not.
Note that in place of explicit module and function names it should be possible to use Variables and Marcos. e.g. fun Mod:Func/Arity and fun ?MOD:?FUNC/?ARITY.
%1 extra space
-export_types([x/0, y/1]).
% brace extra tab
f() ->
X = f(
alpha,
beta
).
%3 detab
-spec using(Module, Params, Callback) -> term() when
Module :: module(),
Params :: term(),
Callback :: fun().
There is a number of macros that are predefined for every module, e.g. MODULE, LINE, etc. (for a complete list please refer to http://www.erlang.org/doc/reference_manual/macros.html#id80541). They are highlighted as errors now.
Records from included headers are claimed as unresolved
http://s10.postimage.org/dl76ed207/erlang_unused.png
1,3 variables are actually used.
2. should be marked as unbound variable but it's not highlighted in first perform and is erroneously highlighted as unused in second
-module(x).
-export([perform/2]).
perform(X, Y) ->
Z = X ++ "X",
[error_m ||
f(Z, EbinProdDir, Y),
m:f(Z, m:v(Y), EbinProdDir)
].
perform(X, Y) ->
Z = X ++ "X",
[error_m ||
f(Z, EbinProdDir, Y)
].
Second foo is an error.
-module(foo).
-export([foo/0]).
foo() ->
ok.
foo() ->
ok.
Emacs code formatter is both de facto and de jure the industry standard. I believe that people will be more eager to move to your IDE if it formats the code the way they used to.
For further information see /usr/lib/erlang/lib/stdlib-1.17.3/src/erl_internal.erl
It would be very usable to set a cursor after Enter pressed and separate menu item "Format code".
When I press Ctrl+Q on a module or a function name a window should open with documentation on the subject. That works only for methods and functions defined in my project, but not for those defined e.g. in stdlib.
This may be an edge case, but it confused me for a few minutes this morning.
The following code has a syntax error on line 14 (an extra comma after final tuple), but the plugin incorrectly flags the error as on line 12 and line 10. The erlang compiler gives me an error on line 14.
-module(foo).
-export([bar/0]).
-record (rec, { something }).
foo(Blah) -> Blah.
bar() ->
F = fun({ Eep }) ->
ok,
#'rec'{ something = Eep } = Eep#'rec'.something,
blah,
foo([{a}, {b},])
end,
F.
For example,
-module('ELDAPv3').
is valid. Yet plugin/idea complains that the file shoudl be declared in file named in a certain way, indicating an error in code.
This is in the latest 0.3 plugin.
I have a code:
-type(my_cell() :: 1..7).
The plugin (ver 0.2.5) highlight the 1..7 (dots) and says ')' or '|', got expected but '..'
The Erlang compiler is ok.
eunit functions are exported by eunit parse_transform
it would be good to have ignore setting with regexp matches for unused symbols inspection for such cases.
Please consider introducing Rebar support by that I mean:
All variables marked "Unresolved". I've made the screenshot to illustrate what I mean.
https://lh3.googleusercontent.com/-GWMY1dC4ScY/UDOm9-jjZII/AAAAAAAABDg/Lxzp4VrkMQc/s450/bug.png
The last line has the record name highlighted with the error "Unresolved record 'msg_full_object'".
foo.hrl:
-record(msg_full_object, { action }).
foo.erl:
-module(foo).
-include("foo.hrl").
-export([foo/0]).
foo() -> #'msg_full_object'{ action = undefined }.
It would be good functions in ctrl+F12 to be sorted alphabetically
In the following updater is marked as unused.
-module(foo).
-export([bar/0]).
updater() ->
ok.
foo(Func) ->
Func().
bar() ->
foo(fun updater/0).
For further information please see example from #21.
Cant configure source root, etc.
E.g. app files, rebar.config etc.
Basically, this means that Erlang file could start with tuple.
Put your cursor after the 'f' in 'foo' in the export statement and press ctrl-space. Hit tab to accept and overwrite the selected completion. It doesn't overwrite the complete function and leaves 'foo/0/0'.
-module(foo).
-export([foo/0]).
foo() ->
ok.
It seems that it only wants to compile to "Project Compiler Output" directory with production/test subdirectories. It would be fantastic if it compiled to ebin directory
The plugin is greyed-out, not compatible with the latest EAP version of IntelliJ IDEA.
these correct lines are red
<< <<X>> || <<X>> <= <<"abc">>>>
<< <<B:8>> || B <- [1,2,3] >>
If a function type specification contains when clause then the first word after it is highlighted as error. E.g.:
-spec expect(Mod, Func, Expect) -> ok when
Mod :: atom() | [atom()], % <-- Mod is highlighted as an error
Func :: atom(),
Expect :: StubFun | [ClauseSpec],
StubFun :: fun(),
ClauseSpec :: {ArgPatterns, RetSpec},
ArgPatterns :: [term() | '_'],
RetSpec :: term() | ret_spec().
Will be cool to create a predefined code fragments for some popular behaviours, e.g. gen_server.
At the moment we have three file templates: empty module, OTP application and OTP gen_server
So the issue is: need to create velocity templates for some useful behavious.
Please, see commit below and http://www.jetbrains.com/idea/webhelp/live-templates.html for futher information.
I'd be nice to have a way to automatically indent code in a module, on a single key press (again, RubyMine docet).
r.
-attr([x / 1, y / 2]).
-spec f/2 :: (atom(),
atom()) -> term().
f(A, B) when is_list(A), is_list(B);
is_binary(A), is_binary(B) ->
f().
f(A, B)
when is_list(A), is_list(B);
is_binary(A), is_binary(B) ->
f().
add support for
It appears easy to reproduce.
git clone git://github.com/esl/parse_trans.git
Then create new project out of the cloned repo.
Open file src/exprecs.erl
At this point IDEA starts spinning CPU and further interactions with it are pointless.
almost forgot to mention: on mac IDEA 11.1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.