-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #326 from arbs-io:feature/20250226-SplitCommands
Feature/20250226-SplitCommands
- Loading branch information
Showing
31 changed files
with
93 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export interface ICommand { | ||
readonly id: string | ||
|
||
execute(...args: any[]): void | Promise<void> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import { ExtensionContext } from 'vscode' | ||
import { Command } from '@app/commands' | ||
import { ICommand } from '@app/commands' | ||
import { ConfigurationQuickPickProvider } from '@app/providers' | ||
|
||
export default class SettingsCommand implements Command { | ||
export default class SettingsCommand implements ICommand { | ||
public readonly id = 'vscode-openai.configuration.show.quickpick' | ||
private _configurationQuickPick: ConfigurationQuickPickProvider | ||
public constructor(context: ExtensionContext) { | ||
this._configurationQuickPick = | ||
ConfigurationQuickPickProvider.getInstance(context) | ||
} | ||
|
||
public async execute(): Promise<void> { | ||
await this._configurationQuickPick.execute() | ||
public async execute() { | ||
this._configurationQuickPick.execute() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import { ExtensionContext } from 'vscode' | ||
import { Command } from '@app/commands' | ||
import { ICommand } from '@app/commands' | ||
import { quickPickCreateConversation } from '@app/utilities/quickPicks' | ||
|
||
export default class NewConversationPersonaCommand implements Command { | ||
export default class NewConversationPersonaCommand implements ICommand { | ||
public readonly id = 'vscode-openai.conversation.new.persona' | ||
public constructor(private _context: ExtensionContext) {} | ||
|
||
public async execute(): Promise<void> { | ||
await quickPickCreateConversation(this._context) | ||
public async execute() { | ||
quickPickCreateConversation(this._context) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import { Command } from '@app/commands' | ||
import { ICommand } from '@app/commands' | ||
import { ConversationStorageService } from '@app/services' | ||
|
||
export default class RefreshConversationsCommand implements Command { | ||
export default class RefreshConversationsCommand implements ICommand { | ||
public readonly id = '_vscode-openai.conversations.refresh' | ||
|
||
public async execute(): Promise<void> { | ||
public async execute() { | ||
ConversationStorageService.instance.refresh() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
import { Command } from '@app/commands' | ||
import { ICommand } from '@app/commands' | ||
import { getSystemPersonas } from '@app/models' | ||
import { | ||
compareResultsToClipboard, | ||
getEditorPrompt, | ||
} from '@app/utilities/editor' | ||
import { VSCODE_OPENAI_QP_PERSONA } from '@app/constants' | ||
|
||
export default class CodeCommentCommand implements Command { | ||
export default class CodeCommentCommand implements ICommand { | ||
public readonly id = '_vscode-openai.editor.code.comment' | ||
|
||
public async execute(): Promise<void> { | ||
public async execute() { | ||
const prompt = await getEditorPrompt('editor.code.comment') | ||
const persona = getSystemPersonas().find( | ||
(a) => a.roleName === VSCODE_OPENAI_QP_PERSONA.DEVELOPER | ||
) | ||
await compareResultsToClipboard(persona, prompt) | ||
compareResultsToClipboard(persona, prompt) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
import { Command } from '@app/commands' | ||
import { ICommand } from '@app/commands' | ||
import { getSystemPersonas } from '@app/models' | ||
import { | ||
compareResultsToClipboard, | ||
getEditorPrompt, | ||
} from '@app/utilities/editor' | ||
import { VSCODE_OPENAI_QP_PERSONA } from '@app/constants' | ||
|
||
export default class CodeExplainCommand implements Command { | ||
export default class CodeExplainCommand implements ICommand { | ||
public readonly id = '_vscode-openai.editor.code.explain' | ||
|
||
public async execute(): Promise<void> { | ||
public async execute() { | ||
const prompt = await getEditorPrompt('editor.code.explain') | ||
const persona = getSystemPersonas().find( | ||
(a) => a.roleName === VSCODE_OPENAI_QP_PERSONA.DEVELOPER | ||
) | ||
await compareResultsToClipboard(persona, prompt) | ||
compareResultsToClipboard(persona, prompt) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
import { Command } from '@app/commands' | ||
import { ICommand } from '@app/commands' | ||
import { getSystemPersonas } from '@app/models' | ||
import { | ||
compareResultsToClipboard, | ||
getEditorPrompt, | ||
} from '@app/utilities/editor' | ||
import { VSCODE_OPENAI_QP_PERSONA } from '@app/constants' | ||
|
||
export default class CodeOptimizeCommand implements Command { | ||
export default class CodeOptimizeCommand implements ICommand { | ||
public readonly id = '_vscode-openai.editor.code.optimize' | ||
|
||
public async execute(): Promise<void> { | ||
public async execute() { | ||
const prompt = await getEditorPrompt('editor.code.optimize') | ||
const persona = getSystemPersonas().find( | ||
(a) => a.roleName === VSCODE_OPENAI_QP_PERSONA.DEVELOPER | ||
) | ||
await compareResultsToClipboard(persona, prompt) | ||
compareResultsToClipboard(persona, prompt) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
import { Command } from '@app/commands' | ||
import { ICommand } from '@app/commands' | ||
import { getSystemPersonas } from '@app/models' | ||
import { | ||
compareResultsToClipboard, | ||
getEditorPrompt, | ||
} from '@app/utilities/editor' | ||
import { VSCODE_OPENAI_QP_PERSONA } from '@app/constants' | ||
|
||
export default class CodePatternsCommand implements Command { | ||
export default class CodePatternsCommand implements ICommand { | ||
public readonly id = '_vscode-openai.editor.code.pattern' | ||
|
||
public async execute(): Promise<void> { | ||
public async execute() { | ||
const prompt = await getEditorPrompt('editor.code.pattern') | ||
const persona = getSystemPersonas().find( | ||
(a) => a.roleName === VSCODE_OPENAI_QP_PERSONA.DEVELOPER | ||
) | ||
await compareResultsToClipboard(persona, prompt) | ||
compareResultsToClipboard(persona, prompt) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.