@lezer/common 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +6 -2
- package/dist/index.js +6 -2
- package/package.json +1 -1
- package/dist/index.es.js +0 -1816
package/dist/index.cjs
CHANGED
|
@@ -321,6 +321,10 @@ class Tree {
|
|
|
321
321
|
/// position. If 1, it'll move into nodes that start at the
|
|
322
322
|
/// position. With 0, it'll only enter nodes that cover the position
|
|
323
323
|
/// from both sides.
|
|
324
|
+
///
|
|
325
|
+
/// Note that this will not enter
|
|
326
|
+
/// [overlays](#common.MountedTree.overlay), and you often want
|
|
327
|
+
/// [`resolveInner`](#common.Tree.resolveInner) instead.
|
|
324
328
|
resolve(pos, side = 0) {
|
|
325
329
|
let node = resolveNode(CachedNode.get(this) || this.topNode, pos, side, false);
|
|
326
330
|
CachedNode.set(this, node);
|
|
@@ -1803,14 +1807,14 @@ function enterFragments(mounts, ranges) {
|
|
|
1803
1807
|
for (let i = 0, pos = from;; i++) {
|
|
1804
1808
|
let last = i == changes.length, end = last ? to : changes[i].from;
|
|
1805
1809
|
if (end > pos)
|
|
1806
|
-
result.push(new TreeFragment(pos, end, mount.tree, -startPos, frag.from >= pos, frag.to <= end));
|
|
1810
|
+
result.push(new TreeFragment(pos, end, mount.tree, -startPos, frag.from >= pos || frag.openStart, frag.to <= end || frag.openEnd));
|
|
1807
1811
|
if (last)
|
|
1808
1812
|
break;
|
|
1809
1813
|
pos = changes[i].to;
|
|
1810
1814
|
}
|
|
1811
1815
|
}
|
|
1812
1816
|
else {
|
|
1813
|
-
result.push(new TreeFragment(from, to, mount.tree, -startPos, frag.from >= startPos, frag.to <= endPos));
|
|
1817
|
+
result.push(new TreeFragment(from, to, mount.tree, -startPos, frag.from >= startPos || frag.openStart, frag.to <= endPos || frag.openEnd));
|
|
1814
1818
|
}
|
|
1815
1819
|
}
|
|
1816
1820
|
return result;
|
package/dist/index.js
CHANGED
|
@@ -317,6 +317,10 @@ class Tree {
|
|
|
317
317
|
/// position. If 1, it'll move into nodes that start at the
|
|
318
318
|
/// position. With 0, it'll only enter nodes that cover the position
|
|
319
319
|
/// from both sides.
|
|
320
|
+
///
|
|
321
|
+
/// Note that this will not enter
|
|
322
|
+
/// [overlays](#common.MountedTree.overlay), and you often want
|
|
323
|
+
/// [`resolveInner`](#common.Tree.resolveInner) instead.
|
|
320
324
|
resolve(pos, side = 0) {
|
|
321
325
|
let node = resolveNode(CachedNode.get(this) || this.topNode, pos, side, false);
|
|
322
326
|
CachedNode.set(this, node);
|
|
@@ -1799,14 +1803,14 @@ function enterFragments(mounts, ranges) {
|
|
|
1799
1803
|
for (let i = 0, pos = from;; i++) {
|
|
1800
1804
|
let last = i == changes.length, end = last ? to : changes[i].from;
|
|
1801
1805
|
if (end > pos)
|
|
1802
|
-
result.push(new TreeFragment(pos, end, mount.tree, -startPos, frag.from >= pos, frag.to <= end));
|
|
1806
|
+
result.push(new TreeFragment(pos, end, mount.tree, -startPos, frag.from >= pos || frag.openStart, frag.to <= end || frag.openEnd));
|
|
1803
1807
|
if (last)
|
|
1804
1808
|
break;
|
|
1805
1809
|
pos = changes[i].to;
|
|
1806
1810
|
}
|
|
1807
1811
|
}
|
|
1808
1812
|
else {
|
|
1809
|
-
result.push(new TreeFragment(from, to, mount.tree, -startPos, frag.from >= startPos, frag.to <= endPos));
|
|
1813
|
+
result.push(new TreeFragment(from, to, mount.tree, -startPos, frag.from >= startPos || frag.openStart, frag.to <= endPos || frag.openEnd));
|
|
1810
1814
|
}
|
|
1811
1815
|
}
|
|
1812
1816
|
return result;
|