Sublime Forum

Can I assert a scope only with source.xxx in a syntax test file?

#1

Can I test a position is only scoped with source.xxx without other scopes?

For example,

print_info_text_compact () { cat <<EOF; do_something; }
#                                  ^^^ keyword.control.heredoc-token.shell
#                                                     ^ punctuation.definition.group.shell
This is some info text.
# <- string.unquoted.heredoc.shell
EOF
# <- keyword.control.heredoc-token.shell


# <- source.shell

I want to make sure the scope is clean after the EOF line.

0 Likes

#2

I think you can only check that a position doesn’t contain certain scopes. You can do this with the - operator i.e.

# <- source.shell - string.unquoted.heredoc.shell

As far as I know, there is no way to assert that a position [ doesn’t contain any other scopes | contains only the specified scope ].

2 Likes

#3

Ah, I forget the use of -. Thanks a lot.

0 Likes