File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77(type_definition
88 declarator: (type_identifier) @identifier.type )
99(struct_specifier
10- name: (type_identifier) @identifier.type )
10+ name: (type_identifier) @identifier.type
11+ body: _)
1112(union_specifier
12- name: (type_identifier) @identifier.type )
13+ name: (type_identifier) @identifier.type
14+ body: _)
1315(field_declaration
1416 declarator: (field_identifier) @identifier.field )
1517(pointer_declarator
1618 declarator: (field_identifier) @identifier.field )
1719(array_declarator
1820 declarator: (field_identifier) @identifier.field )
1921(enum_specifier
20- name: (type_identifier) @identifier.type )
22+ name: (type_identifier) @identifier.type
23+ body: _)
2124(enumerator
2225 name: (identifier) @identifier.constant )
2326(init_declarator
Original file line number Diff line number Diff line change @@ -475,3 +475,17 @@ fn test_c_enum() {
475475 misspelled. sort_by ( |loc1, loc2| loc1. word . cmp ( & loc2. word ) ) ;
476476 assert_eq ! ( misspelled, expected) ;
477477}
478+
479+ #[ test]
480+ fn test_c_type_uses ( ) {
481+ super :: utils:: init_logging ( ) ;
482+ let sample_text = r#"
483+ enum Colorr color;
484+ union Dataa data;
485+ struct Userr user;
486+ "# ;
487+
488+ let processor = super :: utils:: get_processor ( ) ;
489+ let misspelled = processor. spell_check ( sample_text, Some ( LanguageType :: C ) , None ) ;
490+ assert_eq ! ( misspelled, [ ] ) ;
491+ }
You can’t perform that action at this time.
0 commit comments