We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9371c3e commit 291b5dfCopy full SHA for 291b5df
1 file changed
src/slang-utils/metadata.ts
@@ -99,12 +99,10 @@ export function getNodeMetadata(
99
offset += textLength.utf16;
100
}
101
102
- const leadingOffset = enclosePeripheralComments
103
- ? 0
104
- : getLeadingOffset(children);
105
- const trailingOffset = enclosePeripheralComments
106
107
- : getLeadingOffset(children.reverse());
+ const [leadingOffset, trailingOffset] = enclosePeripheralComments
+ ? [0, 0]
+ : [getLeadingOffset(children), getLeadingOffset(children.reverse())];
+
108
const loc = {
109
start: initialOffset + leadingOffset,
110
end: offset - trailingOffset,
0 commit comments