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

Delimitate regions eligible for spell checking. #1017

Open
iago-lito opened this issue Jun 10, 2020 · 4 comments
Open

Delimitate regions eligible for spell checking. #1017

iago-lito opened this issue Jun 10, 2020 · 4 comments
Labels
feature-request Request for new features or functionality new request
Milestone

Comments

@iago-lito
Copy link

iago-lito commented Jun 10, 2020

A discussion started at neovim about the benefits that LSP could bring to spell checking, but I'm not sure whether this has been discussed here yet.

The LSP server is very aware of the file structure and programming language specificities, which makes it a very good candidate for delimiting regions eligible to spellchecking (comments, docstrings, strings maybe, variable names maybe, etc.).

Could this spellcheck-regions-delimiting activity be part of the protocol? What would it imply in terms of coordination with existing spellcheckers/editors?

The most basic support would be to not delimitate anything and return the whole file as one big region, leaving the burden of ignoring keywords, etc. to the spellchecker itself. Such a trivial implementation is dummy, but it would still be useful in 2 cases I think:

  • For a not-a-programming-language-LSP server, dedicated to parse plain, free .txt-like files written in natural language.
  • For transient, basic support in other LSP servers, as a temporary solution so they comply to the protocol even though they have not implemented precise region-delimiting logic yet.
@matklad
Copy link
Contributor

matklad commented Jun 10, 2020

There's actually quite a few things besides the regions that the server needs to communication to have spellchecking:

microsoft/vscode#20266 (comment)

@iago-lito
Copy link
Author

@matklad Of course :) I forgot to acknowledge how ignorant I am regarding the detailed process and every problem met on the way. The intent is rather to check whether this has already been discussed before (so thank you for having brought this other discussion here), and to take the temperature regarding spellchecking at LSP.

@mickaelistria
Copy link

I think this is partly related to #18 . Semantic Highlighting actually seems to involve file tokenization and the LS returning file tokens to the client for further styling.
The "natural language text" could then be just a token type.

@iago-lito
Copy link
Author

@mickaelistria I also think it is. At its core, spellchecking is essentially a linting process, and token highlights is its most natural output. However, I have no idea how standardized existing spellcheckers already are, where they would best fit in the process (e.g. interacting rather with the LSP client or the server?), or how hard it will be to correctly specify that interaction.

For instance, highlighting/linting is a thing, but there is also fixing, fleshing up dictionary, etc. are all these needs already listed somewhere?

@dbaeumer dbaeumer added the feature-request Request for new features or functionality label Nov 11, 2020
@dbaeumer dbaeumer added this to the Backlog milestone Nov 11, 2020
@dbaeumer dbaeumer added idea and removed feature-request Request for new features or functionality new request labels Oct 28, 2021
@dbaeumer dbaeumer added feature-request Request for new features or functionality new request and removed idea labels Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality new request
Projects
None yet
Development

No branches or pull requests

4 participants