[erlang-questions] Erlang IDE: easy AST access / method lookup ?
Roberto Saccon
rsaccon@REDACTED
Fri Dec 14 19:23:20 CET 2007
maybe I should explain better my problem:
a typical link to the edoc (e.g.: locally stored on my PC) looks like this:
file:///Users/rsaccon/opensource/otp_doc_html_R12B-0/lib/stdlib-1.15/doc/html/string.html#tokens/2
at the end you notice that here is a "/2" which represents the arity
of the function I want to look up the edoc
and my problem is to determine from a snippet of source code at a
given position to determine the module and function and the arity of
that function to construct the link. At my first approach I did that
just with a few quick and dirty lines of code, which give expected
results only in simple cases.
On Dec 14, 2007 2:45 PM, Roberto Saccon <rsaccon@REDACTED> wrote:
> I am experimenting with adding better Erlang support to TextMate (a
> Mac OS X Editor). I have added edoc lookup, see details and sceencast
> at:
>
> http://www.rsaccon.com/2007/12/erlang-textmate-integration.html
>
> project page: http://erlymate.googlecode.com/
>
> however I found out that is not very easy to determine the exact link
> to the Erlang documentation for various reasons:
> - mapping HTML files to actual modules (I just crawled through and
> tested if is a modul)
> - arity of functions (thats tricky, I just quasi-parsed (or "guessed")
> the current line of source code)
>
> So my question is:
>
> Does there exist a *very simple way* to lookup the AST of a module to
> get the arity of a method ? By very simple I mean that I provide just
> the line number and column number as input. Traditionally parsing
> through the AST always involves a lot of coding effort, I have learned
> that with other Erlang projects ..
>
> regrads
> --
> Roberto Saccon
> http://rsaccon.com
>
--
Roberto Saccon
http://rsaccon.com
More information about the erlang-questions
mailing list