-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Spell Checking #5305
Comments
My dream would be to embed something like Grammarly right in Zed :) |
Just came along the following code spelling library written in Rust. Just dropping the link in case it would help: https://github.com/crate-ci/typos |
I just tried setting up Zed today and this was the showstopper issue that made me go back to VS Code. Spell check is a critical concern of an editor; it's generally too complex to enforce correct spelling cross-platform via CLI and CI with any degree of confidence and you may be contributing spelling errors to projects with tooling and CI not in your control. I am hopelessly dependent on spellcheck when writing hundreds of words worth of comments and docs per day, or when naming things like types, functions, and variables. VS Code spell check is quite poor because it's via an extension (https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) and not the native macOS spellcheck system, so the spell check UI is inconsistent with other apps and the learned words and not in sync with every other app on your system. But at least it has a solution. There are non VS Code editors out there that have really nice native OS based spell check, so it's possible. |
I would prefer LanguageTool to Grammarly as it FOSS and supports more languages |
This feature feels like a rather large one to add to Zed, when considering all of the things you should be able to do with spell check. What does a good first pass look like? What would be the bare minimum needed to ship something useable? Some unknowns:
Bonus pointsSpell checking in Zed's chat editor. Future AI ideasA distant future goal might be to somehow leverage the supported AI models in Zed to fill suggestions for mispelled words, if the suggestions provided by some crate aren't the greatest. |
In VS Code, the Grammarly extension integrates with the "suggested fix" feature provided by language servers. I can use the same keyboard shortcut to fix ESlint violations and spelling/grammar mistakes. |
Vale is an offline rule-based "prose linter" (spelling & style checker) with an official LSP implementation. It is also code-aware so it can check code comments and won't get confused by markdown or HTML. Seems like a great fit? |
Testing Vale this week, and it works quite well on the CLI level. The configuration might be a bit tricky to set up, but should be fine sailing afterwards. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
I'm trying to use zed to write docs in MD and MDX. The lack of a spell checker is really painful. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Hi, I have taken a first stab at creating a configurable full spell checker / grammar checker and proofing engine that integrates to Zed - example key bindings included, uses the OpenAI and Anthropic API's. The markdown proofing engine is here, and I am finalising an initial baseline to part of a general publication engine from text - although I am starting with research papers. Any and all feedback would be greatly appreciated. This is genuinely a first drop of the approach. Philip |
I truly appreciate the effort the team and contributors put into bringing this feature to life, but I have to ask: is there any chance of getting a spellchecker for Zed that doesn't rely on a remote service or require a local GPU? |
The Vale extension does exactly this. It relies on a local dictionary (defined with plain text files) that it matches words and phrases against with plain old regular expressions. Unfortunately it currently advertises support for Markdown files (Vale itself also supports spellchecking comments in programming languages), and the language server was crashing a lot when used from zed last time I tried. Nobody really knew why, though. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
You know what?, you are right. Its splitting tokens accordingly is not that of an easy problem. Thankfully, is an already solved one. And much easier with tree sitter built in. You can ignore language keywords to speed up spellchecking. However, instead of debating about how difficult this is we can just look what is out there. This is the source code for IntelliJ's spellchecker. Which i personally consider to be the best out there (code wise). License is Apache https://github.com/JetBrains/intellij-community/tree/master/spellchecker/src/com/intellij And this one is Code Spell Checker for VSCode. Not as good. Not as powerful (IntelliJ also caches a lot more stuff like prepositions), but probably simpler. GNU license. https://github.com/streetsidesoftware/vscode-spell-checker Both of these implement the behavior I stated earlier. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This has devolved pretty heavily into a pro-LLM / anti-LLM mess. I'm going to respectfully request that we quiesce further discussion on this GitHub issue, I'd prefer not to lock the issue, but will if necessary. To summarize:
Both are worth considering. If you want to argue about this further, please go somewhere else. Feel free to open a GitHub Discussion thread or hang-out in Thanks all! |
I personally use Language Tools because you can deploy your own instance locally. |
There seems to be a LSP implementation for LanguageTool. Getting that to work with Zed should be as easy as copying some existing language extension and pointing it to that LSP. |
This comment was marked as off-topic.
This comment was marked as off-topic.
There are is a bit of documentation here on extensions, read it, look at a couple of random extensions with an LSP in that repository, specifically the rust code they contain, most of them should be pretty similar with code downloading the LSP from github. Copy the code and change the relevant strings, copy an |
This comment was marked as off-topic.
This comment was marked as off-topic.
I've created an dedicated issue on the extensions repo for discussion of a LanguageTool based Spell-checker extensions. Please migrate your discussion there as this issue has has 20+ followers who get notifications for every comment. Thanks @ivansigmund @bbb651 @jansol @Conaclos for identifying this a potential path forward. |
Add support for the [Typos Language Server](https://github.com/tekumara/typos-lsp). Typos is a spell checker, this extension will help having a bit of spell checking available while waiting for zed-industries/zed#5305 --------- Co-authored-by: Marshall Bowers <[email protected]>
+1 cspell would be my vote! |
I've created a dedicated issue on the extensions repo for cspell via LSP: |
Just popping in to say that someone has contributed a See: zed-typos extension for more. |
This comment was marked as off-topic.
This comment was marked as off-topic.
it works pretty good for me, but I cannot find a way to 'ignore' a word. Is there any configuration file for typos extension? |
Yes, see the typos reference and the README. |
I installed the |
Hey, @kakalot0008. I got it working. Here's the snip of my // Zed settings
//
// For information on how to configure Zed, see the Zed
// documentation: https://zed.dev/docs/configuring-zed
//
// To see all of Zed's default settings without changing your
// custom settings, run `zed: open default settings` from the
// command palette (cmd-shift-p / ctrl-shift-p)
{
// ...
"lsp": {
"typos": {
"initialization_options": {
// Diagnostic severity within Zed. "Error" by default, can be:
// "Error", "Hint", "Information", "Warning"
"diagnosticSeverity": "Hint",
}
}
},
// ...
} Please let me know if that works for you! |
Hi, @scorphus. It's worked. Thanks for your setting. |
Is your feature request related to a problem? Please describe.
I regularely make a lot of typos in code comments, docs, but also in variable names. It is always annoying if pull-requests get post-poned just because of typos reviewers found.
Describe the solution you'd like
I find it tremendously helpful if Zed could spell checks my code. I personally rely a lot on this in e.g.:
Things the spell checker might check:
get_name
/GetName
/getName
, it would checkget
andname
).Additional useful features:
I'd find it especially neat if the spell check would use native system APIs so that I can expect consistent behaviour between the editor and other apps on my system.
Screenshots
Sublime Text:
VSCode Code Spell Checker extension:
The text was updated successfully, but these errors were encountered: