Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I cannot get autocomplete to work #65

Open
azimut opened this issue Mar 14, 2019 · 1 comment
Open

I cannot get autocomplete to work #65

azimut opened this issue Mar 14, 2019 · 1 comment

Comments

@azimut
Copy link

azimut commented Mar 14, 2019

I am new to erlang so I am not sure how to troubleshoot yet.

I am using the 2018 branch without the last commit.

Trying to autocomplete otp_doc:fire with M-TAB It does not work. Albeit I can still jump into code source definition with M-. above otp_doc:firefox.

This is after I tried to fix my installation, because on my system code:root_dir(). is /usr/lib64/erlang and in that dir there isn't a doc dir so I copied it from /usr/share

> cd /usr/lib64/erlang
> mkdir doc
> sudo cp -r /usr/share/doc/erlang-21.1.1/* doc/
> ls -l  doc/man_index.html doc/kernel-6.1/doc/html/index.html
-rw-r--r-- 1 root root 53377 Mar 13 17:00 doc/kernel-6.1/doc/html/index.html
-rw-r--r-- 1 root root 97435 Mar 13 17:00 doc/man_index.html

Logs:

On *messages*

epmd-process - msg: \0�zemacs
epmd-recv-port-resp - Event: data
epmd-recv-port-resp - data: w\0M\0\0�\0�\0�emacs\0\0
epmd-recv-port-resp - arg: w\0M\0\0�\0�\0�emacs\0\0
nodeup: emacs@sabayon
nodedown: emacs@sabayon [2 times]
error in process filter: cl--assertion-failed: Assertion failed: (eq (erlext-get-code (quote null)) (erlext-read1))
error in process filter: Assertion failed: (eq (erlext-get-code (quote null)) (erlext-read1))

On *trace*

>> REG_SEND: [TYPE erl-pid distel_19038@sabayon 11 0 0] rex [[TYPE erl-pid distel_19038@sabayon 11 0 0] [call code ensure_loaded (distel) [TYPE erl-pid distel_19038@sabayon 1 0 0]]]
>> REG_SEND: [TYPE erl-pid distel_19038@sabayon 10 0 0] rex [[TYPE erl-pid distel_19038@sabayon 10 0 0] [call distel rpc_entry (distel functions (otp_doc "fir")) [TYPE erl-pid distel_19038@sabayon 1 0 0]]]
<< SEND: [TYPE erl-pid distel_19038@sabayon 11 0 0] [rex [module distel]]
@azimut
Copy link
Author

azimut commented Mar 23, 2019

Still working on it. A couple of thoughts:

  • Since I used the 2018 branch it seems i need to load massemanet/trane beforehand.
  • My main_index.html has relative path pointing to "../lib/", probably a thing of my distro to fix.
  • Code seems to be case sensitive, i think it might be better lowercase when parsing html. My man_index.html at least didn't match what the code expected. For example lines/3 I change it to the following in order to have otp_doc ets load the {file,*} tuples at least.
lines(Line,_,Dir) ->
  L_Line = string:lowercase(Line),
  case string:tokens(L_Line, "<> \"") of
    ["td", "a", "href=", "../lib/"++Href, M|_] ->
      case filename:basename(Href,".html") of
        "index" -> ok;
        M -> e_set({file,M}, filename:join([Dir,"doc",Href]))
      end;
    _ -> ok
  end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant