Skip to content

Enable extending syntaxes to override indentation constraints#224

Merged
michaelblyons merged 1 commit into
masterfrom
feat/override-noindent
May 25, 2026
Merged

Enable extending syntaxes to override indentation constraints#224
michaelblyons merged 1 commit into
masterfrom
feat/override-noindent

Conversation

@deathaxe
Copy link
Copy Markdown
Member

This commit introduces no_indent variable, inspired by Bash, to enable extending syntaxes to override indentation constraints.

Use cases:

  • embed powershell in indented fenced code blocks in Markdown
  • embed powershell in YAML files, such as Github Action workflows

Alternative:

A more general and easier to use approach would be to accept ST not tracking indentation and just allow to terminate HEREDOCs regardless leading whitespace in general. It would enable proper highlighting without further meassures being taken on 3rd-party syntaxes.

This commit introduces `no_indent` variable, inspired by Bash, to enable
extending syntaxes to override indentation constraints.

Use cases:
- embed powershell in indented fenced code blocks in Markdown
- embed powershell in YAML files, such as Github Action workflows

Alternative:

A more general and easier to use approach would be to accept ST not tracking
indentation and just allow to terminate HEREDOCs regardless leading whitespace
in general.
@michaelblyons michaelblyons changed the title Enable extending syntaxes to override indentation constrints Enable extending syntaxes to override indentation constraints May 25, 2026
@michaelblyons
Copy link
Copy Markdown
Collaborator

A more general and easier to use approach would be to accept ST not tracking indentation and just allow to terminate HEREDOCs regardless leading whitespace in general. It would enable proper highlighting without further meassures being taken on 3rd-party syntaxes.

I know that would be easier. But people (like me!) are going to take their closing punctuation conventions from other languages...

for x in range(10):
    sql = """
        SELECT * FROM foo
    """

and be annoyed when this highlights like it is going to work, but find out that the string leaks:

    sql = @'
        SELECT * FROM foo
    '@

@michaelblyons michaelblyons merged commit 1bb3e44 into master May 25, 2026
4 checks passed
@deathaxe deathaxe deleted the feat/override-noindent branch May 25, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants