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

Feature request: clear cache when LSP client is stopped #198

Open
1 task done
jfly opened this issue Oct 13, 2024 · 0 comments
Open
1 task done

Feature request: clear cache when LSP client is stopped #198

jfly opened this issue Oct 13, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@jfly
Copy link
Collaborator

jfly commented Oct 13, 2024

Issues

  • I have checked existing issues and there are no existing ones with the same request.

Feature description

none-ls has a cache helper, with another one (hopefully) coming soon (relevant discussion here: #192 (comment)).

I think it would be good if restarting none-ls would clear the internal cache (

M._reset = function()
M.cache = {}
end
), to reduce the probability that people get frustrated and restart neovim.

Help

Yes

Implementation help

This looks straightforward to implement. I'll send in a PR.

@jfly jfly added the enhancement New feature or request label Oct 13, 2024
jfly added a commit to jfly/none-ls.nvim that referenced this issue Oct 13, 2024
This completes <nvimtools#198>.
The only tricky bit was that our cache helpers can no longer assume
their key is present in the cache (as the cache can get reset).

I could have done this with a Lua metatable with a default value
instead. Please let me know if you'd prefer that approach!
jfly added a commit to jfly/none-ls.nvim that referenced this issue Oct 13, 2024
This completes nvimtools#198.
The only tricky bit was that our cache helpers can no longer assume
their key is present in the cache (as the cache can get reset).

I could have done this with a Lua metatable with a default value
instead. Please let me know if you'd prefer that approach!
@jfly jfly self-assigned this Oct 13, 2024
jfly added a commit to jfly/none-ls.nvim that referenced this issue Oct 13, 2024
This completes nvimtools#198.
The only tricky bit was that our cache helpers can no longer assume
their key is present in the cache (as the cache can get reset).

I could have done this with a Lua metatable with a default value
instead. Please let me know if you'd prefer that approach!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant