diff --git a/src/createLog.ts b/src/createLog.ts index ed22262..4c8e3e0 100644 --- a/src/createLog.ts +++ b/src/createLog.ts @@ -25,8 +25,9 @@ export function createLog(name: string, options = { info: '🔵', error: '🔴', debug: '🟢', + languageId: '', }) { - const outputChannel = createOutputChannel(name) + const outputChannel = createOutputChannel(name, options.languageId) return { show: () => { outputChannel.show() diff --git a/src/updateText.ts b/src/updateText.ts index f9c5b6b..d7b12cb 100644 --- a/src/updateText.ts +++ b/src/updateText.ts @@ -5,8 +5,19 @@ import { getActiveTextEditor } from './getActiveTextEditor' * 操作当前激活文件的数据比如更新、替换、新增等 * @param callback */ -export function updateText(callback: (editBuilder: TextEditorEdit) => void) { +export function updateText(callback: (editBuilder: TextEditorEdit) => void, options?: { + /** + * Add undo stop before making the edits. + */ + readonly undoStopBefore: boolean + /** + * Add undo stop after making the edits. + */ + readonly undoStopAfter: boolean +}) { const activeTextEditor = getActiveTextEditor() if (activeTextEditor) - activeTextEditor.edit(callback) + return activeTextEditor.edit(callback, options) + + return Promise.resolve(false) }