{"record":{"id":"63028765d8c17a08","repo":"ajaxorg/ace","slug":"use-of-document-insertlines-is-deprecated-use-the","errorCode":null,"errorMessage":"Use of document.insertLines is deprecated. Use the insertFullLines method instead.","messagePattern":"Use of document\\.insertLines is deprecated\\. Use the insertFullLines method instead\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/document.js","lineNumber":201,"sourceCode":"            // Handle a multi-line range.\n            lines = this.getLines(range.start.row, range.end.row);\n            lines[0] = (lines[0] || \"\").substring(range.start.column);\n            var l = lines.length - 1;\n            if (range.end.row - range.start.row == l)\n                lines[l] = lines[l].substring(0, range.end.column);\n        }\n        return lines;\n    }\n\n    // Deprecated methods retained for backwards compatibility.\n    /**\n     * @param row\n     * @param lines\n     \n     * @deprecated\n     */\n    insertLines(row, lines) {\n        console.warn(\"Use of document.insertLines is deprecated. Use the insertFullLines method instead.\");\n        return this.insertFullLines(row, lines);\n    }\n\n    /**\n     * @param firstRow\n     * @param lastRow\n     * @returns {String[]}\n     \n     * @deprecated\n     */\n    removeLines(firstRow, lastRow) {\n        console.warn(\"Use of document.removeLines is deprecated. Use the removeFullLines method instead.\");\n        return this.removeFullLines(firstRow, lastRow);\n    }\n\n    /**\n     * @param position\n     * @returns {Point}","sourceCodeStart":183,"sourceCodeEnd":219,"githubUrl":"https://github.com/ajaxorg/ace/blob/2c1eddc392eb92cf222a4478f1893d2b2c354fb0/src/document.js#L183-L219","documentation":"A deprecation warning printed by Document.insertLines. The method still works — it delegates to insertFullLines — but the API was renamed to reflect that it inserts complete lines, and callers are expected to migrate.","triggerScenarios":"Calling session.doc.insertLines(row, lines) or document.insertLines directly in code written against the old Ace Document API.","commonSituations":"Old editor plugins and legacy codebases ported forward across Ace versions; tutorials or snippets predating the API rename.","solutions":["Replace doc.insertLines(row, lines) with doc.insertFullLines(row, lines)","If you want silent text insertion rather than whole-line semantics, use doc.insert(position, text) instead","Audit wrapper libraries for passthrough calls to insertLines","Acknowledge the warning as benign until migration is done — behavior is unchanged"],"exampleFix":"// before\ndoc.insertLines(5, ['foo', 'bar']);\n// after\ndoc.insertFullLines(5, ['foo', 'bar']);","handlingStrategy":"validation","validationCode":"if (typeof doc.insertFullLines !== 'function') throw new Error('insertFullLines unavailable; upgrade ace');\ndoc.insertFullLines(row, lines);","typeGuard":"function hasFullLinesApi(doc) { return doc && typeof doc.insertFullLines === 'function'; }","tryCatchPattern":"try {\n  doc.insertFullLines(row, lines);\n} catch (e) {\n  console.error('line insert failed', e);\n}","preventionTips":["Migrate to insertFullLines/removeFullLines/insertMergedLines across the board","Run tests with console warnings visible so deprecations surface in CI","Avoid wrapping Document methods in your own facade that may lag the API"],"tags":["deprecation","document-api","console-warning"],"backgroundTag":"deprecated-api-migration","analyzedSha":"2c1eddc392eb92cf222a4478f1893d2b2c354fb0","analyzedAt":"2026-08-30T00:39:52.222Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}