Re: erl-complete ...

Matthias Radestock <[email protected]> Wed, 12 Sep 2007 22:45:08 +0100
Newsgroups gmane.comp.lang.erlang.distel.devel
Message-ID <[email protected]>
Bill Clementson wrote:
> Matthias Radestock <[email protected]> writes:
>> This is not distel's fault. There is something odd about these modules; 
>> xref cannot see much in them either:

> Probably because they're BIF's that are implemented in C rather than
> Erlang:
> 
> (emacs@bc)7> erl_bifs:is_bif(math, pi, 0).
> false
> (emacs@bc)8> erl_bifs:is_bif(math, sin, 1).
> true
> 
> Do a "M-." on "math:pi()" and you'll see that it's the only function
> in the source file.

In which case I know how to fix this:

(x@h)30> xref:start(foo, {xref_mode, modules}).
{ok,<0.7716.0>}
(x@h)31> xref:set_default(foo, builtins, true).
{ok,false}
(x@h)32> xref:add_release(foo, code:lib_dir(), {name, otp}).
{ok,otp}
(x@h)39> xref:q(foo, '(X+B) * math:_/_').
{ok,[{math,exp,1},{math,log,1},{math,pi,0},{math,pow,2},{math,sqrt,1}]}
(x@h)40> xref:q(foo, '(X+B) * erlang:"is_.*"/_').
{ok,[{erlang,is_alive,0},
      {erlang,is_atom,1},
      {erlang,is_binary,1},
      {erlang,is_boolean,1},
      {erlang,is_builtin,3},
      {erlang,is_constant,1},
      {erlang,is_float,1},
      {erlang,is_function,1},
      {erlang,is_function,2},
      {erlang,is_integer,1},
      {erlang,is_list,1},
      {erlang,is_number,1},
      {erlang,is_pid,1},
      {erlang,is_process_alive,1},
      {erlang,is_reference,1},
      {erlang,is_tuple,1}]}


(except distel's completion currently isn't using xref, but it should)


Matthias.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/