Skip to content

Directive blocks are not represented #28

@wkirschbaum

Description

@wkirschbaum

I am currently implementing indentation using emacs treesit ( tree-sitter integration ), which uses this library. Everything works well except for directive blocks like

<%= if true do %>
<.some_tag_or_component>
</.some_tag_or_component>
<% end %>

which produces

(fragment [0, 0] - [4, 0]
  (directive [0, 0] - [0, 17]
    (partial_expression_value [0, 3] - [0, 14]))
  (component [1, 0] - [2, 25]
    (start_component [1, 0] - [1, 24]
      (component_name [1, 1] - [1, 23]
        (function [1, 2] - [1, 23])))
    (end_component [2, 0] - [2, 25]
      (component_name [2, 2] - [2, 24]
        (function [2, 3] - [2, 24]))))
  (directive [3, 0] - [3, 10]
    (partial_expression_value [3, 3] - [3, 7])))

Since the directive is not the parent of the component there is no simple way of checking parent for indentation.

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