Skip to content

Commit

Permalink
chore(createLog): add languageId param
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon-He95 committed Nov 30, 2024
1 parent ad19ab1 commit 1a87d20
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/createLog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
15 changes: 13 additions & 2 deletions src/updateText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit 1a87d20

Please sign in to comment.