{"record":{"id":"7343d0cc578dd4d9","repo":"ajaxorg/ace","slug":"use-of-document-removelines-is-deprecated-use-the","errorCode":null,"errorMessage":"Use of document.removeLines is deprecated. Use the removeFullLines method instead.","messagePattern":"Use of document\\.removeLines is deprecated\\. Use the removeFullLines method instead\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/document.js","lineNumber":213,"sourceCode":"     * @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}\n     \n     * @deprecated\n     */\n    insertNewLine(position) {\n        console.warn(\"Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead.\");\n        return this.insertMergedLines(position, [\"\", \"\"]);\n    }\n\n    /**\n     * Inserts a block of `text` at the indicated `position`.\n     * @param {Point} position The position to start inserting at; it's an object that looks like `{ row: row, column: column}`\n     * @param {String} text A chunk of text to insert","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/ajaxorg/ace/blob/2c1eddc392eb92cf222a4478f1893d2b2c354fb0/src/document.js#L195-L231","documentation":"A deprecation warning printed by Document.removeLines. The method delegates to removeFullLines and behaves identically; the rename clarified that entire rows are removed.","triggerScenarios":"Calling session.doc.removeLines(firstRow, lastRow) in code using the legacy Document API.","commonSituations":"Legacy plugins or copied snippets manipulating document lines directly; long-lived codebases upgraded across Ace versions.","solutions":["Replace doc.removeLines(firstRow, lastRow) with doc.removeFullLines(firstRow, lastRow)","If you actually want to delete a text range, use doc.remove(range) with an Ace Range instead","Search the codebase for 'removeLines(' and migrate all call sites at once","Safe to ignore short-term — it is only a console.warn"],"exampleFix":"// before\ndoc.removeLines(3, 5);\n// after\ndoc.removeFullLines(3, 5);","handlingStrategy":"validation","validationCode":"if (typeof doc.removeFullLines !== 'function') throw new Error('removeFullLines unavailable; upgrade ace');\ndoc.removeFullLines(firstRow, lastRow);","typeGuard":"function hasRemoveFullLines(doc) { return doc && typeof doc.removeFullLines === 'function'; }","tryCatchPattern":"try {\n  doc.removeFullLines(firstRow, lastRow);\n} catch (e) {\n  console.error('line remove failed', e);\n}","preventionTips":["Use removeFullLines for whole-row removal and doc.remove(range) for text ranges","Treat console.warn output in tests as actionable deprecation signals","Keep ace version pinned so API surface is known"],"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"}