Skip to content

Commit 1b53e8d

Browse files
Add regression test for issue dotnet#1097
1 parent b09b97e commit 1b53e8d

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

test/syntaxes/fields.test.syntax.ts

+28-2
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,33 @@ const bool field = true;`);
221221
Token.Identifiers.FieldName("z"),
222222
Token.Punctuation.Semicolon]);
223223
});
224-
});
225-
});
226224

225+
it("Fields with fully-qualified names are highlighted properly (issue #1097)", () => {
226+
227+
const input = Input.InClass(`
228+
private CanvasGroup[] groups;
229+
private UnityEngine.UI.Image[] selectedImages;
230+
`);
231+
const tokens = tokenize(input);
227232

233+
tokens.should.deep.equal([
234+
Token.Keywords.Modifiers.Private,
235+
Token.Type("CanvasGroup"),
236+
Token.Punctuation.OpenBracket,
237+
Token.Punctuation.CloseBracket,
238+
Token.Identifiers.FieldName("groups"),
239+
Token.Punctuation.Semicolon,
240+
Token.Keywords.Modifiers.Private,
241+
Token.Type("UnityEngine"),
242+
Token.Punctuation.Accessor,
243+
Token.Type("UI"),
244+
Token.Punctuation.Accessor,
245+
Token.Type("Image"),
246+
Token.Punctuation.OpenBracket,
247+
Token.Punctuation.CloseBracket,
248+
Token.Identifiers.FieldName("selectedImages"),
249+
Token.Punctuation.Semicolon
250+
]);
251+
});
252+
});
253+
});

0 commit comments

Comments
 (0)