codecadwallader / codemaid

CodeMaid is an open source Visual Studio extension to cleanup and simplify our C#, C++, F#, VB, PHP, PowerShell, JSON, XAML, XML, ASP, HTML, CSS, LESS, SCSS, JavaScript and TypeScript coding.
http://www.codemaid.net
GNU Lesser General Public License v3.0
1.88k stars 353 forks source link

When using "ref struct StructName", "ref" be deleted. #981

Open johnsunabc opened 1 year ago

johnsunabc commented 1 year ago

Environment

Description

Run Code Maid, "internal ref struct StringSplitUtilStruct" changed to "internal struct StringSplitUtilStruct". That is, "ref" be deleted.

Current behavior

internal ref struct StringSplitUtilStruct { private ReadOnlySpan _str; private readonly ReadOnlySpan _chars; //Other codes... } Run Code Maid, "internal ref struct StringSplitUtilStruct" changed to "internal struct StringSplitUtilStruct". That is, "ref" be deleted.

Expected behavior

"ref" should be still in the codes. If not, "ReadOnlySpan" is error!

codecadwallader commented 1 year ago

Thanks for reporting the issue. There is a known bug in the Visual Studio SDK that is causing definitions to lose keywords. See https://github.com/codecadwallader/codemaid/issues/879 for more details. The workaround at this time is to disable CodeMaid's insert explicit access modifiers logic, which bypasses that part of the SDK. I hope that helps.

Sinus32 commented 4 months ago

The problem still persists.