Skip to content

feat: support sftool stub bin and config - #52

Closed
HalfSweet wants to merge 1 commit into
mainfrom
codex/sftool-stub-config
Closed

feat: support sftool stub bin and config#52
HalfSweet wants to merge 1 commit into
mainfrom
codex/sftool-stub-config

Conversation

@HalfSweet

Copy link
Copy Markdown
Collaborator

feat: support sftool stub bin and config

Copilot AI review requested due to automatic review settings June 11, 2026 08:18
@HalfSweet HalfSweet closed this Jun 11, 2026
@HalfSweet
HalfSweet deleted the codex/sftool-stub-config branch June 11, 2026 08:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for configuring an external sftool stub binary and/or stub_config JSON in the VS Code extension, persists the selection in workspace state, surfaces it in the sidebar, and injects the corresponding CLI flags into the generated sftool download command.

Changes:

  • Add buildSftoolStubArgs helper (plus unit tests) to generate --stub / --stub-config CLI arguments.
  • Persist stub settings in WorkspaceStateService and expose a new command/UI flow (extension.configureSftoolStub) to configure/clear them.
  • Display stub status in the sidebar and include stub args when building the sftool download command.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/utils/sftoolCommandUtils.ts New helper for quoting and composing sftool stub CLI arguments.
src/test/sftoolCommandUtils.test.ts Unit tests for the stub argument builder.
src/services/workspaceStateService.ts Adds workspace-state keys/defaults + getters/setters for stub paths.
src/services/boardService.ts Appends configured stub args to the generated sftool download command.
src/providers/sifliSidebarProvider.ts Adds sidebar item showing stub source/status + refresh on state change.
src/extension.ts Registers new configureSftoolStub command.
src/commands/configCommands.ts Implements QuickPick + file pickers to configure/clear stub paths.
package.json Contributes the new command to VS Code.
package.nls.json Adds command title localization key (EN).
package.nls.zh-cn.json Adds command title localization key (ZH-CN).
l10n/bundle.l10n.json Adds runtime UI strings for stub configuration (EN).
l10n/bundle.l10n.zh-cn.json Adds runtime UI strings for stub configuration (ZH-CN).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +6 to +8
export function quoteSftoolCommandArg(value: string): string {
return `"${value}"`;
}
Comment on lines +319 to +330
private getSftoolStubStatusLabel(stubPath: string, stubConfigPath: string): string {
if (stubPath && stubConfigPath) {
return vscode.l10n.t('External bin + config');
}
if (stubPath) {
return vscode.l10n.t('External bin');
}
if (stubConfigPath) {
return vscode.l10n.t('Stub config');
}
return vscode.l10n.t('Embedded');
}
Comment on lines +1 to +31
import * as assert from 'assert';
import { describe, it } from 'mocha';
import { buildSftoolStubArgs } from '../utils/sftoolCommandUtils';

describe('sftoolCommandUtils', () => {
it('omits stub arguments when no stub settings are configured', () => {
assert.strictEqual(buildSftoolStubArgs({}), '');
assert.strictEqual(buildSftoolStubArgs({ stubPath: '', stubConfigPath: ' ' }), '');
});

it('builds an external stub bin argument', () => {
assert.strictEqual(buildSftoolStubArgs({ stubPath: '/tmp/custom stub.bin' }), '--stub "/tmp/custom stub.bin"');
});

it('builds a stub_config JSON argument', () => {
assert.strictEqual(
buildSftoolStubArgs({ stubConfigPath: '/tmp/stub config.json' }),
'--stub-config "/tmp/stub config.json"'
);
});

it('keeps stub arguments before the command when both are configured', () => {
assert.strictEqual(
buildSftoolStubArgs({
stubPath: '/tmp/custom stub.bin',
stubConfigPath: '/tmp/stub config.json',
}),
'--stub "/tmp/custom stub.bin" --stub-config "/tmp/stub config.json"'
);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants