jimenezrick/vimerl

<C-x><C-o> doesn't work on calendar module

tex opened this issue · 3 comments

tex commented

~/.vim/bundle/vimerl (master)$ ./autoload/erlang_complete.erl calendar
escript: exception error: no match of right hand side value {atom,358,
'?SECONDS_PER_DAY'}

Other modules like lists, file, ... works. Project's modules work too.

Erlang build from sources and put to /usr/local/...

The problem happens in line 354 of calendar.erl from R15 where the macro SECONDS_PER_DAY is used inside a -type:

-type secs_per_day() :: 0..?SECONDS_PER_DAY.

The things is I do not know how to get the value of that macro yet. I suppose that with some of the parse tools the OTP comes, should be possible to get the value of the macro definition:

-define(SECONDS_PER_DAY, 86400).
tex commented

Thank you for such quick reply. Indeed, you are right. I temporary replaced macro with the value at the specified line and erlang_complete.erl script works now with calendar module.

Thank you. This is a great project and I like it very much.

Well, I found out that this is another limitation of EDoc to handle all possible Erlang syntax constructs. I'll catch that error and switch to Module:module_info/1. We lose the EDoc rich info but this bug should be fixed.

I reported the bug to the OTP team: http://erlang.org/pipermail/erlang-bugs/2012-March/002800.html.