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
Find References #405
Find References #405
Conversation
b422732
to
501c835
Compare
Shouldn't we be able to start the store for these tests? |
I just found the indexer breaks the 20:43:50.374 [error] Child LXical.Document.Store of Supervisor LXical.Server.Supervisor terminated
** (exit) killed
Pid: #PID<0.135.0>
Start Call: LXical.Document.Store.start_link([])
Restart: :permanent
Shutdown: 5000
Type: :worker
20:43:50.374 [error] Child LXical.Document.Store of Supervisor LXical.Server.Supervisor failed to start
** (exit) already started: #PID<23232.135.0>
Pid: #PID<0.135.0>
Start Call: LXical.Document.Store.start_link([])
Restart: :permanent
Shutdown: 5000
Type: :worker |
501c835
to
59ef187
Compare
This should be an easy fix, we just need to run the indexer only on the node with the store's leader. |
@scottming is that what's going on? I need more information. It looks like there should only be one indexer running at a given time across nodes on a given machine. It looks like you can't get two document stores running at the same time |
Yes, that should be the issue. However, I don't quite understand the logic related to the This is the log in 2023-10-18T09:27:00.233815+08:00 info: backend reports stale
2023-10-18T09:27:00.304509+08:00 info: Loaded []
2023-10-18T09:27:00.376849+08:00 info: Compile completed with status ok Produced 0 diagnostics []
2023-10-18T09:27:00.380429+08:00 info: Plugins found 0 results in 0.008 ms
2023-10-18T09:27:08.407430+08:00 info: global: Name conflict terminating {'Elixir.LXical.Document.Store',<22661.135.0>} |
This is very interesting, I would think it impossible to launch two editors so quickly that they conflict for the global name. How are you doing this? |
I just have this problem after revert indexer commit packaged, opening a very small project with Nvim, wait the compiling finished, and then opening the same project with VScode. |
6277de9
to
1abffdf
Compare
I don't think this issue is related to find references per se; It's related to having different editors connect to an index store node. This effectively flattens out the namespace, and things that were globally registered in the context of an editor and its lsp, will now be seen by other editors. This does mean that using global for the document store's registration isn't going to work any more. 🤔 |
f301dcc
to
39d0d76
Compare
@scottming I added #425 to track this issue. |
397d77b
to
5713f55
Compare
Added initial implementation of find references. It presently works for any module-like thing that can be recognized by Entity.resolve, like Modules, aliased modules, __MODULE__ and structs.
5713f55
to
2385e33
Compare
In order to enable indexing, you must do `ENABLE_INDEXING=true mix package`
I'm on the fence here with deps. We shouldn't see anything from the _build directory since those are compiled artifacts and we're indexing source code. Were you seeing stuff from _build? |
ah, i see. Yes, we should exempt _build from indexing. (This is an indexing problem, and not a find references problem) |
@scottming I'll make an issue for this. |
Added initial implementation of find references. It presently works for any module-like thing that can be recognized by Entity.resolve, like Modules, aliased modules,
__MODULE__
and structs.Note: This will not work reliably until indexing is re-enabled, so if you want to test locally, you'll need to revert a170acb