소스 검색

Removes Directive namespace

main
Eric Amodio 1 년 전
부모
커밋
c8f6cc84d6
3개의 변경된 파일6개의 추가작업 그리고 8개의 파일을 삭제
  1. +2
    -2
      src/commands/gitCommands.ts
  2. +2
    -2
      src/commands/quickCommand.ts
  3. +2
    -4
      src/quickpicks/items/directive.ts

+ 2
- 2
src/commands/gitCommands.ts 파일 보기

@ -4,7 +4,7 @@ import { configuration } from '../configuration';
import { Commands } from '../constants';
import { Container } from '../container';
import type { KeyMapping } from '../keyboard';
import { Directive, DirectiveQuickPickItem } from '../quickpicks/items/directive';
import { Directive, DirectiveQuickPickItem, isDirective } from '../quickpicks/items/directive';
import { command } from '../system/command';
import { log } from '../system/decorators/log';
import type { Deferred } from '../system/promise';
@ -295,7 +295,7 @@ export class GitCommandsCommand extends Command {
const result = await step.show(step);
if (result === StepResult.Break) return undefined;
if (Directive.is(result)) {
if (isDirective(result)) {
switch (result) {
case Directive.Back:
return (await commandsStep?.command?.previous()) ?? commandsStep;

+ 2
- 2
src/commands/quickCommand.ts 파일 보기

@ -2,7 +2,7 @@ import type { InputBox, QuickInputButton, QuickPick, QuickPickItem } from 'vscod
import { configuration } from '../configuration';
import type { Container } from '../container';
import type { Keys } from '../keyboard';
import { Directive, DirectiveQuickPickItem } from '../quickpicks/items/directive';
import { Directive, DirectiveQuickPickItem, isDirective } from '../quickpicks/items/directive';
export * from './quickCommand.buttons';
export * from './quickCommand.steps';
@ -298,7 +298,7 @@ export namespace QuickCommand {
result: Directive | StepItemType<T>,
): result is StepItemType<T> {
if (result == null) return false;
if (Directive.is(result)) {
if (isDirective(result)) {
switch (result) {
case Directive.Back:
state.counter--;

+ 2
- 4
src/quickpicks/items/directive.ts 파일 보기

@ -13,10 +13,8 @@ export enum Directive {
StartPreviewTrial,
}
export namespace Directive {
export function is<T>(value: Directive | T): value is Directive {
return typeof value === 'number' && Directive[value] != null;
}
export function isDirective<T>(value: Directive | T): value is Directive {
return typeof value === 'number' && Directive[value] != null;
}
export interface DirectiveQuickPickItem extends QuickPickItem {

불러오는 중...
취소
저장