codemaid icon indicating copy to clipboard operation
codemaid copied to clipboard

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

Open johnsunabc opened this issue 1 year ago • 2 comments

Environment

  • Visual Studio version: [VS 2022 Enterprise]
  • CodeMaid version: [VS.Net Version 12.0]
  • Code language: [C#, LangVersion: 10.0]

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!

johnsunabc avatar Feb 27 '23 11:02 johnsunabc

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.

codecadwallader avatar Mar 26 '23 20:03 codecadwallader

The problem still persists.

Sinus32 avatar Mar 06 '24 09:03 Sinus32