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
Consider adding Roslyn code analyzers and/or code analysis rules for spell checking #111
Comments
This can be achieved without Roslyn, by using editor classifiers, e.g.
|
Does the classifier distinguish between API methods/properties vs variables, private vs public? If not, it's probably not something I'd want in the editor as it would be hard to limit what it spell checked. For example, I may not care about fields or private/internal members. Also, I wouldn't want it spell checking every occurrence, just on the declarations. Otherwise, there'd be too much clutter if a particular element occurred frequently. |
I've been using such an implementation myself and have been enjoying it. Some people consider that misspelling are harmful in any context, private or public. As to the clutter, it is not an issue in practice. Having every occurrence flagged increases the chances that a violation is noticed, at which point "Ignore all" or "Add to dictionary" will clean all the violation with a single gesture. |
What's true for you, isn't true of everyone though, and those are the ones I will hear from if I just throw in an implementation that spell checks everything without regard to the contexts noted above. Telling everyone to just use Ignore All or Add to Dictionary isn't an acceptable solution in this case. I wouldn't be happy with that response myself. There are other considerations too such as propagating the change throughout the codebase, not just on the specific occurrence (i.e. refactoring). A simple Replace All could break a lot of stuff without proper consideration and not replacing it everywhere will also break the code. I also don't want to spell check identifiers from third-party or base framework code. Since I can't fix them, I'd rather ignore them outright instead of having to keep ignoring them or adding them to the dictionary. |
Thank you for reconsidering this feature. |
https://github.com/aarondandy/WeCantSpell.Roslyn |
Is the spelling of variables already implemented? |
@dmitriy-shleht: Not in this extension yet. |
I would just like to +1 this. |
Maybe it is possible to scan A small problem of the solution is that some specific languages, for instance, C or C++, requires some special handling and using the You don't have to use Roslyn by the above approach and Roslyn is limited to C# and VB only. |
Are there any updates on this issue or any works with this implemented? |
Nothing yet. I haven't had time to work on this. |
@EWSoftware Is there any update on this? I am eagerly waiting for this feature as I am not using Resharper anymore! |
Sorry, no change. I just don't have time to look into doing this right now. |
@TanvirArjel While it is not a Roslyn analyzer have you checked the VS addons? Visual Studio Spell Checker provides source text spell checking. It should be a decent alternative if you are migrating away from ReSharper. |
@ite-klass Could you tell me please how to enable spell checker in Visual Studio 2019? |
@TanvirArjel Simply install the extension within Visual Studio -> Extensions and search for Visual Studio Spell Checker (VS2017 or later). |
@ite-klass I am not talking about this. Please read the issue again and try to understand what I am talking about. I am talking about the spell checking for the identifiers like class name, method name, variable name, etc like Resharper. |
What is the current state of this issue? |
Unless I close the issue with a commit that indicates it's done, it's still in the queue and nothing has changed from the last time this was asked. |
Okay, better late than never but I have finally implemented a code analyzer to spell check identifiers. It's limited to C# right now but I plan on adding support for Visual Basic and perhaps F# later. It works with Visual Studio 2019 and 2022. Yes, VS2022 has a built-in spell checker now but I still think mine is better as it has more configuration options and doesn't require you to modify your OS to add dictionaries. The built-in one may get better over time and rival mine but, for now, I plan on continuing support for the extension in VS2022 and later. There are some limitations and I'll open new work items for those for further investigation. They may be a result of my lack of knowledge when it comes to code analyzers or may not be solvable. The spell checker isn't like a normal code analyzer in some respects so what I'm trying to do just may not be possible. |
Good to see that. The VS 2022 checker does not check text in the Git comment. Hopefully yours can do so. |
Yes, mine still does the WPF textbox spell checking so it will check the Git comments. If it isn't currently, it may be turned off in the global options. |
Adding these would enable spell checking of API member names in actual source code using the extended options provided by this spell checker. It's been requested before (#15, #106, #110) and is being requested fairly often.
There are some spell checking code analysis rules provided by Microsoft but many find them to be inadequate. Adding such analyzers and rules here would probably only cover managed code languages so it still wouldn't be possible to check native code C++ or scripting languages.
Options that would differ for code analysis so would most likely needs separate settings:
The text was updated successfully, but these errors were encountered: