-
Notifications
You must be signed in to change notification settings - Fork 136
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
Goto macro definition is too slow #1309
Comments
Hi @misaki214 and thanks for the report! These times are extremely high compared to our experience, so it would be good to understand what is going on in your case. A couple of things you could try:
Any specific reason why you suspect the on-demand indexing as the root cause? E.g. if you try a prior version and then switch back to a recent one, can you reproduce the performance issue consistently only with the new version? |
I can confirm the issue. diff --git a/apps/els_lsp/src/els_scope.erl b/apps/els_lsp/src/els_scope.erl
index 66c1ae3..4e4e625 100644
--- a/apps/els_lsp/src/els_scope.erl
+++ b/apps/els_lsp/src/els_scope.erl
@@ -65,12 +65,18 @@ find_includers_loop(Uri, Acc0) ->
-spec find_includers(uri()) -> [uri()].
find_includers(Uri) ->
- IncludeId = els_utils:include_id(els_uri:path(Uri)),
- IncludeLibId = els_utils:include_lib_id(els_uri:path(Uri)),
- lists:usort(
- find_includers(include, IncludeId) ++
- find_includers(include_lib, IncludeLibId)
- ).
+ Path = els_uri:path(Uri),
+ case filename:extension(Path) of
+ <<".hrl">> ->
+ IncludeId = els_utils:include_id(Path),
+ IncludeLibId = els_utils:include_lib_id(Path),
+ lists:usort(
+ find_includers(include, IncludeId) ++
+ find_includers(include_lib, IncludeLibId)
+ );
+ _ ->
+ []
+ end. |
Hi @plux , I think we need support the use case of including |
Yes, but is it really common that people |
It means |
Yep that's what I meant. I implemented my other proposal in this branch: Go ahead and give it a spin! |
Describe the bug
After on demand indexing, goto macro definition is too slow.
To Reproduce
Expected behavior
Get a response in a second.
Actual behavior
Get a response more than 5s.
Context
erlang_ls
version (tag/sha):The text was updated successfully, but these errors were encountered: