@codemirror/language 6.3.1 → 6.3.2
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 +8 -2
- package/dist/index.js +8 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -183,7 +183,13 @@ up to that point if the tree isn't already available.
|
|
|
183
183
|
function ensureSyntaxTree(state, upto, timeout = 50) {
|
|
184
184
|
var _a;
|
|
185
185
|
let parse = (_a = state.field(Language.state, false)) === null || _a === void 0 ? void 0 : _a.context;
|
|
186
|
-
|
|
186
|
+
if (!parse)
|
|
187
|
+
return null;
|
|
188
|
+
let oldVieport = parse.viewport;
|
|
189
|
+
parse.updateViewport({ from: 0, to: upto });
|
|
190
|
+
let result = parse.isDone(upto) || parse.work(timeout, upto) ? parse.tree : null;
|
|
191
|
+
parse.updateViewport(oldVieport);
|
|
192
|
+
return result;
|
|
187
193
|
}
|
|
188
194
|
/**
|
|
189
195
|
Queries whether there is a full syntax tree available up to the
|
|
@@ -1682,7 +1688,7 @@ A default highlight style (works well with light themes).
|
|
|
1682
1688
|
*/
|
|
1683
1689
|
const defaultHighlightStyle = HighlightStyle.define([
|
|
1684
1690
|
{ tag: highlight.tags.meta,
|
|
1685
|
-
color: "#
|
|
1691
|
+
color: "#404740" },
|
|
1686
1692
|
{ tag: highlight.tags.link,
|
|
1687
1693
|
textDecoration: "underline" },
|
|
1688
1694
|
{ tag: highlight.tags.heading,
|
package/dist/index.js
CHANGED
|
@@ -179,7 +179,13 @@ up to that point if the tree isn't already available.
|
|
|
179
179
|
function ensureSyntaxTree(state, upto, timeout = 50) {
|
|
180
180
|
var _a;
|
|
181
181
|
let parse = (_a = state.field(Language.state, false)) === null || _a === void 0 ? void 0 : _a.context;
|
|
182
|
-
|
|
182
|
+
if (!parse)
|
|
183
|
+
return null;
|
|
184
|
+
let oldVieport = parse.viewport;
|
|
185
|
+
parse.updateViewport({ from: 0, to: upto });
|
|
186
|
+
let result = parse.isDone(upto) || parse.work(timeout, upto) ? parse.tree : null;
|
|
187
|
+
parse.updateViewport(oldVieport);
|
|
188
|
+
return result;
|
|
183
189
|
}
|
|
184
190
|
/**
|
|
185
191
|
Queries whether there is a full syntax tree available up to the
|
|
@@ -1678,7 +1684,7 @@ A default highlight style (works well with light themes).
|
|
|
1678
1684
|
*/
|
|
1679
1685
|
const defaultHighlightStyle = /*@__PURE__*/HighlightStyle.define([
|
|
1680
1686
|
{ tag: tags.meta,
|
|
1681
|
-
color: "#
|
|
1687
|
+
color: "#404740" },
|
|
1682
1688
|
{ tag: tags.link,
|
|
1683
1689
|
textDecoration: "underline" },
|
|
1684
1690
|
{ tag: tags.heading,
|