Skip to content

Commit

Permalink
feat(dev): remote -b short option and other rename
Browse files Browse the repository at this point in the history
  • Loading branch information
tomgao365 committed Jun 10, 2024
1 parent d14fe9a commit 3f9922e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/vscode-dev/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ cli
.option('--dts-name [dtsName]', 'Specify the output file name of d.ts', {
default: 'vscode.d.ts',
})
.option('-b, --builtin [...builtin]', 'Builtin commands')
.option('--builtin [...builtin]', 'Builtin commands')
.option('-w, --watch', 'Watch mode')
.option('--verbose', 'Display verbose output')
.action(async (cwd: string, options: CLIOptions) => {
Expand Down
16 changes: 8 additions & 8 deletions packages/vscode-dev/src/gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,15 @@ function getDtsType(types: string[]) {

function getCommandDts(pkg: IExtensionManifest, opts: CLIOptions) {
const commands = pkg?.contributes?.commands || [];
const command = getDtsType(commands.map(s => s.command));
const builtin = getDtsType([...new Set(opts.builtin || [])]);
if (!command && !builtin) {
const commandType = getDtsType(commands.map(s => s.command));
const builtinType = getDtsType([...new Set(opts.builtin || [])]);
if (!commandType && !builtinType) {
return '';
}

return /* ts */ `
export type BuiltinCommand = ${builtin || 'undefined'};
export type UserCommand = ${command || 'undefined'};
export type BuiltinCommand = ${builtinType || 'undefined'};
export type UserCommand = ${commandType || 'undefined'};
export namespace commands {
Expand Down Expand Up @@ -195,14 +195,14 @@ function getViewDts(pkg: IExtensionManifest) {
return acc.concat(ids);
}, [] as string[]);

const viewType = getDtsType(viewIds);
if (!viewType) {
const dtsType = getDtsType(viewIds);
if (!dtsType) {
return '';
}

return /* ts */ `
export namespace window {
type ViewId = ${viewType};
type ViewId = ${dtsType};
export function registerTreeDataProvider<T>(viewId: ViewId, treeDataProvider: TreeDataProvider<T>): Disposable;
export function createTreeView<T>(viewId: ViewId, options: TreeViewOptions<T>): TreeView<T>;
Expand Down
8 changes: 8 additions & 0 deletions packages/vscode-dev/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ export interface CLIOptions {
* builtin commands
*/
builtin?: string[];
/**
* A dot-separated identifier for the configuration
*
* When a section-identifier is provided only that part of the configuration
* is returned. Dots in the section-identifier are interpreted as child-access,
* like `{ myExt: { setting: { doIt: true }}}` and `getConfiguration('myExt.setting').get('doIt') === true`.
*/
identifier?: string;
/**
* watch files change
* @default false
Expand Down

0 comments on commit 3f9922e

Please sign in to comment.