未验证 提交 af99f3cd 编写于 作者: M Miguel Solorio 提交者: GitHub

Merge branch 'master' into misolori/notebook-cell-polish

......@@ -4,7 +4,7 @@
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
"version": "https://github.com/microsoft/vscode-markdown-tm-grammar/commit/7cf9aa7bb76c55428063383610edc0a631230d58",
"version": "https://github.com/microsoft/vscode-markdown-tm-grammar/commit/a7e4475626a505472c76d18e0a1b3cfcf46f9cf9",
"name": "Markdown",
"scopeName": "text.html.markdown",
"patterns": [
......@@ -1715,6 +1715,72 @@
}
]
},
"fenced_code_block_erlang": {
"begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(erlang)((\\s+|:|\\{)[^`~]*)?$)",
"name": "markup.fenced_code.block.markdown",
"end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
"beginCaptures": {
"3": {
"name": "punctuation.definition.markdown"
},
"4": {
"name": "fenced_code.block.language.markdown"
},
"5": {
"name": "fenced_code.block.language.attributes.markdown"
}
},
"endCaptures": {
"3": {
"name": "punctuation.definition.markdown"
}
},
"patterns": [
{
"begin": "(^|\\G)(\\s*)(.*)",
"while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
"contentName": "meta.embedded.block.erlang",
"patterns": [
{
"include": "source.erlang"
}
]
}
]
},
"fenced_code_block_elixir": {
"begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(elixir)((\\s+|:|\\{)[^`~]*)?$)",
"name": "markup.fenced_code.block.markdown",
"end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
"beginCaptures": {
"3": {
"name": "punctuation.definition.markdown"
},
"4": {
"name": "fenced_code.block.language.markdown"
},
"5": {
"name": "fenced_code.block.language.attributes.markdown"
}
},
"endCaptures": {
"3": {
"name": "punctuation.definition.markdown"
}
},
"patterns": [
{
"begin": "(^|\\G)(\\s*)(.*)",
"while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
"contentName": "meta.embedded.block.elixir",
"patterns": [
{
"include": "source.elixir"
}
]
}
]
},
"fenced_code_block": {
"patterns": [
{
......@@ -1867,6 +1933,12 @@
{
"include": "#fenced_code_block_log"
},
{
"include": "#fenced_code_block_erlang"
},
{
"include": "#fenced_code_block_elixir"
},
{
"include": "#fenced_code_block_unknown"
}
......
......@@ -25,11 +25,7 @@ namespace Experimental {
readonly error?: string
}
export type RefactorTriggerReason = RefactorInvokedReason;
export interface RefactorInvokedReason {
readonly kind: 'invoked';
}
export type RefactorTriggerReason = 'implicit' | 'invoked';
export interface GetApplicableRefactorsRequestArgs extends Proto.FileRangeRequestArgs {
readonly triggerReason?: RefactorTriggerReason;
......@@ -275,11 +271,11 @@ class TypeScriptRefactorProvider implements vscode.CodeActionProvider {
return this.appendInvalidActions(actions);
}
private toTsTriggerReason(context: vscode.CodeActionContext): Experimental.RefactorInvokedReason | undefined {
private toTsTriggerReason(context: vscode.CodeActionContext): Experimental.RefactorTriggerReason | undefined {
if (!context.only) {
return;
}
return { kind: 'invoked' };
return 'invoked';
}
private convertApplicableRefactors(
......
......@@ -432,11 +432,37 @@ export abstract class AbstractExtHostExtensionService implements ExtHostExtensio
this._logService.error(err);
});
for (const desc of this._registry.getAllExtensionDescriptions()) {
if (desc.activationEvents) {
for (const activationEvent of desc.activationEvents) {
if (/^onStartup:/.test(activationEvent)) {
const strTime = activationEvent.substr('onStartup:'.length);
const time = parseInt(strTime, 10);
if (!isNaN(time)) {
this._activateDelayed(desc, activationEvent, time);
}
}
}
}
}
this._disposables.add(this._extHostWorkspace.onDidChangeWorkspace((e) => this._handleWorkspaceContainsEagerExtensions(e.added)));
const folders = this._extHostWorkspace.workspace ? this._extHostWorkspace.workspace.folders : [];
return this._handleWorkspaceContainsEagerExtensions(folders);
}
private _activateDelayed(desc: IExtensionDescription, activationEvent: string, delayMs: number): void {
setTimeout(() => {
this._activateById(desc.identifier, {
startup: true,
extensionId: desc.identifier,
activationEvent: activationEvent
}).then(undefined, (err) => {
this._logService.error(err);
});
}, delayMs);
}
private _handleWorkspaceContainsEagerExtensions(folders: ReadonlyArray<vscode.WorkspaceFolder>): Promise<void> {
if (folders.length === 0) {
return Promise.resolve(undefined);
......
......@@ -372,6 +372,9 @@ export class RuntimeExtensionsEditor extends BaseEditor {
'{0} will be a glob pattern'
]
}, "Activated by {1} because searching for {0} took too long", glob, activationId);
} else if (/^onStartup:/.test(activationEvent)) {
const time = activationEvent.substr('onStartup:'.length);
title = nls.localize('startupActivation', "Activated by {0} with a delay of {1} ms on start-up", activationId, time);
} else if (/^onLanguage:/.test(activationEvent)) {
let language = activationEvent.substr('onLanguage:'.length);
title = nls.localize('languageActivation', "Activated by {1} because you opened a {0} file", language, activationId);
......
......@@ -269,6 +269,11 @@ export const schema: IJSONSchema = {
description: nls.localize('vscode.extension.activationEvents.workspaceContains', 'An activation event emitted whenever a folder is opened that contains at least a file matching the specified glob pattern.'),
body: 'workspaceContains:${4:filePattern}'
},
{
label: 'onStartup',
description: nls.localize('vscode.extension.activationEvents.onStartup', 'An activation event emitted a certain amount of milliseconds after the start-up.'),
body: 'onStartup:${1:2000}'
},
{
label: 'onFileSystem',
description: nls.localize('vscode.extension.activationEvents.onFileSystem', 'An activation event emitted whenever a file or folder is accessed with the given scheme.'),
......
......@@ -323,6 +323,12 @@ export class ExtensionService extends AbstractExtensionService implements IExten
shouldActivateReason = activationEvent;
break;
}
if (/^onStartup/.test(activationEvent)) {
shouldActivate = true;
shouldActivateReason = activationEvent;
break;
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册