@codemirror/autocomplete 6.0.2 → 6.0.3
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/CHANGELOG.md +6 -0
- package/dist/index.cjs +9 -1
- package/dist/index.js +9 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1662,10 +1662,18 @@ function nodeStart(state, pos) {
|
|
|
1662
1662
|
return tree.parent && tree.from == pos;
|
|
1663
1663
|
}
|
|
1664
1664
|
function probablyInString(state, pos, quoteToken) {
|
|
1665
|
+
console.log('check pos', pos);
|
|
1665
1666
|
let node = language.syntaxTree(state).resolveInner(pos, -1);
|
|
1666
1667
|
for (let i = 0; i < 5; i++) {
|
|
1667
|
-
if (state.sliceDoc(node.from, node.from + quoteToken.length) == quoteToken)
|
|
1668
|
+
if (state.sliceDoc(node.from, node.from + quoteToken.length) == quoteToken) {
|
|
1669
|
+
let first = node.firstChild;
|
|
1670
|
+
while (first && first.from == node.from && first.to - first.from > quoteToken.length) {
|
|
1671
|
+
if (state.sliceDoc(first.to - quoteToken.length, first.to) == quoteToken)
|
|
1672
|
+
return false;
|
|
1673
|
+
first = first.firstChild;
|
|
1674
|
+
}
|
|
1668
1675
|
return true;
|
|
1676
|
+
}
|
|
1669
1677
|
let parent = node.to == pos && node.parent;
|
|
1670
1678
|
if (!parent)
|
|
1671
1679
|
break;
|
package/dist/index.js
CHANGED
|
@@ -1658,10 +1658,18 @@ function nodeStart(state, pos) {
|
|
|
1658
1658
|
return tree.parent && tree.from == pos;
|
|
1659
1659
|
}
|
|
1660
1660
|
function probablyInString(state, pos, quoteToken) {
|
|
1661
|
+
console.log('check pos', pos);
|
|
1661
1662
|
let node = syntaxTree(state).resolveInner(pos, -1);
|
|
1662
1663
|
for (let i = 0; i < 5; i++) {
|
|
1663
|
-
if (state.sliceDoc(node.from, node.from + quoteToken.length) == quoteToken)
|
|
1664
|
+
if (state.sliceDoc(node.from, node.from + quoteToken.length) == quoteToken) {
|
|
1665
|
+
let first = node.firstChild;
|
|
1666
|
+
while (first && first.from == node.from && first.to - first.from > quoteToken.length) {
|
|
1667
|
+
if (state.sliceDoc(first.to - quoteToken.length, first.to) == quoteToken)
|
|
1668
|
+
return false;
|
|
1669
|
+
first = first.firstChild;
|
|
1670
|
+
}
|
|
1664
1671
|
return true;
|
|
1672
|
+
}
|
|
1665
1673
|
let parent = node.to == pos && node.parent;
|
|
1666
1674
|
if (!parent)
|
|
1667
1675
|
break;
|