chore: lint and code review fixes

This commit is contained in:
2025-09-13 01:14:45 +03:00
parent 13a00d2f0f
commit b180fbeb48
15 changed files with 191 additions and 51 deletions

View File

@@ -13,18 +13,19 @@ module.exports = grammar(bashGrammar, {
name: "shellspec",
// Add conflicts to handle ambiguity between commands and ShellSpec constructs
conflicts: ($) => [
// Essential bash conflicts only
[$._expression, $.command_name],
[$.command, $.variable_assignments],
[$.redirected_statement, $.command],
[$.redirected_statement, $.command_substitution],
[$.function_definition, $.command_name],
[$.pipeline],
// Required ShellSpec conflicts
[$.command_name, $.shellspec_data_block],
[$.shellspec_hook_block],
],
conflicts: ($, previous) =>
previous.concat([
// Essential bash conflicts only
[$._expression, $.command_name],
[$.command, $.variable_assignments],
[$.redirected_statement, $.command],
[$.redirected_statement, $.command_substitution],
[$.function_definition, $.command_name],
[$.pipeline],
// Required ShellSpec conflicts
[$.command_name, $.shellspec_data_block],
[$.shellspec_hook_block],
]),
rules: {
// Extend the main statement rule to include ShellSpec blocks and directives