mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
Merge branch 'master' into ben/sandbox-environment
This commit is contained in:
commit
3da939d1d7
|
@ -94,6 +94,10 @@
|
|||
"name": "vs/workbench/contrib/issue",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/contrib/keybindings",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/contrib/markers",
|
||||
"project": "vscode-workbench"
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"url": "vscode://schemas/keybindings"
|
||||
},
|
||||
{
|
||||
"fileMatch": "vscode://defaultsettings/*/*.json",
|
||||
"fileMatch": "vscode://defaultsettings/*.json",
|
||||
"url": "vscode://schemas/settings/default"
|
||||
},
|
||||
{
|
||||
|
|
|
@ -123,7 +123,10 @@ export async function publishRepository(gitAPI: GitAPI, repository?: Repository)
|
|||
try {
|
||||
quickpick.busy = true;
|
||||
|
||||
const children = (await vscode.workspace.fs.readDirectory(folder)).map(([name]) => name);
|
||||
const children = (await vscode.workspace.fs.readDirectory(folder))
|
||||
.map(([name]) => name)
|
||||
.filter(name => name !== '.git');
|
||||
|
||||
quickpick.items = children.map(name => ({ label: name }));
|
||||
quickpick.selectedItems = quickpick.items;
|
||||
quickpick.busy = false;
|
||||
|
|
|
@ -36,7 +36,8 @@ const args = minimist(process.argv, {
|
|||
'help',
|
||||
'verbose',
|
||||
'wrap-iframe',
|
||||
'enable-sync'
|
||||
'enable-sync',
|
||||
'trusted-types'
|
||||
],
|
||||
string: [
|
||||
'scheme',
|
||||
|
@ -53,6 +54,7 @@ if (args.help) {
|
|||
'yarn web [options]\n' +
|
||||
' --no-launch Do not open VSCode web in the browser\n' +
|
||||
' --wrap-iframe Wrap the Web Worker Extension Host in an iframe\n' +
|
||||
' --trusted-types Enable trusted types (report only)\n' +
|
||||
' --enable-sync Enable sync by default\n' +
|
||||
' --scheme Protocol (https or http)\n' +
|
||||
' --host Remote host\n' +
|
||||
|
@ -396,7 +398,13 @@ async function handleRoot(req, res) {
|
|||
.replace('{{WEBVIEW_ENDPOINT}}', '')
|
||||
.replace('{{REMOTE_USER_DATA_URI}}', '');
|
||||
|
||||
res.writeHead(200, { 'Content-Type': 'text/html' });
|
||||
|
||||
const headers = { 'Content-Type': 'text/html' };
|
||||
if (args['trusted-types']) {
|
||||
headers['Content-Security-Policy-Report-Only'] = 'require-trusted-types-for \'script\';';
|
||||
}
|
||||
|
||||
res.writeHead(200, headers);
|
||||
return res.end(data);
|
||||
}
|
||||
|
||||
|
|
|
@ -533,6 +533,53 @@ class Queue<T> {
|
|||
}
|
||||
}
|
||||
|
||||
class LoadEstimator {
|
||||
|
||||
private static _HISTORY_LENGTH = 10;
|
||||
private static _INSTANCE: LoadEstimator | null = null;
|
||||
public static getInstance(): LoadEstimator {
|
||||
if (!LoadEstimator._INSTANCE) {
|
||||
LoadEstimator._INSTANCE = new LoadEstimator();
|
||||
}
|
||||
return LoadEstimator._INSTANCE;
|
||||
}
|
||||
|
||||
private lastRuns: number[];
|
||||
|
||||
constructor() {
|
||||
this.lastRuns = [];
|
||||
const now = Date.now();
|
||||
for (let i = 0; i < LoadEstimator._HISTORY_LENGTH; i++) {
|
||||
this.lastRuns[i] = now - 1000 * i;
|
||||
}
|
||||
setInterval(() => {
|
||||
for (let i = LoadEstimator._HISTORY_LENGTH; i >= 1; i--) {
|
||||
this.lastRuns[i] = this.lastRuns[i - 1];
|
||||
}
|
||||
this.lastRuns[0] = Date.now();
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
* returns an estimative number, from 0 (low load) to 1 (high load)
|
||||
*/
|
||||
public load(): number {
|
||||
const now = Date.now();
|
||||
const historyLimit = (1 + LoadEstimator._HISTORY_LENGTH) * 1000;
|
||||
let score = 0;
|
||||
for (let i = 0; i < LoadEstimator._HISTORY_LENGTH; i++) {
|
||||
if (now - this.lastRuns[i] <= historyLimit) {
|
||||
score++;
|
||||
}
|
||||
}
|
||||
return 1 - score / LoadEstimator._HISTORY_LENGTH;
|
||||
}
|
||||
|
||||
public hasHighLoad(): boolean {
|
||||
return this.load() >= 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Same as Protocol, but will actually track messages and acks.
|
||||
* Moreover, it will ensure no messages are lost if there are no event listeners.
|
||||
|
@ -559,6 +606,8 @@ export class PersistentProtocol implements IMessagePassingProtocol {
|
|||
private _socketReader: ProtocolReader;
|
||||
private _socketDisposables: IDisposable[];
|
||||
|
||||
private readonly _loadEstimator = LoadEstimator.getInstance();
|
||||
|
||||
private readonly _onControlMessage = new BufferedEmitter<VSBuffer>();
|
||||
readonly onControlMessage: Event<VSBuffer> = this._onControlMessage.event;
|
||||
|
||||
|
@ -670,15 +719,19 @@ export class PersistentProtocol implements IMessagePassingProtocol {
|
|||
|
||||
const timeSinceLastIncomingMsg = Date.now() - this._socketReader.lastReadTime;
|
||||
if (timeSinceLastIncomingMsg >= ProtocolConstants.KeepAliveTimeoutTime) {
|
||||
// Trash the socket
|
||||
this._onSocketTimeout.fire(undefined);
|
||||
return;
|
||||
// It's been a long time since we received a server message
|
||||
// But this might be caused by the event loop being busy and failing to read messages
|
||||
if (!this._loadEstimator.hasHighLoad()) {
|
||||
// Trash the socket
|
||||
this._onSocketTimeout.fire(undefined);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this._incomingKeepAliveTimeout = setTimeout(() => {
|
||||
this._incomingKeepAliveTimeout = null;
|
||||
this._recvKeepAliveCheck();
|
||||
}, ProtocolConstants.KeepAliveTimeoutTime - timeSinceLastIncomingMsg + 5);
|
||||
}, Math.max(ProtocolConstants.KeepAliveTimeoutTime - timeSinceLastIncomingMsg, 0) + 5);
|
||||
}
|
||||
|
||||
public getSocket(): ISocket {
|
||||
|
@ -821,15 +874,19 @@ export class PersistentProtocol implements IMessagePassingProtocol {
|
|||
const oldestUnacknowledgedMsg = this._outgoingUnackMsg.peek()!;
|
||||
const timeSinceOldestUnacknowledgedMsg = Date.now() - oldestUnacknowledgedMsg.writtenTime;
|
||||
if (timeSinceOldestUnacknowledgedMsg >= ProtocolConstants.AcknowledgeTimeoutTime) {
|
||||
// Trash the socket
|
||||
this._onSocketTimeout.fire(undefined);
|
||||
return;
|
||||
// It's been a long time since our sent message was acknowledged
|
||||
// But this might be caused by the event loop being busy and failing to read messages
|
||||
if (!this._loadEstimator.hasHighLoad()) {
|
||||
// Trash the socket
|
||||
this._onSocketTimeout.fire(undefined);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this._outgoingAckTimeout = setTimeout(() => {
|
||||
this._outgoingAckTimeout = null;
|
||||
this._recvAckCheck();
|
||||
}, ProtocolConstants.AcknowledgeTimeoutTime - timeSinceOldestUnacknowledgedMsg + 5);
|
||||
}, Math.max(ProtocolConstants.AcknowledgeTimeoutTime - timeSinceOldestUnacknowledgedMsg, 0) + 5);
|
||||
}
|
||||
|
||||
private _sendAck(): void {
|
||||
|
|
|
@ -440,7 +440,13 @@ class WindowIndicator implements IWindowIndicator {
|
|||
// Find credentials from DOM
|
||||
const credentialsElement = document.getElementById('vscode-workbench-credentials');
|
||||
const credentialsElementAttribute = credentialsElement ? credentialsElement.getAttribute('data-settings') : undefined;
|
||||
const credentialsProvider = new LocalStorageCredentialsProvider(credentialsElementAttribute ? JSON.parse(credentialsElementAttribute) : []);
|
||||
let credentials = undefined;
|
||||
if (credentialsElementAttribute) {
|
||||
try {
|
||||
credentials = JSON.parse(credentialsElementAttribute);
|
||||
} catch (error) { /* Invalid credentials are passed. Ignore. */ }
|
||||
}
|
||||
const credentialsProvider = new LocalStorageCredentialsProvider(credentials || []);
|
||||
|
||||
// Finally create workbench
|
||||
create(document.body, {
|
||||
|
|
|
@ -358,7 +358,7 @@ registerThemingParticipant((theme, collector) => {
|
|||
if (!caretBackground) {
|
||||
caretBackground = caret.opposite();
|
||||
}
|
||||
collector.addRule(`.monaco-editor .cursor { background-color: ${caret}; border-color: ${caret}; color: ${caretBackground}; }`);
|
||||
collector.addRule(`.monaco-editor .cursors-layer .cursor { background-color: ${caret}; border-color: ${caret}; color: ${caretBackground}; }`);
|
||||
if (theme.type === 'hc') {
|
||||
collector.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${caretBackground}; border-right: 1px solid ${caretBackground}; }`);
|
||||
}
|
||||
|
|
|
@ -81,8 +81,6 @@ export abstract class AbstractKeybindingService extends Disposable implements IK
|
|||
protected _log(str: string): void {
|
||||
if (this._logging) {
|
||||
this._logService.info(`[KeybindingService]: ${str}`);
|
||||
} else {
|
||||
this._logService.trace(`[KeybindingService]: ${str}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ import { fromNow } from 'vs/base/common/date';
|
|||
import { ActivationKind, IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
|
||||
import { Platform, platform } from 'vs/base/common/platform';
|
||||
|
||||
const VSO_ALLOWED_EXTENSIONS = ['github.vscode-pull-request-github', 'github.vscode-pull-request-github-insiders', 'vscode.git', 'ms-vsonline.vsonline', 'vscode.github-browser'];
|
||||
const VSO_ALLOWED_EXTENSIONS = ['github.vscode-pull-request-github', 'github.vscode-pull-request-github-insiders', 'vscode.git', 'ms-vsonline.vsonline', 'vscode.github-browser', 'ms-vscode.github-browser'];
|
||||
|
||||
interface IAccountUsage {
|
||||
extensionId: string;
|
||||
|
|
|
@ -324,8 +324,6 @@ configurationRegistry.registerConfiguration({
|
|||
type: 'string',
|
||||
format: 'color-hex',
|
||||
default: '#FF0000',
|
||||
minLength: 4,
|
||||
maxLength: 9,
|
||||
description: nls.localize('screencastMode.mouseIndicatorColor', "Controls the color in hex (#RGB, #RGBA, #RRGGBB or #RRGGBBAA) of the mouse indicator in screencast mode.")
|
||||
},
|
||||
'screencastMode.mouseIndicatorSize': {
|
||||
|
|
|
@ -106,6 +106,11 @@ export abstract class CompositePart<T extends Composite> extends Part {
|
|||
return this.activeComposite;
|
||||
}
|
||||
|
||||
// We cannot open the composite if we have not been created yet
|
||||
if (!this.element) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Open
|
||||
return this.doOpenComposite(id, focus);
|
||||
}
|
||||
|
|
|
@ -187,11 +187,11 @@ function registerCommandsAndActions(): void {
|
|||
registerDebugViewMenuItem(MenuId.DebugCallStackContext, RESTART_FRAME_ID, nls.localize('restartFrame', "Restart Frame"), 10, ContextKeyExpr.and(CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('stackFrame'), CONTEXT_RESTART_FRAME_SUPPORTED));
|
||||
registerDebugViewMenuItem(MenuId.DebugCallStackContext, COPY_STACK_TRACE_ID, nls.localize('copyStackTrace', "Copy Call Stack"), 20, CONTEXT_CALLSTACK_ITEM_TYPE.isEqualTo('stackFrame'));
|
||||
|
||||
registerDebugViewMenuItem(MenuId.DebugVariablesContext, SET_VARIABLE_ID, nls.localize('setValue', "Set Value"), 10, CONTEXT_SET_VARIABLE_SUPPORTED);
|
||||
registerDebugViewMenuItem(MenuId.DebugVariablesContext, COPY_VALUE_ID, nls.localize('copyValue', "Copy Value"), 20);
|
||||
registerDebugViewMenuItem(MenuId.DebugVariablesContext, COPY_EVALUATE_PATH_ID, nls.localize('copyAsExpression', "Copy as Expression"), 30, CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT);
|
||||
registerDebugViewMenuItem(MenuId.DebugVariablesContext, ADD_TO_WATCH_ID, nls.localize('addToWatchExpressions', "Add to Watch"), 10, CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT, undefined, '3_watch');
|
||||
registerDebugViewMenuItem(MenuId.DebugVariablesContext, BREAK_WHEN_VALUE_CHANGES_ID, nls.localize('breakWhenValueChanges', "Break When Value Changes"), 20, CONTEXT_BREAK_WHEN_VALUE_CHANGES_SUPPORTED, undefined, '5_breakpoint');
|
||||
registerDebugViewMenuItem(MenuId.DebugVariablesContext, SET_VARIABLE_ID, nls.localize('setValue', "Set Value"), 10, CONTEXT_SET_VARIABLE_SUPPORTED, undefined, '3_modification');
|
||||
registerDebugViewMenuItem(MenuId.DebugVariablesContext, COPY_VALUE_ID, nls.localize('copyValue', "Copy Value"), 10, undefined, undefined, '5_cutcopypaste');
|
||||
registerDebugViewMenuItem(MenuId.DebugVariablesContext, COPY_EVALUATE_PATH_ID, nls.localize('copyAsExpression', "Copy as Expression"), 20, CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT, undefined, '5_cutcopypaste');
|
||||
registerDebugViewMenuItem(MenuId.DebugVariablesContext, ADD_TO_WATCH_ID, nls.localize('addToWatchExpressions', "Add to Watch"), 100, CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT, undefined, 'z_commands');
|
||||
registerDebugViewMenuItem(MenuId.DebugVariablesContext, BREAK_WHEN_VALUE_CHANGES_ID, nls.localize('breakWhenValueChanges', "Break When Value Changes"), 200, CONTEXT_BREAK_WHEN_VALUE_CHANGES_SUPPORTED, undefined, 'z_commands');
|
||||
|
||||
// Touch Bar
|
||||
if (isMacintosh) {
|
||||
|
|
|
@ -22,6 +22,7 @@ import { KeyCode } from 'vs/base/common/keyCodes';
|
|||
import { ContextScopedHistoryInputBox } from 'vs/platform/browser/contextScopedHistoryWidget';
|
||||
import { attachInputBoxStyler } from 'vs/platform/theme/common/styler';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { ReplEvaluationResult, ReplEvaluationInput } from 'vs/workbench/contrib/debug/common/replModel';
|
||||
|
||||
|
||||
type ParsedQuery = {
|
||||
|
@ -51,6 +52,11 @@ export class ReplFilter implements ITreeFilter<IReplElement> {
|
|||
}
|
||||
|
||||
filter(element: IReplElement, parentVisibility: TreeVisibility): TreeFilterResult<void> {
|
||||
if (element instanceof ReplEvaluationInput || element instanceof ReplEvaluationResult) {
|
||||
// Only filter the output events, everything else is visible https://github.com/microsoft/vscode/issues/105863
|
||||
return TreeVisibility.Visible;
|
||||
}
|
||||
|
||||
let includeQueryPresent = false;
|
||||
let includeQueryMatched = false;
|
||||
|
||||
|
@ -107,7 +113,7 @@ export class ReplFilterActionViewItem extends BaseActionViewItem {
|
|||
@IThemeService private readonly themeService: IThemeService,
|
||||
@IContextViewService private readonly contextViewService: IContextViewService) {
|
||||
super(null, action);
|
||||
this.delayedFilterUpdate = new Delayer<void>(200);
|
||||
this.delayedFilterUpdate = new Delayer<void>(400);
|
||||
this._register(toDisposable(() => this.delayedFilterUpdate.cancel()));
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ export class SimpleReplElement implements IReplElement {
|
|||
) { }
|
||||
|
||||
toString(): string {
|
||||
const sourceStr = this.sourceData ? ` ${this.sourceData.source.name}:${this.sourceData.lineNumber}` : '';
|
||||
const sourceStr = this.sourceData ? ` ${this.sourceData.source.name}` : '';
|
||||
return this.value + sourceStr;
|
||||
}
|
||||
|
||||
|
@ -145,7 +145,7 @@ export class ReplGroup implements IReplElement {
|
|||
}
|
||||
|
||||
toString(): string {
|
||||
const sourceStr = this.sourceData ? ` ${this.sourceData.source.name}:${this.sourceData.lineNumber}` : '';
|
||||
const sourceStr = this.sourceData ? ` ${this.sourceData.source.name}` : '';
|
||||
return this.name + sourceStr;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as nls from 'vs/nls';
|
||||
import { Action2, registerAction2 } from 'vs/platform/actions/common/actions';
|
||||
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { rendererLogChannelId } from 'vs/workbench/contrib/logs/common/logConstants';
|
||||
import { IOutputService } from 'vs/workbench/contrib/output/common/output';
|
||||
|
||||
const developerCategory = { value: nls.localize({ key: 'developer', comment: ['A developer on Code itself or someone diagnosing issues in Code'] }, "Developer"), original: 'Developer' };
|
||||
|
||||
class ToggleKeybindingsLogAction extends Action2 {
|
||||
|
||||
constructor() {
|
||||
super({
|
||||
id: 'workbench.action.toggleKeybindingsLog',
|
||||
title: { value: nls.localize('toggleKeybindingsLog', "Toggle Keyboard Shortcuts Troubleshooting"), original: 'Toggle Keyboard Shortcuts Troubleshooting' },
|
||||
category: developerCategory,
|
||||
f1: true
|
||||
});
|
||||
}
|
||||
|
||||
run(accessor: ServicesAccessor): void {
|
||||
const logging = accessor.get(IKeybindingService).toggleLogging();
|
||||
if (logging) {
|
||||
const outputService = accessor.get(IOutputService);
|
||||
outputService.showChannel(rendererLogChannelId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
registerAction2(ToggleKeybindingsLogAction);
|
|
@ -274,7 +274,7 @@ export class MarkersFilterActionViewItem extends BaseActionViewItem {
|
|||
) {
|
||||
super(null, action);
|
||||
this.focusContextKey = Constants.MarkerViewFilterFocusContextKey.bindTo(contextKeyService);
|
||||
this.delayedFilterUpdate = new Delayer<void>(200);
|
||||
this.delayedFilterUpdate = new Delayer<void>(400);
|
||||
this._register(toDisposable(() => this.delayedFilterUpdate.cancel()));
|
||||
this._register(filterController.onDidFocusFilter(() => this.focus()));
|
||||
this._register(filterController.onDidClearFilterText(() => this.clearFilterText()));
|
||||
|
|
|
@ -209,7 +209,6 @@ export class NotebookTextDiffEditor extends EditorPane implements INotebookTextD
|
|||
}
|
||||
|
||||
async updateLayout() {
|
||||
console.log('update layout');
|
||||
if (!this._model) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -387,7 +387,7 @@ export class NotebookContribution extends Disposable implements IWorkbenchContri
|
|||
const existingEditors = group.editors.filter(editor => editor.resource && isEqual(editor.resource, notebookUri) && !(editor instanceof NotebookEditorInput));
|
||||
|
||||
if (existingEditors.length) {
|
||||
return { override: this.editorService.openEditor(existingEditors[0]) };
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const userAssociatedEditors = this.getUserAssociatedEditors(notebookUri);
|
||||
|
|
|
@ -44,9 +44,8 @@ class NotebookDiffEditorModel extends EditorModel implements INotebookDiffEditor
|
|||
}
|
||||
|
||||
dispose(): void {
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export class NotebookDiffEditorInput extends EditorInput {
|
||||
|
|
|
@ -192,7 +192,6 @@ export type ToWebviewMessage =
|
|||
| IHideOutputMessage
|
||||
| IShowOutputMessage
|
||||
| IUpdatePreloadResourceMessage
|
||||
| IFocusOutputMessage
|
||||
| IUpdateDecorationsMessage
|
||||
| ICustomRendererMessage;
|
||||
|
||||
|
|
|
@ -561,7 +561,7 @@ export class OutlinePane extends ViewPane {
|
|||
return;
|
||||
}
|
||||
|
||||
this._revealTreeSelection(newModel, e.element, !!e.editorOptions.preserveFocus || !e.editorOptions.pinned, e.sideBySide);
|
||||
this._revealTreeSelection(newModel, e.element, !!e.editorOptions.preserveFocus, !!e.editorOptions.pinned, e.sideBySide);
|
||||
}));
|
||||
|
||||
// feature: reveal editor selection in outline
|
||||
|
@ -615,12 +615,13 @@ export class OutlinePane extends ViewPane {
|
|||
}));
|
||||
}
|
||||
|
||||
private async _revealTreeSelection(model: OutlineModel, element: OutlineElement, preserveFocus: boolean, aside: boolean): Promise<void> {
|
||||
private async _revealTreeSelection(model: OutlineModel, element: OutlineElement, preserveFocus: boolean, pinned: boolean, aside: boolean): Promise<void> {
|
||||
await this._editorService.openCodeEditor(
|
||||
{
|
||||
resource: model.uri,
|
||||
options: {
|
||||
preserveFocus,
|
||||
pinned,
|
||||
selection: Range.collapseToStart(element.symbol.selectionRange),
|
||||
selectionRevealType: TextEditorSelectionRevealType.NearTopIfOutsideViewport,
|
||||
}
|
||||
|
|
|
@ -706,7 +706,7 @@ class TreeRenderer extends Disposable implements ITreeRenderer<ITreeItem, FuzzyS
|
|||
@IHoverService private readonly hoverService: IHoverService
|
||||
) {
|
||||
super();
|
||||
this.hoverDelay = this.configurationService.getValue<number>('editor.hover.delay');
|
||||
this.hoverDelay = 500; // milliseconds
|
||||
}
|
||||
|
||||
get templateId(): string {
|
||||
|
@ -811,12 +811,17 @@ class TreeRenderer extends Disposable implements ITreeRenderer<ITreeItem, FuzzyS
|
|||
const hoverService = this.hoverService;
|
||||
const hoverDelay = this.hoverDelay;
|
||||
let hoverOptions: IHoverOptions | undefined;
|
||||
let mouseX: number | undefined;
|
||||
function mouseOver(this: HTMLElement, e: MouseEvent): any {
|
||||
let isHovering = true;
|
||||
function mouseMove(this: HTMLElement, e: MouseEvent): any {
|
||||
mouseX = e.x;
|
||||
}
|
||||
function mouseLeave(this: HTMLElement, e: MouseEvent): any {
|
||||
isHovering = false;
|
||||
}
|
||||
this.addEventListener(DOM.EventType.MOUSE_LEAVE, mouseLeave, { passive: true });
|
||||
this.addEventListener(DOM.EventType.MOUSE_MOVE, mouseMove, { passive: true });
|
||||
setTimeout(async () => {
|
||||
if (node instanceof ResolvableTreeItem) {
|
||||
await node.resolve();
|
||||
|
@ -830,9 +835,12 @@ class TreeRenderer extends Disposable implements ITreeRenderer<ITreeItem, FuzzyS
|
|||
};
|
||||
hoverOptions = { text: tooltip, target };
|
||||
}
|
||||
(<IHoverTarget>hoverOptions.target).x = e.x;
|
||||
if (mouseX !== undefined) {
|
||||
(<IHoverTarget>hoverOptions.target).x = mouseX;
|
||||
}
|
||||
hoverService.showHover(hoverOptions);
|
||||
}
|
||||
this.removeEventListener(DOM.EventType.MOUSE_MOVE, mouseMove);
|
||||
this.removeEventListener(DOM.EventType.MOUSE_LEAVE, mouseLeave);
|
||||
}, hoverDelay);
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ import { IUserKeybindingItem, KeybindingIO, OutputBuilder } from 'vs/workbench/s
|
|||
import { IKeyboardMapper } from 'vs/workbench/services/keybinding/common/keyboardMapper';
|
||||
import { IHostService } from 'vs/workbench/services/host/browser/host';
|
||||
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
|
||||
import { Action2, MenuRegistry, registerAction2 } from 'vs/platform/actions/common/actions';
|
||||
import { MenuRegistry } from 'vs/platform/actions/common/actions';
|
||||
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
|
||||
import { commandsExtensionPoint } from 'vs/workbench/api/common/menusExtensionPoint';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
|
@ -48,7 +48,6 @@ import { ScanCode, ScanCodeUtils, IMMUTABLE_CODE_TO_KEY_CODE } from 'vs/base/com
|
|||
import { flatten } from 'vs/base/common/arrays';
|
||||
import { BrowserFeatures, KeyboardSupport } from 'vs/base/browser/canIUse';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
|
||||
|
||||
interface ContributedKeyBinding {
|
||||
|
@ -745,26 +744,6 @@ let schema: IJSONSchema = {
|
|||
}
|
||||
};
|
||||
|
||||
const preferencesCategory = nls.localize('preferences', "Preferences");
|
||||
|
||||
class ToggleKeybindingsLogAction extends Action2 {
|
||||
|
||||
constructor() {
|
||||
super({
|
||||
id: 'workbench.action.toggleKeybindingsLog',
|
||||
title: { value: nls.localize('toggleKeybindingsLog', "Toggle Keyboard Shortcuts Troubleshooting"), original: 'Toggle Keyboard Shortcuts Troubleshooting' },
|
||||
category: preferencesCategory,
|
||||
f1: true
|
||||
});
|
||||
}
|
||||
|
||||
run(accessor: ServicesAccessor): void {
|
||||
accessor.get(IKeybindingService).toggleLogging();
|
||||
}
|
||||
}
|
||||
|
||||
registerAction2(ToggleKeybindingsLogAction);
|
||||
|
||||
let schemaRegistry = Registry.as<IJSONContributionRegistry>(Extensions.JSONContribution);
|
||||
schemaRegistry.registerSchema(schemaId, schema);
|
||||
|
||||
|
|
|
@ -3,9 +3,10 @@
|
|||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { JSONSchemaType } from 'vs/base/common/jsonSchema';
|
||||
import { isArray } from 'vs/base/common/types';
|
||||
import * as nls from 'vs/nls';
|
||||
import { JSONSchemaType } from 'vs/base/common/jsonSchema';
|
||||
import { Color } from 'vs/base/common/color';
|
||||
import { isArray } from 'vs/base/common/types';
|
||||
import { IConfigurationPropertySchema } from 'vs/platform/configuration/common/configurationRegistry';
|
||||
|
||||
type Validator<T> = { enabled: boolean, isValid: (value: T) => boolean; message: string };
|
||||
|
@ -111,6 +112,11 @@ function getStringValidators(prop: IConfigurationPropertySchema) {
|
|||
isValid: ((value: string) => patternRegex!.test(value)),
|
||||
message: prop.patternErrorMessage || nls.localize('validations.regex', "Value must match regex `{0}`.", prop.pattern)
|
||||
},
|
||||
{
|
||||
enabled: prop.format === 'color-hex',
|
||||
isValid: ((value: string) => Color.Format.CSS.parseHex(value)),
|
||||
message: nls.localize('validations.colorFormat', "Invalid color format. Use #RGB, #RGBA, #RRGGBB or #RRGGBBAA.")
|
||||
}
|
||||
].filter(validation => validation.enabled);
|
||||
}
|
||||
|
||||
|
|
|
@ -232,6 +232,9 @@ import 'vs/workbench/contrib/emmet/browser/emmet.contribution';
|
|||
// CodeEditor Contributions
|
||||
import 'vs/workbench/contrib/codeEditor/browser/codeEditor.contribution';
|
||||
|
||||
// Keybindings Contributions
|
||||
import 'vs/workbench/contrib/keybindings/browser/keybindings.contribution';
|
||||
|
||||
// Execution
|
||||
import 'vs/workbench/contrib/externalTerminal/browser/externalTerminal.contribution';
|
||||
|
||||
|
|
|
@ -1236,9 +1236,9 @@ bindings@^1.5.0:
|
|||
file-uri-to-path "1.0.0"
|
||||
|
||||
bl@^4.0.1, bl@^4.0.2:
|
||||
version "4.0.2"
|
||||
resolved "https://registry.yarnpkg.com/bl/-/bl-4.0.2.tgz#52b71e9088515d0606d9dd9cc7aa48dc1f98e73a"
|
||||
integrity sha512-j4OH8f6Qg2bGuWfRiltT2HYGx0e1QcBTrK9KAHNMwMZdQnDZFk0ZSYIpADjYCB3U12nicC5tVJwSIhwOWjb4RQ==
|
||||
version "4.0.3"
|
||||
resolved "https://registry.yarnpkg.com/bl/-/bl-4.0.3.tgz#12d6287adc29080e22a705e5764b2a9522cdc489"
|
||||
integrity sha512-fs4G6/Hu4/EE+F75J8DuN/0IpQqNjAdC7aEQv7Qt8MHGUH7Ckv2MwTEEeN9QehD0pfIDkMI1bkHYkKy7xHyKIg==
|
||||
dependencies:
|
||||
buffer "^5.5.0"
|
||||
inherits "^2.0.4"
|
||||
|
|
Loading…
Reference in a new issue