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
SA1642 (constructor summary text) special case for incorrect class name #415
Comments
I initially assigned @pdelvo since he did a great job with the initial implementation. I'll take a look soon if you don't have time. |
💡 The code fix for each of the above cases should replace the current type reference with the corrected type reference, as opposed to inserting the entire standard prefix. |
❓ I also noticed a case like the following:
Notice that everything is correct except the word "class" has been omitted. Should we special case handling for code that is close but not exactly correct? If so, how close is close? |
This is getting complicated. Calculating the Levenshtein distance and having an upper limit would make this rule almost useless. If I have a spelling mistake in there the distance would be very small and I would not get a diagnostic. But we could add a few special cases like the one you mentioned. |
I tend to agree but wanted to ask the question publicly before just deciding 👍 |
Doh. I thought I made a new issue for the "closeness" question. |
The incorrect class name situation is common and relatively simple to detect/correct. |
I am working on this. It is getting a bit complicated but my solution is able to also detect spelling mistakes and changing the comment instead of adding a new one |
Well that would be cool 👍 It's OK if it doesn't work out too. |
When SA1642 is reported, it is always reported for the entire
<summary>
element. In each of the following scenarios, a more specific location should be used for reporting the warning.When the name of the class is not wrapped in a
<see>
element, but the text is otherwise correct. For example, the warning reported for the following code should only underline the wordCustomer
:As in the first case, but now considering an incorrect class name. For example:
When the name of the class specified in the
cref
attribute does not match the name of the current class, but the text is otherwise correct. In this case, the warning should be reported for thecref
value instead of the entire<summary>
element. For example:The text was updated successfully, but these errors were encountered: