From d4835da7dd1de59843fb9fc478eab59a47fc2b60 Mon Sep 17 00:00:00 2001 From: nekowasabi Date: Sun, 4 Aug 2024 20:57:08 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20aIDER=E3=82=B3=E3=83=9E=E3=83=B3?= =?UTF-8?q?=E3=83=89=E3=81=AE=E5=AE=9F=E8=A3=85=E3=82=92=E6=95=B4=E7=90=86?= =?UTF-8?q?=20=E2=99=BB=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- denops/aider/aiderCommand.ts | 11 +++++++++++ denops/aider/main.ts | 9 +-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/denops/aider/aiderCommand.ts b/denops/aider/aiderCommand.ts index 5248a1e..dcd066a 100644 --- a/denops/aider/aiderCommand.ts +++ b/denops/aider/aiderCommand.ts @@ -10,6 +10,17 @@ export const aiderCommand = { await denops.cmd("b#"); }, + async openIgnore(denops: Denops): Promise { + const gitRoot = (await fn.system(denops, "git rev-parse --show-toplevel")) + .trim(); + const filePathToOpen = `${gitRoot}/.aiderignore`; + if (await fn.filereadable(denops, filePathToOpen)) { + await denops.cmd(`edit ${filePathToOpen}`); + return; + } + console.log(".aiderignoreファイルが見つかりません。"); + }, + async run(denops: Denops): Promise { const aiderCommand = ensure( await v.g.get(denops, "aider_command"), diff --git a/denops/aider/main.ts b/denops/aider/main.ts index c36ed4e..5f6522f 100644 --- a/denops/aider/main.ts +++ b/denops/aider/main.ts @@ -59,14 +59,7 @@ export async function main(denops: Denops): Promise { } }, async openIgnore(): Promise { - const gitRoot = (await fn.system(denops, "git rev-parse --show-toplevel")) - .trim(); - const filePathToOpen = `${gitRoot}/.aiderignore`; - if (await fn.filereadable(denops, filePathToOpen)) { - await denops.cmd(`edit ${filePathToOpen}`); - return; - } - console.log("No .aiderignore file found."); + await aiderCommand.openIgnore(denops); }, async debug(): Promise { await aiderCommand.debug(denops);