One more Sublime user is here.<div><br></div><div>Hi guys,</div><div><br></div><div>How it is possible for me to try "code completion" feature too? Is there any software? Or github repo? Instruction? Anything?</div>
<div><br></div><div>Thank you in advance!</div><div><br></div><div><br clear="all"><div>Best regards,</div><div>Max</div><br><br>
<br><br><div class="gmail_quote">On Fri, Apr 13, 2012 at 3:13 AM, Andrew Berman <span dir="ltr"><<a href="mailto:rexxe98@gmail.com">rexxe98@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I actually just tested and it appears beam_disasm is really fast. I'm going to try to use it.<div><br>Thanks again!</div><span class="HOEnZb"><font color="#888888"><div><br></div></font></span><div><span class="HOEnZb"><font color="#888888">Andrew</font></span><div>
<div class="h5"><br><br><div class="gmail_quote">On Thu, Apr 12, 2012 at 1:06 PM, Andrew Berman <span dir="ltr"><<a href="mailto:rexxe98@gmail.com" target="_blank">rexxe98@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hey Erik,<div><br></div><div>That looks interesting. Currently, I'm looping through the results of erlang:loaded() which is very fast, then doing Module:module_info(exports) and doing a fuzzy search on those which is why I wanted to load all the modules. By loading them all, they're already cached for me so that's one less thing I would have to do. Is using beam_disasm fast? Is loading all the modules really that bad? I can't imagine it uses that much memory that it would be an issue. Using beam_disasm would mean I would have to cache the results myself which means memory would be used anyway. Thoughts?</div>
<div><br></div><div>Thanks,</div><div><br></div><div>Andrew</div><div><div><div><br><br><div class="gmail_quote">On Thu, Apr 12, 2012 at 3:57 AM, Erik Søe Sørensen <span dir="ltr"><<a href="mailto:eriksoe@gmail.com" target="_blank">eriksoe@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Are you sure that you want to *load* all the modules?<br>(Especially in these days, when modules may have 'on_load' hooks which you're probably not interested in running indiscriminately - and which may fail...)<br>
<br>An alternative, in case you merely wish to know the list of exported functions from a beam file FileName:<br> {beam_file,ModuleName,Exported0,_,_,_} = beam_disasm:file(FileName).<br> Exported = [{Name,Arity} || {Name,Arity,_} <- Exported0].<br>
<br><div class="gmail_quote">Den 12. apr. 2012 09.35 skrev Gustav Simonsson <span dir="ltr"><<a href="mailto:gustav.simonsson@erlang-solutions.com" target="_blank">gustav.simonsson@erlang-solutions.com</a>></span>:<div>
<div><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
If you know which modules are in the added code paths you can simply loop<br>
over them and load each of them using the functions in the code module.<br>
<br>
Typically in Erlang systems one knows which modules exist, but if you<br>
cannot know that prior to adding a new code path my guess is that you<br>
have to search your newly added code paths and use e.g. code:load_file/1<br>
<br>
Regards,<br>
Gustav Simonsson<br>
<br>
Sent from my PC<br>
<div><div><br>
----- Original Message -----<br>
> From: "Andrew Berman" <<a href="mailto:rexxe98@gmail.com" target="_blank">rexxe98@gmail.com</a>><br>
> To: "Erlang Questions" <<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a>><br>
> Sent: Thursday, 12 April, 2012 1:13:17 AM<br>
> Subject: Re: [erlang-questions] Help with Sublime Text 2 Code Completion<br>
><br>
><br>
> Hey all,<br>
><br>
><br>
> Been a while since I posed this question, but I'm still stuck on<br>
> trying to load all the beam files. Is there some magic way to tell<br>
> the VM to load all the beams in the code path or do I have to loop<br>
> through the code path and load them all manually? How would I go<br>
> about doing it that way if that is what is required?<br>
><br>
><br>
> Thanks,<br>
><br>
><br>
> Andrew<br>
><br>
><br>
> On Tue, Mar 6, 2012 at 11:43 PM, Andrew Berman < <a href="mailto:rexxe98@gmail.com" target="_blank">rexxe98@gmail.com</a> ><br>
> wrote:<br>
><br>
><br>
> All,<br>
><br>
><br>
> I'm trying to build a plug-in for Sublime Text 2 to do proper Erlang<br>
> code completion. My thought is to have a server or node running and<br>
> then talk to that node using erl_call. I have it working with the<br>
> stdlib, but I want the code completion to be dynamic such that the<br>
> plug-in tells the remote node to add code paths. I have that working<br>
> too, but the issue is loading the actual modules in the new code<br>
> path. Since the erlang vm loads modules only upon access, when I<br>
> call erlang:loaded() or code:all_loaded(), the modules added with<br>
> the new code path do not show. Do I have to loop through the BEAMs<br>
> in the new code path and manually load them or is there a better way<br>
> to do it? I'm trying to make the completion use a fuzzy search such<br>
> that something like "li" brings up all modules with "li" in it which<br>
> is why I need to be able to have the entire list of modules loaded<br>
> already.<br>
><br>
><br>
> Thanks,<br>
><br>
><br>
> Andrew<br>
><br>
</div></div>> _______________________________________________<br>
> erlang-questions mailing list<br>
> <a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
> <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
><br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div></div></div><br>
<br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br></div></div></div>
<br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>