I created a composite context action that returns a couple of intentions with the following texts:
Now I'm trying to cover this action by tests. I did everything by guidelines, but I'm not able to identify the first action using the caret
notation.
I've tried the following options:
{caret:[Tag]:Action}
{caret:Tag:Action}
Note of them worked :(
If I do the same for the Second Action
, everything is fine. Likely, issue is related to brackets.
I don't want to change name of the action. Could you advice how to specify the action with brackets?
Thanks!
UPDATE
I've found the following workaround:
{caret:TagAction}
.Override SelectItem
method and adjust attribute
protected override IBulbAction SelectItem(SetFrozenAttributeAction contextAction, string attribute, ITextControl textControl)
{
if (attribute == "TagAction") attribute = "[Tag] Action";
return base.SelectItem(contextAction, attribute, textControl);
}
If you know better way - suggest it :)
Yes, it's the brackets. I don't know why, but when it encounters the opening brace {
, it doesn't read up to a closing brace }
, but reads a set of chars that it deems are "valid", and then stops when it hits the first non-valid char. The valid chars are char.IsLetter
, char.IsDigit
and $
, (
, )
, ,
-
, .
, /
, \
. But not [
or ]
- so your {caret:[Tag] Action}
would just read {caret:
and then stop.
Your workaround seems like the best bet!