-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
42 additions
and
42 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 |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import * as vscode from 'vscode'; | ||
|
||
function showInfo() { | ||
vscode.window.showInformationMessage('Information message.', { title: 'Yes' }, { title: 'No' }); | ||
export class Message { | ||
static info() { | ||
vscode.window.showInformationMessage('Information message.', { title: 'Yes' }, { title: 'No' }); | ||
} | ||
|
||
static warn() { | ||
vscode.window.showWarningMessage('Warning message.', { title: 'Yes' }, { title: 'No' }); | ||
} | ||
|
||
static error() { | ||
vscode.window.showErrorMessage('Error message.', { title: 'Yes' }, { title: 'No' }); | ||
} | ||
} | ||
|
||
function showWarn() { | ||
vscode.window.showWarningMessage('Warning message.', { title: 'Yes' }, { title: 'No' }); | ||
} | ||
|
||
function showError() { | ||
vscode.window.showErrorMessage('Error message.', { title: 'Yes' }, { title: 'No' }); | ||
} | ||
|
||
export const message = { showInfo, showWarn, showError }; |
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,28 +1,28 @@ | ||
import * as vscode from 'vscode'; | ||
|
||
let resolveFn: () => void; | ||
export class ProgressBadge { | ||
private static resolveFn?: () => void; | ||
|
||
function start() { | ||
if (resolveFn) { | ||
vscode.window.showWarningMessage('Progress Badge is already visible in Source Control!'); | ||
return; | ||
static start() { | ||
if (this.resolveFn) { | ||
vscode.window.showWarningMessage('Progress Badge is already visible in Source Control!'); | ||
return; | ||
} | ||
|
||
vscode.window.withProgress({ location: vscode.ProgressLocation.SourceControl }, () => { | ||
vscode.window.showInformationMessage('Progress Badge is visible in Source Control.'); | ||
return new Promise(resolve => (this.resolveFn = resolve)); | ||
}); | ||
} | ||
|
||
vscode.window.withProgress({ location: vscode.ProgressLocation.SourceControl }, () => { | ||
vscode.window.showInformationMessage('Progress Badge is visible in Source Control.'); | ||
return new Promise(resolve => (resolveFn = resolve)); | ||
}); | ||
} | ||
static stop() { | ||
if (!this.resolveFn) { | ||
vscode.window.showWarningMessage('Progress Badge is already stopped!'); | ||
return; | ||
} | ||
|
||
function stop() { | ||
if (!resolveFn) { | ||
vscode.window.showWarningMessage('Progress Badge is already stopped!'); | ||
return; | ||
this.resolveFn(); | ||
this.resolveFn = undefined; | ||
vscode.window.showInformationMessage('Progress Badge is stopped.'); | ||
} | ||
|
||
resolveFn(); | ||
resolveFn = undefined; | ||
vscode.window.showInformationMessage('Progress Badge is stopped.'); | ||
} | ||
|
||
export const progressBadge = { start, stop }; |