diff --git a/docs/src/assets/js/playground.js b/docs/src/assets/js/playground.js index 2b4b5708..ef65c371 100644 --- a/docs/src/assets/js/playground.js +++ b/docs/src/assets/js/playground.js @@ -61,7 +61,7 @@ function initializeCustomSelect({ initialValue = null, addListeners = false }) { } window.initializePlayground = async (opts) => { - const { Parser, Language } = window.TreeSitter; + const { Parser, Language, Query } = window.TreeSitter; const { local } = opts; if (local) { @@ -357,11 +357,10 @@ window.initializePlayground = async (opts) => { marks.forEach((m) => m.clear()); if (tree && query) { - const captures = query.captures( - tree.rootNode, - { row: startRow, column: 0 }, - { row: endRow, column: 0 }, - ); + const captures = query.captures(tree.rootNode, { + startPosition: { row: startRow, column: 0 }, + endPosition: { row: endRow, column: 0 }, + }); let lastNodeId; for (const { name, node } of captures) { if (node.id === lastNodeId) continue; @@ -410,7 +409,7 @@ window.initializePlayground = async (opts) => { const queryText = queryEditor.getValue(); try { - query = parser.language.query(queryText); + query = new Query(parser.language, queryText); let match; let row = 0;