Question

My project have a coding convention that: For local variables (inside methods): Use the format [prefix][variable name]

[Prefix] will be the first character of the data type if variables are of primitive type such as Integer, Byte, String...

Example:

Dim sCompanyName As String
Dim iArrayIndex As Integer
Dim bContactStatus As Boolean

Is there any way for Resharper to create custom naming rule for this case?

Thanks.

No correct solution

OTHER TIPS

Strictly speaking, ReSharper isn't set up to handle Hungarian notation because the a la mode way of naming variables in .Net doesn't require it. Thus, if you really need to have this, you would need to implement the naming system yourself by creating a ReSharper plug-in to suppress R#'s own naming suggestion system and implement one of your own.

That said, it a very difficult, and possibly unfeasible, task.

While I totally agree with Piers on the "dated" nature of Hungarian notation, I do realize that sometimes one may get stuck maintaining legacy code or dated company standards.

It may be helpful for your to know that CodeIt.Right includes set of rules that help enforce Hungarian notation style, as well as set of rules that help to move from Hungarian notation to MS .NET conventions. And finally if you are not totally happy, you can customize existing rules or quickly develop own custom ones.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top