in playground/tree-sitter/concrete-syntax.js [739:766]
window.initializePlayground = function(options) {
const result = originalInitializePlayground ? originalInitializePlayground(options) : null;
// Set up multiple checks to ensure playground is ready
let setupAttempts = 0;
const maxAttempts = 50; // 5 seconds total
const checkPlayground = setInterval(() => {
setupAttempts++;
if (window.playground && window.playground.codeEditor) {
clearInterval(checkPlayground);
debugLog('Playground fully accessible for concrete syntax integration');
// Give it a bit more time to ensure everything is initialized
setTimeout(() => {
setupPlaygroundIntegration();
}, 100);
} else if (setupAttempts >= maxAttempts) {
clearInterval(checkPlayground);
debugLog('Timeout waiting for playground initialization');
// Try setup anyway in case some parts work
setupPlaygroundIntegration();
}
}, 100);
return result;
};