提交 8d0228f5 编写于 作者: B Benjamin Pasero

jsdoc 💄

上级 59510ed5
......@@ -49,7 +49,7 @@ import { BufferLogService } from 'vs/platform/log/common/bufferLog';
import { uploadLogs } from 'vs/code/electron-main/logUploader';
import { setUnexpectedErrorHandler } from 'vs/base/common/errors';
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
import { DialogCLIService } from 'vs/platform/dialogs/node/dialogService';
import { CommandLineDialogService } from 'vs/platform/dialogs/node/dialogService';
function createServices(args: ParsedArgs, bufferLogService: BufferLogService): IInstantiationService {
const services = new ServiceCollection();
......@@ -73,7 +73,7 @@ function createServices(args: ParsedArgs, bufferLogService: BufferLogService): I
services.set(IRequestService, new SyncDescriptor(RequestService));
services.set(IURLService, new SyncDescriptor(URLService, args['open-url'] ? args._urls : []));
services.set(IBackupMainService, new SyncDescriptor(BackupMainService));
services.set(IDialogService, new SyncDescriptor(DialogCLIService));
services.set(IDialogService, new SyncDescriptor(CommandLineDialogService));
return new InstantiationService(services, true);
}
......
......@@ -37,7 +37,7 @@ import { createSpdLogService } from 'vs/platform/log/node/spdlogService';
import { ILogService, getLogLevel } from 'vs/platform/log/common/log';
import { isPromiseCanceledError } from 'vs/base/common/errors';
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
import { DialogCLIService } from 'vs/platform/dialogs/node/dialogService';
import { CommandLineDialogService } from 'vs/platform/dialogs/node/dialogService';
const notFound = (id: string) => localize('notFound', "Extension '{0}' not found.", id);
const notInstalled = (id: string) => localize('notInstalled', "Extension '{0}' is not installed.", id);
......@@ -219,7 +219,7 @@ export function main(argv: ParsedArgs): TPromise<void> {
services.set(IRequestService, new SyncDescriptor(RequestService));
services.set(IExtensionManagementService, new SyncDescriptor(ExtensionManagementService));
services.set(IExtensionGalleryService, new SyncDescriptor(ExtensionGalleryService));
services.set(IDialogService, new SyncDescriptor(DialogCLIService));
services.set(IDialogService, new SyncDescriptor(CommandLineDialogService));
if (isBuilt && !extensionDevelopmentPath && !envService.args['disable-telemetry'] && product.enableTelemetry) {
const appenders: AppInsightsAppender[] = [];
......
......@@ -41,6 +41,12 @@ export interface IConfirmationResult {
export const IDialogService = createDecorator<IDialogService>('dialogService');
/**
* A service to bring up modal dialogs.
*
* Note: use the `INotificationService.prompt()` method for a non-modal way to ask
* the user for input.
*/
export interface IDialogService {
_serviceBrand: any;
......
......@@ -9,7 +9,7 @@ import { IDialogService, IConfirmation, IConfirmationResult } from 'vs/platform/
import Severity from 'vs/base/common/severity';
import { localize } from 'vs/nls';
export class DialogCLIService implements IDialogService {
export class CommandLineDialogService implements IDialogService {
_serviceBrand: any;
......
......@@ -142,6 +142,11 @@ export interface SecondaryPromptChoice {
export type PromptOption = PrimaryPromptChoice | SecondaryPromptChoice;
/**
* A service to bring up notifications and non-modal prompts.
*
* Note: use the `IDialogService` for a modal way to ask the user for input.
*/
export interface INotificationService {
_serviceBrand: any;
......
......@@ -68,7 +68,7 @@ export class NotificationService implements INotificationService {
public prompt(severity: Severity, message: string, choices: PromptOption[]): TPromise<number> {
let handle: INotificationHandle;
const promise = new TPromise<number>((c, e) => {
const promise = new TPromise<number>(c => {
// Complete promise with index of action that was picked
const callback = (index: number, closeNotification: boolean) => () => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册