@kkdev92/vscode-ext-kit - v4.1.1
    Preparing search index...

    Interface EditorService

    Reading and editing text.

    module.commands.handle(Upper, {
    inject: { editors: Editors },
    execute: async (_context, _args, { editors }) => {
    const editor = editors.active;
    if (editor === undefined) return false;
    return editor.transformSelection((text) => text.toUpperCase());
    },
    });
    interface EditorService {
        active: ActiveEditor | undefined;
        editFiles(
            edits: readonly WorkspaceTextEdit[],
            options?: WorkspaceEditOptions,
        ): Promise<boolean>;
    }
    Index
    active: ActiveEditor | undefined

    The editor focused at the moment this property is read, or undefined when none is. Read again after an await if the current focus matters.

    • Applies replacements across any number of files as one transaction. The files need not be open, which is what separates this from ActiveEditor.edit. Resolves false when the workspace edit is refused and rejects on an adapter failure.

      Parameters

      Returns Promise<boolean>

      await editors.editFiles(
      matches.map((m) => ({ uri: m.uri, range: m.range, text: m.replacement })),
      { label: 'Rename symbol across files' }
      );