Re: erl-complete ...

Bill Clementson <[email protected]> Fri, 14 Sep 2007 23:11:14 -0700
Newsgroups gmane.comp.lang.erlang.distel.devel
Message-ID <[email protected]>
Hi Matthias,

[email protected] writes:
> Bill Clementson <[email protected]> writes:
>
>> I was asking about a patch for the Call Graph code that you wrote
>> previously. At the moment, the "who calls" support doesn't work for
>> BIF's.
>
> Oh I see. Is it really that useful to have that? I don't often find
> myself wondering who calls a particular BIF.

I would imagine that it might be useful if one were refactoring code
and wanted to eliminate/replace/change calls to specific BIF's.

> I added builtins to the call graph xref server - see attached patch -
> but it doesn't seem to make a difference. I suspect BIFs are only added
> as unconnected vertices.

Perhaps.

>>>>> (except distel's completion currently isn't using xref, but it should)
>> Does the attached patch do what you wanted?
>
> Thanks for the patch. I've made the following changes:
>
> - don't add otp release - the otp modules are part of the code path and
> hence get loaded anyway
>
> - filter duplicates (due to different arity) from function completion
>
> - avoid duplication of code between who_calls and completion
>
> - add rebuild_{completions, call_graph} functions - there is nothing on
> the emacs side that calls them, but you can call them manually
>
> - minor cosmetic changes
>
> See attachment for the revised patch.

Much tidier than my patch. 

> One remaining problem with this code is that it doesn't automatically
> handle the addition/removal of modules or changes to the code load
> path - you have to invoke the aforementioned rebuild functions manually
> for this.

I don't think that's much of a problem. At least it's consistent for
both the completions and the call graph servers and it's easy enough
to invoke the rebuilds.

I've applied your patch (as well as the mod you sent in your later
message) and have committed the changes.

Thanks,
Bill

-------------------------------------------------------------------------
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/