Selecting the code action will make the lsp server to edit the configuration file. Here's what the edits look like in this repository:
Requesting feedback
Some things are a bit open right now, and I'd like to discuss how they should be worked on:
Do you think this general idea is valid? Or should another idea be attempted?
The typos configuration can be overridden on each directory level, so I started a scheme that would allow choosing the configuration file to add the misspelling to. The starting directory (typically the project root, I guess?) is always suggested - the others should be suggested only if they exist. Do you think this is a good idea?
Tests obviously need to be added - I think this could be tested quite thoroughly as the existing tests looked really good.
Error handling is not as clean as I would like. I have worked in some OS rust projects that use anyhow, but I couldn't find a way to use it since the tower lsp crate requires a certain error type 😓 Maybe some trait implementations could be added that could automatically handle this?
Reloading the configuration has not been implemented in the project yet, as far as I can tell. I think this needs to be solved as currently the misspellings are ignored only after the LSP server has been restarted.
Here's a draft on what could become the solution for https://github.com/tekumara/typos-lsp/issues/12
This adds a code action like this:
Selecting the code action will make the lsp server to edit the configuration file. Here's what the edits look like in this repository:
Requesting feedback
Some things are a bit open right now, and I'd like to discuss how they should be worked on:
anyhow
, but I couldn't find a way to use it since the tower lsp crate requires a certain error type 😓 Maybe some trait implementations could be added that could automatically handle this?