Skip to content
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

Merged
merged 13 commits into from
Feb 13, 2020

Conversation

lukaszsamson
Copy link
Collaborator

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 and c for callbacks. Module queries don't need a prefix. Function/type/callback queries can add a filter by arity with / suffix.
Addresses #66

@axelson
Copy link
Member

axelson commented Feb 5, 2020

Thanks for this. Will take a closer look soon.

@lukaszsamson lukaszsamson force-pushed the ls-add-workspace-symbols branch 2 times, most recently from a703ec1 to b82d658 Compare February 6, 2020 13:52
Copy link
Member

@axelson axelson left a 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!

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Copy link
Member

@axelson axelson left a 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. ❤️

@axelson axelson merged commit 4e09ae3 into elixir-lsp:master Feb 13, 2020
@lukaszsamson lukaszsamson deleted the ls-add-workspace-symbols branch April 15, 2020 07:58
axelson added a commit that referenced this pull request May 29, 2020
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants