vscode-elixir icon indicating copy to clipboard operation
vscode-elixir copied to clipboard

Error when using the protox library

Open Rosetjau opened this issue 6 years ago • 6 comments

Hi,

I have noticed that when you open a source file that uses the protox library and then put the cursor on a symbol to get the documentation hover the hover breaks for the entire project and only shows the string "Loading..."

I have checked the developer tools console and when hovering the first time over a symbol the following text is logged at info level:

[Extension Host] [vscode-elixir] ElixirSense client connection closed

[Extension Host] [ElixirSense] 
11:46:12.915 [error] Task #PID<0.164.0> started from #PID<0.161.0> terminating
** (stop) exited in: GenServer.call(Mix.ProjectStack, {:get, #Function<5.37947099/1 in Mix.ProjectStack.peek/0>}, 30000)
    ** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started
    (elixir) lib/gen_server.ex:766: GenServer.call/3
    lib/mix/project.ex:190: Mix.Project.config/0
    lib/mix/project.ex:400: Mix.Project.build_path/0
    (protox) lib/protox/protoc.ex:20: Protox.Protoc.do_run/2
    (protox) expanding macro: Protox.__using__/1
    (data_viewer) /home/bellemo/.vscode/extensions/mjmcloug.vscode-elixir-1.0.0/elixir_sense/lib/elixir_sense/core/ast.ex: ProtoParser.extract_use_info/2
Function: #Function<1.117824386/0 in ElixirSense.Server.TCPServer.start_connection_handler/2>
    Args: []

After that every time I hover the cursor over a symbol, even in another file, the hover is broken and the following text is logged at info level:

[Extension Host] [vscode-elixir] Error: This socket has been ended by the other party

The only way to make it work again is to close VSCode and restart it.

Thanks for the extension BTW, it's very useful!

Rosetjau avatar Oct 18 '17 09:10 Rosetjau

Hey, thanks for reporting the issue. This might be an upstream error in elixir_sense. @msaraiva any thoughts?

timmhirsens avatar Oct 18 '17 17:10 timmhirsens

@Rosetjau: Did you try compiling the project (using mix compile)? Try restarting vscode after doing so.

If this doesnt work, if would be glad if you could provide a small sample project reproducing the issue

timmhirsens avatar Nov 01 '17 10:11 timmhirsens

Hi,

unfortunately compiling the project and restarting vscode does not fix the problem. As soon as you restart vscode, open a file that uses protox and hover over a symbol the extension breaks.

I have created a small sample project for you: https://github.com/Rosetjau/vscode_elixir_protobuffer

Thanks a lot!

Rosetjau avatar Nov 01 '17 15:11 Rosetjau

Ops, I accidentally closed the issue. Reopened now.

Rosetjau avatar Nov 01 '17 15:11 Rosetjau

Thanks, i can reproduce this now. Seems like a pretty hard crash in elixir_sense.

Did you try to add protoc to your $PATH? According to the docs it should only be requried for compilation of the lib but maybe something that elixir_sense does requires it? If you haven't i will try later.

Edit: Adding protoc to $PATH does not fix the issue. This also crashes the atom elixir extension. So it must be something that protox does that is not supported by elixir_sense currently.

Will look into it.

timmhirsens avatar Nov 01 '17 20:11 timmhirsens

@fr1zle any updates here? Also getting this crash...

sraka1 avatar Feb 19 '21 22:02 sraka1