提交 1caaf1b2 编写于 作者: B Benjamin Pasero

💄 path labels

上级 61312f37
...@@ -835,7 +835,7 @@ export class CodeApplication extends Disposable { ...@@ -835,7 +835,7 @@ export class CodeApplication extends Disposable {
mnemonicButtonLabel(localize({ key: 'cancel', comment: ['&& denotes a mnemonic'] }, "&&No")), mnemonicButtonLabel(localize({ key: 'cancel', comment: ['&& denotes a mnemonic'] }, "&&No")),
], ],
cancelId: 1, cancelId: 1,
message: localize('confirmOpenMessage', "An external application wants to open '{0}' in {1}. Do you want to open this file or folder?", getPathLabel(uri.fsPath), product.nameShort), message: localize('confirmOpenMessage', "An external application wants to open '{0}' in {1}. Do you want to open this file or folder?", getPathLabel(uri.fsPath, this.environmentService), product.nameShort),
detail: localize('confirmOpenDetail', "If you did not initiate this request, it may represent an attempted attack on your system. Unless you took an explicit action to initiate this request, you should press 'No'"), detail: localize('confirmOpenDetail', "If you did not initiate this request, it may represent an attempted attack on your system. Unless you took an explicit action to initiate this request, you should press 'No'"),
noLink: true noLink: true
}); });
......
...@@ -31,7 +31,7 @@ import { ConfigurationService } from 'vs/platform/configuration/common/configura ...@@ -31,7 +31,7 @@ import { ConfigurationService } from 'vs/platform/configuration/common/configura
import { IRequestService } from 'vs/platform/request/common/request'; import { IRequestService } from 'vs/platform/request/common/request';
import { RequestMainService } from 'vs/platform/request/electron-main/requestMainService'; import { RequestMainService } from 'vs/platform/request/electron-main/requestMainService';
import { CodeApplication } from 'vs/code/electron-main/app'; import { CodeApplication } from 'vs/code/electron-main/app';
import { mnemonicButtonLabel } from 'vs/base/common/labels'; import { getPathLabel, mnemonicButtonLabel } from 'vs/base/common/labels';
import { SpdLogService } from 'vs/platform/log/node/spdlogService'; import { SpdLogService } from 'vs/platform/log/node/spdlogService';
import { BufferLogService } from 'vs/platform/log/common/bufferLog'; import { BufferLogService } from 'vs/platform/log/common/bufferLog';
import { setUnexpectedErrorHandler } from 'vs/base/common/errors'; import { setUnexpectedErrorHandler } from 'vs/base/common/errors';
...@@ -341,11 +341,11 @@ class CodeMain { ...@@ -341,11 +341,11 @@ class CodeMain {
private handleStartupDataDirError(environmentService: IEnvironmentMainService, error: NodeJS.ErrnoException): void { private handleStartupDataDirError(environmentService: IEnvironmentMainService, error: NodeJS.ErrnoException): void {
if (error.code === 'EACCES' || error.code === 'EPERM') { if (error.code === 'EACCES' || error.code === 'EPERM') {
const directories = coalesce([environmentService.userDataPath, environmentService.extensionsPath, XDG_RUNTIME_DIR]); const directories = coalesce([environmentService.userDataPath, environmentService.extensionsPath, XDG_RUNTIME_DIR]).map(folder => getPathLabel(folder, environmentService));
this.showStartupWarningDialog( this.showStartupWarningDialog(
localize('startupDataDirError', "Unable to write program user data ({0})", toErrorMessage(error)), localize('startupDataDirError', "Unable to write program user data."),
localize('startupUserDataAndExtensionsDirErrorDetail', "Please make sure the following directories are writeable:\n\n{0}", directories.join('\n')) localize('startupUserDataAndExtensionsDirErrorDetail', "{0}\n\nPlease make sure the following directories are writeable:\n\n{1}", toErrorMessage(error), directories.join('\n'))
); );
} }
} }
......
...@@ -16,7 +16,7 @@ import { Color } from 'vs/base/common/color'; ...@@ -16,7 +16,7 @@ import { Color } from 'vs/base/common/color';
import { ScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement'; import { ScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';
import { ScrollbarVisibility } from 'vs/base/common/scrollable'; import { ScrollbarVisibility } from 'vs/base/common/scrollable';
import { ScrollType } from 'vs/editor/common/editorCommon'; import { ScrollType } from 'vs/editor/common/editorCommon';
import { getBaseLabel, getPathLabel } from 'vs/base/common/labels'; import { getBaseLabel } from 'vs/base/common/labels';
import { isNonEmptyArray } from 'vs/base/common/arrays'; import { isNonEmptyArray } from 'vs/base/common/arrays';
import { Event, Emitter } from 'vs/base/common/event'; import { Event, Emitter } from 'vs/base/common/event';
import { PeekViewWidget, peekViewTitleForeground, peekViewTitleInfoForeground } from 'vs/editor/contrib/peekView/peekView'; import { PeekViewWidget, peekViewTitleForeground, peekViewTitleInfoForeground } from 'vs/editor/contrib/peekView/peekView';
...@@ -31,6 +31,7 @@ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; ...@@ -31,6 +31,7 @@ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { createAndFillInActionBarActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; import { createAndFillInActionBarActions } from 'vs/platform/actions/browser/menuEntryActionViewItem';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { splitLines } from 'vs/base/common/strings'; import { splitLines } from 'vs/base/common/strings';
import { ILabelService } from 'vs/platform/label/common/label';
class MessageWidget { class MessageWidget {
...@@ -51,6 +52,7 @@ class MessageWidget { ...@@ -51,6 +52,7 @@ class MessageWidget {
editor: ICodeEditor, editor: ICodeEditor,
onRelatedInformation: (related: IRelatedInformation) => void, onRelatedInformation: (related: IRelatedInformation) => void,
private readonly _openerService: IOpenerService, private readonly _openerService: IOpenerService,
private readonly _labelService: ILabelService
) { ) {
this._editor = editor; this._editor = editor;
...@@ -169,7 +171,7 @@ class MessageWidget { ...@@ -169,7 +171,7 @@ class MessageWidget {
let relatedResource = document.createElement('a'); let relatedResource = document.createElement('a');
relatedResource.classList.add('filename'); relatedResource.classList.add('filename');
relatedResource.innerText = `${getBaseLabel(related.resource)}(${related.startLineNumber}, ${related.startColumn}): `; relatedResource.innerText = `${getBaseLabel(related.resource)}(${related.startLineNumber}, ${related.startColumn}): `;
relatedResource.title = getPathLabel(related.resource, undefined); relatedResource.title = this._labelService.getUriLabel(related.resource);
this._relatedDiagnostics.set(relatedResource, related); this._relatedDiagnostics.set(relatedResource, related);
let relatedMessage = document.createElement('span'); let relatedMessage = document.createElement('span');
...@@ -248,7 +250,8 @@ export class MarkerNavigationWidget extends PeekViewWidget { ...@@ -248,7 +250,8 @@ export class MarkerNavigationWidget extends PeekViewWidget {
@IOpenerService private readonly _openerService: IOpenerService, @IOpenerService private readonly _openerService: IOpenerService,
@IMenuService private readonly _menuService: IMenuService, @IMenuService private readonly _menuService: IMenuService,
@IInstantiationService instantiationService: IInstantiationService, @IInstantiationService instantiationService: IInstantiationService,
@IContextKeyService private readonly _contextKeyService: IContextKeyService @IContextKeyService private readonly _contextKeyService: IContextKeyService,
@ILabelService private readonly _labelService: ILabelService
) { ) {
super(editor, { showArrow: true, showFrame: true, isAccessible: true }, instantiationService); super(editor, { showArrow: true, showFrame: true, isAccessible: true }, instantiationService);
this._severity = MarkerSeverity.Warning; this._severity = MarkerSeverity.Warning;
...@@ -326,7 +329,7 @@ export class MarkerNavigationWidget extends PeekViewWidget { ...@@ -326,7 +329,7 @@ export class MarkerNavigationWidget extends PeekViewWidget {
this._container = document.createElement('div'); this._container = document.createElement('div');
container.appendChild(this._container); container.appendChild(this._container);
this._message = new MessageWidget(this._container, this.editor, related => this._onDidSelectRelatedInformation.fire(related), this._openerService); this._message = new MessageWidget(this._container, this.editor, related => this._onDidSelectRelatedInformation.fire(related), this._openerService, this._labelService);
this._disposables.add(this._message); this._disposables.add(this._message);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册