Skip to content

Commit

Permalink
feat: Add significant node types for C# in center_block_config
Browse files Browse the repository at this point in the history
- Added significant C# node types including `using_directive`,
`namespace_declaration`, `modifier`, `field_declaration`,
`variable_declaration`, `constructor_declaration`, and
`foreach_statement`.
- Ensured no duplication with common significant blocks by updating the
configuration accordingly.
  • Loading branch information
joshuadanpeterson committed Jul 21, 2024
1 parent 6098195 commit d8a6554
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions lua/typewriter/utils/center_block_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,15 @@ M.expand = {
["return_statement"] = true,
["identifier"] = true,
["expression_statement"] = true,
["declaration"] = true,
["argument_list"] = true,
["binary_expression"] = true,
["foreach_statement"] = true,

-- Language-specific significant blocks
-- PHP
["namespace"] = true,
["php_tag"] = true,
["foreach_statement"] = true,

-- Lua
-- moved to common significant blocks
Expand All @@ -89,10 +92,7 @@ M.expand = {
["type_declaration"] = true,
["type_spec"] = true,
["struct_type"] = true,
["parameter_list"] = true,
["parameter_declaration"] = true,
["selector_expression"] = true,
["argument_list"] = true,
["short_var_declaration"] = true,
["expression_list"] = true,
["for_clause"] = true,
Expand Down Expand Up @@ -198,7 +198,6 @@ M.expand = {
["integer_scalar"] = true,
["boolean_scalar"] = true,


-- JSON
["object"] = true,
["pair"] = true,
Expand All @@ -213,7 +212,6 @@ M.expand = {
["class_definition"] = true,
["function_signature"] = true,
["method_signature"] = true,
["declaration"] = true,
["import_or_export"] = true,
["constructor_signature"] = true,
["argument_part"] = true,
Expand All @@ -227,13 +225,17 @@ M.expand = {
-- C++
["preproc_include"] = true,
["class_specifier"] = true,
["field_initializer_list"] = true,
["field_initializer"] = true,
["binary_expression"] = true,
["declaration"] = true,
["init_declarator"] = true,
["for_range_loop"] = true,
["string_literal"] = true,

-- C#
["using_directive"] = true,
["namespace_declaration"] = true,
["modifier"] = true,
["field_declaration"] = true,
["variable_declaration"] = true,
["constructor_declaration"] = true,
}

--- Get the expansion status for a given node type
Expand Down

0 comments on commit d8a6554

Please sign in to comment.