Merge from vscode 709a07d51919d3266ca71699c6ddfb2d3547c0e1 (#6575)
@@ -36,6 +36,7 @@ import { ICommentInfo, ICommentService } from 'vs/workbench/contrib/comments/bro
|
||||
import { COMMENTEDITOR_DECORATION_KEY, ReviewZoneWidget } from 'vs/workbench/contrib/comments/browser/commentThreadWidget';
|
||||
import { ctxCommentEditorFocused, SimpleCommentEditor } from 'vs/workbench/contrib/comments/browser/simpleCommentEditor';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { EmbeddedCodeEditorWidget } from 'vs/editor/browser/widget/embeddedCodeEditorWidget';
|
||||
|
||||
export const ID = 'editor.contrib.review';
|
||||
|
||||
@@ -173,7 +174,6 @@ export class ReviewController implements IEditorContribution {
|
||||
@IContextMenuService readonly contextMenuService: IContextMenuService,
|
||||
@IQuickInputService private readonly quickInputService: IQuickInputService
|
||||
) {
|
||||
this.editor = editor;
|
||||
this.globalToDispose = [];
|
||||
this.localToDispose = [];
|
||||
this._commentInfos = [];
|
||||
@@ -181,6 +181,12 @@ export class ReviewController implements IEditorContribution {
|
||||
this._pendingCommentCache = {};
|
||||
this._computePromise = null;
|
||||
|
||||
if (editor instanceof EmbeddedCodeEditorWidget) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.editor = editor;
|
||||
|
||||
this._commentingRangeDecorator = new CommentingRangeDecorator();
|
||||
|
||||
this.globalToDispose.push(this.commentService.onDidDeleteDataProvider(ownerId => {
|
||||
|
||||
@@ -433,6 +433,10 @@
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
div.preview.inline .monaco-editor .comment-range-glyph {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.monaco-editor .comment-range-glyph:before {
|
||||
position: absolute;
|
||||
content: "";
|
||||
|
||||
@@ -184,7 +184,7 @@ export function registerCommands(): void {
|
||||
id: STEP_INTO_ID,
|
||||
weight: KeybindingWeight.WorkbenchContrib + 10, // Have a stronger weight to have priority over full screen when debugging
|
||||
primary: KeyCode.F11,
|
||||
when: CONTEXT_DEBUG_STATE.isEqualTo('stopped'),
|
||||
when: CONTEXT_IN_DEBUG_MODE,
|
||||
handler: (accessor: ServicesAccessor, _: string, thread: IThread | undefined) => {
|
||||
getThreadAndRun(accessor, thread, thread => thread.stepIn());
|
||||
}
|
||||
|
||||
@@ -358,7 +358,7 @@ export class RemoteInstallAction extends InstallInOtherServerAction {
|
||||
}
|
||||
|
||||
protected getInstallLabel(): string {
|
||||
return this.extensionManagementServerService.remoteExtensionManagementServer ? localize('Install on Server', "Install on {0}", this.extensionManagementServerService.remoteExtensionManagementServer.label) : InstallInOtherServerAction.INSTALL_LABEL;
|
||||
return this.extensionManagementServerService.remoteExtensionManagementServer ? localize('Install on Server', "Install in {0}", this.extensionManagementServerService.remoteExtensionManagementServer.label) : InstallInOtherServerAction.INSTALL_LABEL;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -712,7 +712,13 @@ export class ManageExtensionAction extends ExtensionDropDownAction {
|
||||
]);
|
||||
groups.push([this.instantiationService.createInstance(UninstallAction)]);
|
||||
groups.push([this.instantiationService.createInstance(InstallAnotherVersionAction)]);
|
||||
groups.push([this.instantiationService.createInstance(ExtensionInfoAction), this.instantiationService.createInstance(ExtensionSettingsAction)]);
|
||||
|
||||
const extensionActions: ExtensionAction[] = [this.instantiationService.createInstance(ExtensionInfoAction)];
|
||||
if (this.extension.local && this.extension.local.manifest.contributes && this.extension.local.manifest.contributes.configuration) {
|
||||
extensionActions.push(this.instantiationService.createInstance(ExtensionSettingsAction));
|
||||
}
|
||||
|
||||
groups.push(extensionActions);
|
||||
|
||||
groups.forEach(group => group.forEach(extensionAction => extensionAction.extension = this.extension));
|
||||
|
||||
@@ -3089,7 +3095,7 @@ interface IExtensionPickItem extends IQuickPickItem {
|
||||
extension?: IExtension;
|
||||
}
|
||||
|
||||
export class InstallLocalExtensionsOnRemoteAction extends Action {
|
||||
export class InstallLocalExtensionsInRemoteAction extends Action {
|
||||
|
||||
constructor(
|
||||
@IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService,
|
||||
@@ -3101,14 +3107,14 @@ export class InstallLocalExtensionsOnRemoteAction extends Action {
|
||||
@IProgressService private readonly progressService: IProgressService,
|
||||
@IInstantiationService private readonly instantiationService: IInstantiationService
|
||||
) {
|
||||
super('workbench.extensions.actions.installLocalExtensionsOnRemote');
|
||||
super('workbench.extensions.actions.installLocalExtensionsInRemote');
|
||||
this.update();
|
||||
this._register(this.extensionsWorkbenchService.onChange(() => this.update()));
|
||||
}
|
||||
|
||||
get label(): string {
|
||||
return this.extensionManagementServerService.remoteExtensionManagementServer ?
|
||||
localize('install local extensions', "Install Local Extensions on {0}", this.extensionManagementServerService.remoteExtensionManagementServer.label) : '';
|
||||
localize('install local extensions', "Install Local Extensions in {0}...", this.extensionManagementServerService.remoteExtensionManagementServer.label) : '';
|
||||
}
|
||||
|
||||
private update(): void {
|
||||
@@ -3141,6 +3147,7 @@ export class InstallLocalExtensionsOnRemoteAction extends Action {
|
||||
const localExtensionsToInstall = this.getLocalExtensionsToInstall();
|
||||
quickPick.busy = false;
|
||||
if (localExtensionsToInstall.length) {
|
||||
quickPick.title = localize('install local extensions title', "Install Local Extensions in {0}", this.extensionManagementServerService.remoteExtensionManagementServer!.label);
|
||||
quickPick.placeholder = localize('select extensions to install', "Select extensions to install");
|
||||
quickPick.canSelectMany = true;
|
||||
localExtensionsToInstall.sort((e1, e2) => e1.displayName.localeCompare(e2.displayName));
|
||||
@@ -3189,9 +3196,9 @@ export class InstallLocalExtensionsOnRemoteAction extends Action {
|
||||
|
||||
this.notificationService.notify({
|
||||
severity: Severity.Info,
|
||||
message: localize('finished installing', "Completed installing the extensions. Please reload the window now."),
|
||||
message: localize('finished installing', "Successfully installed extensions in {0}. Please reload the window to enable them.", this.extensionManagementServerService.remoteExtensionManagementServer!.label),
|
||||
actions: {
|
||||
primary: [new Action('realod', localize('reload', "Realod Window"), '', true,
|
||||
primary: [new Action('realod', localize('reload', "Reload Window"), '', true,
|
||||
() => this.windowService.reloadWindow())]
|
||||
}
|
||||
});
|
||||
|
||||
@@ -68,7 +68,7 @@ export class ExtensionDependencyChecker extends Disposable implements IWorkbench
|
||||
severity: Severity.Info,
|
||||
message: localize('finished installing missing deps', "Finished installing missing dependencies. Please reload the window now."),
|
||||
actions: {
|
||||
primary: [new Action('realod', localize('reload', "Realod Window"), '', true,
|
||||
primary: [new Action('realod', localize('reload', "Reload Window"), '', true,
|
||||
() => this.windowService.reloadWindow())]
|
||||
}
|
||||
});
|
||||
|
||||
@@ -22,7 +22,7 @@ import { IExtensionsWorkbenchService, IExtensionsViewlet, VIEWLET_ID, AutoUpdate
|
||||
import {
|
||||
ShowEnabledExtensionsAction, ShowInstalledExtensionsAction, ShowRecommendedExtensionsAction, ShowPopularExtensionsAction, ShowDisabledExtensionsAction,
|
||||
ShowOutdatedExtensionsAction, ClearExtensionsInputAction, ChangeSortAction, UpdateAllAction, CheckForUpdatesAction, DisableAllAction, EnableAllAction,
|
||||
EnableAutoUpdateAction, DisableAutoUpdateAction, ShowBuiltInExtensionsAction, InstallVSIXAction, InstallLocalExtensionsOnRemoteAction
|
||||
EnableAutoUpdateAction, DisableAutoUpdateAction, ShowBuiltInExtensionsAction, InstallVSIXAction, InstallLocalExtensionsInRemoteAction
|
||||
} from 'vs/workbench/contrib/extensions/browser/extensionsActions';
|
||||
import { IExtensionManagementService } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { IExtensionEnablementService, IExtensionManagementServerService, IExtensionManagementServer } from 'vs/workbench/services/extensionManagement/common/extensionManagement';
|
||||
@@ -409,7 +409,7 @@ export class ExtensionsViewlet extends ViewContainerViewlet implements IExtensio
|
||||
triggerCharacters: ['@'],
|
||||
sortKey: (item: string) => {
|
||||
if (item.indexOf(':') === -1) { return 'a'; }
|
||||
else if (/ext:/.test(item) || /tag:/.test(item)) { return 'b'; }
|
||||
else if (/ext:/.test(item) || /id:/.test(item) || /tag:/.test(item)) { return 'b'; }
|
||||
else if (/sort:/.test(item)) { return 'c'; }
|
||||
else { return 'd'; }
|
||||
},
|
||||
@@ -484,7 +484,7 @@ export class ExtensionsViewlet extends ViewContainerViewlet implements IExtensio
|
||||
this.instantiationService.createInstance(CheckForUpdatesAction, CheckForUpdatesAction.ID, CheckForUpdatesAction.LABEL),
|
||||
...(this.configurationService.getValue(AutoUpdateConfigurationKey) ? [this.instantiationService.createInstance(DisableAutoUpdateAction, DisableAutoUpdateAction.ID, DisableAutoUpdateAction.LABEL)] : [this.instantiationService.createInstance(UpdateAllAction, UpdateAllAction.ID, UpdateAllAction.LABEL), this.instantiationService.createInstance(EnableAutoUpdateAction, EnableAutoUpdateAction.ID, EnableAutoUpdateAction.LABEL)]),
|
||||
this.instantiationService.createInstance(InstallVSIXAction, InstallVSIXAction.ID, InstallVSIXAction.LABEL),
|
||||
...(this.extensionManagementServerService.localExtensionManagementServer && this.extensionManagementServerService.remoteExtensionManagementServer ? [this.instantiationService.createInstance(InstallLocalExtensionsOnRemoteAction)] : []),
|
||||
...(this.extensionManagementServerService.localExtensionManagementServer && this.extensionManagementServerService.remoteExtensionManagementServer ? [this.instantiationService.createInstance(InstallLocalExtensionsInRemoteAction)] : []),
|
||||
new Separator(),
|
||||
this.instantiationService.createInstance(DisableAllAction, DisableAllAction.ID, DisableAllAction.LABEL),
|
||||
this.instantiationService.createInstance(EnableAllAction, EnableAllAction.ID, EnableAllAction.LABEL)
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0)">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14ZM11.9139 8C11.9139 10.1616 10.1616 11.9139 8 11.9139C5.83839 11.9139 4.08606 10.1616 4.08606 8C4.08606 5.83839 5.83839 4.08606 8 4.08606C10.1616 4.08606 11.9139 5.83839 11.9139 8ZM8 3.86919C10.2814 3.86919 12.1308 5.71862 12.1308 8C12.1308 8.00001 12.1308 8 12.1308 8C12.1308 5.71862 10.2814 3.86919 8 3.86919Z" fill="#848484"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0">
|
||||
<rect width="16" height="16" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
<circle cx="8" cy="8" r="5.5" stroke="#C5C5C5"/>
|
||||
<circle cx="8" cy="8" r="2" fill="#C5C5C5"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 715 B After Width: | Height: | Size: 197 B |
@@ -1,10 +1,4 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0)">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14ZM11.9139 8C11.9139 10.1616 10.1616 11.9139 8 11.9139C5.83839 11.9139 4.08606 10.1616 4.08606 8C4.08606 5.83839 5.83839 4.08606 8 4.08606C10.1616 4.08606 11.9139 5.83839 11.9139 8ZM8 3.86919C10.2814 3.86919 12.1308 5.71862 12.1308 8C12.1308 8.00001 12.1308 8 12.1308 8C12.1308 5.71862 10.2814 3.86919 8 3.86919Z" fill="#848484"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0">
|
||||
<rect width="16" height="16" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
<circle cx="8" cy="8" r="5.5" stroke="#424242"/>
|
||||
<circle cx="8" cy="8" r="2" fill="#424242"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 715 B After Width: | Height: | Size: 197 B |
@@ -1,3 +1,3 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.99977 14V2.18091L12.9998 8.06215L3.99977 14ZM5.5 4.99997L10.3145 8.06215L5.5 11.1809L5.5 4.99997Z" fill="#89D185"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 2V14.4805L12.9146 8.24024L4 2ZM11.1809 8.24024L4.995 12.5684V3.91209L11.1809 8.24024Z" fill="#C5C5C5"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 271 B After Width: | Height: | Size: 259 B |
@@ -1,3 +1,3 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.99977 14V2.18091L12.9998 8.06215L3.99977 14ZM5.5 4.99997L10.3145 8.06215L5.5 11.1809L5.5 4.99997Z" fill="#388A34"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 2V14.4805L12.9146 8.24024L4 2ZM11.1809 8.24024L4.995 12.5684V3.91209L11.1809 8.24024Z" fill="#424242"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 271 B After Width: | Height: | Size: 259 B |
@@ -11,7 +11,7 @@ import { Disposable, toDisposable } from 'vs/base/common/lifecycle';
|
||||
import { IExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/common/extensionManagement';
|
||||
import { ILabelService } from 'vs/platform/label/common/label';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { InstallLocalExtensionsOnRemoteAction } from 'vs/workbench/contrib/extensions/browser/extensionsActions';
|
||||
import { InstallLocalExtensionsInRemoteAction } from 'vs/workbench/contrib/extensions/browser/extensionsActions';
|
||||
|
||||
export class RemoteExtensionsInstaller extends Disposable implements IWorkbenchContribution {
|
||||
|
||||
@@ -22,16 +22,16 @@ export class RemoteExtensionsInstaller extends Disposable implements IWorkbenchC
|
||||
) {
|
||||
super();
|
||||
if (this.extensionManagementServerService.localExtensionManagementServer && this.extensionManagementServerService.remoteExtensionManagementServer) {
|
||||
const installLocalExtensionsOnRemoteAction = instantiationService.createInstance(InstallLocalExtensionsOnRemoteAction);
|
||||
CommandsRegistry.registerCommand('workbench.extensions.installLocalExtensions', () => installLocalExtensionsOnRemoteAction.run());
|
||||
const installLocalExtensionsInRemoteAction = instantiationService.createInstance(InstallLocalExtensionsInRemoteAction);
|
||||
CommandsRegistry.registerCommand('workbench.extensions.installLocalExtensions', () => installLocalExtensionsInRemoteAction.run());
|
||||
let disposable = Disposable.None;
|
||||
const appendMenuItem = () => {
|
||||
disposable.dispose();
|
||||
disposable = MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
|
||||
command: {
|
||||
id: 'workbench.extensions.installLocalExtensions',
|
||||
category: localize('extensions', "Extensions"),
|
||||
title: installLocalExtensionsOnRemoteAction.label
|
||||
category: localize('remote', "Remote"),
|
||||
title: installLocalExtensionsInRemoteAction.label
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -41,4 +41,4 @@ export class RemoteExtensionsInstaller extends Disposable implements IWorkbenchC
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1518,7 +1518,7 @@ suite('ExtensionsActions Test', () => {
|
||||
await workbenchService.queryGallery(CancellationToken.None);
|
||||
testObject.extension = extensions[0];
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('Install on remote', testObject.label);
|
||||
assert.equal('Install in remote', testObject.label);
|
||||
assert.equal('extension-action prominent install', testObject.class);
|
||||
});
|
||||
|
||||
@@ -1544,7 +1544,7 @@ suite('ExtensionsActions Test', () => {
|
||||
await workbenchService.queryGallery(CancellationToken.None);
|
||||
testObject.extension = extensions[0];
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('Install on remote', testObject.label);
|
||||
assert.equal('Install in remote', testObject.label);
|
||||
assert.equal('extension-action prominent install', testObject.class);
|
||||
|
||||
onInstallExtension.fire({ identifier: localWorkspaceExtension.identifier, gallery });
|
||||
@@ -1577,7 +1577,7 @@ suite('ExtensionsActions Test', () => {
|
||||
await workbenchService.queryGallery(CancellationToken.None);
|
||||
testObject.extension = extensions[0];
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('Install on remote', testObject.label);
|
||||
assert.equal('Install in remote', testObject.label);
|
||||
assert.equal('extension-action prominent install', testObject.class);
|
||||
|
||||
onInstallExtension.fire({ identifier: localWorkspaceExtension.identifier, gallery });
|
||||
@@ -1608,7 +1608,7 @@ suite('ExtensionsActions Test', () => {
|
||||
await workbenchService.queryGallery(CancellationToken.None);
|
||||
testObject.extension = extensions[0];
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('Install on remote', testObject.label);
|
||||
assert.equal('Install in remote', testObject.label);
|
||||
assert.equal('extension-action prominent install', testObject.class);
|
||||
});
|
||||
|
||||
@@ -1704,7 +1704,7 @@ suite('ExtensionsActions Test', () => {
|
||||
await workbenchService.queryGallery(CancellationToken.None);
|
||||
testObject.extension = extensions[0];
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('Install on remote', testObject.label);
|
||||
assert.equal('Install in remote', testObject.label);
|
||||
|
||||
uninstallEvent.fire(localWorkspaceExtension.identifier);
|
||||
assert.ok(!testObject.enabled);
|
||||
@@ -1825,7 +1825,7 @@ suite('ExtensionsActions Test', () => {
|
||||
await workbenchService.queryGallery(CancellationToken.None);
|
||||
testObject.extension = extensions[0];
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('Install on remote', testObject.label);
|
||||
assert.equal('Install in remote', testObject.label);
|
||||
assert.equal('extension-action prominent install', testObject.class);
|
||||
});
|
||||
|
||||
@@ -1848,7 +1848,7 @@ suite('ExtensionsActions Test', () => {
|
||||
await workbenchService.queryGallery(CancellationToken.None);
|
||||
testObject.extension = extensions[0];
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('Install on remote', testObject.label);
|
||||
assert.equal('Install in remote', testObject.label);
|
||||
|
||||
uninstallEvent.fire(languagePackExtension.identifier);
|
||||
assert.ok(!testObject.enabled);
|
||||
|
||||
@@ -258,7 +258,7 @@ class MarkerWidget extends Disposable {
|
||||
}));
|
||||
this.icon = dom.append(parent, dom.$(''));
|
||||
this.multilineActionbar = this._register(new ActionBar(dom.append(parent, dom.$('.multiline-actions'))));
|
||||
this.messageAndDetailsContainer = dom.append(parent, dom.$('.marker-message-details'));
|
||||
this.messageAndDetailsContainer = dom.append(parent, dom.$('.marker-message-details-container'));
|
||||
}
|
||||
|
||||
render(element: Marker, filterData: MarkerFilterData | undefined): void {
|
||||
@@ -312,33 +312,32 @@ class MarkerWidget extends Disposable {
|
||||
const viewState = this.markersViewModel.getViewModel(element);
|
||||
const multiline = !viewState || viewState.multiline;
|
||||
const lineMatches = filterData && filterData.lineMatches || [];
|
||||
const messageContainer = dom.append(this.messageAndDetailsContainer, dom.$('.marker-message'));
|
||||
dom.toggleClass(messageContainer, 'multiline', multiline);
|
||||
|
||||
let lastLineElement = messageContainer;
|
||||
let lastLineElement: HTMLElement | undefined = undefined;
|
||||
for (let index = 0; index < (multiline ? lines.length : 1); index++) {
|
||||
lastLineElement = dom.append(messageContainer, dom.$('.marker-message-line'));
|
||||
const highlightedLabel = new HighlightedLabel(lastLineElement, false);
|
||||
highlightedLabel.set(lines[index], lineMatches[index]);
|
||||
lastLineElement = dom.append(this.messageAndDetailsContainer, dom.$('.marker-message-line'));
|
||||
const messageElement = dom.append(lastLineElement, dom.$('.marker-message'));
|
||||
const highlightedLabel = new HighlightedLabel(messageElement, false);
|
||||
highlightedLabel.set(lines[index].length > 1000 ? `${lines[index].substring(0, 1000)}...` : lines[index], lineMatches[index]);
|
||||
if (lines[index] === '') {
|
||||
lastLineElement.style.height = `${VirtualDelegate.LINE_HEIGHT}px`;
|
||||
}
|
||||
}
|
||||
this.renderDetails(marker, filterData, multiline ? lastLineElement : this.messageAndDetailsContainer);
|
||||
this.renderDetails(marker, filterData, lastLineElement || dom.append(this.messageAndDetailsContainer, dom.$('.marker-message-line')));
|
||||
}
|
||||
|
||||
private renderDetails(marker: IMarker, filterData: MarkerFilterData | undefined, parent: HTMLElement): void {
|
||||
dom.addClass(parent, 'details-container');
|
||||
const sourceMatches = filterData && filterData.sourceMatches || [];
|
||||
const codeMatches = filterData && filterData.codeMatches || [];
|
||||
|
||||
const source = new HighlightedLabel(dom.append(parent, dom.$('')), false);
|
||||
source.set(marker.source, sourceMatches);
|
||||
dom.toggleClass(source.element, 'marker-source', !!marker.source);
|
||||
if (marker.source || marker.code) {
|
||||
const source = new HighlightedLabel(dom.append(parent, dom.$('.marker-source')), false);
|
||||
const sourceMatches = filterData && filterData.sourceMatches || [];
|
||||
source.set(marker.source, sourceMatches);
|
||||
|
||||
const code = new HighlightedLabel(dom.append(parent, dom.$('')), false);
|
||||
code.set(marker.code, codeMatches);
|
||||
dom.toggleClass(code.element, 'marker-code', !!marker.code);
|
||||
const code = new HighlightedLabel(dom.append(parent, dom.$('.marker-code')), false);
|
||||
const codeMatches = filterData && filterData.codeMatches || [];
|
||||
code.set(marker.code, codeMatches);
|
||||
}
|
||||
|
||||
const lnCol = dom.append(parent, dom.$('span.marker-line'));
|
||||
lnCol.textContent = Messages.MARKERS_PANEL_AT_LINE_COL_NUMBER(marker.startLineNumber, marker.startColumn);
|
||||
|
||||
@@ -97,6 +97,7 @@
|
||||
.markers-panel .markers-panel-container .tree-container .monaco-tl-contents {
|
||||
display: flex;
|
||||
line-height: 22px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
.hc-black .markers-panel .markers-panel-container .tree-container .monaco-tl-contents {
|
||||
@@ -112,23 +113,22 @@
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.markers-panel .markers-panel-container .tree-container .monaco-tl-contents .marker-message-details,
|
||||
.markers-panel .markers-panel-container .tree-container .monaco-tl-contents .marker-message:not(.multiline) {
|
||||
display: flex;
|
||||
.markers-panel .markers-panel-container .tree-container .monaco-tl-contents .marker-message-details-container {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.markers-panel .markers-panel-container .tree-container .monaco-tl-contents .marker-message.multiline {
|
||||
white-space: pre;
|
||||
flex: 1;
|
||||
.markers-panel .markers-panel-container .tree-container .monaco-tl-contents .marker-message-details-container > .marker-message-line {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.markers-panel .markers-panel-container .tree-container .monaco-tl-contents .marker-message:not(.multiline) .marker-message-line {
|
||||
.markers-panel .markers-panel-container .tree-container .monaco-tl-contents .marker-message-details-container > .marker-message-line > .marker-message {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.markers-panel .markers-panel-container .tree-container .monaco-tl-contents .marker-message .details-container {
|
||||
.markers-panel .markers-panel-container .tree-container .monaco-tl-contents .marker-message-details-container > .marker-message-line.details-container {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
@@ -222,4 +222,4 @@
|
||||
.markers-panel .monaco-tl-contents .multiline-actions .action-item.disabled,
|
||||
.markers-panel .monaco-tl-contents .actions .action-item.disabled {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,10 +12,29 @@
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
/* Deal with overflow */
|
||||
.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-widget .setting-list-value,
|
||||
.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-widget .setting-list-sibling {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-widget .setting-list-value {
|
||||
max-width: 90%;
|
||||
}
|
||||
.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-widget .setting-list-sibling {
|
||||
max-width: 10%;
|
||||
}
|
||||
|
||||
.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-value,
|
||||
.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-sibling {
|
||||
display: inline-block;
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
/* Use monospace to display glob patterns in exclude widget */
|
||||
.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-exclude-widget .setting-list-value,
|
||||
.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-exclude-widget .setting-list-sibling {
|
||||
font-family: var(--monaco-monospace-font);
|
||||
}
|
||||
|
||||
@@ -35,6 +54,7 @@
|
||||
|
||||
.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-row {
|
||||
position: relative;
|
||||
max-height: 22px;
|
||||
}
|
||||
|
||||
.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-row:focus {
|
||||
@@ -102,6 +122,8 @@
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-widget {
|
||||
.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-widget,
|
||||
.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-exclude-widget {
|
||||
margin-bottom: 1px;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
@@ -978,8 +978,15 @@ export class SettingsEditor2 extends BaseEditor {
|
||||
// If a single setting is being refreshed, it's ok to refresh now if that is not the focused setting
|
||||
if (key) {
|
||||
const focusedKey = focusedSetting.getAttribute(AbstractSettingRenderer.SETTING_KEY_ATTR);
|
||||
if (focusedKey === key &&
|
||||
!DOM.hasClass(focusedSetting, 'setting-item-list')) { // update `list`s live, as they have a separate "submit edit" step built in before this
|
||||
/**
|
||||
* Update `list`s live if focused item is whole list or list item,
|
||||
* as they have a separate "submit edit" step built in before this
|
||||
*/
|
||||
if (
|
||||
focusedKey === key &&
|
||||
!DOM.hasClass(focusedSetting, 'setting-item-list') &&
|
||||
!DOM.hasClass(focusedSetting, 'setting-item-contents')
|
||||
) {
|
||||
|
||||
this.updateModifiedLabelForKey(key);
|
||||
this.scheduleRefresh(focusedSetting, key);
|
||||
|
||||
@@ -698,32 +698,46 @@ export class SettingArrayRenderer extends AbstractSettingRenderer implements ITr
|
||||
|
||||
private onDidChangeList(template: ISettingListItemTemplate, e: IListChangeEvent): void {
|
||||
if (template.context) {
|
||||
const newValue: any[] | undefined = isArray(template.context.scopeValue)
|
||||
? [...template.context.scopeValue]
|
||||
: [...template.context.value];
|
||||
let newValue: any[] = [];
|
||||
if (isArray(template.context.scopeValue)) {
|
||||
newValue = [...template.context.scopeValue];
|
||||
} else if (isArray(template.context.value)) {
|
||||
newValue = [...template.context.value];
|
||||
}
|
||||
|
||||
// Delete value
|
||||
if (e.removeIndex) {
|
||||
if (!e.value && e.originalValue && e.removeIndex > -1) {
|
||||
newValue.splice(e.removeIndex, 1);
|
||||
if (e.targetIndex !== undefined) {
|
||||
// Delete value
|
||||
if (!e.value && e.originalValue && e.targetIndex > -1) {
|
||||
newValue.splice(e.targetIndex, 1);
|
||||
}
|
||||
}
|
||||
// Add value
|
||||
else if (e.value && !e.originalValue) {
|
||||
newValue.push(e.value);
|
||||
}
|
||||
// Update value
|
||||
else if (e.value && e.originalValue) {
|
||||
const valueIndex = newValue.indexOf(e.originalValue);
|
||||
if (valueIndex > -1) {
|
||||
newValue[valueIndex] = e.value;
|
||||
// Update value
|
||||
else if (e.value && e.originalValue) {
|
||||
if (e.targetIndex > -1) {
|
||||
newValue[e.targetIndex] = e.value;
|
||||
}
|
||||
// For some reason, we are updating and cannot find original value
|
||||
// Just append the value in this case
|
||||
else {
|
||||
newValue.push(e.value);
|
||||
}
|
||||
}
|
||||
// For some reason, we are updating and cannot find original value
|
||||
// Just append the value in this case
|
||||
else {
|
||||
// Add value
|
||||
else if (e.value && !e.originalValue && e.targetIndex >= newValue.length) {
|
||||
newValue.push(e.value);
|
||||
}
|
||||
}
|
||||
if (
|
||||
template.context.defaultValue &&
|
||||
isArray(template.context.defaultValue) &&
|
||||
template.context.defaultValue.length === newValue.length &&
|
||||
template.context.defaultValue.join() === newValue.join()
|
||||
) {
|
||||
return this._onDidChangeSetting.fire({
|
||||
key: template.context.setting.key,
|
||||
value: undefined, // reset setting
|
||||
type: template.context.valueType
|
||||
});
|
||||
}
|
||||
|
||||
this._onDidChangeSetting.fire({
|
||||
key: template.context.setting.key,
|
||||
|
||||
@@ -20,6 +20,7 @@ import { foreground, inputBackground, inputBorder, inputForeground, listActiveSe
|
||||
import { attachButtonStyler, attachInputBoxStyler } from 'vs/platform/theme/common/styler';
|
||||
import { ICssStyleCollector, ITheme, IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
|
||||
import { disposableTimeout } from 'vs/base/common/async';
|
||||
import { isUndefinedOrNull } from 'vs/base/common/types';
|
||||
|
||||
const $ = DOM.$;
|
||||
export const settingsHeaderForeground = registerColor('settings.headerForeground', { light: '#444444', dark: '#e7e7e7', hc: '#ffffff' }, localize('headerForeground', "(For settings editor preview) The foreground color for a section header or active title."));
|
||||
@@ -131,14 +132,16 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
|
||||
}
|
||||
});
|
||||
|
||||
type EditKey = 'none' | 'create' | number;
|
||||
|
||||
export class ListSettingListModel {
|
||||
private _dataItems: IListDataItem[] = [];
|
||||
private _editKey: string | null;
|
||||
private _editKey: EditKey;
|
||||
private _selectedIdx: number | null;
|
||||
|
||||
get items(): IListViewItem[] {
|
||||
const items = this._dataItems.map((item, i) => {
|
||||
const editing = item.value === this._editKey;
|
||||
const editing = typeof this._editKey === 'number' && this._editKey === i;
|
||||
return <IListViewItem>{
|
||||
...item,
|
||||
editing,
|
||||
@@ -146,7 +149,7 @@ export class ListSettingListModel {
|
||||
};
|
||||
});
|
||||
|
||||
if (this._editKey === '') {
|
||||
if (this._editKey === 'create') {
|
||||
items.push({
|
||||
editing: true,
|
||||
selected: true,
|
||||
@@ -158,7 +161,7 @@ export class ListSettingListModel {
|
||||
return items;
|
||||
}
|
||||
|
||||
setEditKey(key: string | null): void {
|
||||
setEditKey(key: EditKey): void {
|
||||
this._editKey = key;
|
||||
}
|
||||
|
||||
@@ -195,7 +198,7 @@ export interface IListChangeEvent {
|
||||
originalValue: string;
|
||||
value?: string;
|
||||
sibling?: string;
|
||||
removeIndex?: number;
|
||||
targetIndex?: number;
|
||||
}
|
||||
|
||||
export class ListSettingWidget extends Disposable {
|
||||
@@ -218,7 +221,8 @@ export class ListSettingWidget extends Disposable {
|
||||
) {
|
||||
super();
|
||||
|
||||
this.listElement = DOM.append(container, $('.setting-list-widget'));
|
||||
this.listElement = DOM.append(container, $('div'));
|
||||
this.getContainerClasses().forEach(c => this.listElement.classList.add(c));
|
||||
this.listElement.setAttribute('tabindex', '0');
|
||||
DOM.append(container, this.renderAddButton());
|
||||
this.renderList();
|
||||
@@ -228,13 +232,19 @@ export class ListSettingWidget extends Disposable {
|
||||
|
||||
this._register(DOM.addStandardDisposableListener(this.listElement, 'keydown', (e: KeyboardEvent) => {
|
||||
if (e.keyCode === KeyCode.UpArrow) {
|
||||
const selectedIndex = this.model.getSelected();
|
||||
this.model.selectPrevious();
|
||||
this.renderList();
|
||||
if (this.model.getSelected() !== selectedIndex) {
|
||||
this.renderList();
|
||||
}
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
} else if (e.keyCode === KeyCode.DownArrow) {
|
||||
const selectedIndex = this.model.getSelected();
|
||||
this.model.selectNext();
|
||||
this.renderList();
|
||||
if (this.model.getSelected() !== selectedIndex) {
|
||||
this.renderList();
|
||||
}
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}
|
||||
@@ -259,6 +269,10 @@ export class ListSettingWidget extends Disposable {
|
||||
};
|
||||
}
|
||||
|
||||
protected getContainerClasses() {
|
||||
return ['setting-list-widget'];
|
||||
}
|
||||
|
||||
setValue(listData: IListDataItem[]): void {
|
||||
this.model.setValue(listData);
|
||||
this.renderList();
|
||||
@@ -288,7 +302,7 @@ export class ListSettingWidget extends Disposable {
|
||||
|
||||
const item = this.model.items[targetIdx];
|
||||
if (item) {
|
||||
this.editSetting(item.value);
|
||||
this.editSetting(targetIdx);
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}
|
||||
@@ -342,30 +356,30 @@ export class ListSettingWidget extends Disposable {
|
||||
enabled: true,
|
||||
id: 'workbench.action.removeListItem',
|
||||
tooltip: this.getLocalizedStrings().deleteActionTooltip,
|
||||
run: () => this._onDidChangeList.fire({ originalValue: key, value: undefined, removeIndex: idx })
|
||||
run: () => this._onDidChangeList.fire({ originalValue: key, value: undefined, targetIndex: idx })
|
||||
};
|
||||
}
|
||||
|
||||
private createEditAction(key: string): IAction {
|
||||
private createEditAction(idx: number): IAction {
|
||||
return <IAction>{
|
||||
class: 'setting-listAction-edit',
|
||||
enabled: true,
|
||||
id: 'workbench.action.editListItem',
|
||||
tooltip: this.getLocalizedStrings().editActionTooltip,
|
||||
run: () => {
|
||||
this.editSetting(key);
|
||||
this.editSetting(idx);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private editSetting(key: string): void {
|
||||
this.model.setEditKey(key);
|
||||
private editSetting(idx: number): void {
|
||||
this.model.setEditKey(idx);
|
||||
this.renderList();
|
||||
}
|
||||
|
||||
private renderItem(item: IListViewItem, idx: number, listFocused: boolean): HTMLElement {
|
||||
return item.editing ?
|
||||
this.renderEditItem(item) :
|
||||
this.renderEditItem(item, idx) :
|
||||
this.renderDataItem(item, idx, listFocused);
|
||||
}
|
||||
|
||||
@@ -384,7 +398,7 @@ export class ListSettingWidget extends Disposable {
|
||||
siblingElement.textContent = item.sibling ? ('when: ' + item.sibling) : null;
|
||||
|
||||
actionBar.push([
|
||||
this.createEditAction(item.value),
|
||||
this.createEditAction(idx),
|
||||
this.createDeleteAction(item.value, idx)
|
||||
], { icon: true, label: false });
|
||||
|
||||
@@ -412,24 +426,25 @@ export class ListSettingWidget extends Disposable {
|
||||
this._register(attachButtonStyler(startAddButton, this.themeService));
|
||||
|
||||
this._register(startAddButton.onDidClick(() => {
|
||||
this.model.setEditKey('');
|
||||
this.model.setEditKey('create');
|
||||
this.renderList();
|
||||
}));
|
||||
|
||||
return rowElement;
|
||||
}
|
||||
|
||||
private renderEditItem(item: IListViewItem): HTMLElement {
|
||||
private renderEditItem(item: IListViewItem, idx: number): HTMLElement {
|
||||
const rowElement = $('.setting-list-edit-row');
|
||||
|
||||
const onSubmit = (edited: boolean) => {
|
||||
this.model.setEditKey(null);
|
||||
this.model.setEditKey('none');
|
||||
const value = valueInput.value.trim();
|
||||
if (edited && value) {
|
||||
if (edited && !isUndefinedOrNull(value)) {
|
||||
this._onDidChangeList.fire({
|
||||
originalValue: item.value,
|
||||
value: value,
|
||||
sibling: siblingInput && siblingInput.value.trim()
|
||||
sibling: siblingInput && siblingInput.value.trim(),
|
||||
targetIndex: idx
|
||||
});
|
||||
}
|
||||
this.renderList();
|
||||
@@ -514,6 +529,10 @@ export class ExcludeSettingWidget extends ListSettingWidget {
|
||||
settingListRowSiblingHintLabel: localize('excludeSiblingHintLabel', "Exclude files matching `{0}`, only when a file matching `{1}` is present", pattern, sibling)
|
||||
};
|
||||
}
|
||||
|
||||
protected getContainerClasses() {
|
||||
return ['setting-list-exclude-widget'];
|
||||
}
|
||||
}
|
||||
|
||||
export interface IListDataItem {
|
||||
|
||||
@@ -284,6 +284,26 @@ class ProgressReporter {
|
||||
}
|
||||
}
|
||||
|
||||
class RemoteExtensionHostEnvironmentUpdater implements IWorkbenchContribution {
|
||||
constructor(
|
||||
@IRemoteAgentService remoteAgentService: IRemoteAgentService,
|
||||
@IRemoteAuthorityResolverService remoteResolverService: IRemoteAuthorityResolverService,
|
||||
@IExtensionService extensionService: IExtensionService
|
||||
) {
|
||||
const connection = remoteAgentService.getConnection();
|
||||
if (connection) {
|
||||
connection.onDidStateChange(async e => {
|
||||
if (e.type === PersistentConnectionEventType.ConnectionGain) {
|
||||
const resolveResult = await remoteResolverService.resolveAuthority(connection.remoteAuthority);
|
||||
if (resolveResult.options && resolveResult.options.extensionHostEnv) {
|
||||
await extensionService.setRemoteEnvironment(resolveResult.options.extensionHostEnv);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class RemoteAgentConnectionStatusListener implements IWorkbenchContribution {
|
||||
constructor(
|
||||
@IRemoteAgentService remoteAgentService: IRemoteAgentService,
|
||||
@@ -440,6 +460,7 @@ const workbenchContributionsRegistry = Registry.as<IWorkbenchContributionsRegist
|
||||
workbenchContributionsRegistry.registerWorkbenchContribution(RemoteChannelsContribution, LifecyclePhase.Starting);
|
||||
workbenchContributionsRegistry.registerWorkbenchContribution(RemoteAgentDiagnosticListener, LifecyclePhase.Eventually);
|
||||
workbenchContributionsRegistry.registerWorkbenchContribution(RemoteAgentConnectionStatusListener, LifecyclePhase.Eventually);
|
||||
workbenchContributionsRegistry.registerWorkbenchContribution(RemoteExtensionHostEnvironmentUpdater, LifecyclePhase.Eventually);
|
||||
workbenchContributionsRegistry.registerWorkbenchContribution(RemoteWindowActiveIndicator, LifecyclePhase.Starting);
|
||||
workbenchContributionsRegistry.registerWorkbenchContribution(RemoteTelemetryEnablementUpdater, LifecyclePhase.Ready);
|
||||
workbenchContributionsRegistry.registerWorkbenchContribution(RemoteEmptyWorkbenchPresentation, LifecyclePhase.Starting);
|
||||
|
||||
@@ -213,37 +213,6 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
||||
}
|
||||
});
|
||||
|
||||
CommandsRegistry.registerCommand({
|
||||
id: Constants.RevealInSideBarForSearchResults,
|
||||
handler: (accessor, fileMatch: FileMatch) => {
|
||||
const viewletService = accessor.get(IViewletService);
|
||||
const explorerService = accessor.get(IExplorerService);
|
||||
const contextService = accessor.get(IWorkspaceContextService);
|
||||
const uri = fileMatch.resource;
|
||||
|
||||
viewletService.openViewlet(VIEWLET_ID_FILES, false).then((viewlet: ExplorerViewlet) => {
|
||||
if (uri && contextService.isInsideWorkspace(uri)) {
|
||||
const explorerView = viewlet.getExplorerView();
|
||||
if (explorerView) {
|
||||
explorerView.setExpanded(true);
|
||||
explorerService.select(uri, true).then(() => explorerView.focus(), onUnexpectedError);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
const RevealInSideBarForSearchResultsCommand: ICommandAction = {
|
||||
id: Constants.RevealInSideBarForSearchResults,
|
||||
title: nls.localize('revealInSideBar', "Reveal in Explorer")
|
||||
};
|
||||
|
||||
MenuRegistry.appendMenuItem(MenuId.SearchContext, {
|
||||
command: RevealInSideBarForSearchResultsCommand,
|
||||
when: ContextKeyExpr.and(Constants.FileFocusKey, Constants.HasSearchResults),
|
||||
group: '2_files',
|
||||
});
|
||||
|
||||
MenuRegistry.appendMenuItem(MenuId.SearchContext, {
|
||||
command: {
|
||||
id: Constants.ReplaceActionId,
|
||||
@@ -343,6 +312,38 @@ CommandsRegistry.registerCommand({
|
||||
handler: clearHistoryCommand
|
||||
});
|
||||
|
||||
CommandsRegistry.registerCommand({
|
||||
id: Constants.RevealInSideBarForSearchResults,
|
||||
handler: (accessor, fileMatch: FileMatch) => {
|
||||
const viewletService = accessor.get(IViewletService);
|
||||
const explorerService = accessor.get(IExplorerService);
|
||||
const contextService = accessor.get(IWorkspaceContextService);
|
||||
const uri = fileMatch.resource;
|
||||
|
||||
viewletService.openViewlet(VIEWLET_ID_FILES, false).then((viewlet: ExplorerViewlet) => {
|
||||
if (uri && contextService.isInsideWorkspace(uri)) {
|
||||
const explorerView = viewlet.getExplorerView();
|
||||
if (explorerView) {
|
||||
explorerView.setExpanded(true);
|
||||
explorerService.select(uri, true).then(() => explorerView.focus(), onUnexpectedError);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
const RevealInSideBarForSearchResultsCommand: ICommandAction = {
|
||||
id: Constants.RevealInSideBarForSearchResults,
|
||||
title: nls.localize('revealInSideBar', "Reveal in Explorer")
|
||||
};
|
||||
|
||||
MenuRegistry.appendMenuItem(MenuId.SearchContext, {
|
||||
command: RevealInSideBarForSearchResultsCommand,
|
||||
when: ContextKeyExpr.and(Constants.FileFocusKey, Constants.HasSearchResults),
|
||||
group: 'search_3',
|
||||
order: 1
|
||||
});
|
||||
|
||||
const clearSearchHistoryLabel = nls.localize('clearSearchHistoryLabel', "Clear Search History");
|
||||
const ClearSearchHistoryCommand: ICommandAction = {
|
||||
id: Constants.ClearSearchHistoryCommandId,
|
||||
|
||||
@@ -470,17 +470,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
|
||||
return this._taskSystem.customExecutionComplete(task, result);
|
||||
}
|
||||
|
||||
private isBadTsConfig(taskId: string | TaskIdentifier | undefined): taskId is string {
|
||||
const badTsconfig = '\\tsconfig.json';
|
||||
const tsc = 'tsc';
|
||||
return typeof taskId === 'string' && (taskId.length > badTsconfig.length) && strings.equalsIgnoreCase(taskId.substring(taskId.length - badTsconfig.length, taskId.length), badTsconfig) && (taskId.substring(0, tsc.length) === tsc);
|
||||
}
|
||||
|
||||
public getTask(folder: IWorkspaceFolder | string, identifier: string | TaskIdentifier, compareId: boolean = false): Promise<Task | undefined> {
|
||||
if (this.isBadTsConfig(identifier)) {
|
||||
return Promise.reject(new Error(nls.localize('badTsConfig', "Task '{0}' contains \"\\\\\". Typescript tasks must use \"/\"", identifier)));
|
||||
}
|
||||
|
||||
const name = Types.isString(folder) ? folder : folder.name;
|
||||
if (this.ignoredWorkspaceFolders.some(ignored => ignored.name === name)) {
|
||||
return Promise.reject(new Error(nls.localize('TaskServer.folderIgnored', 'The folder {0} is ignored since it uses task version 0.1.0', name)));
|
||||
|
||||
@@ -378,6 +378,9 @@ actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(RenameTerminalAc
|
||||
actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(FocusTerminalFindWidgetAction, FocusTerminalFindWidgetAction.ID, FocusTerminalFindWidgetAction.LABEL, {
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_F
|
||||
}, KEYBINDING_CONTEXT_TERMINAL_FOCUS), 'Terminal: Focus Find Widget', category);
|
||||
actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(FocusTerminalFindWidgetAction, FocusTerminalFindWidgetAction.ID, FocusTerminalFindWidgetAction.LABEL, {
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_F
|
||||
}, KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_FOCUSED), 'Terminal: Focus Find Widget', category);
|
||||
actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(HideTerminalFindWidgetAction, HideTerminalFindWidgetAction.ID, HideTerminalFindWidgetAction.LABEL, {
|
||||
primary: KeyCode.Escape,
|
||||
secondary: [KeyMod.Shift | KeyCode.Escape]
|
||||
|
||||
@@ -38,6 +38,7 @@ const winLocalLinkClause = '((' + winPathPrefix + '|(' + winExcludedPathCharacte
|
||||
replacing space with nonBreakningSpace or space ASCII code - 32. */
|
||||
const lineAndColumnClause = [
|
||||
'((\\S*)", line ((\\d+)( column (\\d+))?))', // "(file path)", line 45 [see #40468]
|
||||
'((\\S*)",((\\d+)(:(\\d+))?))', // "(file path)",45 [see #78205]
|
||||
'((\\S*) on line ((\\d+)(, column (\\d+))?))', // (file path) on line 8, column 13
|
||||
'((\\S*):line ((\\d+)(, column (\\d+))?))', // (file path):line 8, column 13
|
||||
'(([^\\s\\(\\)]*)(\\s?[\\(\\[](\\d+)(,\\s?(\\d+))?)[\\)\\]])', // (file path)(45), (file path) (45), (file path)(45,18), (file path) (45,18), (file path)(45, 18), (file path) (45, 18), also with []
|
||||
|
||||
@@ -78,7 +78,11 @@ function resolveConfigurationVariables(configurationResolverService: IConfigurat
|
||||
Object.keys(env).forEach((key) => {
|
||||
const value = env[key];
|
||||
if (typeof value === 'string' && lastActiveWorkspaceRoot !== null) {
|
||||
env[key] = configurationResolverService.resolve(lastActiveWorkspaceRoot, value);
|
||||
try {
|
||||
env[key] = configurationResolverService.resolve(lastActiveWorkspaceRoot, value);
|
||||
} catch (e) {
|
||||
env[key] = value;
|
||||
}
|
||||
}
|
||||
});
|
||||
return env;
|
||||
@@ -138,19 +142,19 @@ export function getCwd(
|
||||
if (!shell.ignoreConfigurationCwd && customCwd) {
|
||||
if (configurationResolverService) {
|
||||
try {
|
||||
cwd = configurationResolverService.resolve(lastActiveWorkspace, customCwd);
|
||||
customCwd = configurationResolverService.resolve(lastActiveWorkspace, customCwd);
|
||||
} catch (e) {
|
||||
// There was an issue resolving a variable, just use the unresolved customCwd which
|
||||
// which will fail, and log the error in the console.
|
||||
cwd = customCwd;
|
||||
if (logService) {
|
||||
logService.error('Resolving terminal.integrated.cwd', e);
|
||||
logService.error('Could not resolve terminal.integrated.cwd', e);
|
||||
}
|
||||
return customCwd;
|
||||
}
|
||||
}
|
||||
if (path.isAbsolute(customCwd) && !cwd) {
|
||||
if (path.isAbsolute(customCwd)) {
|
||||
cwd = customCwd;
|
||||
} else if (root && !cwd) {
|
||||
} else if (root) {
|
||||
cwd = path.join(root.fsPath, customCwd);
|
||||
}
|
||||
}
|
||||
@@ -192,7 +196,8 @@ export function getDefaultShell(
|
||||
windir: string | undefined,
|
||||
lastActiveWorkspace: IWorkspaceFolder | undefined,
|
||||
configurationResolverService: IConfigurationResolverService | undefined,
|
||||
platformOverride: platform.Platform = platform.platform,
|
||||
logService: ILogService,
|
||||
platformOverride: platform.Platform = platform.platform
|
||||
): string {
|
||||
const platformKey = platformOverride === platform.Platform.Windows ? 'windows' : platformOverride === platform.Platform.Mac ? 'osx' : 'linux';
|
||||
const shellConfigValue = fetchSetting(`terminal.integrated.shell.${platformKey}`);
|
||||
@@ -214,7 +219,12 @@ export function getDefaultShell(
|
||||
}
|
||||
|
||||
if (configurationResolverService) {
|
||||
executable = configurationResolverService.resolve(lastActiveWorkspace, executable);
|
||||
try {
|
||||
executable = configurationResolverService.resolve(lastActiveWorkspace, executable);
|
||||
} catch (e) {
|
||||
logService.error(`Could not resolve terminal.integrated.shell.${platformKey}`, e);
|
||||
executable = executable;
|
||||
}
|
||||
}
|
||||
|
||||
return executable;
|
||||
@@ -225,6 +235,7 @@ export function getDefaultShellArgs(
|
||||
isWorkspaceShellAllowed: boolean,
|
||||
lastActiveWorkspace: IWorkspaceFolder | undefined,
|
||||
configurationResolverService: IConfigurationResolverService | undefined,
|
||||
logService: ILogService,
|
||||
platformOverride: platform.Platform = platform.platform,
|
||||
): string | string[] {
|
||||
const platformKey = platformOverride === platform.Platform.Windows ? 'windows' : platformOverride === platform.Platform.Mac ? 'osx' : 'linux';
|
||||
@@ -236,7 +247,12 @@ export function getDefaultShellArgs(
|
||||
if (configurationResolverService) {
|
||||
const resolvedArgs: string[] = [];
|
||||
for (const arg of args) {
|
||||
resolvedArgs.push(configurationResolverService.resolve(lastActiveWorkspace, arg));
|
||||
try {
|
||||
resolvedArgs.push(configurationResolverService.resolve(lastActiveWorkspace, arg));
|
||||
} catch (e) {
|
||||
logService.error(`Could not resolve terminal.integrated.shellArgs.${platformKey}`, e);
|
||||
resolvedArgs.push(arg);
|
||||
}
|
||||
}
|
||||
args = resolvedArgs;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import { getMainProcessParentEnv } from 'vs/workbench/contrib/terminal/node/term
|
||||
import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver';
|
||||
import { IHistoryService } from 'vs/workbench/services/history/common/history';
|
||||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
let Terminal: typeof XTermTerminal;
|
||||
let WebLinksAddon: typeof XTermWebLinksAddon;
|
||||
@@ -34,7 +35,8 @@ export class TerminalInstanceService implements ITerminalInstanceService {
|
||||
@IStorageService private readonly _storageService: IStorageService,
|
||||
@IConfigurationResolverService private readonly _configurationResolverService: IConfigurationResolverService,
|
||||
@IWorkspaceContextService private readonly _workspaceContextService: IWorkspaceContextService,
|
||||
@IHistoryService private readonly _historyService: IHistoryService
|
||||
@IHistoryService private readonly _historyService: IHistoryService,
|
||||
@ILogService private readonly _logService: ILogService
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -84,6 +86,7 @@ export class TerminalInstanceService implements ITerminalInstanceService {
|
||||
process.env.windir,
|
||||
lastActiveWorkspace,
|
||||
this._configurationResolverService,
|
||||
this._logService,
|
||||
platformOverride
|
||||
);
|
||||
const args = getDefaultShellArgs(
|
||||
@@ -91,6 +94,7 @@ export class TerminalInstanceService implements ITerminalInstanceService {
|
||||
isWorkspaceShellAllowed,
|
||||
lastActiveWorkspace,
|
||||
this._configurationResolverService,
|
||||
this._logService,
|
||||
platformOverride
|
||||
);
|
||||
return Promise.resolve({ shell, args });
|
||||
@@ -99,4 +103,4 @@ export class TerminalInstanceService implements ITerminalInstanceService {
|
||||
public getMainProcessParentEnv(): Promise<IProcessEnvironment> {
|
||||
return getMainProcessParentEnv();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,10 +120,11 @@ async function detectAvailableWindowsShells(): Promise<IShellDefinition[]> {
|
||||
`${process.env['ProgramFiles']}\\Git\\usr\\bin\\bash.exe`,
|
||||
`${process.env['LocalAppData']}\\Programs\\Git\\bin\\bash.exe`,
|
||||
],
|
||||
Cygwin: [
|
||||
`${process.env['HOMEDRIVE']}\\cygwin64\\bin\\bash.exe`,
|
||||
`${process.env['HOMEDRIVE']}\\cygwin\\bin\\bash.exe`
|
||||
]
|
||||
// See #75945
|
||||
// Cygwin: [
|
||||
// `${process.env['HOMEDRIVE']}\\cygwin64\\bin\\bash.exe`,
|
||||
// `${process.env['HOMEDRIVE']}\\cygwin\\bin\\bash.exe`
|
||||
// ]
|
||||
};
|
||||
const promises: PromiseLike<IShellDefinition | undefined>[] = [];
|
||||
Object.keys(expectedLocations).forEach(key => promises.push(validateShellPaths(key, expectedLocations[key])));
|
||||
@@ -170,4 +171,4 @@ async function getShellPathFromRegistry(shellName: string): Promise<string> {
|
||||
} catch (error) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +121,8 @@ suite('Workbench - TerminalLinkHandler', () => {
|
||||
{ urlFormat: '{0}[{1},{2}]', line: '5', column: '3' },
|
||||
{ urlFormat: '{0} [{1},{2}]', line: '5', column: '3' },
|
||||
{ urlFormat: '{0}[{1}, {2}]', line: '5', column: '3' },
|
||||
{ urlFormat: '{0} [{1}, {2}]', line: '5', column: '3' }
|
||||
{ urlFormat: '{0} [{1}, {2}]', line: '5', column: '3' },
|
||||
{ urlFormat: '"{0}",{1}', line: '5' }
|
||||
];
|
||||
|
||||
linkUrls.forEach(linkUrl => {
|
||||
@@ -185,7 +186,8 @@ suite('Workbench - TerminalLinkHandler', () => {
|
||||
{ urlFormat: '{0}[{1}]', line: '5' },
|
||||
{ urlFormat: '{0} [{1}]', line: '5' },
|
||||
{ urlFormat: '{0}[{1},{2}]', line: '5', column: '3' },
|
||||
{ urlFormat: '{0} [{1},{2}]', line: '5', column: '3' }
|
||||
{ urlFormat: '{0} [{1},{2}]', line: '5', column: '3' },
|
||||
{ urlFormat: '"{0}",{1}', line: '5' }
|
||||
];
|
||||
|
||||
linkUrls.forEach(linkUrl => {
|
||||
|
||||
@@ -490,7 +490,7 @@ export class UpdateContribution extends Disposable implements IWorkbenchContribu
|
||||
group: '5_update',
|
||||
command: {
|
||||
id: 'update.checking',
|
||||
title: nls.localize('checkingForUpdates', "Checking For Updates..."),
|
||||
title: nls.localize('checkingForUpdates', "Checking for Updates..."),
|
||||
precondition: FalseContext
|
||||
},
|
||||
when: CONTEXT_UPDATE_STATE.isEqualTo(StateType.CheckingForUpdates)
|
||||
|
||||
@@ -31,7 +31,7 @@ export function getWebviewThemeData(
|
||||
}, {} as { [key: string]: string });
|
||||
|
||||
const styles = {
|
||||
'vscode-font-family': '-apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", ans-serif',
|
||||
'vscode-font-family': '-apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", sans-serif',
|
||||
'vscode-font-weight': 'normal',
|
||||
'vscode-font-size': '13px',
|
||||
'vscode-editor-font-family': editorFontFamily,
|
||||
@@ -60,4 +60,4 @@ namespace ApiThemeClassName {
|
||||
return ApiThemeClassName.highContrast;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||