Spaces:
Runtime error
Runtime error
Fix start index for multiline precomments
Browse files- utils/tree_utils.py +2 -1
utils/tree_utils.py
CHANGED
@@ -94,7 +94,8 @@ def grab_before_comments(func_node):
|
|
94 |
if node.start_point[0] != last_comment_line + 1:
|
95 |
precomment = ""
|
96 |
if node.type == "comment":
|
97 |
-
|
|
|
98 |
precomment += node.text.decode() + "\n"
|
99 |
last_comment_line = node.start_point[0]
|
100 |
elif node == func_node:
|
|
|
94 |
if node.start_point[0] != last_comment_line + 1:
|
95 |
precomment = ""
|
96 |
if node.type == "comment":
|
97 |
+
if precomment == "":
|
98 |
+
start_byte = node.start_byte
|
99 |
precomment += node.text.decode() + "\n"
|
100 |
last_comment_line = node.start_point[0]
|
101 |
elif node == func_node:
|