Skip to content

Commit 839d757

Browse files
committed
Fix parsing of line-only locations.
1 parent e540989 commit 839d757

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/debug/session.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ export class Session {
161161
const items = await this.listItemsInScope(scope);
162162
for (const [itemName, itemDesc] of Object.entries(items)) {
163163
const itemLocation = Location.fromCXXRTL(itemDesc.src);
164-
console.log(itemLocation, filename, position, itemLocation !== null && matchLocation(itemLocation, filename, position));
165164
if (itemLocation !== null && matchLocation(itemLocation, filename, position)) {
166165
variables.push(Variable.fromCXXRTL(itemName, itemDesc));
167166
}

src/model/source.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ export class Location {
2121
return new Location(
2222
matches[1],
2323
parseInt(matches[2]) - 1,
24-
matches.length >= 4 ? parseInt(matches[3]) - 1 : undefined,
25-
matches.length >= 4 ? parseInt(matches[4]) - 1 : undefined,
26-
matches.length >= 6 ? parseInt(matches[5]) - 1 : undefined,
24+
matches[3] !== undefined ? parseInt(matches[3]) - 1 : undefined,
25+
matches[4] !== undefined ? parseInt(matches[4]) - 1 : undefined,
26+
matches[5] !== undefined ? parseInt(matches[5]) - 1 : undefined,
2727
);
2828
}
2929

@@ -36,7 +36,7 @@ export class Location {
3636
this.startLine,
3737
this.startColumn ?? 0,
3838
this.endLine ?? this.startLine,
39-
this.endColumn ?? this.startColumn ?? 0
39+
this.endColumn ?? 4096
4040
);
4141
}
4242

0 commit comments

Comments
 (0)