Skip to content

Logical operators are not detected if they are at the beginning of a line #12

@nikitaourazbaev

Description

@nikitaourazbaev

Given this code:

{%- if section.settings.cta_link != blank
  and section.settings.cta_text != ''
-%}
  {{ link }}
{% endif %}

{%- if section.settings.cta_link != blank and section.settings.cta_text != ''
-%}
  {{ link }}
{% endif %}

Expected behaviour is that both ands should be keyword.operator.logical.liquid.

Instead, the top one has the scope:

text.html.liquid meta.template.liquid meta.embedded.liquid source.liquid meta.statement.liquid keyword.other.liquid

Whereas the bottom one has the correct scope:

text.html.liquid meta.template.liquid meta.embedded.liquid source.liquid meta.statement.liquid keyword.operator.logical.liquid

Inserting any characters in front of the top one makes it have the correct scope.

In fact, it seems putting anything in the spot of that first and gives it the keyword.other.liquid scope.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions