ZenSharp icon indicating copy to clipboard operation
ZenSharp copied to clipboard

ci inserts quotes

Open wildcardjoker opened this issue 8 years ago • 1 comments
trafficstars

Using pci (public const int) or _ci (private const int) inserts quote marks around the value:

pciTest becomes public const int Test = "1"; _ciTest becomes private const int Test = "1";

wildcardjoker avatar Jul 21 '17 02:07 wildcardjoker

I realize this is like 1.5ish years later, but I actually just encountered this yesterday so I changed my template to be:

// Consts:
const ::= access "const "=c primType space identifier (" = "="=" """"="""" identifier """;" | " = "="=" identifier ";"  | " = " identifier ";")

That changes it so that the snippet is now either: pcsName="value" or pciName=value which expands to public constant string Name = "value"; or public constant int Name = value;

In detail: " = "="=" means it'll look for '=' and expand to ' = ' """"="""" is just escaping the double quotes ("), and is looking for a double quote in the snippet.

The last section: " = " identifier ";" I only put so that when you type pc and a prim type it'll show public const primType = $name$; instead of public class $name$

Falthazar avatar Mar 06 '19 17:03 Falthazar