EWSoftware / VSSpellChecker

A Visual Studio spell checker editor extension that checks the spelling of comments, strings, and plain text as you type. Supports configuration and various languages.
Other
377 stars 65 forks source link

Spelling check text in html no longer seems to work using visual studio 2022 when HTML (web forms) editor is used #258

Closed emesde closed 2 years ago

emesde commented 2 years ago

Before when using visual studio 2017 and the spell checker for this version, spelling in HTML files was checked during 'spell check as you type'. spell check as you type is working in XML and C files.

When you spell check current project or solution it does check the texts in HTML files, so it seems that somehow with html files the spell as you type is disabled . Active document spell check also doesn't work.

EWSoftware commented 2 years ago

It is likely dependent on the project type which may classify them differently. Can you provide an example project in which it isn't spell checking such files?

emesde commented 2 years ago

Is it working in visual studio 2017 with the same project file. The project file type is c/c++

emesde commented 2 years ago

ProjectToCheckHTMLspelling.zip I added a small project to check this. Of course it could also be possible that it is due to a change in VS2022. (I found more things to be broken/changed in vs 2022 comparing to vs 2017)

EWSoftware commented 2 years ago

It is working for me in your test project. The file you sent doesn't contain any misspelling but if adding some it does flag them as expected. Does it spell check the files if you use the Spell Check Solution or Project options? You might check the global settings to ensure the spell check as you type option is enabled.

emesde commented 2 years ago

spell check as you type option is enabled. Saving it in .txt or xml it will spell check as you type works. For some reason this gets disabled specifically for html files. I'm using Microsoft Visual Studio Professional 2022 (64-bit) - Current Version 17.2.3. For all we know some other component of vs might cause this issues. A component you don't have installed.

EWSoftware commented 2 years ago

I've got 17.2.4 but I don't think that will make a difference. Like I said, try the solution or project spell check. That should work regardless of the spell check as you type setting unless it's being disabled by one of the other configuration options such as the Ignored Files or perhaps ignored elements in the XML Files options.

emesde commented 2 years ago

First message I already stated that is works with solution spell check. I tried many settings before I posted the issue and only after I thought I tried everything I posted this issue. What I will do now is try it on an other machine. (all the spell check settings are on default values and in vs2017 I also didn't need to change anything). I will test on another machine to see if I can reproduce this as you also don't seem to be able to reproduce the issue.

emesde commented 2 years ago

I've found the issue. The check spelling why you type no longer works when you open the html file in the HTML (web forms) editor. When you open it with the 'normal' HTML editor in vs spell when you type is working, open it in source view of the HTML (web forms) editor and it stops working. This did work when using visual studio 2017.

EWSoftware commented 2 years ago

The content type for files opened that way is "WebForms" so I guess it must have changed. I've associated that content type with the HTML text tagger so that it picks up the inner text of the elements for spell checking.