提交 c1219366 编写于 作者: B Benjamin Pasero

use product over context service

上级 55168276
......@@ -9,6 +9,7 @@ import {score} from 'vs/editor/common/modes/languageSelector';
import * as Platform from 'vs/base/common/platform';
import {IThreadService} from 'vs/workbench/services/thread/common/threadService';
import * as errors from 'vs/base/common/errors';
import product from 'vs/platform/product';
import {ExtHostFileSystemEventService} from 'vs/workbench/api/node/extHostFileSystemEventService';
import {ExtHostDocuments} from 'vs/workbench/api/node/extHostDocuments';
import {ExtHostConfiguration} from 'vs/workbench/api/node/extHostConfiguration';
......@@ -168,7 +169,7 @@ export class ExtHostAPIImplementation {
get machineId() { return telemetryInfo.machineId; },
get sessionId() { return telemetryInfo.sessionId; },
get language() { return Platform.language; },
get appName() { return contextService.getConfiguration().env.appName; }
get appName() { return product.nameLong; }
});
telemetryService.getTelemetryInfo().then(info => telemetryInfo = info, errors.onUnexpectedError);
......
......@@ -10,6 +10,7 @@ import errors = require('vs/base/common/errors');
import paths = require('vs/base/common/paths');
import {Action} from 'vs/base/common/actions';
import URI from 'vs/base/common/uri';
import product from 'vs/platform/product';
import {EditorModel} from 'vs/workbench/common/editor';
import {guessMimeTypes} from 'vs/base/common/mime';
import {ResourceEditorInput} from 'vs/workbench/common/editor/resourceEditorInput';
......@@ -25,7 +26,6 @@ import {IEventService} from 'vs/platform/event/common/event';
import {EventType as FileEventType, TextFileChangeEvent, ITextFileService} from 'vs/workbench/parts/files/common/files';
import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation';
import {IMessageService, IMessageWithAction, Severity, CancelAction} from 'vs/platform/message/common/message';
import {IWorkspaceContextService} from 'vs/platform/workspace/common/workspace';
import {IModeService} from 'vs/editor/common/services/modeService';
import {IModelService} from 'vs/editor/common/services/modelService';
......@@ -223,7 +223,6 @@ class ResolveSaveConflictMessage implements IMessageWithAction {
message: string,
@IMessageService private messageService: IMessageService,
@IInstantiationService private instantiationService: IInstantiationService,
@IWorkspaceContextService private contextService: IWorkspaceContextService,
@IWorkbenchEditorService private editorService: IWorkbenchEditorService
) {
this.model = model;
......@@ -241,7 +240,7 @@ class ResolveSaveConflictMessage implements IMessageWithAction {
const mime = guessMimeTypes(resource.fsPath).join(', ');
const originalInput = this.instantiationService.createInstance(FileOnDiskEditorInput, resource, mime, paths.basename(resource.fsPath), resource.fsPath);
const modifiedInput = this.instantiationService.createInstance(FileEditorInput, resource, mime, void 0);
const conflictInput = this.instantiationService.createInstance(ConflictResolutionDiffEditorInput, this.model, nls.localize('saveConflictDiffLabel', "{0} - on disk ↔ in {1}", modifiedInput.getName(), this.contextService.getConfiguration().env.appName), nls.localize('resolveSaveConflict', "{0} - Resolve save conflict", modifiedInput.getDescription()), originalInput, modifiedInput);
const conflictInput = this.instantiationService.createInstance(ConflictResolutionDiffEditorInput, this.model, nls.localize('saveConflictDiffLabel', "{0} - on disk ↔ in {1}", modifiedInput.getName(), product.nameLong), nls.localize('resolveSaveConflict', "{0} - Resolve save conflict", modifiedInput.getDescription()), originalInput, modifiedInput);
return this.editorService.openEditor(conflictInput).then(editor => {
......
......@@ -31,6 +31,7 @@ import {IWindowService} from 'vs/workbench/services/window/electron-browser/wind
import {IEditorGroupService} from 'vs/workbench/services/group/common/groupService';
import {IModelService} from 'vs/editor/common/services/modelService';
import {ModelBuilder} from 'vs/editor/node/model/modelBuilder';
import product from 'vs/platform/product';
export class TextFileService extends AbstractTextFileService {
......@@ -219,7 +220,7 @@ export class TextFileService extends AbstractTextFileService {
}
let opts: Electron.ShowMessageBoxOptions = {
title: this.contextService.getConfiguration().env.appName,
title: product.nameLong,
message: message.join('\n'),
type: 'warning',
detail: nls.localize('saveChangesDetail', "Your changes will be lost if you don't save them."),
......
......@@ -13,7 +13,7 @@ import ee = require('vs/base/common/eventEmitter');
import view = require('vs/workbench/parts/git/browser/views/view');
import builder = require('vs/base/browser/builder');
import actions = require('vs/base/common/actions');
import {IWorkspaceContextService} from 'vs/platform/workspace/common/workspace';
import product from 'vs/platform/product';
var $ = builder.$;
......@@ -23,12 +23,9 @@ export class GitlessView
{
public ID = 'gitless';
private _element: HTMLElement;
private _contextService: IWorkspaceContextService;
constructor(@IWorkspaceContextService contextService: IWorkspaceContextService) {
constructor() {
super();
this._contextService = contextService;
}
public get element(): HTMLElement {
......@@ -72,7 +69,7 @@ export class GitlessView
'<div class="gitless-view">',
'<p>', nls.localize('looksLike', "It looks like git is not installed on your system."), '</p>',
'<p>', instructions, '</p>',
'<p>', nls.localize('pleaseRestart', "Once git is installed, please restart {0}.", this._contextService.getConfiguration().env.appName), '</p>',
'<p>', nls.localize('pleaseRestart', "Once git is installed, please restart {0}.", product.nameLong), '</p>',
'</div>'
].join('')).getHTMLElement();
}
......
......@@ -8,6 +8,7 @@
import errors = require('vs/base/common/errors');
import platform = require('vs/base/common/platform');
import nls = require('vs/nls');
import product from 'vs/platform/product';
import {EventType} from 'vs/base/common/events';
import {IEditor as IBaseEditor} from 'vs/platform/editor/common/editor';
import {EditorInput, IGroupEvent, IEditorRegistry, Extensions} from 'vs/workbench/common/editor';
......@@ -161,7 +162,7 @@ export abstract class BaseHistoryService {
}
private doGetWindowTitle(input?: IEditorInput): string {
const appName = this.contextService.getConfiguration().env.appName;
const appName = product.nameLong;
let prefix = input && input.getName();
if (prefix && input) {
......
......@@ -7,16 +7,15 @@
import {IWindowService} from 'vs/workbench/services/window/electron-browser/windowService';
import nls = require('vs/nls');
import product from 'vs/platform/product';
import {WorkbenchMessageService} from 'vs/workbench/services/message/browser/messageService';
import {IConfirmation} from 'vs/platform/message/common/message';
import {isWindows, isLinux} from 'vs/base/common/platform';
import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry';
import {IWorkspaceContextService} from 'vs/platform/workspace/common/workspace';
export class MessageService extends WorkbenchMessageService {
constructor(
@IWorkspaceContextService private contextService: IWorkspaceContextService,
@IWindowService private windowService: IWindowService,
@ITelemetryService telemetryService: ITelemetryService
) {
......@@ -33,7 +32,7 @@ export class MessageService extends WorkbenchMessageService {
}
let opts: Electron.ShowMessageBoxOptions = {
title: confirmation.title || this.contextService.getConfiguration().env.appName,
title: confirmation.title || product.nameLong,
message: confirmation.message,
buttons: [
isLinux ? this.mnemonicLabel(confirmation.secondaryButton) : this.mnemonicLabel(confirmation.primaryButton),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册