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

Added reindex command #522

Merged
merged 6 commits into from
Dec 24, 2023
Merged

Added reindex command #522

merged 6 commits into from
Dec 24, 2023

Conversation

scohen
Copy link
Collaborator

@scohen scohen commented Dec 15, 2023

Added a reindex code lens so we can rebuild indexes without resorting to manual operations.

As we build the indexing infrastructure out, we'll likely need to rebuild the index a lot. Presently, this means restarting the server, which can take some time, so I thought i'd add a command to do it instead. I tried using code actions, but this was a bit fraught, so instead, I used a code lens on the project definition in your mix.exs file.

Fixes #517

@zachallaun
Copy link
Collaborator

Is there a reason not to use the LSP's Execute Command functionality? We can share known commands with server capabilities on initialize. https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_executeCommand

@zachallaun
Copy link
Collaborator

My apologies: I see we are doing this. The code lens is just a convenient interface to trigger it.

Copy link
Collaborator

@zachallaun zachallaun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't test this until later, but made some comments for now.

@scohen
Copy link
Collaborator Author

scohen commented Dec 18, 2023

My apologies: I see we are doing this. The code lens is just a convenient interface to trigger it.

my understanding is that the only two ways to use that functionality are code actions and code lenses.

Added a reindex code lens so we can rebuild indexes without resorting
to manual operations.

As we build the indexing infrastructure out, we'll likely need to
rebuild the index a lot. Presently, this means restarting the server,
which can take some time, so I thought i'd add a command to do it
instead. I tried using code actions, but this was a bit fraught, so
instead, I used a code lens on the project definition in your mix.exs file.
  * Emit a more detailed reason for indexing failures
  * Added more unit tests for when code lenses should appear
Server originated requests now have improved ergonomics and support
requests with no params
The code lens now disappears after it's been clicked, and reappears
when indexing has completed.
@scohen scohen merged commit c9041d8 into main Dec 24, 2023
7 checks passed
@scohen scohen deleted the reindex-command branch December 24, 2023 01:43
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.

Reindex command
3 participants