Comments (17)
@dylan-chong I get the 'tag not found' error/message sometimes but usually retrying works.
+1
I get both errors:
- Socket is not available
- Tag not found
.... but if I try again immediately it works fine.
Details
elixir 1.7.4
erlang 20.3.8.9
Python: 3.6.10
NVIM v0.3.7
from alchemist.vim.
@kenny-evitt so the way that this plugin works, first attempt to use the current socket, if it's not available, it spawn it again. that's why the next action works.
We could possibly improve it and make it a bit smarter to retry to spawn elixir sense but haven't fixed it
from alchemist.vim.
- One approach is to retry the given command if
system
function returns non-zero
alchemist.vim/after/plugin/alchemist.vim
Lines 11 to 27 in 5575fc8
- The other approach is to improve the python client to try to spawn the server(at least one time) if the server is dead.
alchemist.vim/elixir_sense_client
Lines 62 to 73 in 5575fc8
Thinking about it, I'd do option 2 since it doesn't require me to write VimScript
from alchemist.vim.
Yes, the log file is in /tmp/log.log
though! make sure to change it somewhere more permanent and appropriate
from alchemist.vim.
Hey @zlfera,
May I know if you have compiled the project? https://github.com/slashmili/alchemist.vim/wiki#important-notes
If you still have problem please flow the Debugging steps and send me the outputs
from alchemist.vim.
Yes, I have compiled project yet. but when I type , the problem has appeared.
from alchemist.vim.
hello, same problem here.
from alchemist.vim.
@destne thanks for reporting it.
I can't say anything until you provide the Debugging output.
from alchemist.vim.
@slashmili I get this error too, but only intermittently. The output of the debugging commands:
✔ ~/@code/myapp [my-branch L|✔]
(ins)16:05 $ ~/.local/share/nvim/plugged/alchemist.vim/elixir_sense_client -d./ -c1 -l1 --request=definition < sample.exs
/home/build/elixir/lib/elixir/lib/enum.ex:0✔ ~/@code/myapp [my-branch L|…2]
(ins)16:08 $ ~/.local/share/nvim/plugged/alchemist.vim/elixir_sense_client -d./ -c6 -l1 --request=definition < sample.exs
/home/build/elixir/lib/elixir/lib/enum.ex:0✔ ~/@code/myapp [my-branch L|…2]
(ins)16:09 $ ~/.local/share/nvim/plugged/alchemist.vim/elixir_sense_client -d./ -c6 -l1 --request=docs < sample.exs
> Enum.map(enumerable, fun)
### Specs
`@spec map(t, (element -> any)) :: list`
Returns a list where each item is the result of invoking
`fun` on each corresponding item of `enumerable`.
For maps, the function expects a key-value tuple.
## Examples
iex> Enum.map([1, 2, 3], fn x -> x * 2 end)
[2, 4, 6]
iex> Enum.map([a: 1, b: 2], fn {k, v} -> {k, -v} end)
[a: -1, b: -2]
✔ ~/@code/myapp [my-branch L|…2]
(ins)16:10 $ ~/.local/share/nvim/plugged/alchemist.vim/elixir_sense_client -d./ -c1 -l2 --request=definition < sample.exs
/Users/kenny/@code/myapp/lib/custom_module.ex:1✔ ~/@code/myapp [my-branch L|…2]
(ins)16:11 $ ~/.local/share/nvim/plugged/alchemist.vim/elixir_sense_client -d./ -c14 -l3 --request=definition < sample.exs
/Users/kenny/@code/myapp/lib/custom_module.ex:2
The output of the test commands seems to be missing a trailing newline; a more nicely formatted version of the above:
✔ ~/@code/myapp [my-branch L|✔]
(ins)16:05 $ ~/.local/share/nvim/plugged/alchemist.vim/elixir_sense_client -d./ -c1 -l1 --request=definition < sample.exs
/home/build/elixir/lib/elixir/lib/enum.ex:0
✔ ~/@code/myapp [my-branch L|…2]
(ins)16:08 $ ~/.local/share/nvim/plugged/alchemist.vim/elixir_sense_client -d./ -c6 -l1 --request=definition < sample.exs
/home/build/elixir/lib/elixir/lib/enum.ex:0
✔ ~/@code/myapp [my-branch L|…2]
(ins)16:09 $ ~/.local/share/nvim/plugged/alchemist.vim/elixir_sense_client -d./ -c6 -l1 --request=docs < sample.exs
> Enum.map(enumerable, fun)
### Specs
`@spec map(t, (element -> any)) :: list`
Returns a list where each item is the result of invoking
`fun` on each corresponding item of `enumerable`.
For maps, the function expects a key-value tuple.
## Examples
iex> Enum.map([1, 2, 3], fn x -> x * 2 end)
[2, 4, 6]
iex> Enum.map([a: 1, b: 2], fn {k, v} -> {k, -v} end)
[a: -1, b: -2]
✔ ~/@code/myapp [my-branch L|…2]
(ins)16:10 $ ~/.local/share/nvim/plugged/alchemist.vim/elixir_sense_client -d./ -c1 -l2 --request=definition < sample.exs
/Users/kenny/@code/myapp/lib/custom_module.ex:1
✔ ~/@code/myapp [my-branch L|…2]
(ins)16:11 $ ~/.local/share/nvim/plugged/alchemist.vim/elixir_sense_client -d./ -c14 -l3 --request=definition < sample.exs
/Users/kenny/@code/myapp/lib/custom_module.ex:2
from alchemist.vim.
@slashmili I figured as much. I just wanted to let you know that someone else ran into this and that it wasn't because ElixirSense or the ElixirSense client wasn't working (which I imagine the debugging output confirms). And I was also, implicitly, offering to test any suggestions you might have, e.g. to further investigate this.
If you can, and want, any hints at where in the code to look to potentially fix this would be appreciated. I can't promise that I'll actually provide much help, but I do plan on using this plugin 'in anger', indefinitely, so I'm invested in both fixing this and helping out with improving or maintaining the plugin more generally too.
Thanks for the fantastic plugin as-is too btw!
from alchemist.vim.
@slashmili If I've enabled debug mode in the ElixirSense client file, I should be able to see errors about this in the log file, right?
from alchemist.vim.
@kenny-evitt one possible solution is
diff --git a/elixir_sense_client b/elixir_sense_client
index 3a9d62c..370f58d 100755
--- a/elixir_sense_client
+++ b/elixir_sense_client
@@ -1,6 +1,6 @@
#!/usr/bin/env python
from __future__ import print_function
-import os, sys, getopt
+import os, sys, getopt, time
from elixir_sense import ElixirSenseClient
debug = False
@@ -69,6 +69,10 @@ def main(argv):
sense = ElixirSenseClient(debug=debug, cwd=cwd, ansi=ansi, elixir_sense_script=alchemist_script, elixir_otp_src=elixir_otp_src)
response = sense.process_command(request, source, line ,column)
+ if response == "error:Socket is not available.":
+ time.sleep(1)
+ response = sense.process_command(request, source, line ,column)
+
sense._log("response:\n%s" % response)
print(response, end="")
from alchemist.vim.
In addition, think that the tag fallback is not working properly. If I have my cursor on the method of the following A.B.method
then I will get an error saying tag not found A.B.method
. Without alchemist, the tag is found by searching only method
although we may jump to the method of the same name in the wrong module.
The behaviour of alchemist makes sense, in a sense, because different modules can have methods of the same name, however that's not how C tags files are generated - they are indexed by method name, without the full module prefix.
It would be good for alchemist to be able to find the correct method, but also resolve the duplicate method names by looking at the module prefix.
from alchemist.vim.
@dylan-chong I get the 'tag not found' error/message sometimes but usually retrying works.
from alchemist.vim.
Hmm not for me. Maybe your retrying avoids the tag fallback by succeeding at elixir sense?
from alchemist.vim.
The tag not found bug seems to happen even when a module is not prefixed (in the case of jumping to the definition of an alias). I get the error E426 tag not found. Using the shortcut g<c-]>
which is not overridden by alchemist, Vim can jump to the definition successfully
from alchemist.vim.
.... but if I try again immediately it works fine.
Yeah same here, I get the error the first time, but if I try again it works.
NVIM 0.4.3
Erlang 23
Elixir 1.11.2
from alchemist.vim.
Related Issues (20)
- K / ExDoc loses last line of documentation HOT 1
- Suggestions dont show up for deoplete HOT 2
- Feature Request: Let alchemist.vim call elixir_sense's "Referrers" code HOT 6
- failed to load deoplete source HOT 2
- something wrong editing the elixir code with spacevim HOT 1
- error on looking up for a function that is imported
- Error when work with YouCompleteMe HOT 1
- Problems installing with vim-plug for VimR (Neovim) on macOS? HOT 1
- Change short keys bindings for ExDoc? HOT 7
- ExDoc and ExDef for functions (or modules) in Embedded Elixir files HOT 1
- ExDoc shortcut fails when non-ascii characters present in source file HOT 7
- ExDoc is wrong arity for function called in 'pipeline' HOT 3
- Python error HOT 2
- When trying to jump to a function definition: Error: "E484: Can't open file: b' ..." HOT 3
- Autocomplete imports already written module HOT 7
- definition_not_found% for local definition in small project (wrong working directory?) HOT 5
- Autocomplete not works on Windows HOT 3
- Doesn't work on Ubuntu 20.04 HOT 6
- Can we change this to '<C-[>'?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alchemist.vim.