Update all 5 tree-sitter query files to cover the full grammar: highlights.scm: - Add highlights for new literals (binary, octal, date, bool, typed_int, wstring, char) - Add highlights for block names (organization_block, function_block, function, data_block, type_definition) - Add highlights for return_statement, goto_statement, title_statement - Add highlights for bit_access, method_callee - Add compound assignment operators (+=, -=, *=, /=, etc.) indents.scm: - Add function, type_definition, data_block to @indent.begin - Add all var_*_declaration variants to @indent.begin - Add struct_type to @indent.begin - Add END_FUNCTION, END_TYPE, END_DATA_BLOCK, END_STRUCT to @indent.end folds.scm: - Add function, type_definition, data_block to @fold - Add all var_*_declaration variants to @fold - Add struct_type to @fold locals.scm: - Add function, type_definition, data_block as @local.scope - Add all var_*_declaration variants as @local.scope - Add struct_type as @local.scope - Add block name definitions (@definition.function, @definition.class, @definition.type) - Narrow @reference to prefixed_identifier only (reduces noise) tags.scm: - Add function, data_block, type_definition tags - Add FB call references - Add region_statement as @definition.module
66 lines
1.0 KiB
Scheme
66 lines
1.0 KiB
Scheme
; Indentation rules for SCL
|
|
|
|
; Indent after block definitions
|
|
[
|
|
(organization_block)
|
|
(function_block)
|
|
(function)
|
|
(type_definition)
|
|
(data_block)
|
|
] @indent.begin
|
|
|
|
; Indent after VAR sections
|
|
[
|
|
(var_declaration)
|
|
(var_temp_declaration)
|
|
(var_constant_declaration)
|
|
(var_retain_declaration)
|
|
(var_non_retain_declaration)
|
|
(var_db_specific_declaration)
|
|
] @indent.begin
|
|
|
|
; Indent after control structures
|
|
[
|
|
(if_statement)
|
|
(case_statement)
|
|
(for_statement)
|
|
(while_statement)
|
|
(repeat_statement)
|
|
(region_statement)
|
|
] @indent.begin
|
|
|
|
; Indent after STRUCT in UDTs and inline structs
|
|
(struct_type) @indent.begin
|
|
|
|
; Indent after THEN, DO, ELSE, ELSIF, BEGIN
|
|
[
|
|
"THEN"
|
|
"DO"
|
|
"ELSE"
|
|
"ELSIF"
|
|
(keyword) @indent.branch
|
|
] @indent.branch
|
|
|
|
; Outdent at end keywords
|
|
[
|
|
"END_VAR"
|
|
"END_IF"
|
|
"END_CASE"
|
|
"END_FOR"
|
|
"END_WHILE"
|
|
"END_REPEAT"
|
|
"END_REGION"
|
|
"END_STRUCT"
|
|
"END_ORGANIZATION_BLOCK"
|
|
"END_FUNCTION_BLOCK"
|
|
"END_FUNCTION"
|
|
"END_TYPE"
|
|
"END_DATA_BLOCK"
|
|
] @indent.end
|
|
|
|
; Outdent for ELSE and ELSIF
|
|
[
|
|
"ELSE"
|
|
"ELSIF"
|
|
] @indent.dedent
|