Open antonioatom opened 1 year ago
In item 1, are you referring to actual dictionaries (the pair of files .aff and .dic) or the user dictionary where words are added while spell checking (the _User.dic)? User dictionaries do need to be named "_User.dic".
Can you supply an example that demonstrates the issues in item 1 and item 2? I don't need branches, just the general structure of the folders and files so that I can better understand what you are doing. There is a bug in how the additional dictionary folders are resolved so that that may be affecting this. I've fixed that for the next release.
Item 3 is to be expected. As noted in the documentation, the code analyzers run in a separate process so there is no way to have their results show in either the Spell Check Current Document or Solution/Project Spell Check tool windows. They will only show string/comment misspellings.
Item 1. Yes I was refering to custom dictionaries.
Regarding the folder structure I have:
CodeAnalysis (in the root of the solution)
-- Dictionaries
---- Solution.sln.IgnoredWords.dic
---- en-US_User.dic
.editorconfig (this is in the root of the solution. the file has the root = true in the first line)
[FolderPerProject]
-- .editorconfig (this file is only there for some projects where I want to exclude something)
I was able to fix most of the issues but everytime I build or run the analyzer I get more errors that were not found before.
One example I can give now is the following: I have a specific .editorconfig in my web project where I want him to ignore the cshtml files:
[*.cshtml]
vsspell_spell_check_as_you_type = false
vsspell_include_in_project_spell_check = false
vsspell_code_analyzers_enabled = false
I'm getting this error in the error list:
As you can see it's giving several errors for the same file and the word "Mvc" does not exist on that file. The error is underlined in @model
In any case I assume with the rule for *.cshtml I added above in the .editorconfig in the root of that project it shouldn't check for any cshtml files.
I'll try to get other examples but this is very hit and miss. Sometimes it shows errors on the error list, I double click to check the error and the error just goes away. I got a VSSpell error for the work "cancelation" in a cancelation token variable, when I double clicked to see the error the error just vanished although the word was still wrong. After I've fixed it and rebuilt it showed the same error although it was fixed. The same with other spelling errors that I've found.
This is another example I could screenshot before the error went away:
I had an error with "appplication", I've fixed it. The error got away. Rebuilt. The error showed up again. Double click the error, I go to the file and the error disappears. If I then call "Run Code Analysis On Solution" the errors reappear as well.
So I have 3 VSSpell001 errors there of things I've fixed:
catch (RequestFailedException stx)
{
this.logger.LogError(stx, "Error while deleting Blob.");
throw;
}
It seems everyday I open the solution I get different errors.
I've just published an update that fixes an issue resolving dictionary paths and the default ignored words file. It should be available shortly. See if that has an effect.
If not, can you supply an actual set of files I can download and test? It's much easier to do that than to try and reproduce the example based on a description alone as I may not do everything the same way that you have. Case in point, your spelling issues are showing up as errors. They're only set to report as warnings by default.
Regarding building the projects, you won't see any identifier spelling warnings there since as I recall, it needs a NuGet package to apply them during the build which I did not create. You won't see anything unless you open file with code or run the code analysis option that causes them to be reported.
Hi... It's hard to share my code due to privacy reason. Regarind VSSpell001 showing as error this is by design of the solution "Show all warnings as errors".
Just a note on what I reported yesterday: I left my solution open with 0 errors and just went on my life. Today when opening the computer I had 16 new VSSpell001 errors. It seems the spell check keeps running in the background even if code analysis is not running. Could be something with Visual Studio. Just wanted to let you know.
I'll test the new version of the package as soon as i I can. I can see it in the pending extension updates as version 2023.5.15.1.
Another update... Using the new version 2023.5.15.1. Added the word "env" to the ignore dictionary and still the error shows up as a VSSpell001. Again if I leave VS open without doing anything it will find new spelling errors that didn't find before. I cannot find a way to trigger a full code analysis with the VSSpell so I can fix all spelling errors all at once.
Run Code Analysis for solution or for project does not trigger new spelling errors.
Already tried with "Run Code Analysis in separate process" on and off. Same result.
The behavior of showing a spelling error, you click on the error, it opens the file and the error just goes away from the error list even if I don't fix it.
If I close the file the error shows up again in the error list even if I corrected it.
I did a small video showing this:
https://github.com/EWSoftware/VSSpellChecker/assets/89639809/d42430ae-9fa3-44e5-acf5-e16fe895eb8a
Using the new version 2023.5.15.1 the problem with closing and opening the solution doesn't load the dictionaries. Steps:
So I think the fix for loading the dictionaries on close / open solution it's not working.
Any updates on this issue?
I haven't had a chance to look at it yet. I'm not sure I understand what you mean by "ran spell checker" unless you mean you did a solution/project spell check or are you just referring to opening/closing a file for the code analyzer to run?
Ran spell checker -> solution/project spell check My visual studio is set to run analysis on Entire Solution but I manually run the "Run Code Analysis" for solution manually if I want to check the full project.
I'm also having this issue. How can I set the severity from Error
to another value? I already tried by right click on the item and Set severity
with other value, but the value doesn't change. It's annoying to have many errors in the Error List
for names I choose for namespaces, classes, parameters, etc.
@BDisp Disable the code analyzer option in the global configuration if you don't want to use it at all. If you have the "all warnings as errors" option set, you can change the VSSpell01 diagnostic to a suggestion in the .editorconfig file. That changes the warning/error underlines to gray dots instead. You can also set it to silent or none which gets rid of all the markers but that's effectively turning it off so you might as well use the spelling configuration option.
[*.{cs,vb}]
# Treat spell checker issues as suggestions rather than warnings (or errors if treating all warnings as errors)
dotnet_diagnostic.VSSpell001.severity = suggestion
# Or turn off the code analyzer completely so that no identifier spell checking is performed
vsspell_code_analyzers_enabled = false
Thanks for the response. I really don't want to disable it because I like it a lot to speller check on xml documents, commits, etc. But I also don't like to insert it on a .editorconfig
at solution level file because others users may not be using the extension. That why I prefer to put it on a global config. What I don't understand is why on some solutions the speller check show as error and on others show as warning (which is what I want). Note that I also don't have the global configuration file in the C:\Users\Luis\AppData\Local\EWSoftware\Visual Studio Spell Checker\VSSpellChecker.editorconfig
. I think it assumes different behaviors if it's a ConsoleApp, WebApp or BlazorApp.
The global configuration file doesn't need to exist. If it doesn't, there are defaults it uses. Disabling the code analyzer won't disable spell checking of strings, comments, and plain text as they're separate. The code analyzer only handles identifiers. If they're showing as errors in some cases, it's likely that the project has the "show all warnings as errors" option set.
Thank you very much. I had in the Directory.Build.props
file <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
and was showing as errors.
Just migrated everything to the new .editorconfig but I ran into some problems
As stated in the documentation the file should be the language name "en-US.dic" for example. This doesn't seem to work. I needed to change the name of the file to the one used in the global settings "en-US_User.dic". This is not clear in the documentation since it cleary states the dictionary should have the language name as the filename (it is also mentioned here: https://github.com/EWSoftware/VSSpellChecker/issues/204)
You state in the documentation that any changes done to the .editorconfig file might only be read if you reload the solution but this doesn't seem to be the case. Few scenarios:
Another problem is running manually the spell check in the entire solution shows no errors but running the code analysis on the solution shows some VSSpelll001 errors of words that are in the ignore file:
Using VS 17.5.5. Extension version: 2023.5.8.0.
Current .editorconfig in the root of the solution