Which custom dictionary rule handles an acronym with a number?

Is there a way to make the code analysis spell-checker accept an acronym that contains a number?

I'm getting CA1704 and CA1709 warnings from code analysis in a C# application where I have identifiers with an acronym that contains a number. For example, "CheckAbc2deStatus". CA1704 wants to correct the spelling of Abc, while CA1709 wants "de" changed to "DE". I found Code analysis, Lost between CA1709 and CA1704 and have tried putting "Abc2de" in the code analysis dictionary as Words/Recognized/Word, Words/Compound/Term, and Acronyms/CasingExceptions/Acronym, but none of those entries will make the code analyzer happy. Other entries in the custom dictionary for "normal" acronyms work as expected.


I got it to work with:

Code:

    public static bool CheckABC2DEStatus()
    {
        return true;
    }

And in the Code Analysis Dictionary:

  <Acronyms>
    <CasingExceptions>
      <Acronym>ABC</Acronym>
      <Acronym>DE</Acronym>
    </CasingExceptions>
  </Acronyms>

The number seems to be treated as a word break, so I had to put the two halves in seperately.

If CheckABC2DEStatus isn't your preferred method name, let me know and I'll try and adjust the dictionary entry accordingly.

链接地址: http://www.djcxy.com/p/69048.html

上一篇: Android文本选择监听器

下一篇: 哪个自定义词典规则用一个数字来处理首字母缩略词?