Skip to content

Range of jsx_text node is too large  #339

Open
@llemaitre19

Description

@llemaitre19

Hi,

This issue is very similar to this one.

It concerns the jsx_text node. The range of this node is too large as it also covers the white spaces and newlines around it.

Here, how to reproduce the issue:

function test() {
  return (
    <>
        TEXT
    </>
  )
}
(program [0, 0] - [7, 0]
  (export_statement [0, 0] - [6, 1]
    declaration: (function_declaration [0, 15] - [6, 1]
      name: (identifier [0, 24] - [0, 28])
      parameters: (formal_parameters [0, 28] - [0, 30])
      body: (statement_block [0, 31] - [6, 1]
        (return_statement [1, 2] - [5, 3]
          (parenthesized_expression [1, 9] - [5, 3]
            (jsx_element [2, 4] - [4, 7]
              open_tag: (jsx_opening_element [2, 4] - [2, 6])
              (jsx_text [2, 6] - [4, 4])
              close_tag: (jsx_closing_element [4, 4] - [4, 7]))))))))

Thanks in advance for fixing it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions