From c406dbf1c4321f233647857c392c97e7edff9920 Mon Sep 17 00:00:00 2001 From: John Stearns Date: Fri, 1 Nov 2024 15:48:56 -0700 Subject: [PATCH] Remove ellipsis.yaml and address vscode compatibility issue --- ellipsis.yaml | 22 -------------- src/integrations/terminal/TerminalManager.ts | 31 +++++++++++--------- 2 files changed, 17 insertions(+), 36 deletions(-) delete mode 100644 ellipsis.yaml diff --git a/ellipsis.yaml b/ellipsis.yaml deleted file mode 100644 index e72886cf32..0000000000 --- a/ellipsis.yaml +++ /dev/null @@ -1,22 +0,0 @@ -version: 1.3 -pr_review: - - # Modify confidence_threshold to show fewer/more comments. Increase this to show fewer, but higher quality comments. - # If there’s too much noise, we suggest 0.9. The default value is 0.7. - confidence_threshold: 0.7 - - # If quiet mode is enabled, Ellipsis will only leave reviews when it has comments, so “Looks good to me” reviews - # will be skipped. This can reduce clutter. - quiet: false - - # You can disable automatic code review using auto_review_enabled. This will override any global settings you - # have configured via the web UI. - auto_review_enabled: true - - # You can enable auto-review on draft PRs using auto_review_draft. This will override any global settings you - # have configured via the web UI. - auto_review_draft: false - - # You can allow Ellipsis to approve PRs using enable_approve_prs. Note: in common branch GitHub protection configurations, - # the Ellipsis approval will count towards the approval total and allow the PR to be merged when it otherwise may not be. - enable_approve_prs: false diff --git a/src/integrations/terminal/TerminalManager.ts b/src/integrations/terminal/TerminalManager.ts index 6c553fcbca..7dd62993f0 100644 --- a/src/integrations/terminal/TerminalManager.ts +++ b/src/integrations/terminal/TerminalManager.ts @@ -70,15 +70,6 @@ Interestingly, some environments like Cursor enable these APIs even without the This approach allows us to leverage advanced features when available while ensuring broad compatibility. */ declare module "vscode" { - // https://github.com/microsoft/vscode/blob/f0417069c62e20f3667506f4b7e53ca0004b4e3e/src/vscode-dts/vscode.d.ts#L7442 - interface Terminal { - shellIntegration?: { - cwd?: vscode.Uri - executeCommand?: (command: string) => { - read: () => AsyncIterable - } - } - } // https://github.com/microsoft/vscode/blob/f0417069c62e20f3667506f4b7e53ca0004b4e3e/src/vscode-dts/vscode.d.ts#L10794 interface Window { onDidStartTerminalShellExecution?: ( @@ -89,6 +80,16 @@ declare module "vscode" { } } +// Extend the Terminal type to include our custom properties +type ExtendedTerminal = vscode.Terminal & { + shellIntegration?: { + cwd?: vscode.Uri + executeCommand?: (command: string) => { + read: () => AsyncIterable + } + } +} + export class TerminalManager { private terminalIds: Set = new Set() private processes: Map = new Map() @@ -139,16 +140,17 @@ export class TerminalManager { }) // if shell integration is already active, run the command immediately - if (terminalInfo.terminal.shellIntegration) { + const terminal = terminalInfo.terminal as ExtendedTerminal + if (terminal.shellIntegration) { process.waitForShellIntegration = false - process.run(terminalInfo.terminal, command) + process.run(terminal, command) } else { // docs recommend waiting 3s for shell integration to activate - pWaitFor(() => terminalInfo.terminal.shellIntegration !== undefined, { timeout: 4000 }).finally(() => { + pWaitFor(() => (terminalInfo.terminal as ExtendedTerminal).shellIntegration !== undefined, { timeout: 4000 }).finally(() => { const existingProcess = this.processes.get(terminalInfo.id) if (existingProcess && existingProcess.waitForShellIntegration) { existingProcess.waitForShellIntegration = false - existingProcess.run(terminalInfo.terminal, command) + existingProcess.run(terminal, command) } }) } @@ -162,7 +164,8 @@ export class TerminalManager { if (t.busy) { return false } - const terminalCwd = t.terminal.shellIntegration?.cwd // one of cline's commands could have changed the cwd of the terminal + const terminal = t.terminal as ExtendedTerminal + const terminalCwd = terminal.shellIntegration?.cwd // one of cline's commands could have changed the cwd of the terminal if (!terminalCwd) { return false }