tree-sitter-nim icon indicating copy to clipboard operation
tree-sitter-nim copied to clipboard

Comments get falsely included in preceding indent block

Open aMOPel opened this issue 1 year ago • 2 comments

Current Behaviour

var 
  var1 = 5
  # comment

# comment about something else
var var2 = 5
var_section [0, 0] - [5, 0]
  variable_declaration [1, 2] - [1, 10]
    symbol_declaration_list [1, 2] - [1, 6]
      symbol_declaration [1, 2] - [1, 6]
        name: identifier [1, 2] - [1, 6]
    value: integer_literal [1, 9] - [1, 10]
  comment [2, 2] - [2, 11]                                        <- both comments belong to first block
  comment [4, 0] - [4, 30]                                        <-
var_section [5, 0] - [5, 12]
  variable_declaration [5, 4] - [5, 12]
    symbol_declaration_list [5, 4] - [5, 8]
      symbol_declaration [5, 4] - [5, 8]
        name: identifier [5, 4] - [5, 8]
    value: integer_literal [5, 11] - [5, 12]

Expected Behaviour

When not indented like the block, a trailing comment should not be part of it.

aMOPel avatar Sep 21 '23 13:09 aMOPel