-
Notifications
You must be signed in to change notification settings - Fork 198
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
Add workspaceSymbol capability #110
Add workspaceSymbol capability #110
Conversation
48d701c
to
95283e3
Compare
Thanks for this. Will take a closer look soon. |
a703ec1
to
b82d658
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't looked through all of it, but I have some initial comments.
Overall I'm really looking forward to this change!
apps/language_server/lib/language_server/providers/workspace_symbols.ex
Outdated
Show resolved
Hide resolved
apps/language_server/lib/language_server/providers/workspace_symbols.ex
Outdated
Show resolved
Hide resolved
apps/language_server/lib/language_server/providers/workspace_symbols.ex
Outdated
Show resolved
Hide resolved
apps/language_server/lib/language_server/providers/workspace_symbols.ex
Outdated
Show resolved
Hide resolved
…ymbols.ex Co-Authored-By: Jason Axelson <axelson@users.noreply.github.com>
…ymbols.ex Co-Authored-By: Jason Axelson <axelson@users.noreply.github.com>
c6c8d6a
to
2e71ddb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great! Really looking forward to using it. ❤️
* WorkspaceSymbols index after successful build Previously WorkspaceSymbols depended on a side-effect of running Dialyzer: #110 (comment) Now that the Build step loads all modules (added in #227) we need to change the WorkspaceSymbols index to be rebuilt after a successful compile. * Fix tests Allow WorkspaceSymbol to have it's own instance of the GenServer for the test by being parameterized by the server's registered name * Give Server some more time to respond This is probably necessary now because workspace symbols is running earlier * Bump up the timeout
This PR adds workspaceSymbol capability.
It's now possible to search and navigate to modules, functions, types and callbacks. Both Elixir and erlang modules are supported.
WorkspaceSymbols server maintains an index of symbols and listens for notifications about build events and source changes. Initial indexing is rather slow (it takes about 25s on my machine) but following updates are fast.
This provider uses fuzzy logic for matching symbols so exact queries are not needed.
To make results more relevant prefixes are utilised:
f
for functions,t
for types andc
for callbacks. Module queries don't need a prefix. Function/type/callback queries can add a filter by arity with/
suffix.Addresses #66