We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 53f6efe commit ce50324Copy full SHA for ce50324
src/scope/index.ts
@@ -115,11 +115,17 @@ export function getInnermostScope(
115
node: ESTree.Node
116
): Scope {
117
const location = node.range![0];
118
+ const isInRange =
119
+ node.range![0] === node.range![1]
120
+ ? (range: [number, number]) =>
121
+ range[0] <= location && location <= range[1]
122
+ : (range: [number, number]) =>
123
+ range[0] <= location && location < range[1];
124
125
for (const childScope of initialScope.childScopes) {
126
const range = childScope.block.range!;
127
- if (range[0] <= location && location < range[1]) {
128
+ if (isInRange(range)) {
129
return getInnermostScope(childScope, node);
130
}
131
0 commit comments