Merge branch 'master' into electron-4.0.x
commit
a2ef1c8491
|
@ -65,7 +65,7 @@ This project incorporates components from the projects listed below. The origina
|
|||
58. TypeScript-TmLanguage version 1.0.0 (https://github.com/Microsoft/TypeScript-TmLanguage)
|
||||
59. Unicode version 12.0.0 (http://www.unicode.org/)
|
||||
60. vscode-logfile-highlighter version 2.4.1 (https://github.com/emilast/vscode-logfile-highlighter)
|
||||
61. vscode-octicons-font version 1.2.0 (https://github.com/Microsoft/vscode-octicons-font)
|
||||
61. vscode-octicons-font version 1.3.0 (https://github.com/Microsoft/vscode-octicons-font)
|
||||
62. vscode-swift version 0.0.1 (https://github.com/owensd/vscode-swift)
|
||||
63. Web Background Synchronization (https://github.com/WICG/BackgroundSync)
|
||||
|
||||
|
|
|
@ -98,11 +98,11 @@
|
|||
"git": {
|
||||
"name": "vscode-octicons-font",
|
||||
"repositoryUrl": "https://github.com/Microsoft/vscode-octicons-font",
|
||||
"commitHash": "d9b9724beb850c6d038afe1cc1d46ba89a6a10ac"
|
||||
"commitHash": "415cd5b42ab699b6b46c0bf011ada0a2ae50bfb4"
|
||||
}
|
||||
},
|
||||
"license": "MIT",
|
||||
"version": "1.3.0"
|
||||
"version": "1.3.1"
|
||||
},
|
||||
{
|
||||
"component": {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "code-oss-dev",
|
||||
"version": "1.35.0",
|
||||
"distro": "78b820fcfbca46e0a1387efef3b8216e04100f45",
|
||||
"distro": "cab40df703292bfd88267c5b1941205cbd04de62",
|
||||
"author": {
|
||||
"name": "Microsoft Corporation"
|
||||
},
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
@font-face {
|
||||
font-family: "octicons";
|
||||
src: url("./octicons.ttf?f6919d21f641711143d5590f9de474df") format("truetype"),
|
||||
url("./octicons.svg?f6919d21f641711143d5590f9de474df#octicons") format("svg");
|
||||
src: url("./octicons.ttf?1b0f2a9535896866c74dd24eedeb4374") format("truetype"),
|
||||
url("./octicons.svg?1b0f2a9535896866c74dd24eedeb4374#octicons") format("svg");
|
||||
}
|
||||
|
||||
.octicon, .mega-octicon {
|
||||
|
|
|
@ -507,7 +507,7 @@
|
|||
horiz-adv-x="875" d=" M625 757.5H250L0 507.5V132.5L250 -117.5H625L875 132.5V507.5L625 757.5zM812.5 163.75L593.75 -55H281.25L62.5 163.75V476.25L281.25 695H593.75L812.5 476.25V163.75zM375 570H500V257.5H375V570zM375 195H500V70H375V195z" />
|
||||
<glyph glyph-name="sync"
|
||||
unicode=""
|
||||
horiz-adv-x="875" d=" M746.3625000000001 363.748125C760.21875 270.415 731.78125 172.70625 658.8625000000001 101.25C551.676875 -4.48125 386.155625 -17.60625 264.385 61.875L349.6975 145L36.1556875 188.75L79.905625 -117.5L175.42625 -25.625C347.51 -152.5 591.051875 -140.10625 747.09375 13.75C837.5125 103.4375 879.075 221.560625 873.96875 338.956875L746.3625000000001 363.748125V363.748125zM215.52875 538.75C322.71625 644.479375 488.2375 657.604375 610.0081250000001 578.125L524.695625 495L838.2375 451.25L794.4875000000001 757.5L698.96875 665.625C526.8831250000001 792.5 283.34125 780.1041875 126.570625 626.25C36.153875 536.5625 -4.67944375 418.4375 0.424724375 301.041875L128.02875 275.520625C114.175 368.854375 142.6125 467.291875 215.52875 538.75V538.75z" />
|
||||
horiz-adv-x="750" d=" M640 357.5A259.37500000000006 259.37500000000006 0 0 0 565.0000000000001 132.5A271.625 271.625 0 0 0 226.8750000000001 98.75L300 170L31.25 207.5L68.75 -55L150.625 23.75C298.125 -85 506.8749999999999 -74.375 640.625 57.5A367.25 367.25 0 0 1 749.375 336.2500000000001L640 357.5000000000001zM185 507.5A271.625 271.625 0 0 0 523.1250000000001 541.25L450 470L718.75 432.5000000000001L681.25 695L599.375 616.25C451.875 725.0000000000001 243.125 714.3750000000001 108.75 582.5C31.25 505.625 -3.75 404.375 0.625 303.75L110 281.875A260.625 260.625 0 0 0 185 507.5z" />
|
||||
<glyph glyph-name="tag"
|
||||
unicode=""
|
||||
horiz-adv-x="937.5" d=" M483.125 711.875C453.75 741.25 413.75 757.5 372.5 757.5H218.75C133.125 757.5 62.5 686.875 62.5 601.25V446.875C62.5 405.625 79.375 365.625 108.125 336.25L486.8749999999999 -42.5C511.25 -66.8750000000001 550.6249999999999 -66.8750000000001 575 -42.5L861.875 244.375A62.25000000000001 62.25000000000001 0 0 1 861.875 332.5L483.125 711.875zM148.75 376.875C129.375 395.625 119.375 420.625 119.375 447.5V601.25C119.375 656.25 164.375 700.625 218.75 700.625H373.1250000000001C399.3750000000001 700.625 425.0000000000001 690.625 443.7500000000001 671.25L827.5 288.125L531.875 -7.5L148.75 376.875zM188.125 632.5H313.125V507.5H187.5V632.5H188.125z" />
|
||||
|
|
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 130 KiB |
Binary file not shown.
|
@ -839,7 +839,7 @@ const editorConfiguration: IConfigurationNode = {
|
|||
enumDescriptions: [
|
||||
nls.localize('editor.gotoLocation.multiple.peek', 'Show peek view of the results (default)'),
|
||||
nls.localize('editor.gotoLocation.multiple.gotoAndPeek', 'Go to the primary result and show a peek view'),
|
||||
nls.localize('editor.gotoLocation.multiple.goto', 'Go to the primary result and ignore others')
|
||||
nls.localize('editor.gotoLocation.multiple.goto', 'Go to the primary result and enable peek-less navigation to others')
|
||||
]
|
||||
},
|
||||
'editor.selectionHighlight': {
|
||||
|
|
|
@ -469,6 +469,9 @@ export class MainThreadComments extends Disposable implements MainThreadComments
|
|||
private _handlers = new Map<number, string>();
|
||||
private _commentControllers = new Map<number, MainThreadCommentController>();
|
||||
|
||||
private _activeCommentThread?: MainThreadCommentThread;
|
||||
private _input?: modes.CommentInput;
|
||||
|
||||
private _openPanelListener: IDisposable | null;
|
||||
|
||||
constructor(
|
||||
|
@ -483,6 +486,26 @@ export class MainThreadComments extends Disposable implements MainThreadComments
|
|||
this._disposables = [];
|
||||
this._activeCommentThreadDisposables = [];
|
||||
this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostComments);
|
||||
|
||||
this._disposables.push(this._commentService.onDidChangeActiveCommentThread(async thread => {
|
||||
let handle = (thread as MainThreadCommentThread).controllerHandle;
|
||||
let controller = this._commentControllers.get(handle);
|
||||
|
||||
if (!controller) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._activeCommentThreadDisposables = dispose(this._activeCommentThreadDisposables);
|
||||
this._activeCommentThread = thread as MainThreadCommentThread;
|
||||
controller.activeCommentThread = this._activeCommentThread;
|
||||
|
||||
this._activeCommentThreadDisposables.push(this._activeCommentThread.onDidChangeInput(input => { // todo, dispose
|
||||
this._input = input;
|
||||
this._proxy.$onCommentWidgetInputChange(handle, URI.parse(this._activeCommentThread!.resource), this._activeCommentThread!.range, this._input ? this._input.value : undefined);
|
||||
}));
|
||||
|
||||
await this._proxy.$onCommentWidgetInputChange(controller.handle, URI.parse(this._activeCommentThread!.resource), this._activeCommentThread.range, this._input ? this._input.value : undefined);
|
||||
}));
|
||||
}
|
||||
|
||||
$registerCommentController(handle: number, id: string, label: string): void {
|
||||
|
|
|
@ -331,10 +331,12 @@ namespace schema {
|
|||
|
||||
let _commandRegistrations: IDisposable[] = [];
|
||||
|
||||
ExtensionsRegistry.registerExtensionPoint<schema.IUserFriendlyCommand | schema.IUserFriendlyCommand[]>({
|
||||
export const commandsExtensionPoint = ExtensionsRegistry.registerExtensionPoint<schema.IUserFriendlyCommand | schema.IUserFriendlyCommand[]>({
|
||||
extensionPoint: 'commands',
|
||||
jsonSchema: schema.commandsContribution
|
||||
}).setHandler(extensions => {
|
||||
});
|
||||
|
||||
commandsExtensionPoint.setHandler(extensions => {
|
||||
|
||||
function handleCommand(userFriendlyCommand: schema.IUserFriendlyCommand, extension: IExtensionPointUser<any>, disposables: IDisposable[]) {
|
||||
|
||||
|
|
|
@ -833,33 +833,34 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
|
|||
private async doShowEditor(editor: EditorInput, active: boolean, options?: EditorOptions): Promise<IEditor | null> {
|
||||
|
||||
// Show in editor control if the active editor changed
|
||||
const openEditorPromise = this.editorControl.openEditor(editor, options);
|
||||
let openEditorPromise: Promise<IEditor | null>;
|
||||
if (active) {
|
||||
openEditorPromise = (async () => {
|
||||
try {
|
||||
const result = await this.editorControl.openEditor(editor, options);
|
||||
|
||||
// Editor change event
|
||||
if (result.editorChanged) {
|
||||
this._onDidGroupChange.fire({ kind: GroupChangeKind.EDITOR_ACTIVE, editor });
|
||||
}
|
||||
|
||||
return result.control;
|
||||
} catch (error) {
|
||||
|
||||
// Handle errors but do not bubble them up
|
||||
this.doHandleOpenEditorError(error, editor, options);
|
||||
|
||||
return null; // error: return NULL as result to signal this
|
||||
}
|
||||
})();
|
||||
} else {
|
||||
openEditorPromise = Promise.resolve(null); // inactive: return NULL as result to signal this
|
||||
}
|
||||
|
||||
// Show in title control after editor control because some actions depend on it
|
||||
this.titleAreaControl.openEditor(editor);
|
||||
|
||||
// Return opened editor to caller (can be NULL)
|
||||
let openedEditor: IEditor | null = null;
|
||||
if (active) {
|
||||
try {
|
||||
const result = await openEditorPromise;
|
||||
|
||||
// Editor change event
|
||||
if (result.editorChanged) {
|
||||
this._onDidGroupChange.fire({ kind: GroupChangeKind.EDITOR_ACTIVE, editor });
|
||||
}
|
||||
|
||||
openedEditor = result.control;
|
||||
} catch (error) {
|
||||
|
||||
// Handle errors but do not bubble them up
|
||||
this.doHandleOpenEditorError(error, editor, options);
|
||||
}
|
||||
} else {
|
||||
openedEditor = null; // inactive: return NULL as result to signal this
|
||||
}
|
||||
|
||||
return openedEditor;
|
||||
return openEditorPromise;
|
||||
}
|
||||
|
||||
private doHandleOpenEditorError(error: Error, editor: EditorInput, options?: EditorOptions): void {
|
||||
|
|
|
@ -619,6 +619,7 @@ export class SimpleCommentService implements ICommentService {
|
|||
onDidSetAllCommentThreads: Event<IWorkspaceCommentThreadsEvent> = Event.None;
|
||||
onDidUpdateCommentThreads: Event<ICommentThreadChangedEvent> = Event.None;
|
||||
onDidChangeActiveCommentingRange: Event<{ range: Range; commentingRangesInfo: CommentingRanges; }> = Event.None;
|
||||
onDidChangeActiveCommentThread: Event<any> = Event.None;
|
||||
onDidSetDataProvider: Event<void> = Event.None;
|
||||
onDidDeleteDataProvider: Event<string> = Event.None;
|
||||
setDocumentComments: any;
|
||||
|
@ -649,6 +650,7 @@ export class SimpleCommentService implements ICommentService {
|
|||
deleteReaction: any;
|
||||
getReactionGroup: any;
|
||||
toggleReaction: any;
|
||||
setActiveCommentThread: any;
|
||||
}
|
||||
registerSingleton(ICommentService, SimpleCommentService, true);
|
||||
//#endregion
|
||||
|
|
|
@ -424,12 +424,14 @@ export class CommentNode extends Disposable {
|
|||
uri: this._commentEditor.getModel()!.uri,
|
||||
value: this.comment.body.value
|
||||
};
|
||||
this.commentService.setActiveCommentThread(commentThread);
|
||||
|
||||
this._commentEditorDisposables.push(this._commentEditor.onDidFocusEditorWidget(() => {
|
||||
commentThread.input = {
|
||||
uri: this._commentEditor!.getModel()!.uri,
|
||||
value: this.comment.body.value
|
||||
};
|
||||
this.commentService.setActiveCommentThread(commentThread);
|
||||
}));
|
||||
|
||||
this._commentEditorDisposables.push(this._commentEditor.onDidChangeModelContent(e => {
|
||||
|
@ -439,6 +441,7 @@ export class CommentNode extends Disposable {
|
|||
let input = commentThread.input;
|
||||
input.value = newVal;
|
||||
commentThread.input = input;
|
||||
this.commentService.setActiveCommentThread(commentThread);
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
@ -486,6 +489,7 @@ export class CommentNode extends Disposable {
|
|||
uri: this._commentEditor.getModel()!.uri,
|
||||
value: newBody
|
||||
};
|
||||
this.commentService.setActiveCommentThread(commentThread);
|
||||
let commandId = this.comment.editCommand.id;
|
||||
let args = this.comment.editCommand.arguments || [];
|
||||
|
||||
|
@ -523,6 +527,7 @@ export class CommentNode extends Disposable {
|
|||
if (result.confirmed) {
|
||||
try {
|
||||
if (this.comment.deleteCommand) {
|
||||
this.commentService.setActiveCommentThread(this.commentThread);
|
||||
let commandId = this.comment.deleteCommand.id;
|
||||
let args = this.comment.deleteCommand.arguments || [];
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ export interface ICommentService {
|
|||
readonly onDidSetResourceCommentInfos: Event<IResourceCommentThreadEvent>;
|
||||
readonly onDidSetAllCommentThreads: Event<IWorkspaceCommentThreadsEvent>;
|
||||
readonly onDidUpdateCommentThreads: Event<ICommentThreadChangedEvent>;
|
||||
readonly onDidChangeActiveCommentThread: Event<CommentThread | null>;
|
||||
readonly onDidChangeActiveCommentingRange: Event<{ range: Range, commentingRangesInfo: CommentingRanges }>;
|
||||
readonly onDidSetDataProvider: Event<void>;
|
||||
readonly onDidDeleteDataProvider: Event<string>;
|
||||
|
@ -69,6 +70,7 @@ export interface ICommentService {
|
|||
deleteReaction(owner: string, resource: URI, comment: Comment, reaction: CommentReaction): Promise<void>;
|
||||
getReactionGroup(owner: string): CommentReaction[] | undefined;
|
||||
toggleReaction(owner: string, resource: URI, thread: CommentThread2, comment: Comment, reaction: CommentReaction): Promise<void>;
|
||||
setActiveCommentThread(commentThread: CommentThread | null): void;
|
||||
}
|
||||
|
||||
export class CommentService extends Disposable implements ICommentService {
|
||||
|
@ -89,6 +91,9 @@ export class CommentService extends Disposable implements ICommentService {
|
|||
private readonly _onDidUpdateCommentThreads: Emitter<ICommentThreadChangedEvent> = this._register(new Emitter<ICommentThreadChangedEvent>());
|
||||
readonly onDidUpdateCommentThreads: Event<ICommentThreadChangedEvent> = this._onDidUpdateCommentThreads.event;
|
||||
|
||||
private readonly _onDidChangeActiveCommentThread = this._register(new Emitter<CommentThread | null>());
|
||||
readonly onDidChangeActiveCommentThread = this._onDidChangeActiveCommentThread.event;
|
||||
|
||||
private readonly _onDidChangeActiveCommentingRange: Emitter<{
|
||||
range: Range, commentingRangesInfo:
|
||||
CommentingRanges
|
||||
|
@ -109,6 +114,10 @@ export class CommentService extends Disposable implements ICommentService {
|
|||
super();
|
||||
}
|
||||
|
||||
setActiveCommentThread(commentThread: CommentThread | null) {
|
||||
this._onDidChangeActiveCommentThread.fire(commentThread);
|
||||
}
|
||||
|
||||
setDocumentComments(resource: URI, commentInfos: ICommentInfo[]): void {
|
||||
this._onDidSetResourceCommentInfos.fire({ resource, commentInfos });
|
||||
}
|
||||
|
|
|
@ -211,6 +211,10 @@ export class ReviewZoneWidget extends ZoneWidget implements ICommentThreadWidget
|
|||
|
||||
this._bodyElement = <HTMLDivElement>dom.$('.body');
|
||||
container.appendChild(this._bodyElement);
|
||||
|
||||
dom.addDisposableListener(this._bodyElement, dom.EventType.FOCUS_IN, e => {
|
||||
this.commentService.setActiveCommentThread(this._commentThread);
|
||||
});
|
||||
}
|
||||
|
||||
protected _fillHead(container: HTMLElement): void {
|
||||
|
@ -265,6 +269,7 @@ export class ReviewZoneWidget extends ZoneWidget implements ICommentThreadWidget
|
|||
} else {
|
||||
const deleteCommand = (this._commentThread as modes.CommentThread2).deleteCommand;
|
||||
if (deleteCommand) {
|
||||
this.commentService.setActiveCommentThread(this._commentThread);
|
||||
return this.commandService.executeCommand(deleteCommand.id, ...(deleteCommand.arguments || []));
|
||||
} else if (this._commentEditor.getValue() === '') {
|
||||
this.commentService.disposeCommentThread(this._owner, this._commentThread.threadId!);
|
||||
|
@ -516,6 +521,7 @@ export class ReviewZoneWidget extends ZoneWidget implements ICommentThreadWidget
|
|||
uri: this._commentEditor.getModel()!.uri,
|
||||
value: this._commentEditor.getValue()
|
||||
};
|
||||
this.commentService.setActiveCommentThread(this._commentThread);
|
||||
}));
|
||||
|
||||
this._commentThreadDisposables.push(this._commentEditor.getModel()!.onDidChangeContent(() => {
|
||||
|
@ -526,6 +532,7 @@ export class ReviewZoneWidget extends ZoneWidget implements ICommentThreadWidget
|
|||
newInput.value = modelContent;
|
||||
thread.input = newInput;
|
||||
}
|
||||
this.commentService.setActiveCommentThread(this._commentThread);
|
||||
}));
|
||||
|
||||
this._commentThreadDisposables.push((this._commentThread as modes.CommentThread2).onDidChangeInput(input => {
|
||||
|
@ -727,6 +734,7 @@ export class ReviewZoneWidget extends ZoneWidget implements ICommentThreadWidget
|
|||
uri: this._commentEditor.getModel()!.uri,
|
||||
value: this._commentEditor.getValue()
|
||||
};
|
||||
this.commentService.setActiveCommentThread(this._commentThread);
|
||||
await this.commandService.executeCommand(acceptInputCommand.id, ...(acceptInputCommand.arguments || []));
|
||||
}));
|
||||
|
||||
|
@ -751,6 +759,7 @@ export class ReviewZoneWidget extends ZoneWidget implements ICommentThreadWidget
|
|||
uri: this._commentEditor.getModel()!.uri,
|
||||
value: this._commentEditor.getValue()
|
||||
};
|
||||
this.commentService.setActiveCommentThread(this._commentThread);
|
||||
await this.commandService.executeCommand(command.id, ...(command.arguments || []));
|
||||
}));
|
||||
});
|
||||
|
@ -821,6 +830,7 @@ export class ReviewZoneWidget extends ZoneWidget implements ICommentThreadWidget
|
|||
uri: this._commentEditor.getModel()!.uri,
|
||||
value: this._commentEditor.getValue()
|
||||
};
|
||||
this.commentService.setActiveCommentThread(this._commentThread);
|
||||
let commandId = commentThread.acceptInputCommand.id;
|
||||
let args = commentThread.acceptInputCommand.arguments || [];
|
||||
|
||||
|
|
|
@ -200,6 +200,9 @@ export class TerminalProcess implements ITerminalChildProcess, IDisposable {
|
|||
if (this._isDisposed) {
|
||||
return;
|
||||
}
|
||||
if (typeof cols !== 'number' || typeof rows !== 'number' || isNaN(cols) || isNaN(rows)) {
|
||||
return;
|
||||
}
|
||||
// Ensure that cols and rows are always >= 1, this prevents a native
|
||||
// exception in winpty.
|
||||
if (this._ptyProcess) {
|
||||
|
|
|
@ -44,6 +44,7 @@ import { ConfigurationCache } from 'vs/workbench/services/configuration/node/con
|
|||
import { ConfigurationFileService } from 'vs/workbench/services/configuration/node/configurationFileService';
|
||||
import { IRemoteAgentEnvironment } from 'vs/platform/remote/common/remoteAgentEnvironment';
|
||||
import { IConfigurationCache } from 'vs/workbench/services/configuration/common/configuration';
|
||||
import { VSBuffer } from 'vs/base/common/buffer';
|
||||
|
||||
class SettingsTestEnvironmentService extends EnvironmentService {
|
||||
|
||||
|
@ -1574,26 +1575,26 @@ suite('WorkspaceConfigurationService - Remote Folder', () => {
|
|||
return promise;
|
||||
});
|
||||
|
||||
// test('update remote settings', async () => {
|
||||
// registerRemoteFileSystemProvider();
|
||||
// resolveRemoteEnvironment();
|
||||
// await initialize();
|
||||
// assert.equal(testObject.getValue('configurationService.remote.machineSetting'), 'isSet');
|
||||
// const promise = new Promise((c, e) => {
|
||||
// testObject.onDidChangeConfiguration(event => {
|
||||
// try {
|
||||
// assert.equal(event.source, ConfigurationTarget.USER);
|
||||
// assert.deepEqual(event.affectedKeys, ['configurationService.remote.machineSetting']);
|
||||
// assert.equal(testObject.getValue('configurationService.remote.machineSetting'), 'remoteValue');
|
||||
// c();
|
||||
// } catch (error) {
|
||||
// e(error);
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
// fs.writeFileSync(remoteSettingsFile, '{ "configurationService.remote.machineSetting": "remoteValue" }');
|
||||
// return promise;
|
||||
// });
|
||||
test('update remote settings', async () => {
|
||||
registerRemoteFileSystemProvider();
|
||||
resolveRemoteEnvironment();
|
||||
await initialize();
|
||||
assert.equal(testObject.getValue('configurationService.remote.machineSetting'), 'isSet');
|
||||
const promise = new Promise((c, e) => {
|
||||
testObject.onDidChangeConfiguration(event => {
|
||||
try {
|
||||
assert.equal(event.source, ConfigurationTarget.USER);
|
||||
assert.deepEqual(event.affectedKeys, ['configurationService.remote.machineSetting']);
|
||||
assert.equal(testObject.getValue('configurationService.remote.machineSetting'), 'remoteValue');
|
||||
c();
|
||||
} catch (error) {
|
||||
e(error);
|
||||
}
|
||||
});
|
||||
});
|
||||
await instantiationService.get(IFileService).writeFile(URI.file(remoteSettingsFile), VSBuffer.fromString('{ "configurationService.remote.machineSetting": "remoteValue" }'));
|
||||
return promise;
|
||||
});
|
||||
|
||||
test('machine settings in local user settings does not override defaults', async () => {
|
||||
fs.writeFileSync(globalSettingsFile, '{ "configurationService.remote.machineSetting": "globalValue" }');
|
||||
|
|
|
@ -41,6 +41,7 @@ import { IWindowService } from 'vs/platform/windows/common/windows';
|
|||
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
|
||||
import { MenuRegistry } from 'vs/platform/actions/common/actions';
|
||||
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
|
||||
import { commandsExtensionPoint } from 'vs/workbench/api/common/menusExtensionPoint';
|
||||
|
||||
export class KeyboardMapperFactory {
|
||||
public static readonly INSTANCE = new KeyboardMapperFactory();
|
||||
|
@ -239,6 +240,7 @@ let keybindingType: IJSONSchema = {
|
|||
|
||||
const keybindingsExtPoint = ExtensionsRegistry.registerExtensionPoint<ContributedKeyBinding | ContributedKeyBinding[]>({
|
||||
extensionPoint: 'keybindings',
|
||||
deps: [commandsExtensionPoint],
|
||||
jsonSchema: {
|
||||
description: nls.localize('vscode.extension.contributes.keybindings', "Contributes keybindings."),
|
||||
oneOf: [
|
||||
|
@ -500,10 +502,21 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService {
|
|||
weight = KeybindingWeight.ExternalExtension + idx;
|
||||
}
|
||||
|
||||
let commandAction = MenuRegistry.getCommand(command);
|
||||
let precondition = commandAction && commandAction.precondition;
|
||||
let fullWhen: ContextKeyExpr | undefined;
|
||||
if (when && precondition) {
|
||||
fullWhen = ContextKeyExpr.and(precondition, ContextKeyExpr.deserialize(when));
|
||||
} else if (when) {
|
||||
fullWhen = ContextKeyExpr.deserialize(when);
|
||||
} else if (precondition) {
|
||||
fullWhen = precondition;
|
||||
}
|
||||
|
||||
let desc: IKeybindingRule2 = {
|
||||
id: command,
|
||||
args,
|
||||
when: ContextKeyExpr.deserialize(when),
|
||||
when: fullWhen,
|
||||
weight: weight,
|
||||
primary: KeybindingParser.parseKeybinding(key, OS),
|
||||
mac: mac ? { primary: KeybindingParser.parseKeybinding(mac, OS) } : null,
|
||||
|
@ -712,4 +725,4 @@ const keyboardConfiguration: IConfigurationNode = {
|
|||
|
||||
configurationRegistry.registerConfiguration(keyboardConfiguration);
|
||||
|
||||
registerSingleton(IKeybindingService, WorkbenchKeybindingService);
|
||||
registerSingleton(IKeybindingService, WorkbenchKeybindingService);
|
||||
|
|
Loading…
Reference in New Issue