diff --git a/.github/commands.yml b/.github/commands.yml index d2bac8edb1fb3f842ae5a0633bd3c94a68b4af5f..64fdf683bfe99740e23cf5918ce07fbdab2e8686 100644 --- a/.github/commands.yml +++ b/.github/commands.yml @@ -1,154 +1,12 @@ -# { -# perform: true, -# commands: [ -# { -# type: 'comment', -# name: 'findDuplicates', -# allowUsers: ['cleidigh', 'usernamehw', 'gjsjohnmurray', 'IllusionMH'], -# action: 'comment', -# comment: "Potential duplicates:\n${potentialDuplicates}" -# } -# ] -# } - { perform: true, commands: [ - { - type: 'comment', - name: 'question', - allowUsers: ['cleidigh', 'usernamehw', 'gjsjohnmurray', 'IllusionMH'], - action: 'updateLabels', - addLabel: '*question' - }, - { - type: 'label', - name: '*question', - allowTriggerByBot: true, - action: 'close', - comment: "Please ask your question on [StackOverflow](https://aka.ms/vscodestackoverflow). We have a great community over [there](https://aka.ms/vscodestackoverflow). They have already answered thousands of questions and are happy to answer yours as well. See also our [issue reporting](https://aka.ms/vscodeissuereporting) guidelines.\n\nHappy Coding!" - }, - { - type: 'label', - name: '*dev-question', - allowTriggerByBot: true, - action: 'close', - comment: "We have a great developer community [over on slack](https://aka.ms/vscode-dev-community) where extension authors help each other. This is a great place for you to ask questions and find support.\n\nHappy Coding!" - }, - { - type: 'label', - name: '*extension-candidate', - allowTriggerByBot: true, - action: 'close', - comment: "We try to keep VS Code lean and we think the functionality you're asking for is great for a VS Code extension. Maybe you can already find one that suits you in the [VS Code Marketplace](https://aka.ms/vscodemarketplace). Just in case, in a few simple steps you can get started [writing your own extension](https://aka.ms/vscodewritingextensions). See also our [issue reporting](https://aka.ms/vscodeissuereporting) guidelines.\n\nHappy Coding!" - }, - { - type: 'label', - name: '*not-reproducible', - allowTriggerByBot: true, - action: 'close', - comment: "We closed this issue because we are unable to reproduce the problem with the steps you describe. Chances are we've already fixed your problem in a recent version of VS Code. If not, please ask us to reopen the issue and provide us with more detail. Our [issue reporting](https://aka.ms/vscodeissuereporting) guidelines might help you with that.\n\nHappy Coding!" - }, - { - type: 'label', - name: '*out-of-scope', - allowTriggerByBot: true, - action: 'close', - comment: "We closed this issue because we don't plan to address it in the foreseeable future. You can find more detailed information about our decision-making process [here](https://aka.ms/vscode-out-of-scope). If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.\n\nIf you wonder what we are up to, please see our [roadmap](https://aka.ms/vscoderoadmap) and [issue reporting](https://aka.ms/vscodeissuereporting) guidelines.\n\nThanks for your understanding and happy coding!" - }, - { - type: 'comment', - name: 'causedByExtension', - allowUsers: ['cleidigh', 'usernamehw', 'gjsjohnmurray', 'IllusionMH'], - action: 'updateLabels', - addLabel: '*caused-by-extension' - }, - { - type: 'label', - name: '*caused-by-extension', - allowTriggerByBot: true, - action: 'close', - comment: "This issue is caused by an extension, please file it with the repository (or contact) the extension has linked in its overview in VS Code or the [marketplace](https://aka.ms/vscodemarketplace) for VS Code. See also our [issue reporting](https://aka.ms/vscodeissuereporting) guidelines.\n\nHappy Coding!" - }, - { - type: 'label', - name: '*as-designed', - allowTriggerByBot: true, - action: 'close', - comment: "The described behavior is how it is expected to work. If you disagree, please explain what is expected and what is not in more detail. See also our [issue reporting](https://aka.ms/vscodeissuereporting) guidelines.\n\nHappy Coding!" - }, - { - type: 'label', - name: '*english-please', - allowTriggerByBot: true, - action: 'close', - comment: "This issue is being closed because its description is not in English, that makes it hard for us to work on it. Please open a new issue with an English description. You might find [Bing Translator](https://www.bing.com/translator) useful." - }, - { - type: 'comment', - name: 'duplicate', - allowUsers: ['cleidigh', 'usernamehw', 'gjsjohnmurray', 'IllusionMH'], - action: 'updateLabels', - addLabel: '*duplicate' - }, - { - type: 'label', - name: '*duplicate', - allowTriggerByBot: true, - action: 'close', - comment: "Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues [here](https://aka.ms/vscodeissuesearch). See also our [issue reporting](https://aka.ms/vscodeissuereporting) guidelines.\n\nHappy Coding!" - }, - { - type: 'comment', - name: 'confirm', - allowUsers: ['cleidigh', 'usernamehw', 'gjsjohnmurray', 'IllusionMH'], - action: 'updateLabels', - addLabel: 'confirmed', - removeLabel: 'confirmation-pending' - }, - { - type: 'comment', - name: 'confirmationPending', - allowUsers: ['cleidigh', 'usernamehw', 'gjsjohnmurray', 'IllusionMH'], - action: 'updateLabels', - addLabel: 'confirmation-pending', - removeLabel: 'confirmed' - }, { type: 'comment', name: 'findDuplicates', allowUsers: ['cleidigh', 'usernamehw', 'gjsjohnmurray', 'IllusionMH'], action: 'comment', comment: "Potential duplicates:\n${potentialDuplicates}" - }, - { - type: 'comment', - name: 'needsMoreInfo', - allowUsers: ['cleidigh', 'usernamehw', 'gjsjohnmurray', 'IllusionMH'], - action: 'updateLabels', - addLabel: 'needs more info', - comment: "Thanks for creating this issue! We figured it's missing some basic information or in some other way doesn't follow our [issue reporting](https://aka.ms/vscodeissuereporting) guidelines. Please take the time to review these and update the issue.\n\nHappy Coding!" - }, - { - type: 'label', - name: '~needs more info', - action: 'updateLabels', - addLabel: 'needs more info', - removeLabel: '~needs more info', - comment: "Thanks for creating this issue! We figured it's missing some basic information or in some other way doesn't follow our [issue reporting](https://aka.ms/vscodeissuereporting) guidelines. Please take the time to review these and update the issue.\n\nHappy Coding!" - }, - { - type: 'comment', - name: 'a11ymas', - allowUsers: ['AccessibilityTestingTeam-TCS', 'dixitsonali95', 'Mohini78', 'ChitrarupaSharma', 'mspatil110', 'umasarath52', 'v-umnaik'], - action: 'updateLabels', - addLabel: 'a11ymas' - }, - { - type: 'label', - name: '*off-topic', - action: 'close', - comment: "Thanks for creating this issue. We think this issue is unactionable or unrelated to the goals of this project. Please follow our [issue reporting](https://aka.ms/vscodeissuereporting) guidelines.\n\nHappy Coding!" } ] } diff --git a/.github/workflows/commands.yml b/.github/workflows/commands.yml index 35974e435355cb9007ba1c19dad0e7ec5bd072d5..9a31b98bfe20094939a7f6c0838ec4b6bad41637 100644 --- a/.github/workflows/commands.yml +++ b/.github/workflows/commands.yml @@ -14,8 +14,8 @@ jobs: with: repository: 'JacksonKearl/vscode-triage-github-actions' ref: v2 - # - name: Run Commands - # uses: ./commands - # with: - # token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}} - # config-path: commands + - name: Run Commands + uses: ./commands + with: + token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}} + config-path: commands diff --git a/.github/workflows/copycat.yml b/.github/workflows/copycat.yml index 34fb291329a52d75d751f8cde5868ed5801864a9..c4b706759f9386979af00783cfa3308d493ebbba 100644 --- a/.github/workflows/copycat.yml +++ b/.github/workflows/copycat.yml @@ -12,15 +12,15 @@ jobs: with: repository: 'JacksonKearl/vscode-triage-github-actions' ref: v2 - # - name: Run CopyCat (JacksonKearl/testissues) - # uses: ./copycat - # with: - # token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}} - # owner: JacksonKearl - # repo: testissues - # - name: Run CopyCat (chrmarti/testissues) - # uses: ./copycat - # with: - # token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}} - # owner: chrmarti - # repo: testissues + - name: Run CopyCat (JacksonKearl/testissues) + uses: ./copycat + with: + token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}} + owner: JacksonKearl + repo: testissues + - name: Run CopyCat (chrmarti/testissues) + uses: ./copycat + with: + token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}} + owner: chrmarti + repo: testissues diff --git a/src/vs/platform/progress/common/progress.ts b/src/vs/platform/progress/common/progress.ts index b6ff5e5057b9d36e1221418260c9f82d7ff8e2e2..2a5cfda1b32f7e0503b0653c409f787334aabd45 100644 --- a/src/vs/platform/progress/common/progress.ts +++ b/src/vs/platform/progress/common/progress.ts @@ -62,6 +62,7 @@ export interface IProgressNotificationOptions extends IProgressOptions { readonly primaryActions?: ReadonlyArray; readonly secondaryActions?: ReadonlyArray; readonly delay?: number; + readonly silent?: boolean; } export interface IProgressWindowOptions extends IProgressOptions { diff --git a/src/vs/workbench/contrib/debug/browser/debug.contribution.ts b/src/vs/workbench/contrib/debug/browser/debug.contribution.ts index 6f93ec9f73127760ec35754c3e71ef9042e3f468..7c3220d2e54e64805093c190d08fae27ad667f1e 100644 --- a/src/vs/workbench/contrib/debug/browser/debug.contribution.ts +++ b/src/vs/workbench/contrib/debug/browser/debug.contribution.ts @@ -54,6 +54,7 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer'; import { IQuickAccessRegistry, Extensions as QuickAccessExtensions } from 'vs/platform/quickinput/common/quickAccess'; import { StartDebugQuickAccessProvider } from 'vs/workbench/contrib/debug/browser/debugQuickAccess'; +import { DebugProgressContribution } from 'vs/workbench/contrib/debug/browser/debugProgress'; class OpenDebugViewletAction extends ShowViewletAction { public static readonly ID = VIEWLET_ID; @@ -298,6 +299,7 @@ configurationRegistry.registerConfiguration({ // Register Debug Status Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugStatusContribution, LifecyclePhase.Eventually); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugProgressContribution, LifecyclePhase.Eventually); // Debug toolbar diff --git a/src/vs/workbench/contrib/debug/browser/debugProgress.ts b/src/vs/workbench/contrib/debug/browser/debugProgress.ts new file mode 100644 index 0000000000000000000000000000000000000000..2216a01e56dc789f530927a7ab8e92d22965e687 --- /dev/null +++ b/src/vs/workbench/contrib/debug/browser/debugProgress.ts @@ -0,0 +1,51 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { Event } from 'vs/base/common/event'; +import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; +import { IDebugService, VIEWLET_ID } from 'vs/workbench/contrib/debug/common/debug'; +import { IProgressService, ProgressLocation } from 'vs/platform/progress/common/progress'; +import { dispose, IDisposable } from 'vs/base/common/lifecycle'; + +export class DebugProgressContribution implements IWorkbenchContribution { + + private toDispose: IDisposable[] = []; + + constructor( + @IDebugService private readonly debugService: IDebugService, + @IProgressService private readonly progressService: IProgressService + ) { + let progressListener: IDisposable; + this.toDispose.push(this.debugService.getViewModel().onDidFocusSession(session => { + if (progressListener) { + progressListener.dispose(); + } + if (session) { + progressListener = session.onDidProgressStart(async progressStartEvent => { + const promise = new Promise(r => { + // Show progress until a progress end event comes or the session ends + const listener = Event.any(Event.filter(session.onDidProgressEnd, e => e.body.progressId === progressStartEvent.body.progressId), + session.onDidEndAdapter)(() => { + listener.dispose(); + r(); + }); + }); + + this.progressService.withProgress({ location: VIEWLET_ID }, () => promise); + this.progressService.withProgress({ + location: ProgressLocation.Notification, + title: progressStartEvent.body.title, + cancellable: progressStartEvent.body.cancellable, + silent: true + }, () => promise, () => session.cancel(progressStartEvent.body.progressId)); + }); + } + })); + } + + dispose(): void { + dispose(this.toDispose); + } +} diff --git a/src/vs/workbench/contrib/debug/browser/debugViewlet.ts b/src/vs/workbench/contrib/debug/browser/debugViewlet.ts index d91eb34c82d80eba223243ed53159ccfd5b3eaee..d330f6da6e784bb01ef024d13e82be5a52783afb 100644 --- a/src/vs/workbench/contrib/debug/browser/debugViewlet.ts +++ b/src/vs/workbench/contrib/debug/browser/debugViewlet.ts @@ -5,11 +5,10 @@ import 'vs/css!./media/debugViewlet'; import * as nls from 'vs/nls'; -import { IAction, Action } from 'vs/base/common/actions'; +import { IAction } from 'vs/base/common/actions'; import * as DOM from 'vs/base/browser/dom'; -import { Event } from 'vs/base/common/event'; import { IActionViewItem } from 'vs/base/browser/ui/actionbar/actionbar'; -import { IDebugService, VIEWLET_ID, State, BREAKPOINTS_VIEW_ID, IDebugConfiguration, DEBUG_PANEL_ID, CONTEXT_DEBUG_UX, CONTEXT_DEBUG_UX_KEY, IDebugSession } from 'vs/workbench/contrib/debug/common/debug'; +import { IDebugService, VIEWLET_ID, State, BREAKPOINTS_VIEW_ID, IDebugConfiguration, DEBUG_PANEL_ID, CONTEXT_DEBUG_UX, CONTEXT_DEBUG_UX_KEY } from 'vs/workbench/contrib/debug/common/debug'; import { StartAction, ConfigureAction, SelectAndStartAction, FocusSessionAction } from 'vs/workbench/contrib/debug/browser/debugActions'; import { StartDebugActionViewItem, FocusSessionActionViewItem } from 'vs/workbench/contrib/debug/browser/debugActionViewItems'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; @@ -44,7 +43,6 @@ export class DebugViewPaneContainer extends ViewPaneContainer { private paneListeners = new Map(); private debugToolBarMenu: IMenu | undefined; private disposeOnTitleUpdate: IDisposable | undefined; - private progressEvents: { event: DebugProtocol.ProgressStartEvent, session: IDebugSession }[] = []; constructor( @IWorkbenchLayoutService layoutService: IWorkbenchLayoutService, @@ -81,38 +79,6 @@ export class DebugViewPaneContainer extends ViewPaneContainer { this.updateTitleArea(); } })); - - let progressListener: IDisposable; - this._register(this.debugService.getViewModel().onDidFocusSession(session => { - if (progressListener) { - progressListener.dispose(); - } - if (session) { - progressListener = session.onDidProgressStart(async progressStartEvent => { - // Update title area to show the cancel progress action - this.progressEvents.push({ session: session, event: progressStartEvent }); - if (progressStartEvent.body.cancellable) { - this.cancelAction.tooltip = nls.localize('cancelProgress', "Cancel {0}", progressStartEvent.body.title); - this.updateTitleArea(); - } - await this.progressService.withProgress({ location: VIEWLET_ID }, () => { - return new Promise(r => { - // Show progress until a progress end event comes or the session ends - const listener = Event.any(Event.filter(session.onDidProgressEnd, e => e.body.progressId === progressStartEvent.body.progressId), - session.onDidEndAdapter)(() => { - listener.dispose(); - r(); - }); - }); - }); - this.progressEvents = this.progressEvents.filter(pe => pe.event.body.progressId !== progressStartEvent.body.progressId); - if (progressStartEvent.body.cancellable) { - this.cancelAction.tooltip = nls.localize('cancel', "Cancel"); - this.updateTitleArea(); - } - }); - } - })); } create(parent: HTMLElement): void { @@ -145,16 +111,6 @@ export class DebugViewPaneContainer extends ViewPaneContainer { return this._register(this.instantiationService.createInstance(OpenDebugPanelAction, OpenDebugPanelAction.ID, OpenDebugPanelAction.LABEL)); } - @memoize - private get cancelAction(): Action { - return this._register(new Action('debug.cancelProgress', nls.localize('cancel', "Cancel"), 'debug-action codicon codicon-stop', true, async () => { - const progressEvent = this.progressEvents.filter(e => e.event.body.cancellable).pop(); - if (progressEvent) { - await progressEvent.session.cancel(progressEvent.event.body.progressId); - } - })); - } - @memoize private get selectAndStartAction(): SelectAndStartAction { return this._register(this.instantiationService.createInstance(SelectAndStartAction, SelectAndStartAction.ID, nls.localize('startAdditionalSession', "Start Additional Session"))); @@ -165,7 +121,6 @@ export class DebugViewPaneContainer extends ViewPaneContainer { return []; } - let result: IAction[]; if (!this.showInitialDebugActions) { if (!this.debugToolBarMenu) { @@ -179,18 +134,14 @@ export class DebugViewPaneContainer extends ViewPaneContainer { } this.disposeOnTitleUpdate = disposable; - result = actions; - } else if (this.contextService.getWorkbenchState() === WorkbenchState.EMPTY) { - result = [this.toggleReplAction]; - } else { - result = [this.startAction, this.configureAction, this.toggleReplAction]; + return actions; } - if (this.progressEvents.filter(e => e.event.body.cancellable).length) { - result.unshift(this.cancelAction); + if (this.contextService.getWorkbenchState() === WorkbenchState.EMPTY) { + return [this.toggleReplAction]; } - return result; + return [this.startAction, this.configureAction, this.toggleReplAction]; } get showInitialDebugActions(): boolean { @@ -235,7 +186,7 @@ export class DebugViewPaneContainer extends ViewPaneContainer { } if (state === State.Initializing) { - this.progressService.withProgress({ location: VIEWLET_ID }, _progress => { + this.progressService.withProgress({ location: VIEWLET_ID, }, _progress => { return new Promise(resolve => this.progressResolve = resolve); }); } diff --git a/src/vs/workbench/services/progress/browser/progressService.ts b/src/vs/workbench/services/progress/browser/progressService.ts index ed8b9499f696e889de0b46a751e72ac1952573f9..72d2116f82ccd16974f2f0bd770ace29f210856d 100644 --- a/src/vs/workbench/services/progress/browser/progressService.ts +++ b/src/vs/workbench/services/progress/browser/progressService.ts @@ -251,7 +251,7 @@ export class ProgressService extends Disposable implements IProgressService { return toDisposable(() => promiseResolve()); }; - const createNotification = (message: string, increment?: number): INotificationHandle => { + const createNotification = (message: string, silent: boolean, increment?: number): INotificationHandle => { const notificationDisposables = new DisposableStore(); const primaryActions = options.primaryActions ? Array.from(options.primaryActions) : []; @@ -294,7 +294,8 @@ export class ProgressService extends Disposable implements IProgressService { message, source: options.source, actions: { primary: primaryActions, secondary: secondaryActions }, - progress: typeof increment === 'number' && increment >= 0 ? { total: 100, worked: increment } : { infinite: true } + progress: typeof increment === 'number' && increment >= 0 ? { total: 100, worked: increment } : { infinite: true }, + silent }); // Switch to window based progress once the notification @@ -302,8 +303,7 @@ export class ProgressService extends Disposable implements IProgressService { // Remove that window based progress once the notification // shows again. let windowProgressDisposable: IDisposable | undefined = undefined; - notificationDisposables.add(notification.onDidChangeVisibility(visible => { - + const onVisibilityChange = (visible: boolean) => { // Clear any previous running window progress dispose(windowProgressDisposable); @@ -311,7 +311,11 @@ export class ProgressService extends Disposable implements IProgressService { if (!visible && !progressStateModel.done) { windowProgressDisposable = createWindowProgress(); } - })); + }; + notificationDisposables.add(notification.onDidChangeVisibility(onVisibilityChange)); + if (silent) { + onVisibilityChange(false); + } // Clear upon dispose Event.once(notification.onDidClose)(() => notificationDisposables.dispose()); @@ -346,10 +350,10 @@ export class ProgressService extends Disposable implements IProgressService { // create notification now or after a delay if (typeof options.delay === 'number' && options.delay > 0) { if (typeof notificationTimeout !== 'number') { - notificationTimeout = setTimeout(() => notificationHandle = createNotification(titleAndMessage!, step?.increment), options.delay); + notificationTimeout = setTimeout(() => notificationHandle = createNotification(titleAndMessage!, !!options.silent, step?.increment), options.delay); } } else { - notificationHandle = createNotification(titleAndMessage, step?.increment); + notificationHandle = createNotification(titleAndMessage, !!options.silent, step?.increment); } }