Skip to content

Commit

Permalink
[ShellScript] Tweak command reference scopes and symbols
Browse files Browse the repository at this point in the history
This commit...

1. introduces a common `meta.command` scope applied to function calls and
   function name references.
2. adjusts reference definitions accordingly.

Goal is a common and unique scope to target function or command references.
  • Loading branch information
deathaxe committed Aug 7, 2024
1 parent 497e9d2 commit 6e9a4b3
Show file tree
Hide file tree
Showing 5 changed files with 138 additions and 126 deletions.
14 changes: 7 additions & 7 deletions ShellScript/Bash.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ contexts:
- alias-name-chars

alias-name-chars:
- meta_scope: meta.variable.shell entity.name.function.shell
- meta_scope: meta.command.shell entity.name.function.shell
- include: line-continuations
- include: literal-unquoted-content
- match: '{{opt_break}}'
Expand Down Expand Up @@ -857,10 +857,10 @@ contexts:
cmd-builtin:
# cmd modifier commands are directly followed by simple commands
- match: '{{modifier_cmds}}'
scope: meta.function-call.identifier.shell meta.path.shell support.function.shell
scope: meta.function-call.identifier.shell meta.command.shell support.function.shell
# shell built-in commands with arbritary arguments
- match: '{{builtin_cmds}}'
scope: meta.function-call.identifier.shell meta.path.shell support.function.shell
scope: meta.function-call.identifier.shell meta.command.shell support.function.shell
push:
- cmd-args-meta
- cmd-args
Expand Down Expand Up @@ -890,7 +890,7 @@ contexts:
- path-pattern-begin

cmd-name-body:
- meta_scope: meta.function-call.identifier.shell meta.path.shell variable.function.shell
- meta_scope: meta.function-call.identifier.shell meta.command.shell variable.function.shell
- include: line-continuations
- include: path-pattern-content
- match: '{{cmd_break}}'
Expand Down Expand Up @@ -984,7 +984,7 @@ contexts:
push: function-declaration-name-chars

function-declaration-name-chars:
- meta_scope: meta.variable.shell entity.name.function.shell
- meta_scope: meta.command.shell entity.name.function.shell
- include: line-continuations
- include: literal-unquoted-content
- match: '{{word_break}}'
Expand All @@ -1003,7 +1003,7 @@ contexts:
push: function-reference-name-chars

function-reference-name-chars:
- meta_scope: meta.variable.shell variable.function.shell
- meta_scope: meta.command.shell variable.function.shell
- include: line-continuations
- include: literal-unquoted-content
- match: '{{word_break}}'
Expand Down Expand Up @@ -1462,7 +1462,7 @@ contexts:
- path-pattern-begin

unquoted-statements-word-body:
- meta_scope: meta.string.shell meta.path.shell variable.function.shell
- meta_scope: meta.string.shell meta.command.shell variable.function.shell
- include: line-continuations
- include: path-pattern-content
- match: '{{cmd_break}}'
Expand Down
Loading

0 comments on commit 6e9a4b3

Please sign in to comment.