Merge branch 'splitview' into scm-viewlet

This commit is contained in:
Joao Moreno
2017-09-18 11:32:04 +02:00
239 changed files with 5624 additions and 3555 deletions
+1 -1
View File
@@ -9,7 +9,7 @@
a code editor with what developers need for their core edit-build-debug cycle. Code
provides comprehensive editing and debugging support, an extensibility model, and lightweight integration with existing tools.
VS Code is updated monthly with new features and bug fixes. You can download it for Windows, macOS, and Linux on [VS Code's website](https://code.visualstudio.com/Download). To get the latest releases everyday, you can install the [Insiders version of VS Code](https://code.visualstudio.com/insiders). This builds from the master branch and is updated at least daily.
VS Code is updated monthly with new features and bug fixes. You can download it for Windows, macOS, and Linux on [VS Code's website](https://code.visualstudio.com/Download). To get the latest releases every day, you can install the [Insiders version of VS Code](https://code.visualstudio.com/insiders). This builds from the master branch and is updated at least daily.
<p align="center">
<img alt="VS Code in action" src="https://cloud.githubusercontent.com/assets/11839736/16642200/6624dde0-43bd-11e6-8595-c81885ba0dc2.png">
+1 -1
View File
@@ -43,7 +43,7 @@ const nodeModules = ['electron', 'original-fs']
// Build
const builtInExtensions = [
{ name: 'ms-vscode.node-debug', version: '1.17.3' },
{ name: 'ms-vscode.node-debug', version: '1.17.5' },
{ name: 'ms-vscode.node-debug2', version: '1.17.1' }
];
+1 -1
View File
@@ -38,7 +38,7 @@ step "Build minified" {
}
step "Run smoke test" {
$Screenshots = "$env:AGENT_BUILDDIRECTORY\smoketests-screenshots"
$Screenshots = "$env:AGENT_BUILDDIRECTORY\smoketest-screenshots"
Remove-Item -Recurse -Force -ErrorAction Ignore $Screenshots
exec { & Push-Location test\smoke }
@@ -69,8 +69,8 @@
"c": "(",
"t": "source.coffee string.regexp.coffee meta.group.regexp punctuation.definition.group.regexp",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "punctuation.definition.group.regexp: #CE9178",
"light_plus": "punctuation.definition.group.regexp: #D16969",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
@@ -80,19 +80,19 @@
"c": "\\d",
"t": "source.coffee string.regexp.coffee meta.group.regexp constant.character.character-class.regexp",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "constant.character.character-class.regexp: #D16969",
"light_plus": "constant.character.character-class.regexp: #811F3F",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
"hc_black": "constant.character: #569CD6"
}
},
{
"c": "+",
"t": "source.coffee string.regexp.coffee meta.group.regexp keyword.operator.quantifier.regexp",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
"dark_plus": "keyword.operator.quantifier.regexp: #D7BA7D",
"light_plus": "keyword.operator.quantifier.regexp: #000000",
"dark_vs": "keyword.operator: #D4D4D4",
"light_vs": "keyword.operator: #000000",
"hc_black": "keyword.operator: #D4D4D4"
@@ -102,8 +102,8 @@
"c": ")",
"t": "source.coffee string.regexp.coffee meta.group.regexp punctuation.definition.group.regexp",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "punctuation.definition.group.regexp: #CE9178",
"light_plus": "punctuation.definition.group.regexp: #D16969",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
@@ -454,11 +454,11 @@
"c": "#{",
"t": "source.coffee string.regexp.coffee source.coffee.embedded.source punctuation.section.embedded.coffee",
"r": {
"dark_plus": "punctuation.section.embedded.coffee: #569CD6",
"light_plus": "punctuation.section.embedded.coffee: #0000FF",
"dark_vs": "punctuation.section.embedded.coffee: #569CD6",
"light_vs": "punctuation.section.embedded.coffee: #0000FF",
"hc_black": "punctuation.section.embedded.coffee: #569CD6"
"dark_plus": "punctuation.section.embedded: #569CD6",
"light_plus": "punctuation.section.embedded: #0000FF",
"dark_vs": "punctuation.section.embedded: #569CD6",
"light_vs": "punctuation.section.embedded: #0000FF",
"hc_black": "punctuation.section.embedded: #569CD6"
}
},
{
@@ -476,11 +476,11 @@
"c": "}",
"t": "source.coffee string.regexp.coffee source.coffee.embedded.source punctuation.section.embedded.coffee",
"r": {
"dark_plus": "punctuation.section.embedded.coffee: #569CD6",
"light_plus": "punctuation.section.embedded.coffee: #0000FF",
"dark_vs": "punctuation.section.embedded.coffee: #569CD6",
"light_vs": "punctuation.section.embedded.coffee: #0000FF",
"hc_black": "punctuation.section.embedded.coffee: #569CD6"
"dark_plus": "punctuation.section.embedded: #569CD6",
"light_plus": "punctuation.section.embedded: #0000FF",
"dark_vs": "punctuation.section.embedded: #569CD6",
"light_vs": "punctuation.section.embedded: #0000FF",
"hc_black": "punctuation.section.embedded: #569CD6"
}
},
{
@@ -311,11 +311,11 @@
"c": "#{",
"t": "source.coffee meta.function-call.coffee meta.arguments.coffee string.quoted.double.coffee source.coffee.embedded.source punctuation.section.embedded.coffee",
"r": {
"dark_plus": "punctuation.section.embedded.coffee: #569CD6",
"light_plus": "punctuation.section.embedded.coffee: #0000FF",
"dark_vs": "punctuation.section.embedded.coffee: #569CD6",
"light_vs": "punctuation.section.embedded.coffee: #0000FF",
"hc_black": "punctuation.section.embedded.coffee: #569CD6"
"dark_plus": "punctuation.section.embedded: #569CD6",
"light_plus": "punctuation.section.embedded: #0000FF",
"dark_vs": "punctuation.section.embedded: #569CD6",
"light_vs": "punctuation.section.embedded: #0000FF",
"hc_black": "punctuation.section.embedded: #569CD6"
}
},
{
@@ -333,11 +333,11 @@
"c": "}",
"t": "source.coffee meta.function-call.coffee meta.arguments.coffee string.quoted.double.coffee source.coffee.embedded.source punctuation.section.embedded.coffee",
"r": {
"dark_plus": "punctuation.section.embedded.coffee: #569CD6",
"light_plus": "punctuation.section.embedded.coffee: #0000FF",
"dark_vs": "punctuation.section.embedded.coffee: #569CD6",
"light_vs": "punctuation.section.embedded.coffee: #0000FF",
"hc_black": "punctuation.section.embedded.coffee: #569CD6"
"dark_plus": "punctuation.section.embedded: #569CD6",
"light_plus": "punctuation.section.embedded: #0000FF",
"dark_vs": "punctuation.section.embedded: #569CD6",
"light_vs": "punctuation.section.embedded: #0000FF",
"hc_black": "punctuation.section.embedded: #569CD6"
}
},
{
@@ -575,11 +575,11 @@
"c": "#{",
"t": "source.coffee meta.function-call.coffee meta.arguments.coffee string.quoted.double.coffee source.coffee.embedded.source punctuation.section.embedded.coffee",
"r": {
"dark_plus": "punctuation.section.embedded.coffee: #569CD6",
"light_plus": "punctuation.section.embedded.coffee: #0000FF",
"dark_vs": "punctuation.section.embedded.coffee: #569CD6",
"light_vs": "punctuation.section.embedded.coffee: #0000FF",
"hc_black": "punctuation.section.embedded.coffee: #569CD6"
"dark_plus": "punctuation.section.embedded: #569CD6",
"light_plus": "punctuation.section.embedded: #0000FF",
"dark_vs": "punctuation.section.embedded: #569CD6",
"light_vs": "punctuation.section.embedded: #0000FF",
"hc_black": "punctuation.section.embedded: #569CD6"
}
},
{
@@ -597,11 +597,11 @@
"c": "}",
"t": "source.coffee meta.function-call.coffee meta.arguments.coffee string.quoted.double.coffee source.coffee.embedded.source punctuation.section.embedded.coffee",
"r": {
"dark_plus": "punctuation.section.embedded.coffee: #569CD6",
"light_plus": "punctuation.section.embedded.coffee: #0000FF",
"dark_vs": "punctuation.section.embedded.coffee: #569CD6",
"light_vs": "punctuation.section.embedded.coffee: #0000FF",
"hc_black": "punctuation.section.embedded.coffee: #569CD6"
"dark_plus": "punctuation.section.embedded: #569CD6",
"light_plus": "punctuation.section.embedded: #0000FF",
"dark_vs": "punctuation.section.embedded: #569CD6",
"light_vs": "punctuation.section.embedded: #0000FF",
"hc_black": "punctuation.section.embedded: #569CD6"
}
},
{
@@ -1378,8 +1378,8 @@
"c": "(",
"t": "source.coffee string.regexp.coffee meta.group.regexp punctuation.definition.group.regexp",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "punctuation.definition.group.regexp: #CE9178",
"light_plus": "punctuation.definition.group.regexp: #D16969",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
@@ -1389,19 +1389,19 @@
"c": "\\d",
"t": "source.coffee string.regexp.coffee meta.group.regexp constant.character.character-class.regexp",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "constant.character.character-class.regexp: #D16969",
"light_plus": "constant.character.character-class.regexp: #811F3F",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
"hc_black": "constant.character: #569CD6"
}
},
{
"c": "+",
"t": "source.coffee string.regexp.coffee meta.group.regexp keyword.operator.quantifier.regexp",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
"dark_plus": "keyword.operator.quantifier.regexp: #D7BA7D",
"light_plus": "keyword.operator.quantifier.regexp: #000000",
"dark_vs": "keyword.operator: #D4D4D4",
"light_vs": "keyword.operator: #000000",
"hc_black": "keyword.operator: #D4D4D4"
@@ -1411,8 +1411,8 @@
"c": ")",
"t": "source.coffee string.regexp.coffee meta.group.regexp punctuation.definition.group.regexp",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "punctuation.definition.group.regexp: #CE9178",
"light_plus": "punctuation.definition.group.regexp: #D16969",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
@@ -1466,8 +1466,8 @@
"c": "(",
"t": "source.coffee string.regexp.coffee meta.group.regexp punctuation.definition.group.regexp",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "punctuation.definition.group.regexp: #CE9178",
"light_plus": "punctuation.definition.group.regexp: #D16969",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
@@ -1477,19 +1477,19 @@
"c": "\\w",
"t": "source.coffee string.regexp.coffee meta.group.regexp constant.character.character-class.regexp",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "constant.character.character-class.regexp: #D16969",
"light_plus": "constant.character.character-class.regexp: #811F3F",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
"hc_black": "constant.character: #569CD6"
}
},
{
"c": "*",
"t": "source.coffee string.regexp.coffee meta.group.regexp keyword.operator.quantifier.regexp",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
"dark_plus": "keyword.operator.quantifier.regexp: #D7BA7D",
"light_plus": "keyword.operator.quantifier.regexp: #000000",
"dark_vs": "keyword.operator: #D4D4D4",
"light_vs": "keyword.operator: #000000",
"hc_black": "keyword.operator: #D4D4D4"
@@ -1499,8 +1499,8 @@
"c": ")",
"t": "source.coffee string.regexp.coffee meta.group.regexp punctuation.definition.group.regexp",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "punctuation.definition.group.regexp: #CE9178",
"light_plus": "punctuation.definition.group.regexp: #D16969",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
@@ -1554,8 +1554,8 @@
"c": "$",
"t": "source.coffee string.regexp.coffee keyword.control.anchor.regexp",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
"dark_plus": "keyword.control.anchor.regexp: #DCDCAA",
"light_plus": "keyword.control.anchor.regexp: #FF0000",
"dark_vs": "keyword.control: #569CD6",
"light_vs": "keyword.control: #0000FF",
"hc_black": "keyword.control: #C586C0"
File diff suppressed because it is too large Load Diff
+3
View File
@@ -1,4 +1,5 @@
{
"css.title": "CSS",
"css.lint.argumentsInColorFunction.desc": "Invalid number of parameters",
"css.lint.boxModel.desc": "Do not use width or height when using padding or border",
"css.lint.compatibleVendorPrefixes.desc": "When using a vendor-specific prefix make sure to also include all other vendor-specific properties",
@@ -20,6 +21,7 @@
"css.trace.server.desc": "Traces the communication between VS Code and the CSS language server.",
"css.validate.title": "Controls CSS validation and problem severities.",
"css.validate.desc": "Enables or disables all validations",
"less.title": "LESS",
"less.lint.argumentsInColorFunction.desc": "Invalid number of parameters",
"less.lint.boxModel.desc": "Do not use width or height when using padding or border",
"less.lint.compatibleVendorPrefixes.desc": "When using a vendor-specific prefix make sure to also include all other vendor-specific properties",
@@ -40,6 +42,7 @@
"less.lint.zeroUnits.desc": "No unit for zero needed",
"less.validate.title": "Controls LESS validation and problem severities.",
"less.validate.desc": "Enables or disables all validations",
"scss.title": "SCSS (Sass)",
"scss.lint.argumentsInColorFunction.desc": "Invalid number of parameters",
"scss.lint.boxModel.desc": "Do not use width or height when using padding or border",
"scss.lint.compatibleVendorPrefixes.desc": "When using a vendor-specific prefix make sure to also include all other vendor-specific properties",
+2 -2
View File
@@ -3,9 +3,9 @@
"version": "1.0.0",
"dependencies": {
"vscode-css-languageservice": {
"version": "2.1.4",
"version": "2.1.6",
"from": "vscode-css-languageservice@next",
"resolved": "https://registry.npmjs.org/vscode-css-languageservice/-/vscode-css-languageservice-2.1.4.tgz"
"resolved": "https://registry.npmjs.org/vscode-css-languageservice/-/vscode-css-languageservice-2.1.6.tgz"
},
"vscode-jsonrpc": {
"version": "3.3.1",
+1 -1
View File
@@ -8,7 +8,7 @@
"node": "*"
},
"dependencies": {
"vscode-css-languageservice": "^2.1.4",
"vscode-css-languageservice": "^2.1.6",
"vscode-languageserver": "3.4.0-next.6",
"vscode-languageserver-protocol": "^3.1.1"
},
+3 -3
View File
@@ -38,9 +38,9 @@
"resolved": "https://registry.npmjs.org/image-size/-/image-size-0.5.5.tgz"
},
"vscode-emmet-helper": {
"version": "1.1.7",
"from": "vscode-emmet-helper@>=1.0.17 <2.0.0",
"resolved": "https://registry.npmjs.org/vscode-emmet-helper/-/vscode-emmet-helper-1.1.7.tgz"
"version": "1.1.8",
"from": "vscode-emmet-helper@>=1.0.8 <2.0.0",
"resolved": "https://registry.npmjs.org/vscode-emmet-helper/-/vscode-emmet-helper-1.1.8.tgz"
},
"vscode-languageserver-types": {
"version": "3.3.0",
+1 -1
View File
@@ -265,7 +265,7 @@
"@emmetio/html-matcher": "^0.3.1",
"@emmetio/css-parser": "ramya-rao-a/css-parser#vscode",
"@emmetio/math-expression": "^0.1.1",
"vscode-emmet-helper": "^1.1.7",
"vscode-emmet-helper": "^1.1.8",
"vscode-languageserver-types": "^3.0.3",
"image-size": "^0.5.2",
"vscode-nls": "2.0.2"
@@ -55,7 +55,7 @@ export class DefaultCompletionItemProvider implements vscode.CompletionItemProvi
return;
}
let result: vscode.CompletionList = doComplete(document, position, syntax, getEmmetConfiguration(syntax));
let result = doComplete(document, position, syntax, getEmmetConfiguration(syntax));
let newItems: vscode.CompletionItem[] = [];
if (result && result.items) {
result.items.forEach(item => {
@@ -1026,11 +1026,11 @@
"c": "\\n",
"t": "source.fsharp string.quoted.double.fsharp constant.character.string.escape.fsharp",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
"dark_plus": "constant.character: #569CD6",
"light_plus": "constant.character: #0000FF",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "string: #CE9178"
"hc_black": "constant.character: #569CD6"
}
},
{
+5
View File
@@ -529,6 +529,11 @@
"group": "3_commit",
"when": "config.git.enabled && scmProvider == git"
},
{
"command": "git.stageAll",
"group": "4_stage",
"when": "config.git.enabled && scmProvider == git"
},
{
"command": "git.unstageAll",
"group": "4_stage",
-4
View File
@@ -27,10 +27,6 @@ function getIPCHandlePath(nonce: string): string {
return `\\\\.\\pipe\\vscode-git-askpass-${nonce}-sock`;
}
if (process.env['XDG_RUNTIME_DIR']) {
return path.join(process.env['XDG_RUNTIME_DIR'], `vscode-git-askpass-${nonce}.sock`);
}
return path.join(os.tmpdir(), `vscode-git-askpass-${nonce}.sock`);
}
@@ -9232,33 +9232,33 @@
"c": "${",
"t": "source.groovy meta.definition.method.groovy meta.method.body.java string.quoted.double.groovy source.groovy.embedded.source punctuation.section.embedded.groovy",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "string: #CE9178"
"dark_plus": "punctuation.section.embedded: #569CD6",
"light_plus": "punctuation.section.embedded: #0000FF",
"dark_vs": "punctuation.section.embedded: #569CD6",
"light_vs": "punctuation.section.embedded: #0000FF",
"hc_black": "punctuation.section.embedded: #569CD6"
}
},
{
"c": "System.currentTimeMillis() - start",
"t": "source.groovy meta.definition.method.groovy meta.method.body.java string.quoted.double.groovy source.groovy.embedded.source",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "string: #CE9178"
"dark_plus": "source.groovy.embedded: #D4D4D4",
"light_plus": "source.groovy.embedded: #000000",
"dark_vs": "source.groovy.embedded: #D4D4D4",
"light_vs": "source.groovy.embedded: #000000",
"hc_black": "source.groovy.embedded: #FFFFFF"
}
},
{
"c": "}",
"t": "source.groovy meta.definition.method.groovy meta.method.body.java string.quoted.double.groovy source.groovy.embedded.source punctuation.section.embedded.groovy",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "string: #CE9178"
"dark_plus": "punctuation.section.embedded: #569CD6",
"light_plus": "punctuation.section.embedded: #0000FF",
"dark_vs": "punctuation.section.embedded: #569CD6",
"light_vs": "punctuation.section.embedded: #0000FF",
"hc_black": "punctuation.section.embedded: #569CD6"
}
},
{
+1
View File
@@ -31,6 +31,7 @@
"title": "Grunt",
"properties": {
"grunt.autoDetect": {
"scope": "resource",
"type": "string",
"enum": [
"off",
+268 -134
View File
@@ -13,49 +13,6 @@ import * as nls from 'vscode-nls';
const localize = nls.config(process.env.VSCODE_NLS_CONFIG)();
type AutoDetect = 'on' | 'off';
let taskProvider: vscode.Disposable | undefined;
export function activate(_context: vscode.ExtensionContext): void {
let workspaceRoot = vscode.workspace.rootPath;
if (!workspaceRoot) {
return;
}
let pattern = path.join(workspaceRoot, '[Gg]runtfile.js');
let detectorPromise: Thenable<vscode.Task[]> | undefined = undefined;
let fileWatcher = vscode.workspace.createFileSystemWatcher(pattern);
fileWatcher.onDidChange(() => detectorPromise = undefined);
fileWatcher.onDidCreate(() => detectorPromise = undefined);
fileWatcher.onDidDelete(() => detectorPromise = undefined);
function onConfigurationChanged() {
let autoDetect = vscode.workspace.getConfiguration('grunt').get<AutoDetect>('autoDetect');
if (taskProvider && autoDetect === 'off') {
detectorPromise = undefined;
taskProvider.dispose();
taskProvider = undefined;
} else if (!taskProvider && autoDetect === 'on') {
taskProvider = vscode.workspace.registerTaskProvider('grunt', {
provideTasks: () => {
if (!detectorPromise) {
detectorPromise = getGruntTasks();
}
return detectorPromise;
},
resolveTask(_task: vscode.Task): vscode.Task | undefined {
return undefined;
}
});
}
}
vscode.workspace.onDidChangeConfiguration(onConfigurationChanged);
onConfigurationChanged();
}
export function deactivate(): void {
if (taskProvider) {
taskProvider.dispose();
}
}
function exists(file: string): Promise<boolean> {
return new Promise<boolean>((resolve, _reject) => {
@@ -76,19 +33,6 @@ function exec(command: string, options: cp.ExecOptions): Promise<{ stdout: strin
});
}
let _channel: vscode.OutputChannel;
function getOutputChannel(): vscode.OutputChannel {
if (!_channel) {
_channel = vscode.window.createOutputChannel('Grunt Auto Detection');
}
return _channel;
}
interface GruntTaskDefinition extends vscode.TaskDefinition {
task: string;
file?: string;
}
const buildNames: string[] = ['build', 'compile', 'watch'];
function isBuildTask(name: string): boolean {
for (let buildName of buildNames) {
@@ -109,97 +53,287 @@ function isTestTask(name: string): boolean {
return false;
}
async function getGruntTasks(): Promise<vscode.Task[]> {
let workspaceRoot = vscode.workspace.rootPath;
let emptyTasks: vscode.Task[] = [];
if (!workspaceRoot) {
return emptyTasks;
let _channel: vscode.OutputChannel;
function getOutputChannel(): vscode.OutputChannel {
if (!_channel) {
_channel = vscode.window.createOutputChannel('Gulp Auto Detection');
}
if (!await exists(path.join(workspaceRoot, 'gruntfile.js')) && !await exists(path.join(workspaceRoot, 'Gruntfile.js'))) {
return emptyTasks;
return _channel;
}
interface GruntTaskDefinition extends vscode.TaskDefinition {
task: string;
file?: string;
}
class FolderDetector {
private fileWatcher: vscode.FileSystemWatcher;
private promise: Thenable<vscode.Task[]> | undefined;
constructor(private _workspaceFolder: vscode.WorkspaceFolder) {
}
let command: string;
let platform = process.platform;
if (platform === 'win32' && await exists(path.join(workspaceRoot!, 'node_modules', '.bin', 'grunt.cmd'))) {
command = path.join('.', 'node_modules', '.bin', 'grunt.cmd');
} else if ((platform === 'linux' || platform === 'darwin') && await exists(path.join(workspaceRoot!, 'node_modules', '.bin', 'grunt'))) {
command = path.join('.', 'node_modules', '.bin', 'grunt');
} else {
command = 'grunt';
public get workspaceFolder(): vscode.WorkspaceFolder {
return this._workspaceFolder;
}
let commandLine = `${command} --help --no-color`;
try {
let { stdout, stderr } = await exec(commandLine, { cwd: workspaceRoot });
if (stderr) {
getOutputChannel().appendLine(stderr);
getOutputChannel().show(true);
public isEnabled(): boolean {
return vscode.workspace.getConfiguration('grunt', this._workspaceFolder.uri).get<AutoDetect>('autoDetect') === 'on';
}
public start(): void {
let pattern = path.join(this._workspaceFolder.uri.fsPath, '[Gg]runtfile.js');
this.fileWatcher = vscode.workspace.createFileSystemWatcher(pattern);
this.fileWatcher.onDidChange(() => this.promise = undefined);
this.fileWatcher.onDidCreate(() => this.promise = undefined);
this.fileWatcher.onDidDelete(() => this.promise = undefined);
}
public async getTasks(): Promise<vscode.Task[]> {
if (!this.promise) {
this.promise = this.computeTasks();
}
let result: vscode.Task[] = [];
if (stdout) {
// grunt lists tasks as follows (description is wrapped into a new line if too long):
// ...
// Available tasks
// uglify Minify files with UglifyJS. *
// jshint Validate files with JSHint. *
// test Alias for "jshint", "qunit" tasks.
// default Alias for "jshint", "qunit", "concat", "uglify" tasks.
// long Alias for "eslint", "qunit", "browserify", "sass",
// "autoprefixer", "uglify", tasks.
//
// Tasks run in the order specified
return this.promise;
}
let lines = stdout.split(/\r{0,1}\n/);
let tasksStart = false;
let tasksEnd = false;
for (let line of lines) {
if (line.length === 0) {
continue;
}
if (!tasksStart && !tasksEnd) {
if (line.indexOf('Available tasks') === 0) {
tasksStart = true;
private async computeTasks(): Promise<vscode.Task[]> {
let rootPath = this._workspaceFolder.uri.scheme === 'file' ? this._workspaceFolder.uri.fsPath : undefined;
let emptyTasks: vscode.Task[] = [];
if (!rootPath) {
return emptyTasks;
}
if (!await exists(path.join(rootPath, 'gruntfile.js')) && !await exists(path.join(rootPath, 'Gruntfile.js'))) {
return emptyTasks;
}
let command: string;
let platform = process.platform;
if (platform === 'win32' && await exists(path.join(rootPath!, 'node_modules', '.bin', 'grunt.cmd'))) {
command = path.join('.', 'node_modules', '.bin', 'grunt.cmd');
} else if ((platform === 'linux' || platform === 'darwin') && await exists(path.join(rootPath!, 'node_modules', '.bin', 'grunt'))) {
command = path.join('.', 'node_modules', '.bin', 'grunt');
} else {
command = 'grunt';
}
let commandLine = `${command} --help --no-color`;
try {
let { stdout, stderr } = await exec(commandLine, { cwd: rootPath });
if (stderr) {
getOutputChannel().appendLine(stderr);
getOutputChannel().show(true);
}
let result: vscode.Task[] = [];
if (stdout) {
// grunt lists tasks as follows (description is wrapped into a new line if too long):
// ...
// Available tasks
// uglify Minify files with UglifyJS. *
// jshint Validate files with JSHint. *
// test Alias for "jshint", "qunit" tasks.
// default Alias for "jshint", "qunit", "concat", "uglify" tasks.
// long Alias for "eslint", "qunit", "browserify", "sass",
// "autoprefixer", "uglify", tasks.
//
// Tasks run in the order specified
let lines = stdout.split(/\r{0,1}\n/);
let tasksStart = false;
let tasksEnd = false;
for (let line of lines) {
if (line.length === 0) {
continue;
}
} else if (tasksStart && !tasksEnd) {
if (line.indexOf('Tasks run in the order specified') === 0) {
tasksEnd = true;
} else {
let regExp = /^\s*(\S.*\S) \S/g;
let matches = regExp.exec(line);
if (matches && matches.length === 2) {
let name = matches[1];
let kind: GruntTaskDefinition = {
type: 'grunt',
task: name
};
let source = 'grunt';
let task = name.indexOf(' ') === -1
? new vscode.Task(kind, name, source, new vscode.ShellExecution(`${command} ${name}`))
: new vscode.Task(kind, name, source, new vscode.ShellExecution(`${command} "${name}"`));
result.push(task);
let lowerCaseTaskName = name.toLowerCase();
if (isBuildTask(lowerCaseTaskName)) {
task.group = vscode.TaskGroup.Build;
} else if (isTestTask(lowerCaseTaskName)) {
task.group = vscode.TaskGroup.Test;
if (!tasksStart && !tasksEnd) {
if (line.indexOf('Available tasks') === 0) {
tasksStart = true;
}
} else if (tasksStart && !tasksEnd) {
if (line.indexOf('Tasks run in the order specified') === 0) {
tasksEnd = true;
} else {
let regExp = /^\s*(\S.*\S) \S/g;
let matches = regExp.exec(line);
if (matches && matches.length === 2) {
let name = matches[1];
let kind: GruntTaskDefinition = {
type: 'grunt',
task: name
};
let source = 'grunt';
let options: vscode.ShellExecutionOptions = { cwd: this.workspaceFolder.uri.fsPath };
let task = name.indexOf(' ') === -1
? new vscode.Task(kind, this.workspaceFolder, name, source, new vscode.ShellExecution(`${command} ${name}`, options))
: new vscode.Task(kind, this.workspaceFolder, name, source, new vscode.ShellExecution(`${command} "${name}"`, options));
result.push(task);
let lowerCaseTaskName = name.toLowerCase();
if (isBuildTask(lowerCaseTaskName)) {
task.group = vscode.TaskGroup.Build;
} else if (isTestTask(lowerCaseTaskName)) {
task.group = vscode.TaskGroup.Test;
}
}
}
}
}
}
return result;
} catch (err) {
let channel = getOutputChannel();
if (err.stderr) {
channel.appendLine(err.stderr);
}
if (err.stdout) {
channel.appendLine(err.stdout);
}
channel.appendLine(localize('execFailed', 'Auto detecting Grunt failed with error: {0}', err.error ? err.error.toString() : 'unknown'));
channel.show(true);
return emptyTasks;
}
return result;
} catch (err) {
let channel = getOutputChannel();
if (err.stderr) {
channel.appendLine(err.stderr);
}
if (err.stdout) {
channel.appendLine(err.stdout);
}
channel.appendLine(localize('execFailed', 'Auto detecting Grunt failed with error: {0}', err.error ? err.error.toString() : 'unknown'));
channel.show(true);
return emptyTasks;
}
public dispose() {
this.promise = undefined;
if (this.fileWatcher) {
this.fileWatcher.dispose();
}
}
}
class TaskDetector {
private taskProvider: vscode.Disposable | undefined;
private detectors: Map<string, FolderDetector> = new Map();
private promise: Promise<vscode.Task[]> | undefined;
constructor() {
}
public start(): void {
let folders = vscode.workspace.workspaceFolders;
if (folders) {
this.updateWorkspaceFolders(folders, []);
}
vscode.workspace.onDidChangeWorkspaceFolders((event) => this.updateWorkspaceFolders(event.added, event.removed));
vscode.workspace.onDidChangeConfiguration(this.updateConfiguration, this);
}
public dispose(): void {
if (this.taskProvider) {
this.taskProvider.dispose();
this.taskProvider = undefined;
}
this.detectors.clear();
this.promise = undefined;
}
private updateWorkspaceFolders(added: vscode.WorkspaceFolder[], removed: vscode.WorkspaceFolder[]): void {
let changed = false;
for (let remove of removed) {
let detector = this.detectors.get(remove.uri.toString());
if (detector) {
changed = true;
detector.dispose();
this.detectors.delete(remove.uri.toString());
}
}
for (let add of added) {
let detector = new FolderDetector(add);
if (detector.isEnabled()) {
changed = true;
this.detectors.set(add.uri.toString(), detector);
detector.start();
}
}
if (changed) {
this.promise = undefined;
}
this.updateProvider();
}
private updateConfiguration(): void {
let changed = false;
for (let detector of this.detectors.values()) {
if (!detector.isEnabled()) {
changed = true;
detector.dispose();
this.detectors.delete(detector.workspaceFolder.uri.toString());
}
}
let folders = vscode.workspace.workspaceFolders;
if (folders) {
for (let folder of folders) {
if (!this.detectors.has(folder.uri.toString())) {
let detector = new FolderDetector(folder);
if (detector.isEnabled()) {
changed = true;
this.detectors.set(folder.uri.toString(), detector);
detector.start();
}
}
}
}
if (changed) {
this.promise = undefined;
}
this.updateProvider();
}
private updateProvider(): void {
if (!this.taskProvider && this.detectors.size > 0) {
this.taskProvider = vscode.workspace.registerTaskProvider('gulp', {
provideTasks: () => {
return this.getTasks();
},
resolveTask(_task: vscode.Task): vscode.Task | undefined {
return undefined;
}
});
}
else if (this.taskProvider && this.detectors.size === 0) {
this.taskProvider.dispose();
this.taskProvider = undefined;
this.promise = undefined;
}
}
public getTasks(): Promise<vscode.Task[]> {
if (!this.promise) {
this.promise = this.computeTasks();
}
return this.promise;
}
private computeTasks(): Promise<vscode.Task[]> {
if (this.detectors.size === 0) {
return Promise.resolve([]);
} else if (this.detectors.size === 1) {
return this.detectors.values().next().value.getTasks();
} else {
let promises: Promise<vscode.Task[]>[] = [];
for (let detector of this.detectors.values()) {
promises.push(detector.getTasks().then((value) => value, () => []));
}
return Promise.all(promises).then((values) => {
let result: vscode.Task[] = [];
for (let tasks of values) {
if (tasks && tasks.length > 0) {
result.push(...tasks);
}
}
return result;
});
}
}
}
let detector: TaskDetector;
export function activate(_context: vscode.ExtensionContext): void {
detector = new TaskDetector();
detector.start();
}
export function deactivate(): void {
detector.dispose();
}
+1
View File
@@ -31,6 +31,7 @@
"title": "Gulp",
"properties": {
"gulp.autoDetect": {
"scope": "resource",
"type": "string",
"enum": [
"off",
+242 -108
View File
@@ -13,49 +13,6 @@ import * as nls from 'vscode-nls';
const localize = nls.config(process.env.VSCODE_NLS_CONFIG)();
type AutoDetect = 'on' | 'off';
let taskProvider: vscode.Disposable | undefined;
export function activate(_context: vscode.ExtensionContext): void {
let workspaceRoot = vscode.workspace.rootPath;
if (!workspaceRoot) {
return;
}
let pattern = path.join(workspaceRoot, 'gulpfile{.babel.js,.js}');
let gulpPromise: Thenable<vscode.Task[]> | undefined = undefined;
let fileWatcher = vscode.workspace.createFileSystemWatcher(pattern);
fileWatcher.onDidChange(() => gulpPromise = undefined);
fileWatcher.onDidCreate(() => gulpPromise = undefined);
fileWatcher.onDidDelete(() => gulpPromise = undefined);
function onConfigurationChanged() {
let autoDetect = vscode.workspace.getConfiguration('gulp').get<AutoDetect>('autoDetect');
if (taskProvider && autoDetect === 'off') {
gulpPromise = undefined;
taskProvider.dispose();
taskProvider = undefined;
} else if (!taskProvider && autoDetect === 'on') {
taskProvider = vscode.workspace.registerTaskProvider('gulp', {
provideTasks: () => {
if (!gulpPromise) {
gulpPromise = getGulpTasks();
}
return gulpPromise;
},
resolveTask(_task: vscode.Task): vscode.Task | undefined {
return undefined;
}
});
}
}
vscode.workspace.onDidChangeConfiguration(onConfigurationChanged);
onConfigurationChanged();
}
export function deactivate(): void {
if (taskProvider) {
taskProvider.dispose();
}
}
function exists(file: string): Promise<boolean> {
return new Promise<boolean>((resolve, _reject) => {
@@ -76,19 +33,6 @@ function exec(command: string, options: cp.ExecOptions): Promise<{ stdout: strin
});
}
let _channel: vscode.OutputChannel;
function getOutputChannel(): vscode.OutputChannel {
if (!_channel) {
_channel = vscode.window.createOutputChannel('Gulp Auto Detection');
}
return _channel;
}
interface GulpTaskDefinition extends vscode.TaskDefinition {
task: string;
file?: string;
}
const buildNames: string[] = ['build', 'compile', 'watch'];
function isBuildTask(name: string): boolean {
for (let buildName of buildNames) {
@@ -109,69 +53,259 @@ function isTestTask(name: string): boolean {
return false;
}
async function getGulpTasks(): Promise<vscode.Task[]> {
let workspaceRoot = vscode.workspace.rootPath;
let emptyTasks: vscode.Task[] = [];
if (!workspaceRoot) {
return emptyTasks;
let _channel: vscode.OutputChannel;
function getOutputChannel(): vscode.OutputChannel {
if (!_channel) {
_channel = vscode.window.createOutputChannel('Gulp Auto Detection');
}
let gulpfile = path.join(workspaceRoot, 'gulpfile.js');
if (!await exists(gulpfile)) {
gulpfile = path.join(workspaceRoot, 'gulpfile.babel.js');
if (! await exists(gulpfile)) {
return _channel;
}
interface GulpTaskDefinition extends vscode.TaskDefinition {
task: string;
file?: string;
}
class FolderDetector {
private fileWatcher: vscode.FileSystemWatcher;
private promise: Thenable<vscode.Task[]> | undefined;
constructor(private _workspaceFolder: vscode.WorkspaceFolder) {
}
public get workspaceFolder(): vscode.WorkspaceFolder {
return this._workspaceFolder;
}
public isEnabled(): boolean {
return vscode.workspace.getConfiguration('gulp', this._workspaceFolder.uri).get<AutoDetect>('autoDetect') === 'on';
}
public start(): void {
let pattern = path.join(this._workspaceFolder.uri.fsPath, 'gulpfile{.babel.js,.js}');
this.fileWatcher = vscode.workspace.createFileSystemWatcher(pattern);
this.fileWatcher.onDidChange(() => this.promise = undefined);
this.fileWatcher.onDidCreate(() => this.promise = undefined);
this.fileWatcher.onDidDelete(() => this.promise = undefined);
}
public async getTasks(): Promise<vscode.Task[]> {
if (!this.promise) {
this.promise = this.computeTasks();
}
return this.promise;
}
private async computeTasks(): Promise<vscode.Task[]> {
let rootPath = this._workspaceFolder.uri.scheme === 'file' ? this._workspaceFolder.uri.fsPath : undefined;
let emptyTasks: vscode.Task[] = [];
if (!rootPath) {
return emptyTasks;
}
let gulpfile = path.join(rootPath, 'gulpfile.js');
if (!await exists(gulpfile)) {
gulpfile = path.join(rootPath, 'gulpfile.babel.js');
if (! await exists(gulpfile)) {
return emptyTasks;
}
}
let gulpCommand: string;
let platform = process.platform;
if (platform === 'win32' && await exists(path.join(rootPath!, 'node_modules', '.bin', 'gulp.cmd'))) {
gulpCommand = path.join('.', 'node_modules', '.bin', 'gulp.cmd');
} else if ((platform === 'linux' || platform === 'darwin') && await exists(path.join(rootPath!, 'node_modules', '.bin', 'gulp'))) {
gulpCommand = path.join('.', 'node_modules', '.bin', 'gulp');
} else {
gulpCommand = 'gulp';
}
let commandLine = `${gulpCommand} --tasks-simple --no-color`;
try {
let { stdout, stderr } = await exec(commandLine, { cwd: rootPath });
if (stderr && stderr.length > 0) {
getOutputChannel().appendLine(stderr);
getOutputChannel().show(true);
}
let result: vscode.Task[] = [];
if (stdout) {
let lines = stdout.split(/\r{0,1}\n/);
for (let line of lines) {
if (line.length === 0) {
continue;
}
let kind: GulpTaskDefinition = {
type: 'gulp',
task: line
};
let options: vscode.ShellExecutionOptions = { cwd: this.workspaceFolder.uri.fsPath };
let task = new vscode.Task(kind, this.workspaceFolder, line, 'gulp', new vscode.ShellExecution(`${gulpCommand} ${line}`, options));
result.push(task);
let lowerCaseLine = line.toLowerCase();
if (isBuildTask(lowerCaseLine)) {
task.group = vscode.TaskGroup.Build;
} else if (isTestTask(lowerCaseLine)) {
task.group = vscode.TaskGroup.Test;
}
}
}
return result;
} catch (err) {
let channel = getOutputChannel();
if (err.stderr) {
channel.appendLine(err.stderr);
}
if (err.stdout) {
channel.appendLine(err.stdout);
}
channel.appendLine(localize('execFailed', 'Auto detecting gulp failed with error: {0}', err.error ? err.error.toString() : 'unknown'));
channel.show(true);
return emptyTasks;
}
}
let gulpCommand: string;
let platform = process.platform;
if (platform === 'win32' && await exists(path.join(workspaceRoot!, 'node_modules', '.bin', 'gulp.cmd'))) {
gulpCommand = path.join('.', 'node_modules', '.bin', 'gulp.cmd');
} else if ((platform === 'linux' || platform === 'darwin') && await exists(path.join(workspaceRoot!, 'node_modules', '.bin', 'gulp'))) {
gulpCommand = path.join('.', 'node_modules', '.bin', 'gulp');
} else {
gulpCommand = 'gulp';
public dispose() {
this.promise = undefined;
if (this.fileWatcher) {
this.fileWatcher.dispose();
}
}
}
class TaskDetector {
private taskProvider: vscode.Disposable | undefined;
private detectors: Map<string, FolderDetector> = new Map();
private promise: Promise<vscode.Task[]> | undefined;
constructor() {
}
let commandLine = `${gulpCommand} --tasks-simple --no-color`;
try {
let { stdout, stderr } = await exec(commandLine, { cwd: workspaceRoot });
if (stderr && stderr.length > 0) {
getOutputChannel().appendLine(stderr);
getOutputChannel().show(true);
public start(): void {
let folders = vscode.workspace.workspaceFolders;
if (folders) {
this.updateWorkspaceFolders(folders, []);
}
let result: vscode.Task[] = [];
if (stdout) {
let lines = stdout.split(/\r{0,1}\n/);
for (let line of lines) {
if (line.length === 0) {
continue;
}
let kind: GulpTaskDefinition = {
type: 'gulp',
task: line
};
let task = new vscode.Task(kind, line, 'gulp', new vscode.ShellExecution(`${gulpCommand} ${line}`));
result.push(task);
let lowerCaseLine = line.toLowerCase();
if (isBuildTask(lowerCaseLine)) {
task.group = vscode.TaskGroup.Build;
} else if (isTestTask(lowerCaseLine)) {
task.group = vscode.TaskGroup.Test;
vscode.workspace.onDidChangeWorkspaceFolders((event) => this.updateWorkspaceFolders(event.added, event.removed));
vscode.workspace.onDidChangeConfiguration(this.updateConfiguration, this);
}
public dispose(): void {
if (this.taskProvider) {
this.taskProvider.dispose();
this.taskProvider = undefined;
}
this.detectors.clear();
this.promise = undefined;
}
private updateWorkspaceFolders(added: vscode.WorkspaceFolder[], removed: vscode.WorkspaceFolder[]): void {
let changed = false;
for (let remove of removed) {
let detector = this.detectors.get(remove.uri.toString());
if (detector) {
changed = true;
detector.dispose();
this.detectors.delete(remove.uri.toString());
}
}
for (let add of added) {
let detector = new FolderDetector(add);
if (detector.isEnabled()) {
changed = true;
this.detectors.set(add.uri.toString(), detector);
detector.start();
}
}
if (changed) {
this.promise = undefined;
}
this.updateProvider();
}
private updateConfiguration(): void {
let changed = false;
for (let detector of this.detectors.values()) {
if (!detector.isEnabled()) {
changed = true;
detector.dispose();
this.detectors.delete(detector.workspaceFolder.uri.toString());
}
}
let folders = vscode.workspace.workspaceFolders;
if (folders) {
for (let folder of folders) {
if (!this.detectors.has(folder.uri.toString())) {
let detector = new FolderDetector(folder);
if (detector.isEnabled()) {
changed = true;
this.detectors.set(folder.uri.toString(), detector);
detector.start();
}
}
}
}
return result;
} catch (err) {
let channel = getOutputChannel();
if (err.stderr) {
channel.appendLine(err.stderr);
if (changed) {
this.promise = undefined;
}
if (err.stdout) {
channel.appendLine(err.stdout);
}
channel.appendLine(localize('execFailed', 'Auto detecting gulp failed with error: {0}', err.error ? err.error.toString() : 'unknown'));
channel.show(true);
return emptyTasks;
this.updateProvider();
}
private updateProvider(): void {
if (!this.taskProvider && this.detectors.size > 0) {
this.taskProvider = vscode.workspace.registerTaskProvider('gulp', {
provideTasks: () => {
return this.getTasks();
},
resolveTask(_task: vscode.Task): vscode.Task | undefined {
return undefined;
}
});
}
else if (this.taskProvider && this.detectors.size === 0) {
this.taskProvider.dispose();
this.taskProvider = undefined;
this.promise = undefined;
}
}
public getTasks(): Promise<vscode.Task[]> {
if (!this.promise) {
this.promise = this.computeTasks();
}
return this.promise;
}
private computeTasks(): Promise<vscode.Task[]> {
if (this.detectors.size === 0) {
return Promise.resolve([]);
} else if (this.detectors.size === 1) {
return this.detectors.values().next().value.getTasks();
} else {
let promises: Promise<vscode.Task[]>[] = [];
for (let detector of this.detectors.values()) {
promises.push(detector.getTasks().then((value) => value, () => []));
}
return Promise.all(promises).then((values) => {
let result: vscode.Task[] = [];
for (let tasks of values) {
if (tasks && tasks.length > 0) {
result.push(...tasks);
}
}
return result;
});
}
}
}
let detector: TaskDetector;
export function activate(_context: vscode.ExtensionContext): void {
detector = new TaskDetector();
detector.start();
}
export function deactivate(): void {
detector.dispose();
}
+2 -2
View File
@@ -92,7 +92,7 @@
"null"
],
"scope": "resource",
"default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var",
"default": "",
"description": "%html.format.unformatted.desc%"
},
"html.format.contentUnformatted": {
@@ -101,7 +101,7 @@
"null"
],
"scope": "resource",
"default": "pre",
"default": "pre,code,textarea",
"description": "%html.format.contentUnformatted.desc%"
},
"html.format.indentInnerHtml": {
+4 -4
View File
@@ -3,14 +3,14 @@
"version": "1.0.0",
"dependencies": {
"vscode-css-languageservice": {
"version": "2.1.4",
"version": "2.1.6",
"from": "vscode-css-languageservice@next",
"resolved": "https://registry.npmjs.org/vscode-css-languageservice/-/vscode-css-languageservice-2.1.4.tgz"
"resolved": "https://registry.npmjs.org/vscode-css-languageservice/-/vscode-css-languageservice-2.1.6.tgz"
},
"vscode-html-languageservice": {
"version": "2.0.7",
"version": "2.0.8",
"from": "vscode-html-languageservice@next",
"resolved": "https://registry.npmjs.org/vscode-html-languageservice/-/vscode-html-languageservice-2.0.7.tgz"
"resolved": "https://registry.npmjs.org/vscode-html-languageservice/-/vscode-html-languageservice-2.0.8.tgz"
},
"vscode-jsonrpc": {
"version": "3.3.1",
+2 -2
View File
@@ -8,8 +8,8 @@
"node": "*"
},
"dependencies": {
"vscode-css-languageservice": "^2.1.4",
"vscode-html-languageservice": "^2.0.7",
"vscode-css-languageservice": "^2.1.6",
"vscode-html-languageservice": "^2.0.8",
"vscode-languageserver": "3.4.0-next.6",
"vscode-languageserver-protocol": "^3.1.1",
"vscode-languageserver-types": "^3.3.0",
@@ -54,7 +54,6 @@ documents.onDidClose(e => {
});
function getDocumentSettings(textDocument: TextDocument, needsDocumentSettings: () => boolean): Thenable<Settings> {
console.log('scopedSettingsSupport ' + scopedSettingsSupport + 'needsSettings ' + needsDocumentSettings());
if (scopedSettingsSupport && needsDocumentSettings()) {
let promise = documentSettings[textDocument.uri];
if (!promise) {
@@ -29,7 +29,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -51,7 +51,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -106,7 +106,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -128,7 +128,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -150,7 +150,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -194,7 +194,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -205,7 +205,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -293,7 +293,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -315,7 +315,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -337,7 +337,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -381,7 +381,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -392,7 +392,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -62,7 +62,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -84,7 +84,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -139,7 +139,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -172,7 +172,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -194,7 +194,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -359,7 +359,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -381,7 +381,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -436,7 +436,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -458,7 +458,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -480,7 +480,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -502,7 +502,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -524,7 +524,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -601,7 +601,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -623,7 +623,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -678,7 +678,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -711,7 +711,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -733,7 +733,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -480,7 +480,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -502,7 +502,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -557,7 +557,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -579,7 +579,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -590,7 +590,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -601,7 +601,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -623,7 +623,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -634,7 +634,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -656,7 +656,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -667,7 +667,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -689,7 +689,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -700,7 +700,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -733,7 +733,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -744,7 +744,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -755,7 +755,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -766,7 +766,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1129,7 +1129,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1151,7 +1151,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1283,7 +1283,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1305,7 +1305,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1448,7 +1448,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1470,7 +1470,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1492,7 +1492,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1536,7 +1536,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1547,7 +1547,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1558,7 +1558,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1580,7 +1580,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1602,7 +1602,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1613,7 +1613,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1624,7 +1624,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1657,7 +1657,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1701,7 +1701,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1712,7 +1712,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1745,7 +1745,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1756,7 +1756,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1767,7 +1767,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1800,7 +1800,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1844,7 +1844,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1855,7 +1855,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1866,7 +1866,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1877,7 +1877,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1888,7 +1888,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1899,7 +1899,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1910,7 +1910,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1932,7 +1932,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1943,7 +1943,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1954,7 +1954,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1976,7 +1976,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1987,7 +1987,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1998,7 +1998,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -2009,7 +2009,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -2020,7 +2020,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -2042,7 +2042,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -2053,7 +2053,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -2064,7 +2064,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -2075,7 +2075,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -2086,7 +2086,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -2097,7 +2097,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -2119,7 +2119,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -2141,7 +2141,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -2152,7 +2152,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -2163,7 +2163,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -2174,7 +2174,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -2185,7 +2185,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -2196,7 +2196,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -2207,7 +2207,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -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/TypeScript-TmLanguage/commit/648a036db2bad78ee93463269ec49ed91ee5aa91",
"version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/30d95ebb561fc57e784b43d08f0a6f46ad0c3e5d",
"name": "JavaScript (with React support)",
"scopeName": "source.js",
"fileTypes": [
@@ -94,6 +94,29 @@
{
"include": "#comment"
},
{
"begin": "(,)\\s*(?!\\S)",
"beginCaptures": {
"1": {
"name": "punctuation.separator.comma.js"
}
},
"end": "(?<!,)((?==|;|}|(\\s+(of|in)\\s+)|^\\s*$))|((?<=\\S)(?=\\s*$))",
"patterns": [
{
"include": "#comment"
},
{
"include": "#destructuring-variable"
},
{
"include": "#var-single-variable"
},
{
"include": "#punctuation-comma"
}
]
},
{
"include": "#punctuation-comma"
}
@@ -103,7 +126,7 @@
"patterns": [
{
"name": "meta.var-single-variable.expr.js",
"begin": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\n (=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n )) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n ))\n)",
"begin": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\n (=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<\\s*[_$[:alpha:]\\{\\(]([^<>=]|=[^<]|\\<\\s*[_$[:alpha:]\\{\\(]([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n )) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n ))\n)",
"beginCaptures": {
"1": {
"name": "meta.definition.variable.js entity.name.function.js"
@@ -727,7 +750,7 @@
},
"import-declaration": {
"name": "meta.import.js",
"begin": "(?<!\\.|\\$)(?:(\\bexport)\\s+)?\\b(import)(?!(\\s*:)|(\\$|\\.))\\b",
"begin": "(?<!\\.|\\$)(?:(\\bexport)\\s+)?\\b(import)(?!(\\s*[:\\(])|(\\$|\\.))\\b",
"beginCaptures": {
"1": {
"name": "keyword.control.export.js"
@@ -1181,7 +1204,7 @@
},
{
"name": "meta.definition.property.js entity.name.function.js",
"match": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?=(\\?\\s*)?\\s*\n (=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n )) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n ))\n)"
"match": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?=(\\?\\s*)?\\s*\n (=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<\\s*[_$[:alpha:]\\{\\(]([^<>=]|=[^<]|\\<\\s*[_$[:alpha:]\\{\\(]([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n )) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n ))\n)"
},
{
"name": "meta.definition.property.js variable.object.property.js",
@@ -1572,7 +1595,7 @@
}
},
{
"match": "(?x)(?:\\s*\\b(public|private|protected|readonly)\\s+)?(\\.\\.\\.)?\\s*(?<!=|:)(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))\\s*(\\??)(?=\\s*\n (=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n )) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n ))\n)",
"match": "(?x)(?:\\s*\\b(public|private|protected|readonly)\\s+)?(\\.\\.\\.)?\\s*(?<!=|:)(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))\\s*(\\??)(?=\\s*\n (=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<\\s*[_$[:alpha:]\\{\\(]([^<>=]|=[^<]|\\<\\s*[_$[:alpha:]\\{\\(]([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n )) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n ))\n)",
"captures": {
"1": {
"name": "storage.modifier.js"
@@ -2410,7 +2433,7 @@
}
},
{
"match": "(?x) (\\.) \\s* (?:\n (ATTRIBUTE_NODE|CDATA_SECTION_NODE|COMMENT_NODE|DOCUMENT_FRAGMENT_NODE|DOCUMENT_NODE|DOCUMENT_TYPE_NODE\n |DOMSTRING_SIZE_ERR|ELEMENT_NODE|ENTITY_NODE|ENTITY_REFERENCE_NODE|HIERARCHY_REQUEST_ERR|INDEX_SIZE_ERR\n |INUSE_ATTRIBUTE_ERR|INVALID_CHARACTER_ERR|NO_DATA_ALLOWED_ERR|NO_MODIFICATION_ALLOWED_ERR|NOT_FOUND_ERR\n |NOT_SUPPORTED_ERR|NOTATION_NODE|PROCESSING_INSTRUCTION_NODE|TEXT_NODE|WRONG_DOCUMENT_ERR)\n |\n (_content|[xyz]|abbr|above|accept|acceptCharset|accessKey|action|align|[av]Link(?:color)?|all|alt|anchors|appCodeName\n |appCore|applets|appMinorVersion|appName|appVersion|archive|areas|arguments|attributes|availHeight|availLeft|availTop\n |availWidth|axis|background|backgroundColor|backgroundImage|below|bgColor|body|border|borderBottomWidth|borderColor\n |borderLeftWidth|borderRightWidth|borderStyle|borderTopWidth|borderWidth|bottom|bufferDepth|callee|caller|caption\n |cellPadding|cells|cellSpacing|ch|characterSet|charset|checked|childNodes|chOff|cite|classes|className|clear\n |clientInformation|clip|clipBoardData|closed|code|codeBase|codeType|color|colorDepth|cols|colSpan|compact|complete\n |components|content|controllers|cookie|cookieEnabled|cords|cpuClass|crypto|current|data|dateTime|declare|defaultCharset\n |defaultChecked|defaultSelected|defaultStatus|defaultValue|defaultView|defer|description|dialogArguments|dialogHeight\n |dialogLeft|dialogTop|dialogWidth|dir|directories|disabled|display|docmain|doctype|documentElement|elements|embeds\n |enabledPlugin|encoding|enctype|entities|event|expando|external|face|fgColor|filename|firstChild|fontFamily|fontSize\n |fontWeight|form|formName|forms|frame|frameBorder|frameElement|frames|hasFocus|hash|headers|height|history|host\n |hostname|href|hreflang|hspace|htmlFor|httpEquiv|id|ids|ignoreCase|images|implementation|index|innerHeight|innerWidth\n |input|isMap|label|lang|language|lastChild|lastIndex|lastMatch|lastModified|lastParen|layer[sXY]|left|leftContext\n |lineHeight|link|linkColor|links|listStyleType|localName|location|locationbar|longDesc|lowsrc|lowSrc|marginBottom\n |marginHeight|marginLeft|marginRight|marginTop|marginWidth|maxLength|media|menubar|method|mimeTypes|multiline|multiple\n |name|nameProp|namespaces|namespaceURI|next|nextSibling|nodeName|nodeType|nodeValue|noHref|noResize|noShade|notationName\n |notations|noWrap|object|offscreenBuffering|onLine|onreadystatechange|opener|opsProfile|options|oscpu|outerHeight\n |outerWidth|ownerDocument|paddingBottom|paddingLeft|paddingRight|paddingTop|page[XY]|page[XY]Offset|parent|parentLayer\n |parentNode|parentWindow|pathname|personalbar|pixelDepth|pkcs11|platform|plugins|port|prefix|previous|previousDibling\n |product|productSub|profile|profileend|prompt|prompter|protocol|publicId|readOnly|readyState|referrer|rel|responseText\n |responseXML|rev|right|rightContext|rowIndex|rows|rowSpan|rules|scheme|scope|screen[XY]|screenLeft|screenTop|scripts\n |scrollbars|scrolling|sectionRowIndex|security|securityPolicy|selected|selectedIndex|selection|self|shape|siblingAbove\n |siblingBelow|size|source|specified|standby|start|status|statusbar|statusText|style|styleSheets|suffixes|summary\n |systemId|systemLanguage|tagName|tags|target|tBodies|text|textAlign|textDecoration|textIndent|textTransform|tFoot|tHead\n |title|toolbar|top|type|undefined|uniqueID|updateInterval|URL|URLUnencoded|useMap|userAgent|userLanguage|userProfile\n |vAlign|value|valueType|vendor|vendorSub|version|visibility|vspace|whiteSpace|width|X[MS]LDocument|zIndex))\\b(?!\\$|\\s*(<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\()",
"match": "(?x) (\\.) \\s* (?:\n (ATTRIBUTE_NODE|CDATA_SECTION_NODE|COMMENT_NODE|DOCUMENT_FRAGMENT_NODE|DOCUMENT_NODE|DOCUMENT_TYPE_NODE\n |DOMSTRING_SIZE_ERR|ELEMENT_NODE|ENTITY_NODE|ENTITY_REFERENCE_NODE|HIERARCHY_REQUEST_ERR|INDEX_SIZE_ERR\n |INUSE_ATTRIBUTE_ERR|INVALID_CHARACTER_ERR|NO_DATA_ALLOWED_ERR|NO_MODIFICATION_ALLOWED_ERR|NOT_FOUND_ERR\n |NOT_SUPPORTED_ERR|NOTATION_NODE|PROCESSING_INSTRUCTION_NODE|TEXT_NODE|WRONG_DOCUMENT_ERR)\n |\n (_content|[xyz]|abbr|above|accept|acceptCharset|accessKey|action|align|[av]Link(?:color)?|all|alt|anchors|appCodeName\n |appCore|applets|appMinorVersion|appName|appVersion|archive|areas|arguments|attributes|availHeight|availLeft|availTop\n |availWidth|axis|background|backgroundColor|backgroundImage|below|bgColor|body|border|borderBottomWidth|borderColor\n |borderLeftWidth|borderRightWidth|borderStyle|borderTopWidth|borderWidth|bottom|bufferDepth|callee|caller|caption\n |cellPadding|cells|cellSpacing|ch|characterSet|charset|checked|childNodes|chOff|cite|classes|className|clear\n |clientInformation|clip|clipBoardData|closed|code|codeBase|codeType|color|colorDepth|cols|colSpan|compact|complete\n |components|content|controllers|cookie|cookieEnabled|cords|cpuClass|crypto|current|data|dateTime|declare|defaultCharset\n |defaultChecked|defaultSelected|defaultStatus|defaultValue|defaultView|defer|description|dialogArguments|dialogHeight\n |dialogLeft|dialogTop|dialogWidth|dir|directories|disabled|display|docmain|doctype|documentElement|elements|embeds\n |enabledPlugin|encoding|enctype|entities|event|expando|external|face|fgColor|filename|firstChild|fontFamily|fontSize\n |fontWeight|form|formName|forms|frame|frameBorder|frameElement|frames|hasFocus|hash|headers|height|history|host\n |hostname|href|hreflang|hspace|htmlFor|httpEquiv|id|ids|ignoreCase|images|implementation|index|innerHeight|innerWidth\n |input|isMap|label|lang|language|lastChild|lastIndex|lastMatch|lastModified|lastParen|layer[sXY]|left|leftContext\n |lineHeight|link|linkColor|links|listStyleType|localName|location|locationbar|longDesc|lowsrc|lowSrc|marginBottom\n |marginHeight|marginLeft|marginRight|marginTop|marginWidth|maxLength|media|menubar|method|mimeTypes|multiline|multiple\n |name|nameProp|namespaces|namespaceURI|next|nextSibling|nodeName|nodeType|nodeValue|noHref|noResize|noShade|notationName\n |notations|noWrap|object|offscreenBuffering|onLine|onreadystatechange|opener|opsProfile|options|oscpu|outerHeight\n |outerWidth|ownerDocument|paddingBottom|paddingLeft|paddingRight|paddingTop|page[XY]|page[XY]Offset|parent|parentLayer\n |parentNode|parentWindow|pathname|personalbar|pixelDepth|pkcs11|platform|plugins|port|prefix|previous|previousDibling\n |product|productSub|profile|profileend|prompt|prompter|protocol|publicId|readOnly|readyState|referrer|rel|responseText\n |responseXML|rev|right|rightContext|rowIndex|rows|rowSpan|rules|scheme|scope|screen[XY]|screenLeft|screenTop|scripts\n |scrollbars|scrolling|sectionRowIndex|security|securityPolicy|selected|selectedIndex|selection|self|shape|siblingAbove\n |siblingBelow|size|source|specified|standby|start|status|statusbar|statusText|style|styleSheets|suffixes|summary\n |systemId|systemLanguage|tagName|tags|target|tBodies|text|textAlign|textDecoration|textIndent|textTransform|tFoot|tHead\n |title|toolbar|top|type|undefined|uniqueID|updateInterval|URL|URLUnencoded|useMap|userAgent|userLanguage|userProfile\n |vAlign|value|valueType|vendor|vendorSub|version|visibility|vspace|whiteSpace|width|X[MS]LDocument|zIndex))\\b(?!\\$|\\s*(<\\s*[_$[:alpha:]\\{\\(]([^<>=]|=[^<]|\\<\\s*[_$[:alpha:]\\{\\(]([^=<>]|=[^<])+\\>)+>\\s*)?\\()",
"captures": {
"1": {
"name": "punctuation.accessor.js"
@@ -2485,13 +2508,13 @@
]
},
"function-call": {
"begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\.\\s*)*|(\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*)\\s*(<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\()",
"end": "(?<=\\))(?!(([_$[:alpha:]][_$[:alnum:]]*\\s*\\.\\s*)*|(\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*)\\s*(<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\()",
"begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\.\\s*)*|(\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*)\\s*(<\\s*[_$[:alpha:]\\{\\(]([^<>=]|=[^<]|\\<\\s*[_$[:alpha:]\\{\\(]([^=<>]|=[^<])+\\>)+>\\s*)?\\()",
"end": "(?<=\\))(?!(([_$[:alpha:]][_$[:alnum:]]*\\s*\\.\\s*)*|(\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*)\\s*(<\\s*[_$[:alpha:]\\{\\(]([^<>=]|=[^<]|\\<\\s*[_$[:alpha:]\\{\\(]([^=<>]|=[^<])+\\>)+>\\s*)?\\()",
"patterns": [
{
"name": "meta.function-call.js",
"begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\.\\s*)*|(\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))",
"end": "(?=\\s*(<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\()",
"end": "(?=\\s*(<\\s*[_$[:alpha:]\\{\\(]([^<>=]|=[^<]|\\<\\s*[_$[:alpha:]\\{\\(]([^=<>]|=[^<])+\\>)+>\\s*)?\\()",
"patterns": [
{
"include": "#literal"
@@ -2552,7 +2575,7 @@
"include": "#object-identifiers"
},
{
"match": "(?x)(?:(\\.)\\s*)?([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n))",
"match": "(?x)(?:(\\.)\\s*)?([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<\\s*[_$[:alpha:]\\{\\(]([^<>=]|=[^<]|\\<\\s*[_$[:alpha:]\\{\\(]([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n))",
"captures": {
"1": {
"name": "punctuation.accessor.js"
@@ -2697,7 +2720,7 @@
},
{
"name": "meta.object.member.js",
"match": "(?x)(?:([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=:\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n)))",
"match": "(?x)(?:([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=:\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<\\s*[_$[:alpha:]\\{\\(]([^<>=]|=[^<]|\\<\\s*[_$[:alpha:]\\{\\(]([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n)))",
"captures": {
"0": {
"name": "meta.object-literal.key.js"
@@ -2714,8 +2737,7 @@
"0": {
"name": "meta.object-literal.key.js"
}
},
"end": "(?=,|\\})"
}
},
{
"name": "meta.object.member.js",
@@ -2741,6 +2763,16 @@
}
}
},
{
"name": "meta.object.member.js",
"begin": "(?=[_$[:alpha:]][_$[:alnum:]]*\\s*=)",
"end": "(?=,|\\}|$)",
"patterns": [
{
"include": "#expression"
}
]
},
{
"include": "#object-member-body"
},
@@ -2815,7 +2847,7 @@
"name": "keyword.control.as.js"
}
},
"end": "(?=$|^|[;,:})\\]])",
"end": "(?=$|^|[;,:})\\]]|((?<!\\.|\\$)\\b(as)\\s+))",
"patterns": [
{
"include": "#type"
@@ -2900,7 +2932,7 @@
},
{
"name": "meta.arrow.js",
"begin": "(?x) (?:\n (?<!\\.|\\$)(\\basync)\n)? ((?<![})!\\]])\\s*\n (?=\n # sure shot arrow functions even if => is on new line\n (\n [(]\\s*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n ) |\n (\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends \n ) |\n # arrow function possible to detect only with => on same line\n (\n (<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)? # typeparameters\n \\(([^()]|\\([^()]*\\))*\\) # parameteres\n (\\s*:\\s*(.)*)? # return type\n \\s*=> # arrow operator\n )\n )\n)",
"begin": "(?x) (?:\n (?<!\\.|\\$)(\\basync)\n)? ((?<![})!\\]])\\s*\n (?=\n # sure shot arrow functions even if => is on new line\n (\n [(]\\s*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n ) |\n (\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends \n ) |\n # arrow function possible to detect only with => on same line\n (\n (<\\s*[_$[:alpha:]\\{\\(]([^<>=]|=[^<]|\\<\\s*[_$[:alpha:]\\{\\(]([^=<>]|=[^<])+\\>)+>\\s*)? # typeparameters\n \\(([^()]|\\([^()]*\\))*\\) # parameteres\n (\\s*:\\s*(.)*)? # return type\n \\s*=> # arrow operator\n )\n )\n)",
"beginCaptures": {
"1": {
"name": "storage.modifier.async.js"
@@ -3053,7 +3085,7 @@
"patterns": [
{
"name": "string.regexp.js",
"begin": "(?<=[=(:,\\[?+!]|return|case|=>|&&|\\|\\||\\*\\/)\\s*(\\/)(?![\\/*])(?=(?:[^\\/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+\\/(?![\\/*])[gimy]*(?!\\s*[a-zA-Z0-9_$]))",
"begin": "(?<=[=(:,\\[?+!]|return|case|=>|&&|\\|\\||\\*\\/)\\s*(\\/)(?![\\/*])(?=(?:[^\\/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+\\/(?![\\/*])[gimuy]*(?!\\s*[a-zA-Z0-9_$]))",
"beginCaptures": {
"1": {
"name": "punctuation.definition.string.begin.js"
@@ -3076,7 +3108,7 @@
},
{
"name": "string.regexp.js",
"begin": "(?<![_$[:alnum:])])\\/(?![\\/*])(?=(?:[^\\/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+\\/(?![\\/*])[gimy]*(?!\\s*[a-zA-Z0-9_$]))",
"begin": "(?<![_$[:alnum:])])\\/(?![\\/*])(?=(?:[^\\/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+\\/(?![\\/*])[gimuy]*(?!\\s*[a-zA-Z0-9_$]))",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.js"
@@ -3299,7 +3331,8 @@
{
"include": "#expression"
}
]
],
"contentName": "meta.embedded.line.tsx"
},
"literal": {
"patterns": [
@@ -3412,7 +3445,7 @@
},
"this-literal": {
"name": "variable.language.this.js",
"match": "(?<!\\.|\\$)\\bthis\\b(?!\\$)"
"match": "(?<!\\$)((?<=\\.\\.\\.)|(?<!\\.))\\bthis\\b(?!\\$)"
},
"super-literal": {
"name": "variable.language.super.js",
@@ -1664,11 +1664,11 @@
"c": "{",
"t": "source.js meta.var.expr.js meta.objectliteral.js meta.object.member.js meta.function.expression.js meta.block.js meta.tag.without-attributes.js meta.jsx.children.tsx meta.tag.without-attributes.js meta.jsx.children.tsx meta.embedded.expression.js punctuation.section.embedded.begin.js",
"r": {
"dark_plus": "meta.embedded: #D4D4D4",
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"dark_plus": "punctuation.section.embedded: #569CD6",
"light_plus": "punctuation.section.embedded: #0000FF",
"dark_vs": "punctuation.section.embedded: #569CD6",
"light_vs": "punctuation.section.embedded: #0000FF",
"hc_black": "punctuation.section.embedded: #569CD6"
}
},
{
@@ -1686,11 +1686,11 @@
"c": "}",
"t": "source.js meta.var.expr.js meta.objectliteral.js meta.object.member.js meta.function.expression.js meta.block.js meta.tag.without-attributes.js meta.jsx.children.tsx meta.tag.without-attributes.js meta.jsx.children.tsx meta.embedded.expression.js punctuation.section.embedded.end.js",
"r": {
"dark_plus": "meta.embedded: #D4D4D4",
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"dark_plus": "punctuation.section.embedded: #569CD6",
"light_plus": "punctuation.section.embedded: #0000FF",
"dark_vs": "punctuation.section.embedded: #569CD6",
"light_vs": "punctuation.section.embedded: #0000FF",
"hc_black": "punctuation.section.embedded: #569CD6"
}
},
{
@@ -1862,11 +1862,11 @@
"c": "{",
"t": "source.js meta.var.expr.js meta.objectliteral.js meta.object.member.js meta.function.expression.js meta.block.js meta.tag.without-attributes.js meta.jsx.children.tsx meta.tag.js meta.embedded.expression.js punctuation.section.embedded.begin.js",
"r": {
"dark_plus": "meta.embedded: #D4D4D4",
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"dark_plus": "punctuation.section.embedded: #569CD6",
"light_plus": "punctuation.section.embedded: #0000FF",
"dark_vs": "punctuation.section.embedded: #569CD6",
"light_vs": "punctuation.section.embedded: #0000FF",
"hc_black": "punctuation.section.embedded: #569CD6"
}
},
{
@@ -1888,7 +1888,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1906,11 +1906,11 @@
"c": "}",
"t": "source.js meta.var.expr.js meta.objectliteral.js meta.object.member.js meta.function.expression.js meta.block.js meta.tag.without-attributes.js meta.jsx.children.tsx meta.tag.js meta.embedded.expression.js punctuation.section.embedded.end.js",
"r": {
"dark_plus": "meta.embedded: #D4D4D4",
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"dark_plus": "punctuation.section.embedded: #569CD6",
"light_plus": "punctuation.section.embedded: #0000FF",
"dark_vs": "punctuation.section.embedded: #569CD6",
"light_vs": "punctuation.section.embedded: #0000FF",
"hc_black": "punctuation.section.embedded: #569CD6"
}
},
{
+52 -26
View File
@@ -10,11 +10,11 @@ import { workspace, languages, ExtensionContext, extensions, Uri, TextDocument,
import { LanguageClient, LanguageClientOptions, RequestType, ServerOptions, TransportKind, NotificationType, DidChangeConfigurationNotification } from 'vscode-languageclient';
import TelemetryReporter from 'vscode-extension-telemetry';
import { ConfigurationFeature } from 'vscode-languageclient/lib/proposed';
import { DocumentColorRequest } from 'vscode-languageserver-protocol/lib/protocol.colorProvider.proposed';
import * as nls from 'vscode-nls';
import { hash } from './utils/hash';
let localize = nls.loadMessageBundle();
namespace VSCodeContentRequest {
@@ -192,8 +192,6 @@ function getSettings(): Settings {
let httpSettings = workspace.getConfiguration('http');
let jsonSettings = workspace.getConfiguration('json');
let schemas = [];
let settings: Settings = {
http: {
proxy: httpSettings.get('proxy'),
@@ -201,41 +199,69 @@ function getSettings(): Settings {
},
json: {
format: jsonSettings.get('format'),
schemas: schemas,
schemas: [],
}
};
let schemaSettingsById: { [schemaId: string]: JSONSchemaSettings } = Object.create(null);
let collectSchemaSettings = (schemaSettings: JSONSchemaSettings[], rootPath?: string, fileMatchPrefix?: string) => {
for (let setting of schemaSettings) {
let url = getSchemaId(setting, rootPath);
if (!url) {
continue;
}
let schemaSetting = schemaSettingsById[url];
if (!schemaSetting) {
schemaSetting = schemaSettingsById[url] = { url, fileMatch: [] };
settings.json.schemas.push(schemaSetting);
}
let fileMatches = setting.fileMatch;
if (Array.isArray(fileMatches)) {
if (fileMatchPrefix) {
fileMatches = fileMatches.map(m => fileMatchPrefix + m);
}
schemaSetting.fileMatch.push(...fileMatches);
}
if (setting.schema) {
schemaSetting.schema = setting.schema;
}
}
};
let settingsSchemas = jsonSettings.get('schemas');
if (Array.isArray(settingsSchemas)) {
schemas.push(...settingsSchemas);
}
// merge global and folder settings. Qualify all file matches with the folder path.
let globalSettings = jsonSettings.get<JSONSchemaSettings[]>('schemas');
if (Array.isArray(globalSettings)) {
collectSchemaSettings(globalSettings, workspace.rootPath);
}
let folders = workspace.workspaceFolders;
if (folders) {
folders.forEach(folder => {
let jsonConfig = workspace.getConfiguration('json', folder.uri);
let schemaConfigInfo = jsonConfig.inspect<JSONSchemaSettings[]>('schemas');
for (let folder of folders) {
let folderUri = folder.uri;
let schemaConfigInfo = workspace.getConfiguration('json', folderUri).inspect<JSONSchemaSettings[]>('schemas');
let folderSchemas = schemaConfigInfo.workspaceFolderValue;
if (Array.isArray(folderSchemas)) {
folderSchemas.forEach(schema => {
let url = schema.url;
if (!url && schema.schema) {
url = schema.schema.id;
}
if (url && url[0] === '.') {
url = Uri.file(path.normalize(path.join(folder.uri.fsPath, url))).toString();
}
let fileMatch = schema.fileMatch;
if (fileMatch) {
fileMatch = fileMatch.map(m => folder.uri.toString() + '*' + m);
}
schemas.push({ url, fileMatch, schema: schema.schema });
});
let folderPath = folderUri.toString();
if (folderPath[folderPath.length - 1] !== '/') {
folderPath = folderPath + '/';
}
collectSchemaSettings(folderSchemas, folderUri.fsPath, folderPath + '*');
};
});
};
}
return settings;
}
function getSchemaId(schema: JSONSchemaSettings, rootPath?: string) {
let url = schema.url;
if (!url) {
if (schema.schema) {
url = schema.schema.id || `vscode://schemas/custom/${encodeURIComponent(hash(schema.schema).toString(16))}`;
}
} else if (rootPath && (url[0] === '.' || url[0] === '/')) {
url = Uri.file(path.normalize(path.join(rootPath, url))).toString();
}
return url;
}
function getPackageInfo(context: ExtensionContext): IPackageInfo {
let extensionPackage = require(context.asAbsolutePath('./package.json'));
if (extensionPackage) {
+59
View File
@@ -0,0 +1,59 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
/**
* Return a hash value for an object.
*/
export function hash(obj: any, hashVal = 0): number {
switch (typeof obj) {
case 'object':
if (obj === null) {
return numberHash(349, hashVal);
} else if (Array.isArray(obj)) {
return arrayHash(obj, hashVal);
}
return objectHash(obj, hashVal);
case 'string':
return stringHash(obj, hashVal);
case 'boolean':
return booleanHash(obj, hashVal);
case 'number':
return numberHash(obj, hashVal);
case 'undefined':
return numberHash(obj, 937);
default:
return numberHash(obj, 617);
}
}
function numberHash(val: number, initialHashVal: number): number {
return (((initialHashVal << 5) - initialHashVal) + val) | 0; // hashVal * 31 + ch, keep as int32
}
function booleanHash(b: boolean, initialHashVal: number): number {
return numberHash(b ? 433 : 863, initialHashVal);
}
function stringHash(s: string, hashVal: number) {
hashVal = numberHash(149417, hashVal);
for (let i = 0, length = s.length; i < length; i++) {
hashVal = numberHash(s.charCodeAt(i), hashVal);
}
return hashVal;
}
function arrayHash(arr: any[], initialHashVal: number): number {
initialHashVal = numberHash(104579, initialHashVal);
return arr.reduce((hashVal, item) => hash(item, hashVal), initialHashVal);
}
function objectHash(obj: any, initialHashVal: number): number {
initialHashVal = numberHash(181387, initialHashVal);
return Object.keys(obj).sort().reduce((hashVal, key) => {
hashVal = stringHash(key, hashVal);
return hash(obj[key], hashVal);
}, initialHashVal);
}
+2 -2
View File
@@ -43,9 +43,9 @@
"resolved": "https://registry.npmjs.org/request-light/-/request-light-0.2.1.tgz"
},
"vscode-json-languageservice": {
"version": "2.0.16",
"version": "2.0.18",
"from": "vscode-json-languageservice@next",
"resolved": "https://registry.npmjs.org/vscode-json-languageservice/-/vscode-json-languageservice-2.0.16.tgz"
"resolved": "https://registry.npmjs.org/vscode-json-languageservice/-/vscode-json-languageservice-2.0.18.tgz"
},
"vscode-jsonrpc": {
"version": "3.3.1",
+3 -2
View File
@@ -10,10 +10,11 @@
"dependencies": {
"jsonc-parser": "^1.0.0",
"request-light": "^0.2.1",
"vscode-json-languageservice": "^2.0.16",
"vscode-json-languageservice": "^2.0.18",
"vscode-languageserver": "3.4.0-next.6",
"vscode-languageserver-protocol": "^3.1.1",
"vscode-nls": "^2.0.2"
"vscode-nls": "^2.0.2",
"vscode-uri": "^1.0.1"
},
"devDependencies": {
"@types/node": "^6.0.51"
+3 -13
View File
@@ -13,9 +13,8 @@ import {
import { DocumentColorRequest, ServerCapabilities as CPServerCapabilities } from 'vscode-languageserver-protocol/lib/protocol.colorProvider.proposed';
import { xhr, XHRResponse, configure as configureHttpRequests, getErrorStatusDescription } from 'request-light';
import path = require('path');
import fs = require('fs');
import URI from './utils/uri';
import URI from 'vscode-uri';
import * as URL from 'url';
import Strings = require('./utils/strings');
import { JSONDocument, JSONSchema, LanguageSettings, getLanguageService } from 'vscode-json-languageservice';
@@ -54,9 +53,7 @@ let clientDynamicRegisterSupport = false;
// After the server has started the client sends an initilize request. The server receives
// in the passed params the rootPath of the workspace plus the client capabilities.
let workspaceRoot: URI;
connection.onInitialize((params: InitializeParams): InitializeResult => {
workspaceRoot = URI.parse(params.rootPath);
function hasClientCapability(...keys: string[]) {
let c = params.capabilities;
@@ -192,19 +189,12 @@ function updateConfiguration() {
}
}
if (jsonConfigurationSettings) {
jsonConfigurationSettings.forEach(schema => {
jsonConfigurationSettings.forEach((schema, index) => {
let uri = schema.url;
if (!uri && schema.schema) {
uri = schema.schema.id;
}
if (!uri && schema.fileMatch) {
uri = 'vscode://schemas/custom/' + encodeURIComponent(schema.fileMatch.join('&'));
uri = schema.schema.id || `vscode://schemas/custom/${index}`;
}
if (uri) {
if (uri[0] === '.' && workspaceRoot) {
// workspace relative path
uri = URI.file(path.normalize(path.join(workspaceRoot.fsPath, uri))).toString();
}
languageSettings.schemas.push({ uri, fileMatch: schema.fileMatch, schema: schema.schema });
}
});
-351
View File
@@ -1,351 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
function _encode(ch: string): string {
return '%' + ch.charCodeAt(0).toString(16).toUpperCase();
}
// see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent
function encodeURIComponent2(str: string): string {
return encodeURIComponent(str).replace(/[!'()*]/g, _encode);
}
function encodeNoop(str: string): string {
return str;
}
/**
* Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986.
* This class is a simple parser which creates the basic component paths
* (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation
* and encoding.
*
* foo://example.com:8042/over/there?name=ferret#nose
* \_/ \______________/\_________/ \_________/ \__/
* | | | | |
* scheme authority path query fragment
* | _____________________|__
* / \ / \
* urn:example:animal:ferret:nose
*
*
*/
export default class URI {
private static _empty = '';
private static _slash = '/';
private static _regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;
private static _driveLetterPath = /^\/[a-zA-z]:/;
private static _upperCaseDrive = /^(\/)?([A-Z]:)/;
private _scheme: string;
private _authority: string;
private _path: string;
private _query: string;
private _fragment: string;
private _formatted: string;
private _fsPath: string;
constructor() {
this._scheme = URI._empty;
this._authority = URI._empty;
this._path = URI._empty;
this._query = URI._empty;
this._fragment = URI._empty;
this._formatted = null;
this._fsPath = null;
}
/**
* scheme is the 'http' part of 'http://www.msft.com/some/path?query#fragment'.
* The part before the first colon.
*/
get scheme() {
return this._scheme;
}
/**
* authority is the 'www.msft.com' part of 'http://www.msft.com/some/path?query#fragment'.
* The part between the first double slashes and the next slash.
*/
get authority() {
return this._authority;
}
/**
* path is the '/some/path' part of 'http://www.msft.com/some/path?query#fragment'.
*/
get path() {
return this._path;
}
/**
* query is the 'query' part of 'http://www.msft.com/some/path?query#fragment'.
*/
get query() {
return this._query;
}
/**
* fragment is the 'fragment' part of 'http://www.msft.com/some/path?query#fragment'.
*/
get fragment() {
return this._fragment;
}
// ---- filesystem path -----------------------
/**
* Returns a string representing the corresponding file system path of this URI.
* Will handle UNC paths and normalize windows drive letters to lower-case. Also
* uses the platform specific path separator. Will *not* validate the path for
* invalid characters and semantics. Will *not* look at the scheme of this URI.
*/
get fsPath() {
if (!this._fsPath) {
var value: string;
if (this._authority && this.scheme === 'file') {
// unc path: file://shares/c$/far/boo
value = `//${this._authority}${this._path}`;
} else if (URI._driveLetterPath.test(this._path)) {
// windows drive letter: file:///c:/far/boo
value = this._path[1].toLowerCase() + this._path.substr(2);
} else {
// other path
value = this._path;
}
if (process.platform === 'win32') {
value = value.replace(/\//g, '\\');
}
this._fsPath = value;
}
return this._fsPath;
}
// ---- modify to new -------------------------
public with(scheme: string, authority: string, path: string, query: string, fragment: string): URI {
var ret = new URI();
ret._scheme = scheme || this.scheme;
ret._authority = authority || this.authority;
ret._path = path || this.path;
ret._query = query || this.query;
ret._fragment = fragment || this.fragment;
URI._validate(ret);
return ret;
}
public withScheme(value: string): URI {
return this.with(value, undefined, undefined, undefined, undefined);
}
public withAuthority(value: string): URI {
return this.with(undefined, value, undefined, undefined, undefined);
}
public withPath(value: string): URI {
return this.with(undefined, undefined, value, undefined, undefined);
}
public withQuery(value: string): URI {
return this.with(undefined, undefined, undefined, value, undefined);
}
public withFragment(value: string): URI {
return this.with(undefined, undefined, undefined, undefined, value);
}
// ---- parse & validate ------------------------
public static parse(value: string): URI {
const ret = new URI();
const data = URI._parseComponents(value);
ret._scheme = data.scheme;
ret._authority = decodeURIComponent(data.authority);
ret._path = decodeURIComponent(data.path);
ret._query = decodeURIComponent(data.query);
ret._fragment = decodeURIComponent(data.fragment);
URI._validate(ret);
return ret;
}
public static file(path: string): URI {
const ret = new URI();
ret._scheme = 'file';
// normalize to fwd-slashes
path = path.replace(/\\/g, URI._slash);
// check for authority as used in UNC shares
// or use the path as given
if (path[0] === URI._slash && path[0] === path[1]) {
let idx = path.indexOf(URI._slash, 2);
if (idx === -1) {
ret._authority = path.substring(2);
} else {
ret._authority = path.substring(2, idx);
ret._path = path.substring(idx);
}
} else {
ret._path = path;
}
// Ensure that path starts with a slash
// or that it is at least a slash
if (ret._path[0] !== URI._slash) {
ret._path = URI._slash + ret._path;
}
URI._validate(ret);
return ret;
}
private static _parseComponents(value: string): UriComponents {
const ret: UriComponents = {
scheme: URI._empty,
authority: URI._empty,
path: URI._empty,
query: URI._empty,
fragment: URI._empty,
};
const match = URI._regexp.exec(value);
if (match) {
ret.scheme = match[2] || ret.scheme;
ret.authority = match[4] || ret.authority;
ret.path = match[5] || ret.path;
ret.query = match[7] || ret.query;
ret.fragment = match[9] || ret.fragment;
}
return ret;
}
public static create(scheme?: string, authority?: string, path?: string, query?: string, fragment?: string): URI {
return new URI().with(scheme, authority, path, query, fragment);
}
private static _validate(ret: URI): void {
// validation
// path, http://tools.ietf.org/html/rfc3986#section-3.3
// If a URI contains an authority component, then the path component
// must either be empty or begin with a slash ("/") character. If a URI
// does not contain an authority component, then the path cannot begin
// with two slash characters ("//").
if (ret.authority && ret.path && ret.path[0] !== '/') {
throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character');
}
if (!ret.authority && ret.path.indexOf('//') === 0) {
throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")');
}
}
// ---- printing/externalize ---------------------------
/**
*
* @param skipEncoding Do not encode the result, default is `false`
*/
public toString(skipEncoding: boolean = false): string {
if (!skipEncoding) {
if (!this._formatted) {
this._formatted = URI._asFormatted(this, false);
}
return this._formatted;
} else {
// we don't cache that
return URI._asFormatted(this, true);
}
}
private static _asFormatted(uri: URI, skipEncoding: boolean): string {
const encoder = !skipEncoding
? encodeURIComponent2
: encodeNoop;
const parts: string[] = [];
let { scheme, authority, path, query, fragment } = uri;
if (scheme) {
parts.push(scheme, ':');
}
if (authority || scheme === 'file') {
parts.push('//');
}
if (authority) {
authority = authority.toLowerCase();
let idx = authority.indexOf(':');
if (idx === -1) {
parts.push(encoder(authority));
} else {
parts.push(encoder(authority.substr(0, idx)), authority.substr(idx));
}
}
if (path) {
// lower-case windown drive letters in /C:/fff
const m = URI._upperCaseDrive.exec(path);
if (m) {
path = m[1] + m[2].toLowerCase() + path.substr(m[1].length + m[2].length);
}
// encode every segement but not slashes
// make sure that # and ? are always encoded
// when occurring in paths - otherwise the result
// cannot be parsed back again
let lastIdx = 0;
while (true) {
let idx = path.indexOf(URI._slash, lastIdx);
if (idx === -1) {
parts.push(encoder(path.substring(lastIdx)).replace(/[#?]/, _encode));
break;
}
parts.push(encoder(path.substring(lastIdx, idx)).replace(/[#?]/, _encode), URI._slash);
lastIdx = idx + 1;
};
}
if (query) {
parts.push('?', encoder(query));
}
if (fragment) {
parts.push('#', encoder(fragment));
}
return parts.join(URI._empty);
}
public toJSON(): any {
return <UriState>{
scheme: this.scheme,
authority: this.authority,
path: this.path,
fsPath: this.fsPath,
query: this.query,
fragment: this.fragment,
external: this.toString(),
$mid: 1
};
}
}
interface UriComponents {
scheme: string;
authority: string;
path: string;
query: string;
fragment: string;
}
interface UriState extends UriComponents {
$mid: number;
fsPath: string;
external: string;
}
@@ -388,11 +388,11 @@
"c": "\\u0056",
"t": "source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json constant.character.escape.json",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #A31515",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "string: #CE9178"
"hc_black": "constant.character: #569CD6"
}
},
{
@@ -135,11 +135,11 @@
"c": "\\",
"t": "source.makefile meta.scope.target.makefile meta.scope.prerequisites.makefile constant.character.escape.continuation.makefile",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #A31515",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "constant.character: #569CD6"
}
},
{
@@ -278,11 +278,11 @@
"c": "\\",
"t": "source.makefile meta.scope.target.makefile meta.scope.prerequisites.makefile constant.character.escape.continuation.makefile",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #A31515",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "constant.character: #569CD6"
}
},
{
@@ -322,11 +322,11 @@
"c": "\\",
"t": "source.makefile meta.scope.target.makefile meta.scope.prerequisites.makefile comment.line.number-sign.makefile constant.character.escape.continuation.makefile",
"r": {
"dark_plus": "comment: #608B4E",
"light_plus": "comment: #008000",
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #A31515",
"dark_vs": "comment: #608B4E",
"light_vs": "comment: #008000",
"hc_black": "comment: #7CA668"
"hc_black": "constant.character: #569CD6"
}
},
{
@@ -377,11 +377,11 @@
"c": "\\",
"t": "source.makefile comment.line.number-sign.makefile constant.character.escape.continuation.makefile",
"r": {
"dark_plus": "comment: #608B4E",
"light_plus": "comment: #008000",
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #A31515",
"dark_vs": "comment: #608B4E",
"light_vs": "comment: #008000",
"hc_black": "comment: #7CA668"
"hc_black": "constant.character: #569CD6"
}
},
{
@@ -553,11 +553,11 @@
"c": "\\",
"t": "source.makefile meta.scope.target.makefile meta.scope.prerequisites.makefile constant.character.escape.continuation.makefile",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #A31515",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "constant.character: #569CD6"
}
},
{
@@ -656,7 +656,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -678,7 +678,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -733,7 +733,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -744,7 +744,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1030,7 +1030,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1052,7 +1052,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1063,7 +1063,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1074,7 +1074,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1096,7 +1096,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1107,7 +1107,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1151,7 +1151,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1162,7 +1162,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1173,7 +1173,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1301,11 +1301,11 @@
"c": "\\d\\d\\d",
"t": "source.perl string.regexp.find.perl constant.character.escape.perl",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #A31515",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
"hc_black": "constant.character: #569CD6"
}
},
{
@@ -1323,11 +1323,11 @@
"c": "\\d\\d",
"t": "source.perl string.regexp.find.perl constant.character.escape.perl",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #A31515",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
"hc_black": "constant.character: #569CD6"
}
},
{
@@ -1345,11 +1345,11 @@
"c": "\\d\\d",
"t": "source.perl string.regexp.find.perl constant.character.escape.perl",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #A31515",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
"hc_black": "constant.character: #569CD6"
}
},
{
@@ -1774,11 +1774,11 @@
"c": "\\d",
"t": "source.perl string.regexp.find.perl constant.character.escape.perl",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #A31515",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
"hc_black": "constant.character: #569CD6"
}
},
{
@@ -388,11 +388,11 @@
"c": "\\s",
"t": "source.perl string.regexp.find.perl constant.character.escape.perl",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #A31515",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
"hc_black": "constant.character: #569CD6"
}
},
{
@@ -410,11 +410,11 @@
"c": "\\s",
"t": "source.perl string.regexp.find.perl constant.character.escape.perl",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #A31515",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
"hc_black": "constant.character: #569CD6"
}
},
{
@@ -432,11 +432,11 @@
"c": "\\(",
"t": "source.perl string.regexp.find.perl constant.character.escape.perl",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #A31515",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
"hc_black": "constant.character: #569CD6"
}
},
{
@@ -454,11 +454,11 @@
"c": "\\)",
"t": "source.perl string.regexp.find.perl constant.character.escape.perl",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #A31515",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
"hc_black": "constant.character: #569CD6"
}
},
{
@@ -476,11 +476,11 @@
"c": "\\)",
"t": "source.perl string.regexp.find.perl constant.character.escape.perl",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #A31515",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
"hc_black": "constant.character: #569CD6"
}
},
{
@@ -674,11 +674,11 @@
"c": "\\n",
"t": "source.perl string.quoted.double.perl constant.character.escape.perl",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #A31515",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "string: #CE9178"
"hc_black": "constant.character: #569CD6"
}
},
{
@@ -949,11 +949,11 @@
"c": "\\n",
"t": "source.perl string.quoted.double.perl constant.character.escape.perl",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #A31515",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "string: #CE9178"
"hc_black": "constant.character: #569CD6"
}
},
{
@@ -1444,11 +1444,11 @@
"c": "\\n",
"t": "source.perl string.quoted.double.perl constant.character.escape.perl",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #A31515",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "string: #CE9178"
"hc_black": "constant.character: #569CD6"
}
},
{
@@ -2280,11 +2280,11 @@
"c": "\\n",
"t": "source.perl string.quoted.double.perl constant.character.escape.perl",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #A31515",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "string: #CE9178"
"hc_black": "constant.character: #569CD6"
}
},
{
+1 -1
View File
@@ -27,7 +27,7 @@
"PHP",
"php"
],
"firstLine": "^#!/.*\\bphp\\b",
"firstLine": "^#!/.*\\bphp\\b",
"mimetypes": [
"application/x-php"
],
+10 -21
View File
@@ -1,10 +1,10 @@
{
"information_for_contributors": [
"This file has been converted from https://github.com/atom/language-php/blob/master/grammars/php.cson",
"This file has been converted from https://github.com/roblourens/language-php/blob/revertBraceMatching/grammars/php.cson",
"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/atom/language-php/commit/efab9c83b91c02f04b8cfd0236e0239e14c4af52",
"version": "https://github.com/roblourens/language-php/commit/91d50ab5f871ea2d11b4c511dc0b9a972e4ac5ce",
"scopeName": "text.html.php",
"name": "PHP",
"fileTypes": [
@@ -1428,6 +1428,14 @@
{
"include": "#comments"
},
{
"match": "{",
"name": "punctuation.section.scope.begin.php"
},
{
"match": "}",
"name": "punctuation.section.scope.end.php"
},
{
"begin": "(?i)^\\s*(interface)\\s+([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)\\s*(extends)?\\s*",
"beginCaptures": {
@@ -2086,25 +2094,6 @@
{
"include": "#string-backtick"
},
{
"begin": "{",
"beginCaptures": {
"0": {
"name": "punctuation.definition.begin.bracket.curly.php"
}
},
"end": "}",
"endCaptures": {
"0": {
"name": "punctuation.definition.end.bracket.curly.php"
}
},
"patterns": [
{
"include": "#language"
}
]
},
{
"begin": "\\[",
"beginCaptures": {
@@ -40,7 +40,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -62,7 +62,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -73,7 +73,7 @@
"light_plus": "punctuation.section.embedded.begin.php: #800000",
"dark_vs": "punctuation.section.embedded.begin.php: #569CD6",
"light_vs": "punctuation.section.embedded.begin.php: #800000",
"hc_black": "default: #FFFFFF"
"hc_black": "punctuation.section.embedded: #569CD6"
}
},
{
@@ -84,7 +84,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -106,7 +106,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -139,7 +139,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -161,7 +161,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -194,7 +194,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -205,18 +205,18 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "{",
"t": "text.html.php meta.embedded.block.html source.js meta.embedded.block.php source.php punctuation.definition.begin.bracket.curly.php",
"t": "text.html.php meta.embedded.block.html source.js meta.embedded.block.php source.php punctuation.section.scope.begin.php",
"r": {
"dark_plus": "meta.embedded: #D4D4D4",
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -227,7 +227,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -249,7 +249,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -278,11 +278,11 @@
"c": "\\'",
"t": "text.html.php meta.embedded.block.html source.js meta.embedded.block.php source.php string.quoted.single.php constant.character.escape.php",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #A31515",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "string: #CE9178"
"hc_black": "constant.character: #569CD6"
}
},
{
@@ -377,11 +377,11 @@
"c": "\\'",
"t": "text.html.php meta.embedded.block.html source.js meta.embedded.block.php source.php string.quoted.single.php constant.character.escape.php",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #A31515",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "string: #CE9178"
"hc_black": "constant.character: #569CD6"
}
},
{
@@ -414,7 +414,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -425,18 +425,18 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "}",
"t": "text.html.php meta.embedded.block.html source.js meta.embedded.block.php source.php punctuation.definition.end.bracket.curly.php",
"t": "text.html.php meta.embedded.block.html source.js meta.embedded.block.php source.php punctuation.section.scope.end.php",
"r": {
"dark_plus": "meta.embedded: #D4D4D4",
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -447,7 +447,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -458,7 +458,7 @@
"light_plus": "punctuation.section.embedded.end.php: #800000",
"dark_vs": "punctuation.section.embedded.end.php: #569CD6",
"light_vs": "punctuation.section.embedded.end.php: #800000",
"hc_black": "default: #FFFFFF"
"hc_black": "punctuation.section.embedded: #569CD6"
}
},
{
@@ -469,7 +469,7 @@
"light_plus": "punctuation.section.embedded.end.php: #800000",
"dark_vs": "punctuation.section.embedded.end.php: #569CD6",
"light_vs": "punctuation.section.embedded.end.php: #800000",
"hc_black": "default: #FFFFFF"
"hc_black": "punctuation.section.embedded: #569CD6"
}
},
{
@@ -480,7 +480,7 @@
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "default: #FFFFFF"
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
File diff suppressed because it is too large Load Diff
@@ -5294,8 +5294,8 @@
"c": "(",
"t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python support.other.parenthesis.regexp punctuation.parenthesis.begin.regexp",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "support.other.parenthesis.regexp: #CE9178",
"light_plus": "support.other.parenthesis.regexp: #D16969",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
@@ -5305,8 +5305,8 @@
"c": "[",
"t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python meta.character.set.regexp punctuation.character.set.begin.regexp constant.other.set.regexp",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "punctuation.character.set.begin.regexp: #CE9178",
"light_plus": "punctuation.character.set.begin.regexp: #D16969",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
@@ -5316,19 +5316,19 @@
"c": "0-9-",
"t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python meta.character.set.regexp constant.character.set.regexp",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "constant.character.set.regexp: #D16969",
"light_plus": "constant.character.set.regexp: #811F3F",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
"hc_black": "constant.character: #569CD6"
}
},
{
"c": "]",
"t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python meta.character.set.regexp punctuation.character.set.end.regexp constant.other.set.regexp",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "punctuation.character.set.end.regexp: #CE9178",
"light_plus": "punctuation.character.set.end.regexp: #D16969",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
@@ -5338,8 +5338,8 @@
"c": "*",
"t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python keyword.operator.quantifier.regexp",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
"dark_plus": "keyword.operator.quantifier.regexp: #D7BA7D",
"light_plus": "keyword.operator.quantifier.regexp: #000000",
"dark_vs": "keyword.operator: #D4D4D4",
"light_vs": "keyword.operator: #000000",
"hc_black": "keyword.operator: #D4D4D4"
@@ -5349,8 +5349,8 @@
"c": ")",
"t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python support.other.parenthesis.regexp punctuation.parenthesis.end.regexp",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "support.other.parenthesis.regexp: #CE9178",
"light_plus": "support.other.parenthesis.regexp: #D16969",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
@@ -5371,8 +5371,8 @@
"c": "*",
"t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python keyword.operator.quantifier.regexp",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
"dark_plus": "keyword.operator.quantifier.regexp: #D7BA7D",
"light_plus": "keyword.operator.quantifier.regexp: #000000",
"dark_vs": "keyword.operator: #D4D4D4",
"light_vs": "keyword.operator: #000000",
"hc_black": "keyword.operator: #D4D4D4"
@@ -5382,8 +5382,8 @@
"c": "(",
"t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python support.other.parenthesis.regexp punctuation.parenthesis.begin.regexp",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "support.other.parenthesis.regexp: #CE9178",
"light_plus": "support.other.parenthesis.regexp: #D16969",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
@@ -5393,8 +5393,8 @@
"c": "[",
"t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python meta.character.set.regexp punctuation.character.set.begin.regexp constant.other.set.regexp",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "punctuation.character.set.begin.regexp: #CE9178",
"light_plus": "punctuation.character.set.begin.regexp: #D16969",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
@@ -5404,19 +5404,19 @@
"c": "A-Za-z",
"t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python meta.character.set.regexp constant.character.set.regexp",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "constant.character.set.regexp: #D16969",
"light_plus": "constant.character.set.regexp: #811F3F",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
"hc_black": "constant.character: #569CD6"
}
},
{
"c": "]",
"t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python meta.character.set.regexp punctuation.character.set.end.regexp constant.other.set.regexp",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "punctuation.character.set.end.regexp: #CE9178",
"light_plus": "punctuation.character.set.end.regexp: #D16969",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
@@ -5426,8 +5426,8 @@
"c": "+",
"t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python keyword.operator.quantifier.regexp",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
"dark_plus": "keyword.operator.quantifier.regexp: #D7BA7D",
"light_plus": "keyword.operator.quantifier.regexp: #000000",
"dark_vs": "keyword.operator: #D4D4D4",
"light_vs": "keyword.operator: #000000",
"hc_black": "keyword.operator: #D4D4D4"
@@ -5437,8 +5437,8 @@
"c": ")",
"t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python support.other.parenthesis.regexp punctuation.parenthesis.end.regexp",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "support.other.parenthesis.regexp: #CE9178",
"light_plus": "support.other.parenthesis.regexp: #D16969",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
@@ -5470,8 +5470,8 @@
"c": "+",
"t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python keyword.operator.quantifier.regexp",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
"dark_plus": "keyword.operator.quantifier.regexp: #D7BA7D",
"light_plus": "keyword.operator.quantifier.regexp: #000000",
"dark_vs": "keyword.operator: #D4D4D4",
"light_vs": "keyword.operator: #000000",
"hc_black": "keyword.operator: #D4D4D4"
@@ -5481,8 +5481,8 @@
"c": "(",
"t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python support.other.parenthesis.regexp punctuation.parenthesis.begin.regexp",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "support.other.parenthesis.regexp: #CE9178",
"light_plus": "support.other.parenthesis.regexp: #D16969",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
@@ -5503,8 +5503,8 @@
"c": "*",
"t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python keyword.operator.quantifier.regexp",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
"dark_plus": "keyword.operator.quantifier.regexp: #D7BA7D",
"light_plus": "keyword.operator.quantifier.regexp: #000000",
"dark_vs": "keyword.operator: #D4D4D4",
"light_vs": "keyword.operator: #000000",
"hc_black": "keyword.operator: #D4D4D4"
@@ -5514,8 +5514,8 @@
"c": ")",
"t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python support.other.parenthesis.regexp punctuation.parenthesis.end.regexp",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "support.other.parenthesis.regexp: #CE9178",
"light_plus": "support.other.parenthesis.regexp: #D16969",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
@@ -6504,8 +6504,8 @@
"c": "[",
"t": "source.python string.regexp.quoted.multi.python meta.character.set.regexp punctuation.character.set.begin.regexp constant.other.set.regexp",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "punctuation.character.set.begin.regexp: #CE9178",
"light_plus": "punctuation.character.set.begin.regexp: #D16969",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
@@ -6515,11 +6515,11 @@
"c": "1,2)`` leads to",
"t": "source.python string.regexp.quoted.multi.python meta.character.set.regexp constant.character.set.regexp",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "constant.character.set.regexp: #D16969",
"light_plus": "constant.character.set.regexp: #811F3F",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
"hc_black": "constant.character: #569CD6"
}
},
{
@@ -14,11 +14,11 @@
"c": "{",
"t": "text.html.cshtml section.embedded.source.cshtml punctuation.section.embedded.begin.cshtml",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
"dark_plus": "punctuation.section.embedded: #569CD6",
"light_plus": "punctuation.section.embedded: #0000FF",
"dark_vs": "punctuation.section.embedded: #569CD6",
"light_vs": "punctuation.section.embedded: #0000FF",
"hc_black": "punctuation.section.embedded: #569CD6"
}
},
{
@@ -333,11 +333,11 @@
"c": "{",
"t": "text.html.cshtml section.embedded.source.cshtml section.embedded.source.cshtml punctuation.section.embedded.begin.cshtml",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
"dark_plus": "punctuation.section.embedded: #569CD6",
"light_plus": "punctuation.section.embedded: #0000FF",
"dark_vs": "punctuation.section.embedded: #569CD6",
"light_vs": "punctuation.section.embedded: #0000FF",
"hc_black": "punctuation.section.embedded: #569CD6"
}
},
{
@@ -1125,22 +1125,22 @@
"c": "}",
"t": "text.html.cshtml section.embedded.source.cshtml section.embedded.source.cshtml punctuation.section.embedded.begin.cshtml",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
"dark_plus": "punctuation.section.embedded: #569CD6",
"light_plus": "punctuation.section.embedded: #0000FF",
"dark_vs": "punctuation.section.embedded: #569CD6",
"light_vs": "punctuation.section.embedded: #0000FF",
"hc_black": "punctuation.section.embedded: #569CD6"
}
},
{
"c": "}",
"t": "text.html.cshtml section.embedded.source.cshtml punctuation.section.embedded.begin.cshtml",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
"dark_plus": "punctuation.section.embedded: #569CD6",
"light_plus": "punctuation.section.embedded: #0000FF",
"dark_vs": "punctuation.section.embedded: #569CD6",
"light_vs": "punctuation.section.embedded: #0000FF",
"hc_black": "punctuation.section.embedded: #569CD6"
}
},
{
@@ -3226,11 +3226,11 @@
"c": "@(",
"t": "text.html.cshtml punctuation.section.embedded.begin.cshtml",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
"dark_plus": "punctuation.section.embedded: #569CD6",
"light_plus": "punctuation.section.embedded: #0000FF",
"dark_vs": "punctuation.section.embedded: #569CD6",
"light_vs": "punctuation.section.embedded: #0000FF",
"hc_black": "punctuation.section.embedded: #569CD6"
}
},
{
@@ -3270,11 +3270,11 @@
"c": ")",
"t": "text.html.cshtml punctuation.section.embedded.begin.cshtml",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
"dark_plus": "punctuation.section.embedded: #569CD6",
"light_plus": "punctuation.section.embedded: #0000FF",
"dark_vs": "punctuation.section.embedded: #569CD6",
"light_vs": "punctuation.section.embedded: #0000FF",
"hc_black": "punctuation.section.embedded: #569CD6"
}
},
{
@@ -2258,11 +2258,11 @@
"c": "#{",
"t": "source.ruby string.interpolated.ruby meta.embedded.line.ruby punctuation.section.embedded.begin.ruby",
"r": {
"dark_plus": "meta.embedded: #D4D4D4",
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "string: #CE9178"
"dark_plus": "punctuation.section.embedded: #569CD6",
"light_plus": "punctuation.section.embedded: #0000FF",
"dark_vs": "punctuation.section.embedded: #569CD6",
"light_vs": "punctuation.section.embedded: #0000FF",
"hc_black": "punctuation.section.embedded: #569CD6"
}
},
{
@@ -2280,11 +2280,11 @@
"c": "}",
"t": "source.ruby string.interpolated.ruby meta.embedded.line.ruby punctuation.section.embedded.end.ruby source.ruby",
"r": {
"dark_plus": "meta.embedded: #D4D4D4",
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "string: #CE9178"
"dark_plus": "punctuation.section.embedded: #569CD6",
"light_plus": "punctuation.section.embedded: #0000FF",
"dark_vs": "punctuation.section.embedded: #569CD6",
"light_vs": "punctuation.section.embedded: #0000FF",
"hc_black": "punctuation.section.embedded: #569CD6"
}
},
{
@@ -2500,11 +2500,11 @@
"c": "\\d",
"t": "source.ruby string.regexp.classic.ruby meta.group.regexp.ruby constant.character.escape.ruby",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #A31515",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
"hc_black": "constant.character: #569CD6"
}
},
{
@@ -2522,11 +2522,11 @@
"c": "\\.\\d",
"t": "source.ruby string.regexp.classic.ruby meta.group.regexp.ruby constant.character.escape.ruby",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #A31515",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
"hc_black": "constant.character: #569CD6"
}
},
{
@@ -2544,11 +2544,11 @@
"c": "\\.\\d",
"t": "source.ruby string.regexp.classic.ruby meta.group.regexp.ruby constant.character.escape.ruby",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #A31515",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
"hc_black": "constant.character: #569CD6"
}
},
{
@@ -2577,11 +2577,11 @@
"c": "\\.\\d",
"t": "source.ruby string.regexp.classic.ruby meta.group.regexp.ruby meta.group.regexp.ruby constant.character.escape.ruby",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #A31515",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
"hc_black": "constant.character: #569CD6"
}
},
{
@@ -20716,11 +20716,11 @@
"c": "\\\\",
"t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss string.quoted.single.scss constant.character.escape.scss",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #A31515",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "string: #CE9178"
"hc_black": "constant.character: #569CD6"
}
},
{
@@ -20837,11 +20837,11 @@
"c": "\\'",
"t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-value.scss string.quoted.single.scss constant.character.escape.scss",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #A31515",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "string: #CE9178"
"hc_black": "constant.character: #569CD6"
}
},
{
@@ -20914,11 +20914,11 @@
"c": "\\\"",
"t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-value.scss string.quoted.double.scss constant.character.escape.scss",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #A31515",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "string: #CE9178"
"hc_black": "constant.character: #569CD6"
}
},
{
@@ -8,7 +8,7 @@
}
},
{
"scope": "meta.embedded",
"scope": ["meta.embedded", "source.groovy.embedded"],
"settings": {
"background": "#000c18",
"foreground": "#6688cc"
@@ -101,6 +101,59 @@
"settings": {
"foreground": "#CE9178"
}
},
{
"name": "Regular expression groups",
"scope": [
"punctuation.definition.group.regexp",
"punctuation.definition.group.assertion.regexp",
"punctuation.definition.character-class.regexp",
"punctuation.character.set.begin.regexp",
"punctuation.character.set.end.regexp",
"keyword.operator.negation.regexp",
"support.other.parenthesis.regexp"
],
"settings": {
"foreground": "#CE9178"
}
},
{
"scope": [
"constant.character.character-class.regexp",
"constant.other.character-class.set.regexp",
"constant.other.character-class.regexp",
"constant.character.set.regexp"
],
"settings": {
"foreground": "#d16969"
}
},
{
"scope": [
"keyword.operator.or.regexp",
"keyword.control.anchor.regexp"
],
"settings": {
"foreground": "#DCDCAA"
}
},
{
"scope": "keyword.operator.quantifier.regexp",
"settings": {
"foreground": "#d7ba7d"
}
},
{
"scope": "constant.character",
"settings": {
"foreground": "#569cd6"
}
},
{
"scope": "constant.character.escape",
"settings": {
"foreground": "#d7ba7d"
}
}
]
}
@@ -10,7 +10,10 @@
}
},
{
"scope": "meta.embedded",
"scope": [
"meta.embedded",
"source.groovy.embedded"
],
"settings": {
"foreground": "#D4D4D4",
"background": "#1E1E1E"
@@ -248,11 +251,11 @@
}
},
{
"name": "JavaScript string interpolation ${}",
"name": "String interpolation",
"scope": [
"punctuation.definition.template-expression.begin",
"punctuation.definition.template-expression.end",
"punctuation.section.embedded.coffee"
"punctuation.section.embedded"
],
"settings": {
"foreground": "#569cd6"
@@ -14,6 +14,16 @@
"background": "#000000"
}
},
{
"scope": [
"meta.embedded",
"source.groovy.embedded"
],
"settings": {
"foreground": "#FFFFFF",
"background": "#000000"
}
},
{
"scope": "emphasis",
"settings": {
@@ -61,6 +71,12 @@
"foreground": "#b46695"
}
},
{
"scope": "constant.character",
"settings": {
"foreground": "#569cd6"
}
},
{
"scope": "entity.name.tag",
"settings": {
@@ -227,11 +243,11 @@
}
},
{
"name": "JavaScript string interpolation ${}",
"name": "String interpolation",
"scope": [
"punctuation.definition.template-expression.begin",
"punctuation.definition.template-expression.end",
"punctuation.section.embedded.coffee"
"punctuation.section.embedded"
],
"settings": {
"foreground": "#569cd6"
@@ -101,6 +101,60 @@
"settings": {
"foreground": "#0451a5"
}
},
{
"name": "Regular expression groups",
"scope": [
"punctuation.definition.group.regexp",
"punctuation.definition.group.assertion.regexp",
"punctuation.definition.character-class.regexp",
"punctuation.character.set.begin.regexp",
"punctuation.character.set.end.regexp",
"keyword.operator.negation.regexp",
"support.other.parenthesis.regexp"
],
"settings": {
"foreground": "#d16969"
}
},
{
"scope": [
"constant.character.character-class.regexp",
"constant.other.character-class.set.regexp",
"constant.other.character-class.regexp",
"constant.character.set.regexp"
],
"settings": {
"foreground": "#811f3f"
}
},
{
"scope": "keyword.operator.quantifier.regexp",
"settings": {
"foreground": "#000000"
}
},
{
"scope": [
"keyword.operator.or.regexp",
"keyword.control.anchor.regexp"
],
"settings": {
"foreground": "#ff0000"
}
},
{
"scope": "constant.character",
"settings": {
"foreground": "#0000ff"
}
},
{
"scope": "constant.character.escape",
"settings": {
"foreground": "#a31515"
}
}
]
}
@@ -4,7 +4,7 @@
"include": "./light_defaults.json",
"tokenColors": [
{
"scope": "meta.embedded",
"scope": ["meta.embedded", "source.groovy.embedded"],
"settings": {
"foreground": "#000000ff",
"background":"#ffffffff"
@@ -244,11 +244,11 @@
}
},
{
"name": "JavaScript string interpolation ${}",
"name": "String interpolation",
"scope": [
"punctuation.definition.template-expression.begin",
"punctuation.definition.template-expression.end",
"punctuation.section.embedded.coffee"
"punctuation.section.embedded"
],
"settings": {
"foreground": "#0000ff"
@@ -55,7 +55,7 @@
}
},
{
"scope": "meta.embedded",
"scope": ["meta.embedded", "source.groovy.embedded"],
"settings": {
"background": "#221a0f",
"foreground": "#d3af86"
@@ -52,7 +52,7 @@
}
},
{
"scope": "meta.embedded",
"scope": ["meta.embedded", "source.groovy.embedded"],
"settings": {
"background": "#1e1e1e",
"foreground": "#C5C8C6"
@@ -453,7 +453,9 @@
},
{
"name": "Ruby Embedded Source",
"scope": "source.ruby.embedded.source",
"scope": [
"punctuation.section.embedded.begin.ruby",
"punctuation.section.embedded.end.ruby"],
"settings": {
"foreground": "#D08442"
}
@@ -97,7 +97,7 @@
}
},
{
"scope": "meta.embedded",
"scope": ["meta.embedded", "source.groovy.embedded"],
"settings": {
"background": "#272822",
"foreground": "#F8F8F2"
@@ -121,7 +121,7 @@
"name": "Template Definition",
"scope": [
"punctuation.definition.template-expression",
"punctuation.section.embedded.coffee"
"punctuation.section.embedded"
],
"settings": {
"foreground": "#F92672"
@@ -8,7 +8,7 @@
}
},
{
"scope": "meta.embedded",
"scope": ["meta.embedded", "source.groovy.embedded"],
"settings": {
"background": "#F5F5F5",
"foreground": "#333333"
@@ -69,7 +69,7 @@
}
},
{
"scope": "meta.embedded",
"scope": ["meta.embedded", "source.groovy.embedded"],
"settings": {
"background": "#390000",
"foreground": "#F8F8F8"
@@ -170,16 +170,16 @@
}
},
{
"name": "String embedded-source",
"scope": "string.quoted source",
"scope": "constant.character",
"settings": {
"fontStyle": "",
"foreground": "#9df39fff"
"foreground": "#ec0d1e"
}
},
{
"name": "String constant",
"scope": "string constant",
"scope": [
"string constant",
"constant.character.escape"
],
"settings": {
"fontStyle": "",
"foreground": "#ffe862ff"
@@ -393,6 +393,18 @@
"fontStyle": "",
"foreground": "#fec758ff"
}
},
{
"name": "String interpolation",
"scope": [
"punctuation.definition.template-expression.begin",
"punctuation.definition.template-expression.end",
"punctuation.section.embedded",
".format.placeholder"
],
"settings": {
"foreground": "#ec0d1e"
}
}
]
}
@@ -8,7 +8,7 @@
}
},
{
"scope": "meta.embedded",
"scope": ["meta.embedded", "source.groovy.embedded"],
"settings": {
"background": "#002B36",
"foreground": "#93A1A1"
@@ -8,7 +8,7 @@
}
},
{
"scope": "meta.embedded",
"scope": ["meta.embedded", "source.groovy.embedded"],
"settings": {
"background": "#FDF6E3",
"foreground": "#657B83"
@@ -61,7 +61,7 @@
}
},
{
"scope": "meta.embedded",
"scope": ["meta.embedded", "source.groovy.embedded"],
"settings": {
"background": "#002451",
"foreground": "#FFFFFF"
@@ -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/TypeScript-TmLanguage/commit/648a036db2bad78ee93463269ec49ed91ee5aa91",
"version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/30d95ebb561fc57e784b43d08f0a6f46ad0c3e5d",
"name": "TypeScript",
"scopeName": "source.ts",
"fileTypes": [
@@ -91,6 +91,29 @@
{
"include": "#comment"
},
{
"begin": "(,)\\s*(?!\\S)",
"beginCaptures": {
"1": {
"name": "punctuation.separator.comma.ts"
}
},
"end": "(?<!,)((?==|;|}|(\\s+(of|in)\\s+)|^\\s*$))|((?<=\\S)(?=\\s*$))",
"patterns": [
{
"include": "#comment"
},
{
"include": "#destructuring-variable"
},
{
"include": "#var-single-variable"
},
{
"include": "#punctuation-comma"
}
]
},
{
"include": "#punctuation-comma"
}
@@ -100,7 +123,7 @@
"patterns": [
{
"name": "meta.var-single-variable.expr.ts",
"begin": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\n (=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n )) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n ))\n)",
"begin": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\n (=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<\\s*[_$[:alpha:]\\{\\(]([^<>=]|=[^<]|\\<\\s*[_$[:alpha:]\\{\\(]([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n )) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n ))\n)",
"beginCaptures": {
"1": {
"name": "meta.definition.variable.ts entity.name.function.ts"
@@ -721,7 +744,7 @@
},
"import-declaration": {
"name": "meta.import.ts",
"begin": "(?<!\\.|\\$)(?:(\\bexport)\\s+)?\\b(import)(?!(\\s*:)|(\\$|\\.))\\b",
"begin": "(?<!\\.|\\$)(?:(\\bexport)\\s+)?\\b(import)(?!(\\s*[:\\(])|(\\$|\\.))\\b",
"beginCaptures": {
"1": {
"name": "keyword.control.export.ts"
@@ -1175,7 +1198,7 @@
},
{
"name": "meta.definition.property.ts entity.name.function.ts",
"match": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?=(\\?\\s*)?\\s*\n (=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n )) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n ))\n)"
"match": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?=(\\?\\s*)?\\s*\n (=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<\\s*[_$[:alpha:]\\{\\(]([^<>=]|=[^<]|\\<\\s*[_$[:alpha:]\\{\\(]([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n )) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n ))\n)"
},
{
"name": "meta.definition.property.ts variable.object.property.ts",
@@ -1566,7 +1589,7 @@
}
},
{
"match": "(?x)(?:\\s*\\b(public|private|protected|readonly)\\s+)?(\\.\\.\\.)?\\s*(?<!=|:)(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))\\s*(\\??)(?=\\s*\n (=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n )) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n ))\n)",
"match": "(?x)(?:\\s*\\b(public|private|protected|readonly)\\s+)?(\\.\\.\\.)?\\s*(?<!=|:)(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))\\s*(\\??)(?=\\s*\n (=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<\\s*[_$[:alpha:]\\{\\(]([^<>=]|=[^<]|\\<\\s*[_$[:alpha:]\\{\\(]([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n )) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n ))\n)",
"captures": {
"1": {
"name": "storage.modifier.ts"
@@ -2404,7 +2427,7 @@
}
},
{
"match": "(?x) (\\.) \\s* (?:\n (ATTRIBUTE_NODE|CDATA_SECTION_NODE|COMMENT_NODE|DOCUMENT_FRAGMENT_NODE|DOCUMENT_NODE|DOCUMENT_TYPE_NODE\n |DOMSTRING_SIZE_ERR|ELEMENT_NODE|ENTITY_NODE|ENTITY_REFERENCE_NODE|HIERARCHY_REQUEST_ERR|INDEX_SIZE_ERR\n |INUSE_ATTRIBUTE_ERR|INVALID_CHARACTER_ERR|NO_DATA_ALLOWED_ERR|NO_MODIFICATION_ALLOWED_ERR|NOT_FOUND_ERR\n |NOT_SUPPORTED_ERR|NOTATION_NODE|PROCESSING_INSTRUCTION_NODE|TEXT_NODE|WRONG_DOCUMENT_ERR)\n |\n (_content|[xyz]|abbr|above|accept|acceptCharset|accessKey|action|align|[av]Link(?:color)?|all|alt|anchors|appCodeName\n |appCore|applets|appMinorVersion|appName|appVersion|archive|areas|arguments|attributes|availHeight|availLeft|availTop\n |availWidth|axis|background|backgroundColor|backgroundImage|below|bgColor|body|border|borderBottomWidth|borderColor\n |borderLeftWidth|borderRightWidth|borderStyle|borderTopWidth|borderWidth|bottom|bufferDepth|callee|caller|caption\n |cellPadding|cells|cellSpacing|ch|characterSet|charset|checked|childNodes|chOff|cite|classes|className|clear\n |clientInformation|clip|clipBoardData|closed|code|codeBase|codeType|color|colorDepth|cols|colSpan|compact|complete\n |components|content|controllers|cookie|cookieEnabled|cords|cpuClass|crypto|current|data|dateTime|declare|defaultCharset\n |defaultChecked|defaultSelected|defaultStatus|defaultValue|defaultView|defer|description|dialogArguments|dialogHeight\n |dialogLeft|dialogTop|dialogWidth|dir|directories|disabled|display|docmain|doctype|documentElement|elements|embeds\n |enabledPlugin|encoding|enctype|entities|event|expando|external|face|fgColor|filename|firstChild|fontFamily|fontSize\n |fontWeight|form|formName|forms|frame|frameBorder|frameElement|frames|hasFocus|hash|headers|height|history|host\n |hostname|href|hreflang|hspace|htmlFor|httpEquiv|id|ids|ignoreCase|images|implementation|index|innerHeight|innerWidth\n |input|isMap|label|lang|language|lastChild|lastIndex|lastMatch|lastModified|lastParen|layer[sXY]|left|leftContext\n |lineHeight|link|linkColor|links|listStyleType|localName|location|locationbar|longDesc|lowsrc|lowSrc|marginBottom\n |marginHeight|marginLeft|marginRight|marginTop|marginWidth|maxLength|media|menubar|method|mimeTypes|multiline|multiple\n |name|nameProp|namespaces|namespaceURI|next|nextSibling|nodeName|nodeType|nodeValue|noHref|noResize|noShade|notationName\n |notations|noWrap|object|offscreenBuffering|onLine|onreadystatechange|opener|opsProfile|options|oscpu|outerHeight\n |outerWidth|ownerDocument|paddingBottom|paddingLeft|paddingRight|paddingTop|page[XY]|page[XY]Offset|parent|parentLayer\n |parentNode|parentWindow|pathname|personalbar|pixelDepth|pkcs11|platform|plugins|port|prefix|previous|previousDibling\n |product|productSub|profile|profileend|prompt|prompter|protocol|publicId|readOnly|readyState|referrer|rel|responseText\n |responseXML|rev|right|rightContext|rowIndex|rows|rowSpan|rules|scheme|scope|screen[XY]|screenLeft|screenTop|scripts\n |scrollbars|scrolling|sectionRowIndex|security|securityPolicy|selected|selectedIndex|selection|self|shape|siblingAbove\n |siblingBelow|size|source|specified|standby|start|status|statusbar|statusText|style|styleSheets|suffixes|summary\n |systemId|systemLanguage|tagName|tags|target|tBodies|text|textAlign|textDecoration|textIndent|textTransform|tFoot|tHead\n |title|toolbar|top|type|undefined|uniqueID|updateInterval|URL|URLUnencoded|useMap|userAgent|userLanguage|userProfile\n |vAlign|value|valueType|vendor|vendorSub|version|visibility|vspace|whiteSpace|width|X[MS]LDocument|zIndex))\\b(?!\\$|\\s*(<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\()",
"match": "(?x) (\\.) \\s* (?:\n (ATTRIBUTE_NODE|CDATA_SECTION_NODE|COMMENT_NODE|DOCUMENT_FRAGMENT_NODE|DOCUMENT_NODE|DOCUMENT_TYPE_NODE\n |DOMSTRING_SIZE_ERR|ELEMENT_NODE|ENTITY_NODE|ENTITY_REFERENCE_NODE|HIERARCHY_REQUEST_ERR|INDEX_SIZE_ERR\n |INUSE_ATTRIBUTE_ERR|INVALID_CHARACTER_ERR|NO_DATA_ALLOWED_ERR|NO_MODIFICATION_ALLOWED_ERR|NOT_FOUND_ERR\n |NOT_SUPPORTED_ERR|NOTATION_NODE|PROCESSING_INSTRUCTION_NODE|TEXT_NODE|WRONG_DOCUMENT_ERR)\n |\n (_content|[xyz]|abbr|above|accept|acceptCharset|accessKey|action|align|[av]Link(?:color)?|all|alt|anchors|appCodeName\n |appCore|applets|appMinorVersion|appName|appVersion|archive|areas|arguments|attributes|availHeight|availLeft|availTop\n |availWidth|axis|background|backgroundColor|backgroundImage|below|bgColor|body|border|borderBottomWidth|borderColor\n |borderLeftWidth|borderRightWidth|borderStyle|borderTopWidth|borderWidth|bottom|bufferDepth|callee|caller|caption\n |cellPadding|cells|cellSpacing|ch|characterSet|charset|checked|childNodes|chOff|cite|classes|className|clear\n |clientInformation|clip|clipBoardData|closed|code|codeBase|codeType|color|colorDepth|cols|colSpan|compact|complete\n |components|content|controllers|cookie|cookieEnabled|cords|cpuClass|crypto|current|data|dateTime|declare|defaultCharset\n |defaultChecked|defaultSelected|defaultStatus|defaultValue|defaultView|defer|description|dialogArguments|dialogHeight\n |dialogLeft|dialogTop|dialogWidth|dir|directories|disabled|display|docmain|doctype|documentElement|elements|embeds\n |enabledPlugin|encoding|enctype|entities|event|expando|external|face|fgColor|filename|firstChild|fontFamily|fontSize\n |fontWeight|form|formName|forms|frame|frameBorder|frameElement|frames|hasFocus|hash|headers|height|history|host\n |hostname|href|hreflang|hspace|htmlFor|httpEquiv|id|ids|ignoreCase|images|implementation|index|innerHeight|innerWidth\n |input|isMap|label|lang|language|lastChild|lastIndex|lastMatch|lastModified|lastParen|layer[sXY]|left|leftContext\n |lineHeight|link|linkColor|links|listStyleType|localName|location|locationbar|longDesc|lowsrc|lowSrc|marginBottom\n |marginHeight|marginLeft|marginRight|marginTop|marginWidth|maxLength|media|menubar|method|mimeTypes|multiline|multiple\n |name|nameProp|namespaces|namespaceURI|next|nextSibling|nodeName|nodeType|nodeValue|noHref|noResize|noShade|notationName\n |notations|noWrap|object|offscreenBuffering|onLine|onreadystatechange|opener|opsProfile|options|oscpu|outerHeight\n |outerWidth|ownerDocument|paddingBottom|paddingLeft|paddingRight|paddingTop|page[XY]|page[XY]Offset|parent|parentLayer\n |parentNode|parentWindow|pathname|personalbar|pixelDepth|pkcs11|platform|plugins|port|prefix|previous|previousDibling\n |product|productSub|profile|profileend|prompt|prompter|protocol|publicId|readOnly|readyState|referrer|rel|responseText\n |responseXML|rev|right|rightContext|rowIndex|rows|rowSpan|rules|scheme|scope|screen[XY]|screenLeft|screenTop|scripts\n |scrollbars|scrolling|sectionRowIndex|security|securityPolicy|selected|selectedIndex|selection|self|shape|siblingAbove\n |siblingBelow|size|source|specified|standby|start|status|statusbar|statusText|style|styleSheets|suffixes|summary\n |systemId|systemLanguage|tagName|tags|target|tBodies|text|textAlign|textDecoration|textIndent|textTransform|tFoot|tHead\n |title|toolbar|top|type|undefined|uniqueID|updateInterval|URL|URLUnencoded|useMap|userAgent|userLanguage|userProfile\n |vAlign|value|valueType|vendor|vendorSub|version|visibility|vspace|whiteSpace|width|X[MS]LDocument|zIndex))\\b(?!\\$|\\s*(<\\s*[_$[:alpha:]\\{\\(]([^<>=]|=[^<]|\\<\\s*[_$[:alpha:]\\{\\(]([^=<>]|=[^<])+\\>)+>\\s*)?\\()",
"captures": {
"1": {
"name": "punctuation.accessor.ts"
@@ -2479,13 +2502,13 @@
]
},
"function-call": {
"begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\.\\s*)*|(\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*)\\s*(<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\()",
"end": "(?<=\\))(?!(([_$[:alpha:]][_$[:alnum:]]*\\s*\\.\\s*)*|(\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*)\\s*(<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\()",
"begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\.\\s*)*|(\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*)\\s*(<\\s*[_$[:alpha:]\\{\\(]([^<>=]|=[^<]|\\<\\s*[_$[:alpha:]\\{\\(]([^=<>]|=[^<])+\\>)+>\\s*)?\\()",
"end": "(?<=\\))(?!(([_$[:alpha:]][_$[:alnum:]]*\\s*\\.\\s*)*|(\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*)\\s*(<\\s*[_$[:alpha:]\\{\\(]([^<>=]|=[^<]|\\<\\s*[_$[:alpha:]\\{\\(]([^=<>]|=[^<])+\\>)+>\\s*)?\\()",
"patterns": [
{
"name": "meta.function-call.ts",
"begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\.\\s*)*|(\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))",
"end": "(?=\\s*(<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\()",
"end": "(?=\\s*(<\\s*[_$[:alpha:]\\{\\(]([^<>=]|=[^<]|\\<\\s*[_$[:alpha:]\\{\\(]([^=<>]|=[^<])+\\>)+>\\s*)?\\()",
"patterns": [
{
"include": "#literal"
@@ -2546,7 +2569,7 @@
"include": "#object-identifiers"
},
{
"match": "(?x)(?:(\\.)\\s*)?([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n))",
"match": "(?x)(?:(\\.)\\s*)?([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<\\s*[_$[:alpha:]\\{\\(]([^<>=]|=[^<]|\\<\\s*[_$[:alpha:]\\{\\(]([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n))",
"captures": {
"1": {
"name": "punctuation.accessor.ts"
@@ -2625,7 +2648,7 @@
"patterns": [
{
"name": "cast.expr.ts",
"begin": "(?:(?<=return|throw|yield|await|default|[=(,:>*?]))\\s*(<)(?!<?\\=)",
"begin": "(?:(?<=return|throw|yield|await|default|[=(,:>+*?]))\\s*(<)(?!<?\\=)",
"beginCaptures": {
"1": {
"name": "meta.brace.angle.ts"
@@ -2728,7 +2751,7 @@
},
{
"name": "meta.object.member.ts",
"match": "(?x)(?:([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=:\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n)))",
"match": "(?x)(?:([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=:\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<\\s*[_$[:alpha:]\\{\\(]([^<>=]|=[^<]|\\<\\s*[_$[:alpha:]\\{\\(]([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n)))",
"captures": {
"0": {
"name": "meta.object-literal.key.ts"
@@ -2745,8 +2768,7 @@
"0": {
"name": "meta.object-literal.key.ts"
}
},
"end": "(?=,|\\})"
}
},
{
"name": "meta.object.member.ts",
@@ -2772,6 +2794,16 @@
}
}
},
{
"name": "meta.object.member.ts",
"begin": "(?=[_$[:alpha:]][_$[:alnum:]]*\\s*=)",
"end": "(?=,|\\}|$)",
"patterns": [
{
"include": "#expression"
}
]
},
{
"include": "#object-member-body"
},
@@ -2846,7 +2878,7 @@
"name": "keyword.control.as.ts"
}
},
"end": "(?=$|^|[;,:})\\]])",
"end": "(?=$|^|[;,:})\\]]|((?<!\\.|\\$)\\b(as)\\s+))",
"patterns": [
{
"include": "#type"
@@ -2931,7 +2963,7 @@
},
{
"name": "meta.arrow.ts",
"begin": "(?x) (?:\n (?<!\\.|\\$)(\\basync)\n)? ((?<![})!\\]])\\s*\n (?=\n # sure shot arrow functions even if => is on new line\n (\n [(]\\s*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n ) |\n (\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends \n ) |\n # arrow function possible to detect only with => on same line\n (\n (<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)? # typeparameters\n \\(([^()]|\\([^()]*\\))*\\) # parameteres\n (\\s*:\\s*(.)*)? # return type\n \\s*=> # arrow operator\n )\n )\n)",
"begin": "(?x) (?:\n (?<!\\.|\\$)(\\basync)\n)? ((?<![})!\\]])\\s*\n (?=\n # sure shot arrow functions even if => is on new line\n (\n [(]\\s*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n ) |\n (\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends \n ) |\n # arrow function possible to detect only with => on same line\n (\n (<\\s*[_$[:alpha:]\\{\\(]([^<>=]|=[^<]|\\<\\s*[_$[:alpha:]\\{\\(]([^=<>]|=[^<])+\\>)+>\\s*)? # typeparameters\n \\(([^()]|\\([^()]*\\))*\\) # parameteres\n (\\s*:\\s*(.)*)? # return type\n \\s*=> # arrow operator\n )\n )\n)",
"beginCaptures": {
"1": {
"name": "storage.modifier.async.ts"
@@ -3084,7 +3116,7 @@
"patterns": [
{
"name": "string.regexp.ts",
"begin": "(?<=[=(:,\\[?+!]|return|case|=>|&&|\\|\\||\\*\\/)\\s*(\\/)(?![\\/*])(?=(?:[^\\/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+\\/(?![\\/*])[gimy]*(?!\\s*[a-zA-Z0-9_$]))",
"begin": "(?<=[=(:,\\[?+!]|return|case|=>|&&|\\|\\||\\*\\/)\\s*(\\/)(?![\\/*])(?=(?:[^\\/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+\\/(?![\\/*])[gimuy]*(?!\\s*[a-zA-Z0-9_$]))",
"beginCaptures": {
"1": {
"name": "punctuation.definition.string.begin.ts"
@@ -3107,7 +3139,7 @@
},
{
"name": "string.regexp.ts",
"begin": "(?<![_$[:alnum:])])\\/(?![\\/*])(?=(?:[^\\/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+\\/(?![\\/*])[gimy]*(?!\\s*[a-zA-Z0-9_$]))",
"begin": "(?<![_$[:alnum:])])\\/(?![\\/*])(?=(?:[^\\/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+\\/(?![\\/*])[gimuy]*(?!\\s*[a-zA-Z0-9_$]))",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.ts"
@@ -3330,7 +3362,8 @@
{
"include": "#expression"
}
]
],
"contentName": "meta.embedded.line.ts"
},
"literal": {
"patterns": [
@@ -3443,7 +3476,7 @@
},
"this-literal": {
"name": "variable.language.this.ts",
"match": "(?<!\\.|\\$)\\bthis\\b(?!\\$)"
"match": "(?<!\\$)((?<=\\.\\.\\.)|(?<!\\.))\\bthis\\b(?!\\$)"
},
"super-literal": {
"name": "variable.language.super.ts",
@@ -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/TypeScript-TmLanguage/commit/648a036db2bad78ee93463269ec49ed91ee5aa91",
"version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/30d95ebb561fc57e784b43d08f0a6f46ad0c3e5d",
"name": "TypeScriptReact",
"scopeName": "source.tsx",
"fileTypes": [
@@ -91,6 +91,29 @@
{
"include": "#comment"
},
{
"begin": "(,)\\s*(?!\\S)",
"beginCaptures": {
"1": {
"name": "punctuation.separator.comma.tsx"
}
},
"end": "(?<!,)((?==|;|}|(\\s+(of|in)\\s+)|^\\s*$))|((?<=\\S)(?=\\s*$))",
"patterns": [
{
"include": "#comment"
},
{
"include": "#destructuring-variable"
},
{
"include": "#var-single-variable"
},
{
"include": "#punctuation-comma"
}
]
},
{
"include": "#punctuation-comma"
}
@@ -100,7 +123,7 @@
"patterns": [
{
"name": "meta.var-single-variable.expr.tsx",
"begin": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\n (=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n )) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n ))\n)",
"begin": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\n (=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<\\s*[_$[:alpha:]\\{\\(]([^<>=]|=[^<]|\\<\\s*[_$[:alpha:]\\{\\(]([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n )) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n ))\n)",
"beginCaptures": {
"1": {
"name": "meta.definition.variable.tsx entity.name.function.tsx"
@@ -724,7 +747,7 @@
},
"import-declaration": {
"name": "meta.import.tsx",
"begin": "(?<!\\.|\\$)(?:(\\bexport)\\s+)?\\b(import)(?!(\\s*:)|(\\$|\\.))\\b",
"begin": "(?<!\\.|\\$)(?:(\\bexport)\\s+)?\\b(import)(?!(\\s*[:\\(])|(\\$|\\.))\\b",
"beginCaptures": {
"1": {
"name": "keyword.control.export.tsx"
@@ -1178,7 +1201,7 @@
},
{
"name": "meta.definition.property.tsx entity.name.function.tsx",
"match": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?=(\\?\\s*)?\\s*\n (=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n )) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n ))\n)"
"match": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?=(\\?\\s*)?\\s*\n (=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<\\s*[_$[:alpha:]\\{\\(]([^<>=]|=[^<]|\\<\\s*[_$[:alpha:]\\{\\(]([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n )) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n ))\n)"
},
{
"name": "meta.definition.property.tsx variable.object.property.tsx",
@@ -1569,7 +1592,7 @@
}
},
{
"match": "(?x)(?:\\s*\\b(public|private|protected|readonly)\\s+)?(\\.\\.\\.)?\\s*(?<!=|:)(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))\\s*(\\??)(?=\\s*\n (=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n )) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n ))\n)",
"match": "(?x)(?:\\s*\\b(public|private|protected|readonly)\\s+)?(\\.\\.\\.)?\\s*(?<!=|:)(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))\\s*(\\??)(?=\\s*\n (=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<\\s*[_$[:alpha:]\\{\\(]([^<>=]|=[^<]|\\<\\s*[_$[:alpha:]\\{\\(]([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n )) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n ))\n)",
"captures": {
"1": {
"name": "storage.modifier.tsx"
@@ -2407,7 +2430,7 @@
}
},
{
"match": "(?x) (\\.) \\s* (?:\n (ATTRIBUTE_NODE|CDATA_SECTION_NODE|COMMENT_NODE|DOCUMENT_FRAGMENT_NODE|DOCUMENT_NODE|DOCUMENT_TYPE_NODE\n |DOMSTRING_SIZE_ERR|ELEMENT_NODE|ENTITY_NODE|ENTITY_REFERENCE_NODE|HIERARCHY_REQUEST_ERR|INDEX_SIZE_ERR\n |INUSE_ATTRIBUTE_ERR|INVALID_CHARACTER_ERR|NO_DATA_ALLOWED_ERR|NO_MODIFICATION_ALLOWED_ERR|NOT_FOUND_ERR\n |NOT_SUPPORTED_ERR|NOTATION_NODE|PROCESSING_INSTRUCTION_NODE|TEXT_NODE|WRONG_DOCUMENT_ERR)\n |\n (_content|[xyz]|abbr|above|accept|acceptCharset|accessKey|action|align|[av]Link(?:color)?|all|alt|anchors|appCodeName\n |appCore|applets|appMinorVersion|appName|appVersion|archive|areas|arguments|attributes|availHeight|availLeft|availTop\n |availWidth|axis|background|backgroundColor|backgroundImage|below|bgColor|body|border|borderBottomWidth|borderColor\n |borderLeftWidth|borderRightWidth|borderStyle|borderTopWidth|borderWidth|bottom|bufferDepth|callee|caller|caption\n |cellPadding|cells|cellSpacing|ch|characterSet|charset|checked|childNodes|chOff|cite|classes|className|clear\n |clientInformation|clip|clipBoardData|closed|code|codeBase|codeType|color|colorDepth|cols|colSpan|compact|complete\n |components|content|controllers|cookie|cookieEnabled|cords|cpuClass|crypto|current|data|dateTime|declare|defaultCharset\n |defaultChecked|defaultSelected|defaultStatus|defaultValue|defaultView|defer|description|dialogArguments|dialogHeight\n |dialogLeft|dialogTop|dialogWidth|dir|directories|disabled|display|docmain|doctype|documentElement|elements|embeds\n |enabledPlugin|encoding|enctype|entities|event|expando|external|face|fgColor|filename|firstChild|fontFamily|fontSize\n |fontWeight|form|formName|forms|frame|frameBorder|frameElement|frames|hasFocus|hash|headers|height|history|host\n |hostname|href|hreflang|hspace|htmlFor|httpEquiv|id|ids|ignoreCase|images|implementation|index|innerHeight|innerWidth\n |input|isMap|label|lang|language|lastChild|lastIndex|lastMatch|lastModified|lastParen|layer[sXY]|left|leftContext\n |lineHeight|link|linkColor|links|listStyleType|localName|location|locationbar|longDesc|lowsrc|lowSrc|marginBottom\n |marginHeight|marginLeft|marginRight|marginTop|marginWidth|maxLength|media|menubar|method|mimeTypes|multiline|multiple\n |name|nameProp|namespaces|namespaceURI|next|nextSibling|nodeName|nodeType|nodeValue|noHref|noResize|noShade|notationName\n |notations|noWrap|object|offscreenBuffering|onLine|onreadystatechange|opener|opsProfile|options|oscpu|outerHeight\n |outerWidth|ownerDocument|paddingBottom|paddingLeft|paddingRight|paddingTop|page[XY]|page[XY]Offset|parent|parentLayer\n |parentNode|parentWindow|pathname|personalbar|pixelDepth|pkcs11|platform|plugins|port|prefix|previous|previousDibling\n |product|productSub|profile|profileend|prompt|prompter|protocol|publicId|readOnly|readyState|referrer|rel|responseText\n |responseXML|rev|right|rightContext|rowIndex|rows|rowSpan|rules|scheme|scope|screen[XY]|screenLeft|screenTop|scripts\n |scrollbars|scrolling|sectionRowIndex|security|securityPolicy|selected|selectedIndex|selection|self|shape|siblingAbove\n |siblingBelow|size|source|specified|standby|start|status|statusbar|statusText|style|styleSheets|suffixes|summary\n |systemId|systemLanguage|tagName|tags|target|tBodies|text|textAlign|textDecoration|textIndent|textTransform|tFoot|tHead\n |title|toolbar|top|type|undefined|uniqueID|updateInterval|URL|URLUnencoded|useMap|userAgent|userLanguage|userProfile\n |vAlign|value|valueType|vendor|vendorSub|version|visibility|vspace|whiteSpace|width|X[MS]LDocument|zIndex))\\b(?!\\$|\\s*(<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\()",
"match": "(?x) (\\.) \\s* (?:\n (ATTRIBUTE_NODE|CDATA_SECTION_NODE|COMMENT_NODE|DOCUMENT_FRAGMENT_NODE|DOCUMENT_NODE|DOCUMENT_TYPE_NODE\n |DOMSTRING_SIZE_ERR|ELEMENT_NODE|ENTITY_NODE|ENTITY_REFERENCE_NODE|HIERARCHY_REQUEST_ERR|INDEX_SIZE_ERR\n |INUSE_ATTRIBUTE_ERR|INVALID_CHARACTER_ERR|NO_DATA_ALLOWED_ERR|NO_MODIFICATION_ALLOWED_ERR|NOT_FOUND_ERR\n |NOT_SUPPORTED_ERR|NOTATION_NODE|PROCESSING_INSTRUCTION_NODE|TEXT_NODE|WRONG_DOCUMENT_ERR)\n |\n (_content|[xyz]|abbr|above|accept|acceptCharset|accessKey|action|align|[av]Link(?:color)?|all|alt|anchors|appCodeName\n |appCore|applets|appMinorVersion|appName|appVersion|archive|areas|arguments|attributes|availHeight|availLeft|availTop\n |availWidth|axis|background|backgroundColor|backgroundImage|below|bgColor|body|border|borderBottomWidth|borderColor\n |borderLeftWidth|borderRightWidth|borderStyle|borderTopWidth|borderWidth|bottom|bufferDepth|callee|caller|caption\n |cellPadding|cells|cellSpacing|ch|characterSet|charset|checked|childNodes|chOff|cite|classes|className|clear\n |clientInformation|clip|clipBoardData|closed|code|codeBase|codeType|color|colorDepth|cols|colSpan|compact|complete\n |components|content|controllers|cookie|cookieEnabled|cords|cpuClass|crypto|current|data|dateTime|declare|defaultCharset\n |defaultChecked|defaultSelected|defaultStatus|defaultValue|defaultView|defer|description|dialogArguments|dialogHeight\n |dialogLeft|dialogTop|dialogWidth|dir|directories|disabled|display|docmain|doctype|documentElement|elements|embeds\n |enabledPlugin|encoding|enctype|entities|event|expando|external|face|fgColor|filename|firstChild|fontFamily|fontSize\n |fontWeight|form|formName|forms|frame|frameBorder|frameElement|frames|hasFocus|hash|headers|height|history|host\n |hostname|href|hreflang|hspace|htmlFor|httpEquiv|id|ids|ignoreCase|images|implementation|index|innerHeight|innerWidth\n |input|isMap|label|lang|language|lastChild|lastIndex|lastMatch|lastModified|lastParen|layer[sXY]|left|leftContext\n |lineHeight|link|linkColor|links|listStyleType|localName|location|locationbar|longDesc|lowsrc|lowSrc|marginBottom\n |marginHeight|marginLeft|marginRight|marginTop|marginWidth|maxLength|media|menubar|method|mimeTypes|multiline|multiple\n |name|nameProp|namespaces|namespaceURI|next|nextSibling|nodeName|nodeType|nodeValue|noHref|noResize|noShade|notationName\n |notations|noWrap|object|offscreenBuffering|onLine|onreadystatechange|opener|opsProfile|options|oscpu|outerHeight\n |outerWidth|ownerDocument|paddingBottom|paddingLeft|paddingRight|paddingTop|page[XY]|page[XY]Offset|parent|parentLayer\n |parentNode|parentWindow|pathname|personalbar|pixelDepth|pkcs11|platform|plugins|port|prefix|previous|previousDibling\n |product|productSub|profile|profileend|prompt|prompter|protocol|publicId|readOnly|readyState|referrer|rel|responseText\n |responseXML|rev|right|rightContext|rowIndex|rows|rowSpan|rules|scheme|scope|screen[XY]|screenLeft|screenTop|scripts\n |scrollbars|scrolling|sectionRowIndex|security|securityPolicy|selected|selectedIndex|selection|self|shape|siblingAbove\n |siblingBelow|size|source|specified|standby|start|status|statusbar|statusText|style|styleSheets|suffixes|summary\n |systemId|systemLanguage|tagName|tags|target|tBodies|text|textAlign|textDecoration|textIndent|textTransform|tFoot|tHead\n |title|toolbar|top|type|undefined|uniqueID|updateInterval|URL|URLUnencoded|useMap|userAgent|userLanguage|userProfile\n |vAlign|value|valueType|vendor|vendorSub|version|visibility|vspace|whiteSpace|width|X[MS]LDocument|zIndex))\\b(?!\\$|\\s*(<\\s*[_$[:alpha:]\\{\\(]([^<>=]|=[^<]|\\<\\s*[_$[:alpha:]\\{\\(]([^=<>]|=[^<])+\\>)+>\\s*)?\\()",
"captures": {
"1": {
"name": "punctuation.accessor.tsx"
@@ -2482,13 +2505,13 @@
]
},
"function-call": {
"begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\.\\s*)*|(\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*)\\s*(<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\()",
"end": "(?<=\\))(?!(([_$[:alpha:]][_$[:alnum:]]*\\s*\\.\\s*)*|(\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*)\\s*(<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\()",
"begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\.\\s*)*|(\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*)\\s*(<\\s*[_$[:alpha:]\\{\\(]([^<>=]|=[^<]|\\<\\s*[_$[:alpha:]\\{\\(]([^=<>]|=[^<])+\\>)+>\\s*)?\\()",
"end": "(?<=\\))(?!(([_$[:alpha:]][_$[:alnum:]]*\\s*\\.\\s*)*|(\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*)\\s*(<\\s*[_$[:alpha:]\\{\\(]([^<>=]|=[^<]|\\<\\s*[_$[:alpha:]\\{\\(]([^=<>]|=[^<])+\\>)+>\\s*)?\\()",
"patterns": [
{
"name": "meta.function-call.tsx",
"begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\.\\s*)*|(\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))",
"end": "(?=\\s*(<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\()",
"end": "(?=\\s*(<\\s*[_$[:alpha:]\\{\\(]([^<>=]|=[^<]|\\<\\s*[_$[:alpha:]\\{\\(]([^=<>]|=[^<])+\\>)+>\\s*)?\\()",
"patterns": [
{
"include": "#literal"
@@ -2549,7 +2572,7 @@
"include": "#object-identifiers"
},
{
"match": "(?x)(?:(\\.)\\s*)?([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n))",
"match": "(?x)(?:(\\.)\\s*)?([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<\\s*[_$[:alpha:]\\{\\(]([^<>=]|=[^<]|\\<\\s*[_$[:alpha:]\\{\\(]([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n))",
"captures": {
"1": {
"name": "punctuation.accessor.tsx"
@@ -2694,7 +2717,7 @@
},
{
"name": "meta.object.member.tsx",
"match": "(?x)(?:([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=:\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n)))",
"match": "(?x)(?:([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=:\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<\\s*[_$[:alpha:]\\{\\(]([^<>=]|=[^<]|\\<\\s*[_$[:alpha:]\\{\\(]([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n)))",
"captures": {
"0": {
"name": "meta.object-literal.key.tsx"
@@ -2711,8 +2734,7 @@
"0": {
"name": "meta.object-literal.key.tsx"
}
},
"end": "(?=,|\\})"
}
},
{
"name": "meta.object.member.tsx",
@@ -2738,6 +2760,16 @@
}
}
},
{
"name": "meta.object.member.tsx",
"begin": "(?=[_$[:alpha:]][_$[:alnum:]]*\\s*=)",
"end": "(?=,|\\}|$)",
"patterns": [
{
"include": "#expression"
}
]
},
{
"include": "#object-member-body"
},
@@ -2812,7 +2844,7 @@
"name": "keyword.control.as.tsx"
}
},
"end": "(?=$|^|[;,:})\\]])",
"end": "(?=$|^|[;,:})\\]]|((?<!\\.|\\$)\\b(as)\\s+))",
"patterns": [
{
"include": "#type"
@@ -2897,7 +2929,7 @@
},
{
"name": "meta.arrow.tsx",
"begin": "(?x) (?:\n (?<!\\.|\\$)(\\basync)\n)? ((?<![})!\\]])\\s*\n (?=\n # sure shot arrow functions even if => is on new line\n (\n [(]\\s*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n ) |\n (\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends \n ) |\n # arrow function possible to detect only with => on same line\n (\n (<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)? # typeparameters\n \\(([^()]|\\([^()]*\\))*\\) # parameteres\n (\\s*:\\s*(.)*)? # return type\n \\s*=> # arrow operator\n )\n )\n)",
"begin": "(?x) (?:\n (?<!\\.|\\$)(\\basync)\n)? ((?<![})!\\]])\\s*\n (?=\n # sure shot arrow functions even if => is on new line\n (\n [(]\\s*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n ) |\n (\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends \n ) |\n # arrow function possible to detect only with => on same line\n (\n (<\\s*[_$[:alpha:]\\{\\(]([^<>=]|=[^<]|\\<\\s*[_$[:alpha:]\\{\\(]([^=<>]|=[^<])+\\>)+>\\s*)? # typeparameters\n \\(([^()]|\\([^()]*\\))*\\) # parameteres\n (\\s*:\\s*(.)*)? # return type\n \\s*=> # arrow operator\n )\n )\n)",
"beginCaptures": {
"1": {
"name": "storage.modifier.async.tsx"
@@ -3050,7 +3082,7 @@
"patterns": [
{
"name": "string.regexp.tsx",
"begin": "(?<=[=(:,\\[?+!]|return|case|=>|&&|\\|\\||\\*\\/)\\s*(\\/)(?![\\/*])(?=(?:[^\\/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+\\/(?![\\/*])[gimy]*(?!\\s*[a-zA-Z0-9_$]))",
"begin": "(?<=[=(:,\\[?+!]|return|case|=>|&&|\\|\\||\\*\\/)\\s*(\\/)(?![\\/*])(?=(?:[^\\/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+\\/(?![\\/*])[gimuy]*(?!\\s*[a-zA-Z0-9_$]))",
"beginCaptures": {
"1": {
"name": "punctuation.definition.string.begin.tsx"
@@ -3073,7 +3105,7 @@
},
{
"name": "string.regexp.tsx",
"begin": "(?<![_$[:alnum:])])\\/(?![\\/*])(?=(?:[^\\/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+\\/(?![\\/*])[gimy]*(?!\\s*[a-zA-Z0-9_$]))",
"begin": "(?<![_$[:alnum:])])\\/(?![\\/*])(?=(?:[^\\/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+\\/(?![\\/*])[gimuy]*(?!\\s*[a-zA-Z0-9_$]))",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.tsx"
@@ -3296,7 +3328,8 @@
{
"include": "#expression"
}
]
],
"contentName": "meta.embedded.line.tsx"
},
"literal": {
"patterns": [
@@ -3409,7 +3442,7 @@
},
"this-literal": {
"name": "variable.language.this.tsx",
"match": "(?<!\\.|\\$)\\bthis\\b(?!\\$)"
"match": "(?<!\\$)((?<=\\.\\.\\.)|(?<!\\.))\\bthis\\b(?!\\$)"
},
"super-literal": {
"name": "variable.language.super.tsx",
@@ -364,12 +364,12 @@
},
{
"c": "startTime",
"t": "source.ts meta.function.ts meta.block.ts meta.var.expr.ts string.template.ts meta.template.expression.ts variable.other.readwrite.ts",
"t": "source.ts meta.function.ts meta.block.ts meta.var.expr.ts string.template.ts meta.template.expression.ts meta.embedded.line.ts variable.other.readwrite.ts",
"r": {
"dark_plus": "variable: #9CDCFE",
"light_plus": "variable: #001080",
"dark_vs": "meta.template.expression: #D4D4D4",
"light_vs": "meta.template.expression: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "variable: #9CDCFE"
}
},
@@ -408,12 +408,12 @@
},
{
"c": "endTime",
"t": "source.ts meta.function.ts meta.block.ts meta.var.expr.ts string.template.ts meta.template.expression.ts variable.other.readwrite.ts",
"t": "source.ts meta.function.ts meta.block.ts meta.var.expr.ts string.template.ts meta.template.expression.ts meta.embedded.line.ts variable.other.readwrite.ts",
"r": {
"dark_plus": "variable: #9CDCFE",
"light_plus": "variable: #001080",
"dark_vs": "meta.template.expression: #D4D4D4",
"light_vs": "meta.template.expression: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "variable: #9CDCFE"
}
},
@@ -100,12 +100,12 @@
},
{
"c": "foo",
"t": "source.ts meta.var.expr.ts string.template.ts meta.template.expression.ts variable.other.readwrite.ts",
"t": "source.ts meta.var.expr.ts string.template.ts meta.template.expression.ts meta.embedded.line.ts variable.other.readwrite.ts",
"r": {
"dark_plus": "variable: #9CDCFE",
"light_plus": "variable: #001080",
"dark_vs": "meta.template.expression: #D4D4D4",
"light_vs": "meta.template.expression: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "variable: #9CDCFE"
}
},
@@ -353,40 +353,40 @@
},
{
"c": " ",
"t": "source.ts string.template.ts meta.template.expression.ts",
"t": "source.ts string.template.ts meta.template.expression.ts meta.embedded.line.ts",
"r": {
"dark_plus": "meta.template.expression: #D4D4D4",
"light_plus": "meta.template.expression: #000000",
"dark_vs": "meta.template.expression: #D4D4D4",
"light_vs": "meta.template.expression: #000000",
"hc_black": "meta.template.expression: #FFFFFF"
"dark_plus": "meta.embedded: #D4D4D4",
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "a",
"t": "source.ts string.template.ts meta.template.expression.ts variable.other.readwrite.ts",
"t": "source.ts string.template.ts meta.template.expression.ts meta.embedded.line.ts variable.other.readwrite.ts",
"r": {
"dark_plus": "variable: #9CDCFE",
"light_plus": "variable: #001080",
"dark_vs": "meta.template.expression: #D4D4D4",
"light_vs": "meta.template.expression: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "variable: #9CDCFE"
}
},
{
"c": " ",
"t": "source.ts string.template.ts meta.template.expression.ts",
"t": "source.ts string.template.ts meta.template.expression.ts meta.embedded.line.ts",
"r": {
"dark_plus": "meta.template.expression: #D4D4D4",
"light_plus": "meta.template.expression: #000000",
"dark_vs": "meta.template.expression: #D4D4D4",
"light_vs": "meta.template.expression: #000000",
"hc_black": "meta.template.expression: #FFFFFF"
"dark_plus": "meta.embedded: #D4D4D4",
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "+",
"t": "source.ts string.template.ts meta.template.expression.ts keyword.operator.arithmetic.ts",
"t": "source.ts string.template.ts meta.template.expression.ts meta.embedded.line.ts keyword.operator.arithmetic.ts",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
@@ -397,35 +397,35 @@
},
{
"c": " ",
"t": "source.ts string.template.ts meta.template.expression.ts",
"t": "source.ts string.template.ts meta.template.expression.ts meta.embedded.line.ts",
"r": {
"dark_plus": "meta.template.expression: #D4D4D4",
"light_plus": "meta.template.expression: #000000",
"dark_vs": "meta.template.expression: #D4D4D4",
"light_vs": "meta.template.expression: #000000",
"hc_black": "meta.template.expression: #FFFFFF"
"dark_plus": "meta.embedded: #D4D4D4",
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "b",
"t": "source.ts string.template.ts meta.template.expression.ts variable.other.readwrite.ts",
"t": "source.ts string.template.ts meta.template.expression.ts meta.embedded.line.ts variable.other.readwrite.ts",
"r": {
"dark_plus": "variable: #9CDCFE",
"light_plus": "variable: #001080",
"dark_vs": "meta.template.expression: #D4D4D4",
"light_vs": "meta.template.expression: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "variable: #9CDCFE"
}
},
{
"c": " ",
"t": "source.ts string.template.ts meta.template.expression.ts",
"t": "source.ts string.template.ts meta.template.expression.ts meta.embedded.line.ts",
"r": {
"dark_plus": "meta.template.expression: #D4D4D4",
"light_plus": "meta.template.expression: #000000",
"dark_vs": "meta.template.expression: #D4D4D4",
"light_vs": "meta.template.expression: #000000",
"hc_black": "meta.template.expression: #FFFFFF"
"dark_plus": "meta.embedded: #D4D4D4",
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -463,40 +463,40 @@
},
{
"c": " ",
"t": "source.ts string.template.ts meta.template.expression.ts",
"t": "source.ts string.template.ts meta.template.expression.ts meta.embedded.line.ts",
"r": {
"dark_plus": "meta.template.expression: #D4D4D4",
"light_plus": "meta.template.expression: #000000",
"dark_vs": "meta.template.expression: #D4D4D4",
"light_vs": "meta.template.expression: #000000",
"hc_black": "meta.template.expression: #FFFFFF"
"dark_plus": "meta.embedded: #D4D4D4",
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "a",
"t": "source.ts string.template.ts meta.template.expression.ts variable.other.readwrite.ts",
"t": "source.ts string.template.ts meta.template.expression.ts meta.embedded.line.ts variable.other.readwrite.ts",
"r": {
"dark_plus": "variable: #9CDCFE",
"light_plus": "variable: #001080",
"dark_vs": "meta.template.expression: #D4D4D4",
"light_vs": "meta.template.expression: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "variable: #9CDCFE"
}
},
{
"c": " ",
"t": "source.ts string.template.ts meta.template.expression.ts",
"t": "source.ts string.template.ts meta.template.expression.ts meta.embedded.line.ts",
"r": {
"dark_plus": "meta.template.expression: #D4D4D4",
"light_plus": "meta.template.expression: #000000",
"dark_vs": "meta.template.expression: #D4D4D4",
"light_vs": "meta.template.expression: #000000",
"hc_black": "meta.template.expression: #FFFFFF"
"dark_plus": "meta.embedded: #D4D4D4",
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "*",
"t": "source.ts string.template.ts meta.template.expression.ts keyword.operator.arithmetic.ts",
"t": "source.ts string.template.ts meta.template.expression.ts meta.embedded.line.ts keyword.operator.arithmetic.ts",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
@@ -507,35 +507,35 @@
},
{
"c": " ",
"t": "source.ts string.template.ts meta.template.expression.ts",
"t": "source.ts string.template.ts meta.template.expression.ts meta.embedded.line.ts",
"r": {
"dark_plus": "meta.template.expression: #D4D4D4",
"light_plus": "meta.template.expression: #000000",
"dark_vs": "meta.template.expression: #D4D4D4",
"light_vs": "meta.template.expression: #000000",
"hc_black": "meta.template.expression: #FFFFFF"
"dark_plus": "meta.embedded: #D4D4D4",
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "b",
"t": "source.ts string.template.ts meta.template.expression.ts variable.other.readwrite.ts",
"t": "source.ts string.template.ts meta.template.expression.ts meta.embedded.line.ts variable.other.readwrite.ts",
"r": {
"dark_plus": "variable: #9CDCFE",
"light_plus": "variable: #001080",
"dark_vs": "meta.template.expression: #D4D4D4",
"light_vs": "meta.template.expression: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "variable: #9CDCFE"
}
},
{
"c": " ",
"t": "source.ts string.template.ts meta.template.expression.ts",
"t": "source.ts string.template.ts meta.template.expression.ts meta.embedded.line.ts",
"r": {
"dark_plus": "meta.template.expression: #D4D4D4",
"light_plus": "meta.template.expression: #000000",
"dark_vs": "meta.template.expression: #D4D4D4",
"light_vs": "meta.template.expression: #000000",
"hc_black": "meta.template.expression: #FFFFFF"
"dark_plus": "meta.embedded: #D4D4D4",
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
+4 -4
View File
@@ -552,9 +552,9 @@
"resolved": "https://registry.npmjs.org/vscode-debugprotocol/-/vscode-debugprotocol-1.23.0.tgz"
},
"vscode-ripgrep": {
"version": "0.0.25",
"from": "vscode-ripgrep@0.0.25",
"resolved": "https://registry.npmjs.org/vscode-ripgrep/-/vscode-ripgrep-0.0.25.tgz"
"version": "0.0.26",
"from": "vscode-ripgrep@0.0.26",
"resolved": "https://registry.npmjs.org/vscode-ripgrep/-/vscode-ripgrep-0.0.26.tgz"
},
"vscode-textmate": {
"version": "3.1.5",
@@ -574,7 +574,7 @@
"xterm": {
"version": "3.0.0",
"from": "Tyriar/xterm.js#vscode-release/1.17",
"resolved": "git+https://github.com/Tyriar/xterm.js.git#c3039b4d63b5c0e4a0c993e04714ad62fd056185"
"resolved": "git+https://github.com/Tyriar/xterm.js.git#35088059e61ba654ac78df453633c7a9272ed8bd"
},
"yauzl": {
"version": "2.8.0",
+1 -1
View File
@@ -42,7 +42,7 @@
"semver": "4.3.6",
"v8-profiler": "jrieken/v8-profiler#vscode",
"vscode-debugprotocol": "1.23.0",
"vscode-ripgrep": "0.0.25",
"vscode-ripgrep": "0.0.26",
"vscode-textmate": "^3.1.5",
"winreg": "1.2.0",
"xterm": "Tyriar/xterm.js#vscode-release/1.17",
+1 -1
View File
@@ -12,7 +12,7 @@ set VSCODEUSERDATADIR=%TMP%\vscodeuserfolder-%RANDOM%-%TIME:~6,5%
.\scripts\code.bat %~dp0\..\extensions\vscode-api-tests\testWorkspace --extensionDevelopmentPath=%~dp0\..\extensions\vscode-api-tests --extensionTestsPath=%~dp0\..\extensions\vscode-api-tests\out --disableExtensions --user-data-dir=%VSCODEUSERDATADIR%
.\scripts\code.bat %~dp0\..\extensions\vscode-colorize-tests\test --extensionDevelopmentPath=%~dp0\..\extensions\vscode-colorize-tests --extensionTestsPath=%~dp0\..\extensions\vscode-colorize-tests\out --user-data-dir=%VSCODEUSERDATADIR%
.\scripts\test-int-mocha.bat
.\scripts\code.bat $ROOT\extensions\emmet\test-fixtures --extensionDevelopmentPath=%~dp0\..\extensions\emmet --extensionTestsPath=%~dp0\..\extensions\emmet\out\test --disableExtensions --user-data-dir=%VSCODEUSERDATADIR%
.\scripts\code.bat $%~dp0\..\extensions\emmet\test-fixtures --extensionDevelopmentPath=%~dp0\..\extensions\emmet --extensionTestsPath=%~dp0\..\extensions\emmet\out\test --disableExtensions --user-data-dir=%VSCODEUSERDATADIR%
rmdir /s /q %VSCODEUSERDATADIR%
+1
View File
@@ -28,6 +28,7 @@ test -d node_modules || ./scripts/npm.sh install
(test -f "$CODE" && [ $INTENDED_VERSION == $INSTALLED_VERSION ]) || ./node_modules/.bin/gulp electron
# Unit Tests
export ELECTRON_ENABLE_LOGGING=1
if [[ "$OSTYPE" == "darwin"* ]]; then
cd $ROOT ; ulimit -n 4096 ; \
"$CODE" \
@@ -11,7 +11,7 @@ import { HighlightedLabel } from 'vs/base/browser/ui/highlightedlabel/highlighte
import { IMatch } from 'vs/base/common/filters';
import uri from 'vs/base/common/uri';
import paths = require('vs/base/common/paths');
import { IRootProvider, getPathLabel, IUserHomeProvider } from 'vs/base/common/labels';
import { IWorkspaceFolderProvider, getPathLabel, IUserHomeProvider } from 'vs/base/common/labels';
import { IDisposable, combinedDisposable } from 'vs/base/common/lifecycle';
export interface IIconLabelCreationOptions {
@@ -152,13 +152,13 @@ export class IconLabel {
export class FileLabel extends IconLabel {
constructor(container: HTMLElement, file: uri, provider: IRootProvider, userHome?: IUserHomeProvider) {
constructor(container: HTMLElement, file: uri, provider: IWorkspaceFolderProvider, userHome?: IUserHomeProvider) {
super(container);
this.setFile(file, provider, userHome);
}
public setFile(file: uri, provider: IRootProvider, userHome: IUserHomeProvider): void {
public setFile(file: uri, provider: IWorkspaceFolderProvider, userHome: IUserHomeProvider): void {
const parent = paths.dirname(file.fsPath);
this.setValue(paths.basename(file.fsPath), parent && parent !== '.' ? getPathLabel(parent, provider, userHome) : '', { title: file.fsPath });
+1 -1
View File
@@ -398,7 +398,7 @@ class MouseController<T> implements IDisposable {
if (isSelectionRangeChangeEvent(e) && reference !== undefined) {
const min = Math.min(reference, focus);
const max = Math.max(reference, focus);
const rangeSelection = range(max + 1, min);
const rangeSelection = range(min, max + 1);
const selection = this.list.getSelection();
const contiguousRange = getContiguousRangeContaining(disjunction(selection, [reference]), reference);
+4
View File
@@ -268,6 +268,10 @@ export class Sash extends EventEmitter {
this.isDisabled = true;
}
get enabled(): boolean {
return !this.isDisabled;
}
public dispose(): void {
if (this.$e) {
this.$e.destroy();
@@ -0,0 +1,361 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import 'vs/css!./splitview';
import { IDisposable, dispose, combinedDisposable } from 'vs/base/common/lifecycle';
import Event, { Emitter, chain } from 'vs/base/common/event';
import { domEvent } from 'vs/base/browser/event';
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { KeyCode } from 'vs/base/common/keyCodes';
import { $, append, addClass, removeClass, toggleClass } from 'vs/base/browser/dom';
import { firstIndex } from 'vs/base/common/arrays';
import { Color, RGBA } from 'vs/base/common/color';
import { SplitView, IView } from './splitview2';
export interface IPanelOptions {
ariaHeaderLabel?: string;
minimumBodySize?: number;
maximumBodySize?: number;
expanded?: boolean;
}
export interface IPanelStyles {
dropBackground?: Color;
}
export abstract class Panel implements IView {
private static HEADER_SIZE = 22;
private _expanded: boolean;
private _headerVisible: boolean;
private _onDidChange = new Emitter<void>();
private _minimumBodySize: number;
private _maximumBodySize: number;
private ariaHeaderLabel: string;
readonly header: HTMLElement;
protected disposables: IDisposable[] = [];
get minimumBodySize(): number {
return this._minimumBodySize;
}
set minimumBodySize(size: number) {
this._minimumBodySize = size;
this._onDidChange.fire();
}
get maximumBodySize(): number {
return this._maximumBodySize;
}
set maximumBodySize(size: number) {
this._maximumBodySize = size;
this._onDidChange.fire();
}
get minimumSize(): number {
const headerSize = this.headerVisible ? Panel.HEADER_SIZE : 0;
const expanded = !this.headerVisible || this.expanded;
const minimumBodySize = expanded ? this._minimumBodySize : 0;
return headerSize + minimumBodySize;
}
get maximumSize(): number {
const headerSize = this.headerVisible ? Panel.HEADER_SIZE : 0;
const expanded = !this.headerVisible || this.expanded;
const maximumBodySize = expanded ? this._maximumBodySize : 0;
return headerSize + maximumBodySize;
}
readonly onDidChange: Event<void> = this._onDidChange.event;
constructor(options: IPanelOptions = {}) {
this._expanded = typeof options.expanded === 'undefined' ? true : !!options.expanded;
this.ariaHeaderLabel = options.ariaHeaderLabel || '';
this._minimumBodySize = typeof options.minimumBodySize === 'number' ? options.minimumBodySize : 44;
this._maximumBodySize = typeof options.maximumBodySize === 'number' ? options.maximumBodySize : Number.POSITIVE_INFINITY;
}
get expanded(): boolean {
return this._expanded;
}
set expanded(expanded: boolean) {
if (this._expanded === !!expanded) {
return;
}
this._expanded = !!expanded;
this.renderHeader();
this._onDidChange.fire();
}
get headerVisible(): boolean {
return this._headerVisible;
}
set headerVisible(visible: boolean) {
if (this._headerVisible === !!visible) {
return;
}
this._headerVisible = !!visible;
this.renderHeader();
this._onDidChange.fire();
}
render(container: HTMLElement): void {
const panel = append(container, $('.panel'));
const header = append(panel, $('.panel-header'));
header.setAttribute('tabindex', '0');
header.setAttribute('role', 'toolbar');
header.setAttribute('aria-label', this.ariaHeaderLabel);
this.renderHeader();
const onHeaderKeyDown = chain(domEvent(header, 'keydown'))
.map(e => new StandardKeyboardEvent(e));
onHeaderKeyDown.filter(e => e.keyCode === KeyCode.Enter || e.keyCode === KeyCode.Space)
.event(() => this.expanded = !this.expanded, null, this.disposables);
onHeaderKeyDown.filter(e => e.keyCode === KeyCode.LeftArrow)
.event(() => this.expanded = false, null, this.disposables);
onHeaderKeyDown.filter(e => e.keyCode === KeyCode.RightArrow)
.event(() => this.expanded = true, null, this.disposables);
domEvent(header, 'click')
(() => this.expanded = !this.expanded, null, this.disposables);
// TODO@Joao move this down to panelview
// onHeaderKeyDown.filter(e => e.keyCode === KeyCode.UpArrow)
// .event(focusPrevious, this, this.disposables);
// onHeaderKeyDown.filter(e => e.keyCode === KeyCode.DownArrow)
// .event(focusNext, this, this.disposables);
const body = append(panel, $('.panel-body'));
this.renderBody(body);
}
layout(size: number): void {
const headerSize = this.headerVisible ? Panel.HEADER_SIZE : 0;
this.layoutBody(size - headerSize);
}
focus(): void {
// TODO@joao what to do
}
private renderHeader(): void {
const expanded = !this.headerVisible || this.expanded;
toggleClass(this.header, 'hidden', !this.headerVisible);
toggleClass(this.header, 'expanded', expanded);
this.header.setAttribute('aria-expanded', String(expanded));
}
protected abstract renderBody(container: HTMLElement): void;
protected abstract layoutBody(size: number): void;
dispose(): void {
this.disposables = dispose(this.disposables);
}
}
interface IDndContext {
dropBackground: Color | undefined;
draggable: PanelDraggable | null;
}
class PanelDraggable implements IDisposable {
private static DefaultDragOverBackgroundColor = new Color(new RGBA(128, 128, 128, 0.5));
// see https://github.com/Microsoft/vscode/issues/14470
private dragOverCounter = 0;
private disposables: IDisposable[] = [];
private _onDidDrop = new Emitter<{ from: Panel, to: Panel }>();
readonly onDidDrop = this._onDidDrop.event;
constructor(private panel: Panel, private context: IDndContext) {
domEvent(panel.header, 'dragstart')(this.onDragStart, this, this.disposables);
domEvent(panel.header, 'dragenter')(this.onDragEnter, this, this.disposables);
domEvent(panel.header, 'dragleave')(this.onDragLeave, this, this.disposables);
domEvent(panel.header, 'dragend')(this.onDragEnd, this, this.disposables);
domEvent(panel.header, 'drop')(this.onDrop, this, this.disposables);
}
private onDragStart(e: DragEvent): void {
e.dataTransfer.effectAllowed = 'move';
const dragImage = append(document.body, $('.monaco-panel-drag-image', {}, this.panel.header.textContent));
e.dataTransfer.setDragImage(dragImage, -10, -10);
setTimeout(() => document.body.removeChild(dragImage), 0);
this.context.draggable = this;
}
private onDragEnter(e: DragEvent): void {
if (!this.context.draggable || this.context.draggable === this) {
return;
}
this.dragOverCounter++;
this.renderHeader();
}
private onDragLeave(e: DragEvent): void {
if (!this.context.draggable || this.context.draggable === this) {
return;
}
this.dragOverCounter--;
if (this.dragOverCounter === 0) {
this.renderHeader();
}
}
private onDragEnd(e: DragEvent): void {
if (!this.context.draggable) {
return;
}
this.dragOverCounter = 0;
this.renderHeader();
this.context.draggable = null;
}
private onDrop(e: DragEvent): void {
if (!this.context.draggable) {
return;
}
this.dragOverCounter = 0;
this.renderHeader();
if (this.context.draggable !== this) {
this._onDidDrop.fire({ from: this.context.draggable.panel, to: this.panel });
}
this.context.draggable = null;
}
private renderHeader(): void {
let backgroundColor: string = null;
if (this.dragOverCounter > 0) {
backgroundColor = (this.context.dropBackground || PanelDraggable.DefaultDragOverBackgroundColor).toString();
}
this.panel.header.style.backgroundColor = backgroundColor;
}
dispose(): void {
this.disposables = dispose(this.disposables);
}
}
export class IPanelViewOptions {
dnd?: boolean;
}
interface IPanelItem {
panel: Panel;
disposable: IDisposable;
}
export class PanelView implements IDisposable {
private dnd: boolean;
private dndContext: IDndContext = { dropBackground: undefined, draggable: null };
private el: HTMLElement;
private panelItems: IPanelItem[] = [];
private splitview: SplitView;
private animationTimer: number | null = null;
private _onDidDrop = new Emitter<{ from: Panel, to: Panel }>();
readonly onDidDrop: Event<{ from: Panel, to: Panel }> = this._onDidDrop.event;
constructor(private container: HTMLElement, options?: IPanelViewOptions) {
this.dnd = !!options.dnd;
this.el = append(container, $('.monaco-panel-view'));
this.splitview = new SplitView(container);
}
addPanel(panel: Panel, size: number, index = this.splitview.length): void {
const disposables: IDisposable[] = [];
panel.onDidChange(this.setupAnimation, this, disposables);
if (this.dnd) {
const draggable = new PanelDraggable(panel, this.dndContext);
disposables.push(draggable);
draggable.onDidDrop(this._onDidDrop.fire, this._onDidDrop, disposables);
}
const panelItem = { panel, disposable: combinedDisposable(disposables) };
this.panelItems.splice(index, 0, panelItem);
this.splitview.addView(panel, size, index);
}
removePanel(panel: Panel): void {
const index = firstIndex(this.panelItems, item => item.panel === panel);
if (index === -1) {
return;
}
this.splitview.removeView(index);
const panelItem = this.panelItems.splice(index, 1)[0];
panelItem.disposable.dispose();
}
movePanel(from: Panel, to: Panel): void {
const fromIndex = firstIndex(this.panelItems, item => item.panel === from);
const toIndex = firstIndex(this.panelItems, item => item.panel === to);
if (fromIndex === -1 || toIndex === -1) {
return;
}
this.splitview.moveView(fromIndex, toIndex);
}
layout(size: number): void {
this.splitview.layout(size);
}
style(styles: IPanelStyles): void {
this.dndContext.dropBackground = styles.dropBackground;
}
private setupAnimation(): void {
if (typeof this.animationTimer === 'number') {
window.clearTimeout(this.animationTimer);
}
addClass(this.el, 'animated');
this.animationTimer = window.setTimeout(() => {
this.animationTimer = null;
removeClass(this.el, 'animated');
}, 200);
}
dispose(): void {
this.panelItems.forEach(i => i.disposable.dispose());
this.splitview.dispose();
}
}
@@ -0,0 +1,293 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import 'vs/css!./splitview';
import { IDisposable, combinedDisposable, toDisposable } from 'vs/base/common/lifecycle';
import Event, { fromEventEmitter, mapEvent } from 'vs/base/common/event';
import types = require('vs/base/common/types');
import dom = require('vs/base/browser/dom');
import { clamp } from 'vs/base/common/numbers';
import { range, firstIndex } from 'vs/base/common/arrays';
import { Sash, Orientation, ISashEvent as IBaseSashEvent } from 'vs/base/browser/ui/sash/sash';
export { Orientation } from 'vs/base/browser/ui/sash/sash';
export interface ISplitViewOptions {
orientation?: Orientation; // default Orientation.VERTICAL
}
export interface IView {
readonly minimumSize: number;
readonly maximumSize: number;
readonly onDidChange: Event<void>;
render(container: HTMLElement, orientation: Orientation): void;
layout(size: number, orientation: Orientation): void;
focus(): void;
}
interface ISashEvent {
sash: Sash;
start: number;
current: number;
}
interface IViewItem {
view: IView;
size: number;
explicitSize: number;
container: HTMLElement;
disposable: IDisposable;
}
interface ISashItem {
sash: Sash;
disposable: IDisposable;
}
interface ISashDragState {
index: number;
start: number;
sizes: number[];
}
function layoutViewItem(item: IViewItem, orientation: Orientation): void {
if (orientation === Orientation.VERTICAL) {
item.container.style.height = `${item.size}px`;
} else {
item.container.style.width = `${item.size}px`;
}
item.view.layout(item.size, orientation);
}
export class SplitView implements IDisposable {
private orientation: Orientation;
private el: HTMLElement;
private size = 0;
private viewItems: IViewItem[] = [];
private sashItems: ISashItem[] = [];
private sashDragState: ISashDragState;
get length(): number {
return this.viewItems.length;
}
constructor(private container: HTMLElement, options: ISplitViewOptions = {}) {
this.orientation = types.isUndefined(options.orientation) ? Orientation.VERTICAL : options.orientation;
this.el = document.createElement('div');
dom.addClass(this.el, 'monaco-split-view');
dom.addClass(this.el, this.orientation === Orientation.VERTICAL ? 'vertical' : 'horizontal');
container.appendChild(this.el);
}
addView(view: IView, size: number, index = this.viewItems.length): void {
// Add view
const container = dom.$('.split-view-view');
if (this.viewItems.length === 1) {
this.el.appendChild(container);
} else {
this.el.insertBefore(container, this.el.children.item(index));
}
const onChangeDisposable = mapEvent(view.onDidChange, () => item)(this.onViewChange, this);
const containerDisposable = toDisposable(() => this.el.removeChild(container));
const disposable = combinedDisposable([onChangeDisposable, containerDisposable]);
const explicitSize = size;
const item: IViewItem = { view, container, explicitSize, size, disposable };
this.viewItems.splice(index, 0, item);
// Add sash
if (this.viewItems.length > 1) {
const orientation = this.orientation === Orientation.VERTICAL ? Orientation.HORIZONTAL : Orientation.VERTICAL;
const layoutProvider = this.orientation === Orientation.VERTICAL ? { getHorizontalSashTop: sash => this.getSashPosition(sash) } : { getVerticalSashLeft: sash => this.getSashPosition(sash) };
const sash = new Sash(this.el, layoutProvider, { orientation });
const sashEventMapper = this.orientation === Orientation.VERTICAL
? (e: IBaseSashEvent) => ({ sash, start: e.startY, current: e.currentY })
: (e: IBaseSashEvent) => ({ sash, start: e.startX, current: e.currentX });
const onStart = mapEvent(fromEventEmitter<IBaseSashEvent>(sash, 'start'), sashEventMapper);
const onStartDisposable = onStart(this.onSashStart, this);
const onChange = mapEvent(fromEventEmitter<IBaseSashEvent>(sash, 'change'), sashEventMapper);
const onSashChangeDisposable = onChange(this.onSashChange, this);
const disposable = combinedDisposable([onStartDisposable, onSashChangeDisposable, sash]);
const sashItem: ISashItem = { sash, disposable };
this.sashItems.splice(index - 1, 0, sashItem);
}
view.render(container, this.orientation);
this.relayoutPreferredSizes();
}
removeView(index: number): void {
if (index < 0 || index >= this.viewItems.length) {
return;
}
// Remove view
const viewItem = this.viewItems.splice(index, 1)[0];
viewItem.disposable.dispose();
// Remove sash
if (this.viewItems.length >= 1) {
const sashIndex = Math.max(index - 1, 0);
const sashItem = this.sashItems.splice(sashIndex, 1)[0];
sashItem.disposable.dispose();
}
this.relayoutPreferredSizes();
}
moveView(from: number, to: number): void {
if (from < 0 || from >= this.viewItems.length) {
return;
}
if (to < 0 || to >= this.viewItems.length) {
return;
}
if (from === to) {
return;
}
const viewItem = this.viewItems.splice(from, 1)[0];
this.viewItems.splice(to, 0, viewItem);
this.layoutViews();
}
private relayoutPreferredSizes(): void {
this.viewItems.forEach(i => i.size = clamp(i.explicitSize, i.view.minimumSize, i.view.maximumSize));
this.relayout();
}
private relayout(): void {
const previousSize = this.size;
this.size = this.viewItems.reduce((r, i) => r + i.size, 0);
this.layout(previousSize);
}
layout(size: number): void {
this.resize(this.viewItems.length - 1, size - this.size);
this.size = Math.max(size, this.viewItems.reduce((r, i) => r + i.size, 0));
}
private onSashStart({ sash, start }: ISashEvent): void {
const index = firstIndex(this.sashItems, item => item.sash === sash);
const sizes = this.viewItems.map(i => i.size);
this.sashDragState = { start, index, sizes };
}
private onSashChange({ sash, current }: ISashEvent): void {
const { index, start, sizes } = this.sashDragState;
this.resize(index, current - start, sizes);
this.viewItems.forEach(viewItem => viewItem.explicitSize = viewItem.size);
}
private onViewChange(item: IViewItem): void {
item.size = clamp(item.size, item.view.minimumSize, item.view.maximumSize);
this.relayout();
}
resizeView(index: number, size: number): void {
if (index < 0 || index >= this.viewItems.length - 1) {
throw new Error('Cant resize view');
}
this.resize(index, size - this.viewItems[index].size);
}
private resize(index: number, delta: number, sizes = this.viewItems.map(i => i.size)): void {
if (index < 0 || index >= this.viewItems.length) {
return;
}
if (delta !== 0) {
const upIndexes = range(index, -1);
const up = upIndexes.map(i => this.viewItems[i]);
const upSizes = upIndexes.map(i => sizes[i]);
const downIndexes = range(index + 1, this.viewItems.length);
const down = downIndexes.map(i => this.viewItems[i]);
const downSizes = downIndexes.map(i => sizes[i]);
for (let i = 0, deltaUp = delta; deltaUp !== 0 && i < up.length; i++) {
const item = up[i];
const size = clamp(upSizes[i] + deltaUp, item.view.minimumSize, item.view.maximumSize);
const viewDelta = size - upSizes[i];
deltaUp -= viewDelta;
item.size = size;
}
for (let i = 0, deltaDown = delta; deltaDown !== 0 && i < down.length; i++) {
const item = down[i];
const size = clamp(downSizes[i] - deltaDown, item.view.minimumSize, item.view.maximumSize);
const viewDelta = size - downSizes[i];
deltaDown += viewDelta;
item.size = size;
}
}
this.layoutViews();
}
private layoutViews(): void {
this.viewItems.forEach(item => layoutViewItem(item, this.orientation));
this.sashItems.forEach(item => item.sash.layout());
// Update sashes enablement
let previous = false;
const collapsesDown = this.viewItems.map(i => previous = (i.size - i.view.minimumSize > 0) || previous);
previous = false;
const expandsDown = this.viewItems.map(i => previous = (i.view.maximumSize - i.size > 0) || previous);
const reverseViews = [...this.viewItems].reverse();
previous = false;
const collapsesUp = reverseViews.map(i => previous = (i.size - i.view.minimumSize > 0) || previous).reverse();
previous = false;
const expandsUp = reverseViews.map(i => previous = (i.view.maximumSize - i.size > 0) || previous).reverse();
this.sashItems.forEach((s, i) => {
if ((collapsesDown[i] && expandsUp[i + 1]) || (expandsDown[i] && collapsesUp[i + 1])) {
s.sash.enable();
} else {
s.sash.disable();
}
});
}
private getSashPosition(sash: Sash): number {
let position = 0;
for (let i = 0; i < this.sashItems.length; i++) {
position += this.viewItems[i].size;
if (this.sashItems[i].sash === sash) {
return position;
}
}
throw new Error('Sash not found');
}
dispose(): void {
this.viewItems.forEach(i => i.disposable.dispose());
this.viewItems = [];
this.sashItems.forEach(i => i.disposable.dispose());
this.sashItems = [];
}
}
+35 -3
View File
@@ -325,11 +325,43 @@ export function flatten<T>(arr: T[][]): T[] {
return arr.reduce((r, v) => r.concat(v), []);
}
export function range(to: number, from = 0): number[] {
export function range(to: number): number[];
export function range(from: number, to: number): number[];
export function range(arg: number, to?: number): number[] {
let from = typeof to === 'number' ? arg : 0;
if (typeof to === 'number') {
from = arg;
} else {
from = 0;
to = arg;
}
const result: number[] = [];
for (let i = from; i < to; i++) {
result.push(i);
if (from <= to) {
for (let i = from; i < to; i++) {
result.push(i);
}
} else {
for (let i = from; i > to; i--) {
result.push(i);
}
}
return result;
}
export function weave<T>(a: T[], b: T[]): T[] {
const result: T[] = [];
let ai = 0, bi = 0;
for (let i = 0, length = a.length + b.length; i < length; i++) {
if ((i % 2 === 0 && ai < a.length) || bi >= b.length) {
result.push(a[ai++]);
} else {
result.push(b[bi++]);
}
}
return result;
+1
View File
@@ -45,6 +45,7 @@ export interface IJSONSchema {
patternErrorMessage?: string; // VSCode extension
deprecationMessage?: string; // VSCode extension
enumDescriptions?: string[]; // VSCode extension
doNotSuggest?: boolean; // VSCode extension
}
export interface IJSONSchemaMap {
+6 -6
View File
@@ -17,10 +17,10 @@ export interface ILabelProvider {
getLabel(element: any): string;
}
export interface IRootProvider {
getRoot(resource: URI): URI;
export interface IWorkspaceFolderProvider {
getWorkspaceFolder(resource: URI): URI;
getWorkspace(): {
roots: URI[];
folders: URI[];
};
}
@@ -28,7 +28,7 @@ export interface IUserHomeProvider {
userHome: string;
}
export function getPathLabel(resource: URI | string, rootProvider?: IRootProvider, userHomeProvider?: IUserHomeProvider): string {
export function getPathLabel(resource: URI | string, rootProvider?: IWorkspaceFolderProvider, userHomeProvider?: IUserHomeProvider): string {
if (!resource) {
return null;
}
@@ -38,9 +38,9 @@ export function getPathLabel(resource: URI | string, rootProvider?: IRootProvide
}
// return early if we can resolve a relative path label from the root
const baseResource = rootProvider ? rootProvider.getRoot(resource) : null;
const baseResource = rootProvider ? rootProvider.getWorkspaceFolder(resource) : null;
if (baseResource) {
const hasMultipleRoots = rootProvider.getWorkspace().roots.length > 1;
const hasMultipleRoots = rootProvider.getWorkspace().folders.length > 1;
let pathLabel: string;
if (isEqual(baseResource.fsPath, resource.fsPath, !platform.isLinux /* ignorecase */)) {
+5
View File
@@ -46,3 +46,8 @@ export function countToArray(fromOrTo: number, to?: number): number[] {
return result;
}
export function clamp(value: number, min: number, max: number): number {
return Math.min(Math.max(value, min), max);
}
+13 -3
View File
@@ -238,9 +238,19 @@ export function regExpLeadsToEndlessLoop(regexp: RegExp): boolean {
* @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize}
*/
export const canNormalize = typeof ((<any>'').normalize) === 'function';
const nonAsciiCharactersPattern = /[^\u0000-\u0080]/;
const normalizedCache = new BoundedMap<string>(10000); // bounded to 10000 elements
const nfcCache = new BoundedMap<string>(10000); // bounded to 10000 elements
export function normalizeNFC(str: string): string {
return normalize(str, 'NFC', nfcCache);
}
const nfdCache = new BoundedMap<string>(10000); // bounded to 10000 elements
export function normalizeNFD(str: string): string {
return normalize(str, 'NFD', nfdCache);
}
const nonAsciiCharactersPattern = /[^\u0000-\u0080]/;
function normalize(str: string, form: string, normalizedCache: BoundedMap<string>): string {
if (!canNormalize || !str) {
return str;
}
@@ -252,7 +262,7 @@ export function normalizeNFC(str: string): string {
let res: string;
if (nonAsciiCharactersPattern.test(str)) {
res = (<any>str).normalize('NFC');
res = (<any>str).normalize(form);
} else {
res = str;
}
+13 -1
View File
@@ -301,8 +301,20 @@ export default class URI {
parts.push('//');
}
if (authority) {
let idx = authority.indexOf('@');
if (idx !== -1) {
const userinfo = authority.substr(0, idx);
authority = authority.substr(idx + 1);
idx = userinfo.indexOf(':');
if (idx === -1) {
parts.push(encoder(userinfo));
} else {
parts.push(encoder(userinfo.substr(0, idx)), ':', encoder(userinfo.substr(idx + 1)));
}
parts.push('@');
}
authority = authority.toLowerCase();
let idx = authority.indexOf(':');
idx = authority.indexOf(':');
if (idx === -1) {
parts.push(encoder(authority));
} else {
+13 -7
View File
@@ -6,7 +6,7 @@
'use strict';
import * as fs from 'fs';
import * as path from 'path';
import { dirname, basename } from 'path';
import * as objects from 'vs/base/common/objects';
import { IDisposable, dispose, toDisposable } from 'vs/base/common/lifecycle';
import Event, { Emitter } from 'vs/base/common/event';
@@ -49,9 +49,11 @@ export class ConfigWatcher<T> implements IConfigWatcher<T>, IDisposable {
private timeoutHandle: NodeJS.Timer;
private disposables: IDisposable[];
private _onDidUpdateConfiguration: Emitter<IConfigurationChangeEvent<T>>;
private configName: string;
constructor(private _path: string, private options: IConfigOptions<T> = { changeBufferDelay: 0, defaultConfig: Object.create(null), onError: error => console.error(error) }) {
this.disposables = [];
this.configName = basename(this._path);
this._onDidUpdateConfiguration = new Emitter<IConfigurationChangeEvent<T>>();
this.disposables.push(this._onDidUpdateConfiguration);
@@ -121,8 +123,8 @@ export class ConfigWatcher<T> implements IConfigWatcher<T>, IDisposable {
private registerWatcher(): void {
// Watch the parent of the path so that we detect ADD and DELETES
const parentFolder = path.dirname(this._path);
this.watch(parentFolder);
const parentFolder = dirname(this._path);
this.watch(parentFolder, true);
// Check if the path is a symlink and watch its target if so
fs.lstat(this._path, (err, stat) => {
@@ -137,20 +139,20 @@ export class ConfigWatcher<T> implements IConfigWatcher<T>, IDisposable {
return; // path is not a valid symlink
}
this.watch(realPath);
this.watch(realPath, false);
});
}
});
}
private watch(path: string): void {
private watch(path: string, isParentFolder: boolean): void {
if (this.disposed) {
return; // avoid watchers that will never get disposed by checking for being disposed
}
try {
const watcher = fs.watch(path);
watcher.on('change', () => this.onConfigFileChange());
watcher.on('change', (type, file) => this.onConfigFileChange(type, file.toString(), isParentFolder));
watcher.on('error', (code, signal) => this.options.onError(`Error watching ${path} for configuration changes (${code}, ${signal})`));
this.disposables.push(toDisposable(() => {
@@ -166,7 +168,11 @@ export class ConfigWatcher<T> implements IConfigWatcher<T>, IDisposable {
}
}
private onConfigFileChange(): void {
private onConfigFileChange(eventType: string, filename: string, isParentFolder: boolean): void {
if (isParentFolder && filename !== this.configName) {
return; // a change to a sibling file that is not our config file
}
if (this.timeoutHandle) {
global.clearTimeout(this.timeoutHandle);
this.timeoutHandle = null;
+15
View File
@@ -189,3 +189,18 @@ const tmpDir = os.tmpdir();
export function del(path: string, tmp = tmpDir): TPromise<void> {
return nfcall(extfs.del, path, tmp);
}
export function whenDeleted(path: string): TPromise<void> {
// Complete when wait marker file is deleted
return new TPromise<void>(c => {
const interval = setInterval(() => {
fs.exists(path, exists => {
if (!exists) {
clearInterval(interval);
c(null);
}
});
}, 1000);
});
}
@@ -0,0 +1,338 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as assert from 'assert';
import { Emitter } from 'vs/base/common/event';
import { SplitView, IView, Orientation } from 'vs/base/browser/ui/splitview/splitview2';
import { Sash } from 'vs/base/browser/ui/sash/sash';
class TestView implements IView {
private _onDidChange = new Emitter<void>();
readonly onDidChange = this._onDidChange.event;
get minimumSize(): number { return this._minimumSize; }
set minimumSize(size: number) { this._minimumSize = size; this._onDidChange.fire(); }
get maximumSize(): number { return this._maximumSize; }
set maximumSize(size: number) { this._maximumSize = size; this._onDidChange.fire(); }
private _onDidRender = new Emitter<{ container: HTMLElement; orientation: Orientation }>();
readonly onDidRender = this._onDidRender.event;
private _size = 0;
get size(): number { return this._size; }
private _onDidLayout = new Emitter<{ size: number; orientation: Orientation }>();
readonly onDidLayout = this._onDidLayout.event;
private _onDidFocus = new Emitter<void>();
readonly onDidFocus = this._onDidFocus.event;
constructor(
private _minimumSize: number,
private _maximumSize: number
) {
assert(_minimumSize <= _maximumSize, 'splitview view minimum size must be <= maximum size');
}
render(container: HTMLElement, orientation: Orientation): void {
this._onDidRender.fire({ container, orientation });
}
layout(size: number, orientation: Orientation): void {
this._size = size;
this._onDidLayout.fire({ size, orientation });
}
focus(): void {
this._onDidFocus.fire();
}
dispose(): void {
this._onDidChange.dispose();
this._onDidRender.dispose();
this._onDidLayout.dispose();
this._onDidFocus.dispose();
}
}
function getSashes(splitview: SplitView): Sash[] {
return (splitview as any).sashItems.map(i => i.sash) as Sash[];
}
suite('Splitview', () => {
let container: HTMLElement;
setup(() => {
container = document.createElement('div');
container.style.position = 'absolute';
container.style.width = `${200}px`;
container.style.height = `${200}px`;
});
teardown(() => {
container = null;
});
test('empty splitview has empty DOM', () => {
const splitview = new SplitView(container);
assert.equal(container.firstElementChild.childElementCount, 0, 'split view should be empty');
splitview.dispose();
});
test('has views as sashes as children', () => {
const view1 = new TestView(20, 20);
const view2 = new TestView(20, 20);
const view3 = new TestView(20, 20);
const splitview = new SplitView(container);
splitview.addView(view1, 20);
splitview.addView(view2, 20);
splitview.addView(view3, 20);
let viewQuery = container.querySelectorAll('.monaco-split-view > .split-view-view');
assert.equal(viewQuery.length, 3, 'split view should have 3 views');
let sashQuery = container.querySelectorAll('.monaco-split-view > .monaco-sash');
assert.equal(sashQuery.length, 2, 'split view should have 2 sashes');
splitview.removeView(2);
viewQuery = container.querySelectorAll('.monaco-split-view > .split-view-view');
assert.equal(viewQuery.length, 2, 'split view should have 2 views');
sashQuery = container.querySelectorAll('.monaco-split-view > .monaco-sash');
assert.equal(sashQuery.length, 1, 'split view should have 1 sash');
splitview.removeView(0);
viewQuery = container.querySelectorAll('.monaco-split-view > .split-view-view');
assert.equal(viewQuery.length, 1, 'split view should have 1 view');
sashQuery = container.querySelectorAll('.monaco-split-view > .monaco-sash');
assert.equal(sashQuery.length, 0, 'split view should have no sashes');
splitview.removeView(0);
viewQuery = container.querySelectorAll('.monaco-split-view > .split-view-view');
assert.equal(viewQuery.length, 0, 'split view should have no views');
sashQuery = container.querySelectorAll('.monaco-split-view > .monaco-sash');
assert.equal(sashQuery.length, 0, 'split view should have no sashes');
splitview.dispose();
view1.dispose();
view2.dispose();
view3.dispose();
});
test('calls view methods on addView and removeView', () => {
const view = new TestView(20, 20);
const splitview = new SplitView(container);
let didLayout = false;
const layoutDisposable = view.onDidLayout(() => didLayout = true);
let didRender = false;
const renderDisposable = view.onDidRender(() => didRender = true);
splitview.addView(view, 20);
assert.equal(view.size, 20, 'view has right size');
assert(didLayout, 'layout is called');
assert(didLayout, 'render is called');
splitview.dispose();
layoutDisposable.dispose();
renderDisposable.dispose();
view.dispose();
});
test('stretches view to viewport', () => {
const view = new TestView(20, Number.POSITIVE_INFINITY);
const splitview = new SplitView(container);
splitview.layout(200);
splitview.addView(view, 20);
assert.equal(view.size, 200, 'view is stretched');
splitview.layout(200);
assert.equal(view.size, 200, 'view stayed the same');
splitview.layout(100);
assert.equal(view.size, 100, 'view is collapsed');
splitview.layout(20);
assert.equal(view.size, 20, 'view is collapsed');
splitview.layout(10);
assert.equal(view.size, 20, 'view is clamped');
splitview.layout(200);
assert.equal(view.size, 200, 'view is stretched');
splitview.dispose();
view.dispose();
});
test('respects preferred sizes with structural changes', () => {
const view1 = new TestView(20, Number.POSITIVE_INFINITY);
const view2 = new TestView(20, Number.POSITIVE_INFINITY);
const view3 = new TestView(20, Number.POSITIVE_INFINITY);
const splitview = new SplitView(container);
splitview.layout(200);
splitview.addView(view1, 20);
assert.equal(view1.size, 200, 'view1 is stretched');
splitview.addView(view2, 20);
assert.equal(view1.size, 20, 'view1 size is restored');
assert.equal(view2.size, 200 - 20, 'view2 is stretched');
splitview.addView(view3, 20);
assert.equal(view1.size, 20, 'view1 size is restored');
assert.equal(view2.size, 20, 'view2 size is restored');
assert.equal(view3.size, 160, 'view3 is stretched');
splitview.dispose();
view3.dispose();
view2.dispose();
view1.dispose();
});
test('can resize views', () => {
const view1 = new TestView(20, Number.POSITIVE_INFINITY);
const view2 = new TestView(20, Number.POSITIVE_INFINITY);
const view3 = new TestView(20, Number.POSITIVE_INFINITY);
const splitview = new SplitView(container);
splitview.layout(200);
splitview.addView(view1, 20);
splitview.addView(view2, 20);
splitview.addView(view3, 20);
assert.equal(view1.size, 20, 'view1 size is the default');
assert.equal(view2.size, 20, 'view2 size the the default');
assert.equal(view3.size, 160, 'view3 is stretched');
splitview.resizeView(1, 40);
assert.equal(view1.size, 20, 'view1 is untouched');
assert.equal(view2.size, 40, 'view2 is stretched');
assert.equal(view3.size, 140, 'view3 is collapsed');
splitview.resizeView(0, 70);
assert.equal(view1.size, 70, 'view1 is stretched');
assert.equal(view2.size, 20, 'view2 is collapsed');
assert.equal(view3.size, 110, 'view3 is collapsed');
assert.throws(() => splitview.resizeView(2, 20));
assert.equal(view1.size, 70, 'view1 stays the same');
assert.equal(view2.size, 20, 'view2 stays the same');
assert.equal(view3.size, 110, 'view3 stays the same');
splitview.dispose();
view3.dispose();
view2.dispose();
view1.dispose();
});
test('reacts to view changes', () => {
const view1 = new TestView(20, Number.POSITIVE_INFINITY);
const view2 = new TestView(20, Number.POSITIVE_INFINITY);
const view3 = new TestView(20, Number.POSITIVE_INFINITY);
const splitview = new SplitView(container);
splitview.layout(200);
splitview.addView(view1, 20);
splitview.addView(view2, 20);
splitview.addView(view3, 20);
assert.equal(view1.size, 20, 'view1 size is restored');
assert.equal(view2.size, 20, 'view2 size is restored');
assert.equal(view3.size, 160, 'view3 is stretched');
view3.maximumSize = 20;
assert.equal(view1.size, 20, 'view1 stays the same');
assert.equal(view2.size, 160, 'view2 is stretched');
assert.equal(view3.size, 20, 'view3 is collapsed');
view2.maximumSize = 40;
assert.equal(view1.size, 140, 'view1 is stretched');
assert.equal(view2.size, 40, 'view2 is collapsed');
assert.equal(view3.size, 20, 'view3 is collapsed');
view3.maximumSize = 200;
assert.equal(view1.size, 140, 'view1 stays the same');
assert.equal(view2.size, 40, 'view2 stays the same');
assert.equal(view3.size, 20, 'view3 stays the same');
view3.minimumSize = 100;
assert.equal(view1.size, 80, 'view1 is collapsed');
assert.equal(view2.size, 20, 'view2 stays the same');
assert.equal(view3.size, 100, 'view3 is stretched');
splitview.dispose();
view3.dispose();
view2.dispose();
view1.dispose();
});
test('sashes are properly enabled/disabled', () => {
const view1 = new TestView(20, Number.POSITIVE_INFINITY);
const view2 = new TestView(20, Number.POSITIVE_INFINITY);
const view3 = new TestView(20, Number.POSITIVE_INFINITY);
const splitview = new SplitView(container);
splitview.layout(200);
splitview.addView(view1, 20);
splitview.addView(view2, 20);
splitview.addView(view3, 20);
let sashes = getSashes(splitview);
assert.equal(sashes.length, 2, 'there are two sashes');
assert.equal(sashes[0].enabled, true, 'first sash is enabled');
assert.equal(sashes[1].enabled, true, 'second sash is enabled');
splitview.layout(60);
assert.equal(sashes[0].enabled, false, 'first sash is disabled');
assert.equal(sashes[1].enabled, false, 'second sash is disabled');
splitview.layout(20);
assert.equal(sashes[0].enabled, false, 'first sash is disabled');
assert.equal(sashes[1].enabled, false, 'second sash is disabled');
splitview.layout(200);
assert.equal(sashes[0].enabled, true, 'first sash is enabled');
assert.equal(sashes[1].enabled, true, 'second sash is enabled');
view1.maximumSize = 20;
assert.equal(sashes[0].enabled, false, 'first sash is disabled');
assert.equal(sashes[1].enabled, true, 'second sash is enabled');
view2.maximumSize = 20;
assert.equal(sashes[0].enabled, false, 'first sash is disabled');
assert.equal(sashes[1].enabled, false, 'second sash is disabled');
view1.maximumSize = 300;
assert.equal(sashes[0].enabled, true, 'first sash is enabled');
assert.equal(sashes[1].enabled, true, 'second sash is enabled');
view2.maximumSize = 200;
assert.equal(sashes[0].enabled, true, 'first sash is enabled');
assert.equal(sashes[1].enabled, true, 'second sash is enabled');
splitview.dispose();
view3.dispose();
view2.dispose();
view1.dispose();
});
});
+17
View File
@@ -368,6 +368,23 @@ suite('URI', () => {
assert.equal(value.toString(), 'http://l%C3%B6calhost:8080/far');
});
test('URI#toString, user information in authority', () => {
var value = URI.parse('http://foo:bar@localhost/far');
assert.equal(value.toString(), 'http://foo:bar@localhost/far');
value = URI.parse('http://foo@localhost/far');
assert.equal(value.toString(), 'http://foo@localhost/far');
value = URI.parse('http://foo:bAr@localhost:8080/far');
assert.equal(value.toString(), 'http://foo:bAr@localhost:8080/far');
value = URI.parse('http://foo@localhost:8080/far');
assert.equal(value.toString(), 'http://foo@localhost:8080/far');
value = URI.from({ scheme: 'http', authority: 'föö:bör@löcalhost:8080', path: '/far', query: undefined, fragment: undefined });
assert.equal(value.toString(), 'http://f%C3%B6%C3%B6:b%C3%B6r@l%C3%B6calhost:8080/far');
});
test('correctFileUriToFilePath2', () => {
var test = (input: string, expected: string) => {
+5
View File
@@ -174,4 +174,9 @@ export class KeybindingsResolver {
return this.keybindings[commandId];
}
public dispose(): void {
this._onKeybindingsChanged.dispose();
this.keybindingsWatcher.dispose();
}
}
+7 -2
View File
@@ -14,6 +14,7 @@ import { ParsedArgs } from 'vs/platform/environment/common/environment';
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
import { OpenContext } from 'vs/platform/windows/common/windows';
import { IWindowsMainService, ICodeWindow } from 'vs/platform/windows/electron-main/windows';
import { whenDeleted } from 'vs/base/node/pfs';
export const ID = 'launchService';
export const ILaunchService = createDecorator<ILaunchService>(ID);
@@ -113,9 +114,13 @@ export class LaunchService implements ILaunchService {
}
// If the other instance is waiting to be killed, we hook up a window listener if one window
// is being used and only then resolve the startup promise which will kill this second instance
// is being used and only then resolve the startup promise which will kill this second instance.
// In addition, we poll for the wait marker file to be deleted to return.
if (args.wait && usedWindows.length === 1 && usedWindows[0]) {
return this.windowsService.waitForWindowCloseOrLoad(usedWindows[0].id);
return TPromise.any([
this.windowsService.waitForWindowCloseOrLoad(usedWindows[0].id),
whenDeleted(args.waitMarkerFilePath)
]).then(() => void 0, () => void 0);
}
return TPromise.as(null);
+216 -153
View File
@@ -5,7 +5,7 @@
'use strict';
import * as path from 'path';
import { basename, normalize, join, dirname } from 'path';
import * as fs from 'original-fs';
import { localize } from 'vs/nls';
import * as arrays from 'vs/base/common/arrays';
@@ -114,6 +114,7 @@ export class WindowsManager implements IWindowsMainService {
private lastClosedWindowState: IWindowState;
private fileDialog: FileDialog;
private workspacesManager: WorkspacesManager;
private _onWindowReady = new Emitter<CodeWindow>();
onWindowReady: CommonEvent<CodeWindow> = this._onWindowReady.event;
@@ -146,7 +147,9 @@ export class WindowsManager implements IWindowsMainService {
@IInstantiationService private instantiationService: IInstantiationService
) {
this.windowsState = this.storageService.getItem<IWindowsState>(WindowsManager.windowsStateStorageKey) || { openedWindows: [] };
this.fileDialog = new FileDialog(environmentService, telemetryService, storageService, this);
this.workspacesManager = new WorkspacesManager(workspacesService, lifecycleService, backupService, environmentService, this);
this.migrateLegacyWindowState();
}
@@ -403,7 +406,7 @@ export class WindowsManager implements IWindowsMainService {
workspacesToRestore.push(...this.workspacesService.getUntitledWorkspacesSync()); // collect from previous window session
emptyToRestore = this.backupService.getEmptyWindowBackupPaths();
emptyToRestore.push(...pathsToOpen.filter(w => !w.workspace && !w.folderPath && w.backupPath).map(w => path.basename(w.backupPath))); // add empty windows with backupPath
emptyToRestore.push(...pathsToOpen.filter(w => !w.workspace && !w.folderPath && w.backupPath).map(w => basename(w.backupPath))); // add empty windows with backupPath
emptyToRestore = arrays.distinct(emptyToRestore); // prevent duplicates
}
@@ -932,7 +935,7 @@ export class WindowsManager implements IWindowsMainService {
anyPath = parsedPath.path;
}
const candidate = path.normalize(anyPath);
const candidate = normalize(anyPath);
try {
const candidateStat = fs.statSync(candidate);
if (candidateStat) {
@@ -1051,7 +1054,7 @@ export class WindowsManager implements IWindowsMainService {
// For all other cases we first call into registerEmptyWindowBackupSync() to set it before
// loading the window.
if (options.emptyWindowBackupFolder) {
configuration.backupPath = path.join(this.environmentService.backupHome, options.emptyWindowBackupFolder);
configuration.backupPath = join(this.environmentService.backupHome, options.emptyWindowBackupFolder);
}
let window: CodeWindow;
@@ -1291,93 +1294,19 @@ export class WindowsManager implements IWindowsMainService {
});
}
public saveAndOpenWorkspace(window: CodeWindow, path: string): TPromise<void> {
if (!window || !window.win || window.readyState !== ReadyState.READY || !window.openedWorkspace || !path) {
return TPromise.as(null); // return early if the window is not ready or disposed or does not have a workspace
}
return this.doSaveAndOpenWorkspace(window, window.openedWorkspace, path);
public saveAndOpenWorkspace(win: CodeWindow, path: string): TPromise<void> {
return this.workspacesManager.saveAndOpenWorkspace(win, path);
}
public createAndOpenWorkspace(window: CodeWindow, folders?: string[], path?: string): TPromise<void> {
if (!window || !window.win || window.readyState !== ReadyState.READY) {
return TPromise.as(null); // return early if the window is not ready or disposed
}
return this.workspacesService.createWorkspace(folders).then(workspace => {
return this.doSaveAndOpenWorkspace(window, workspace, path);
});
public createAndOpenWorkspace(win: CodeWindow, folders?: string[], path?: string): TPromise<void> {
return this.workspacesManager.createAndOpenWorkspace(win, folders, path);
}
private doSaveAndOpenWorkspace(window: CodeWindow, workspace: IWorkspaceIdentifier, path?: string): TPromise<void> {
let savePromise: TPromise<IWorkspaceIdentifier>;
if (path) {
savePromise = this.workspacesService.saveWorkspace(workspace, path);
} else {
savePromise = TPromise.as(workspace);
}
return savePromise.then(workspace => {
window.focus();
// Only open workspace when the window has not vetoed this
return this.lifecycleService.unload(window, UnloadReason.RELOAD, workspace).done(veto => {
if (!veto) {
// Register window for backups and migrate current backups over
let backupPath: string;
if (window.config && !window.config.extensionDevelopmentPath) {
backupPath = this.backupService.registerWorkspaceBackupSync(workspace, window.config.backupPath);
}
// Craft a new window configuration to use for the transition
const configuration: IWindowConfiguration = mixin({}, window.config);
configuration.folderPath = void 0;
configuration.workspace = workspace;
configuration.backupPath = backupPath;
// Reload
window.reload(configuration);
}
});
});
public openWorkspace(win?: CodeWindow): void {
this.workspacesManager.openWorkspace(win);
}
public openWorkspace(window: CodeWindow = this.getLastActiveWindow()): void {
let defaultPath: string;
if (window && window.openedWorkspace && !this.workspacesService.isUntitledWorkspace(window.openedWorkspace)) {
defaultPath = path.dirname(window.openedWorkspace.configPath);
} else {
defaultPath = this.getWorkspaceDialogDefaultPath(window ? (window.openedWorkspace || window.openedFolderPath) : void 0);
}
this.pickFileAndOpen({
windowId: window ? window.id : void 0,
dialogOptions: {
buttonLabel: mnemonicButtonLabel(localize({ key: 'openWorkspace', comment: ['&& denotes a mnemonic'] }, "&&Open")),
title: localize('openWorkspaceTitle', "Open Workspace"),
filters: WORKSPACE_FILTER,
properties: ['openFile'],
defaultPath
}
});
}
private getWorkspaceDialogDefaultPath(workspace?: IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier): string {
let defaultPath: string;
if (workspace) {
if (isSingleFolderWorkspaceIdentifier(workspace)) {
defaultPath = path.dirname(workspace);
} else {
const resolvedWorkspace = this.workspacesService.resolveWorkspaceSync(workspace.configPath);
if (resolvedWorkspace && resolvedWorkspace.folders.length > 0) {
defaultPath = path.dirname(resolvedWorkspace.folders[0].path);
}
}
}
return defaultPath;
}
private onBeforeWindowUnload(e: IWindowUnloadEvent): void {
const windowClosing = (e.reason === UnloadReason.CLOSE);
@@ -1399,74 +1328,8 @@ export class WindowsManager implements IWindowsMainService {
return; // Windows/Linux: quits when last window is closed, so do not ask then
}
this.promptToSaveUntitledWorkspace(e, workspace);
}
private promptToSaveUntitledWorkspace(e: IWindowUnloadEvent, workspace: IWorkspaceIdentifier): void {
enum ConfirmResult {
SAVE,
DONT_SAVE,
CANCEL
}
const save = { label: mnemonicButtonLabel(localize({ key: 'save', comment: ['&& denotes a mnemonic'] }, "&&Save")), result: ConfirmResult.SAVE };
const dontSave = { label: mnemonicButtonLabel(localize({ key: 'doNotSave', comment: ['&& denotes a mnemonic'] }, "Do&&n't Save")), result: ConfirmResult.DONT_SAVE };
const cancel = { label: localize('cancel', "Cancel"), result: ConfirmResult.CANCEL };
const buttons: { label: string; result: ConfirmResult; }[] = [];
if (isWindows) {
buttons.push(save, dontSave, cancel);
} else if (isLinux) {
buttons.push(dontSave, cancel, save);
} else {
buttons.push(save, cancel, dontSave);
}
const options: Electron.MessageBoxOptions = {
title: this.environmentService.appNameLong,
message: localize('saveWorkspaceMessage', "Do you want to save your workspace configuration as a file?"),
detail: localize('saveWorkspaceDetail', "Save your workspace if you plan to open it again."),
noLink: true,
type: 'warning',
buttons: buttons.map(button => button.label),
cancelId: buttons.indexOf(cancel)
};
if (isLinux) {
options.defaultId = 2;
}
const res = dialog.showMessageBox(e.window.win, options);
switch (buttons[res].result) {
// Cancel: veto unload
case ConfirmResult.CANCEL:
e.veto(true);
break;
// Don't Save: delete workspace
case ConfirmResult.DONT_SAVE:
this.workspacesService.deleteUntitledWorkspaceSync(workspace);
e.veto(false);
break;
// Save: save workspace, but do not veto unload
case ConfirmResult.SAVE: {
const target = dialog.showSaveDialog(e.window.win, {
buttonLabel: mnemonicButtonLabel(localize({ key: 'save', comment: ['&& denotes a mnemonic'] }, "&&Save")),
title: localize('saveWorkspace', "Save Workspace"),
filters: WORKSPACE_FILTER,
defaultPath: this.getWorkspaceDialogDefaultPath(workspace)
});
if (target) {
e.veto(this.workspacesService.saveWorkspace(workspace, target).then(() => false, () => false));
} else {
e.veto(true); // keep veto if no target was provided
}
}
}
// Handle untitled workspaces with prompt as needed
this.workspacesManager.promptToSaveUntitledWorkspace(e, workspace);
}
public focusLastActive(cli: ParsedArgs, context: OpenContext): CodeWindow {
@@ -1754,7 +1617,7 @@ class FileDialog {
if (paths && paths.length > 0) {
// Remember path in storage for next time
this.storageService.setItem(FileDialog.workingDirPickerStorageKey, path.dirname(paths[0]));
this.storageService.setItem(FileDialog.workingDirPickerStorageKey, dirname(paths[0]));
// Return
return clb(paths);
@@ -1763,4 +1626,204 @@ class FileDialog {
return clb(void (0));
});
}
}
class WorkspacesManager {
constructor(
private workspacesService: IWorkspacesMainService,
private lifecycleService: ILifecycleService,
private backupService: IBackupMainService,
private environmentService: IEnvironmentService,
private windowsMainService: IWindowsMainService
) {
}
public saveAndOpenWorkspace(window: CodeWindow, path: string): TPromise<void> {
if (!window || !window.win || window.readyState !== ReadyState.READY || !window.openedWorkspace || !path || !this.isValidTargetWorkspacePath(window, path)) {
return TPromise.as(null); // return early if the window is not ready or disposed or does not have a workspace
}
return this.doSaveAndOpenWorkspace(window, window.openedWorkspace, path);
}
public createAndOpenWorkspace(window: CodeWindow, folders?: string[], path?: string): TPromise<void> {
if (!window || !window.win || window.readyState !== ReadyState.READY || !this.isValidTargetWorkspacePath(window, path)) {
return TPromise.as(null); // return early if the window is not ready or disposed
}
return this.workspacesService.createWorkspace(folders).then(workspace => {
return this.doSaveAndOpenWorkspace(window, workspace, path);
});
}
private isValidTargetWorkspacePath(window: CodeWindow, path?: string): boolean {
if (!path) {
return true;
}
if (window.openedWorkspace && window.openedWorkspace.configPath === path) {
return false; // window is already opened on a workspace with that path
}
// Prevent overwriting a workspace that is currently opened in another window
if (findWindowOnWorkspace(this.windowsMainService.getWindows(), { id: this.workspacesService.getWorkspaceId(path), configPath: path })) {
const options: Electron.MessageBoxOptions = {
title: product.nameLong,
type: 'info',
buttons: [localize('ok', "OK")],
message: localize('workspaceOpenedMessage', "Unable to save workspace '{0}'", basename(path)),
detail: localize('workspaceOpenedDetail', "The workspace is already opened in another window. Please close that window first and then try again."),
noLink: true
};
const activeWindow = BrowserWindow.getFocusedWindow();
if (activeWindow) {
dialog.showMessageBox(activeWindow, options);
} else {
dialog.showMessageBox(options);
}
return false;
}
return true; // OK
}
private doSaveAndOpenWorkspace(window: CodeWindow, workspace: IWorkspaceIdentifier, path?: string): TPromise<void> {
let savePromise: TPromise<IWorkspaceIdentifier>;
if (path) {
savePromise = this.workspacesService.saveWorkspace(workspace, path);
} else {
savePromise = TPromise.as(workspace);
}
return savePromise.then(workspace => {
window.focus();
// Only open workspace when the window has not vetoed this
return this.lifecycleService.unload(window, UnloadReason.RELOAD, workspace).done(veto => {
if (!veto) {
// Register window for backups and migrate current backups over
let backupPath: string;
if (window.config && !window.config.extensionDevelopmentPath) {
backupPath = this.backupService.registerWorkspaceBackupSync(workspace, window.config.backupPath);
}
// Craft a new window configuration to use for the transition
const configuration: IWindowConfiguration = mixin({}, window.config);
configuration.folderPath = void 0;
configuration.workspace = workspace;
configuration.backupPath = backupPath;
// Reload
window.reload(configuration);
}
});
});
}
public openWorkspace(window = this.windowsMainService.getLastActiveWindow()): void {
let defaultPath: string;
if (window && window.openedWorkspace && !this.workspacesService.isUntitledWorkspace(window.openedWorkspace)) {
defaultPath = dirname(window.openedWorkspace.configPath);
} else {
defaultPath = this.getWorkspaceDialogDefaultPath(window ? (window.openedWorkspace || window.openedFolderPath) : void 0);
}
this.windowsMainService.pickFileAndOpen({
windowId: window ? window.id : void 0,
dialogOptions: {
buttonLabel: mnemonicButtonLabel(localize({ key: 'openWorkspace', comment: ['&& denotes a mnemonic'] }, "&&Open")),
title: localize('openWorkspaceTitle', "Open Workspace"),
filters: WORKSPACE_FILTER,
properties: ['openFile'],
defaultPath
}
});
}
public promptToSaveUntitledWorkspace(e: IWindowUnloadEvent, workspace: IWorkspaceIdentifier): void {
enum ConfirmResult {
SAVE,
DONT_SAVE,
CANCEL
}
const save = { label: mnemonicButtonLabel(localize({ key: 'save', comment: ['&& denotes a mnemonic'] }, "&&Save")), result: ConfirmResult.SAVE };
const dontSave = { label: mnemonicButtonLabel(localize({ key: 'doNotSave', comment: ['&& denotes a mnemonic'] }, "Do&&n't Save")), result: ConfirmResult.DONT_SAVE };
const cancel = { label: localize('cancel', "Cancel"), result: ConfirmResult.CANCEL };
const buttons: { label: string; result: ConfirmResult; }[] = [];
if (isWindows) {
buttons.push(save, dontSave, cancel);
} else if (isLinux) {
buttons.push(dontSave, cancel, save);
} else {
buttons.push(save, cancel, dontSave);
}
const options: Electron.MessageBoxOptions = {
title: this.environmentService.appNameLong,
message: localize('saveWorkspaceMessage', "Do you want to save your workspace configuration as a file?"),
detail: localize('saveWorkspaceDetail', "Save your workspace if you plan to open it again."),
noLink: true,
type: 'warning',
buttons: buttons.map(button => button.label),
cancelId: buttons.indexOf(cancel)
};
if (isLinux) {
options.defaultId = 2;
}
const res = dialog.showMessageBox(e.window.win, options);
switch (buttons[res].result) {
// Cancel: veto unload
case ConfirmResult.CANCEL:
e.veto(true);
break;
// Don't Save: delete workspace
case ConfirmResult.DONT_SAVE:
this.workspacesService.deleteUntitledWorkspaceSync(workspace);
e.veto(false);
break;
// Save: save workspace, but do not veto unload
case ConfirmResult.SAVE: {
const target = dialog.showSaveDialog(e.window.win, {
buttonLabel: mnemonicButtonLabel(localize({ key: 'save', comment: ['&& denotes a mnemonic'] }, "&&Save")),
title: localize('saveWorkspace', "Save Workspace"),
filters: WORKSPACE_FILTER,
defaultPath: this.getWorkspaceDialogDefaultPath(workspace)
});
if (target) {
e.veto(this.workspacesService.saveWorkspace(workspace, target).then(() => false, () => false));
} else {
e.veto(true); // keep veto if no target was provided
}
}
}
}
private getWorkspaceDialogDefaultPath(workspace?: IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier): string {
let defaultPath: string;
if (workspace) {
if (isSingleFolderWorkspaceIdentifier(workspace)) {
defaultPath = dirname(workspace);
} else {
const resolvedWorkspace = this.workspacesService.resolveWorkspaceSync(workspace.configPath);
if (resolvedWorkspace && resolvedWorkspace.folders.length > 0) {
defaultPath = dirname(resolvedWorkspace.folders[0].path);
}
}
}
return defaultPath;
}
}
+2 -8
View File
@@ -14,6 +14,7 @@ import pkg from 'vs/platform/node/package';
import * as fs from 'fs';
import * as paths from 'path';
import * as os from 'os';
import { whenDeleted } from 'vs/base/node/pfs';
function shouldSpawnCliProcess(argv: ParsedArgs): boolean {
return argv['list-extensions'] || !!argv['install-extension'] || !!argv['uninstall-extension'];
@@ -105,14 +106,7 @@ export function main(argv: string[]): TPromise<void> {
child.once('exit', () => c(null));
// Complete when wait marker file is deleted
const interval = setInterval(() => {
fs.exists(waitMarkerFilePath, exists => {
if (!exists) {
clearInterval(interval);
c(null);
}
});
}, 1000);
whenDeleted(waitMarkerFilePath).done(c, c);
});
}
}
+3 -2
View File
@@ -308,7 +308,8 @@ export class View extends ViewEventHandler {
}
private getEditorClassName() {
return this._context.configuration.editor.editorClassName + ' ' + getThemeTypeSelector(this._context.theme.type);
let focused = this._textAreaHandler.isFocused() ? ' focused' : '';
return this._context.configuration.editor.editorClassName + ' ' + getThemeTypeSelector(this._context.theme.type) + focused;
}
// --- begin event handlers
@@ -323,7 +324,7 @@ export class View extends ViewEventHandler {
return false;
}
public onFocusChanged(e: viewEvents.ViewFocusChangedEvent): boolean {
this.domNode.toggleClassName('focused', e.isFocused);
this.domNode.setClassName(this.getEditorClassName());
if (e.isFocused) {
this.outgoingEvents.emitViewFocusGained();
} else {
@@ -400,6 +400,7 @@ export abstract class CodeEditorWidget extends CommonCodeEditor implements edito
this._view.render(false, true);
this.hasView = true;
this._view.domNode.domNode.setAttribute('data-uri', model.uri.toString());
}
}
@@ -598,6 +598,11 @@ const editorConfiguration: IConfigurationNode = {
'default': EDITOR_DEFAULTS.contribInfo.colorDecorators,
'description': nls.localize('colorDecorators', "Controls whether the editor should render the inline color decorators and color picker.")
},
'editor.lightbulb.enabled': {
'type': 'boolean',
'default': EDITOR_DEFAULTS.contribInfo.lightbulbEnabled,
'description': nls.localize('codeActions', "Enables the code action lightbulb")
},
'diffEditor.renderSideBySide': {
'type': 'boolean',
'default': true,
+22 -2
View File
@@ -114,6 +114,17 @@ export interface IEditorMinimapOptions {
maxColumn?: number;
}
/**
* Configuration options for editor minimap
*/
export interface IEditorLightbulbOptions {
/**
* Enable the lightbulb code action.
* Defaults to true.
*/
enabled?: boolean;
}
/**
* Configuration options for the editor.
*/
@@ -462,6 +473,10 @@ export interface IEditorOptions {
* @internal
*/
referenceInfos?: boolean;
/**
* Control the behavior and rendering of the code action lightbulb.
*/
lightbulb?: IEditorLightbulbOptions;
/**
* Enable code folding
* Defaults to true in vscode and to false in monaco-editor.
@@ -795,6 +810,7 @@ export interface EditorContribOptions {
readonly matchBrackets: boolean;
readonly find: InternalEditorFindOptions;
readonly colorDecorators: boolean;
readonly lightbulbEnabled: boolean;
}
/**
@@ -1140,6 +1156,7 @@ export class InternalEditorOptions {
&& a.matchBrackets === b.matchBrackets
&& this._equalFindOptions(a.find, b.find)
&& a.colorDecorators === b.colorDecorators
&& a.lightbulbEnabled === b.lightbulbEnabled
);
}
@@ -1669,6 +1686,7 @@ export class EditorOptionsValidator {
matchBrackets: _boolean(opts.matchBrackets, defaults.matchBrackets),
find: find,
colorDecorators: _boolean(opts.colorDecorators, defaults.colorDecorators),
lightbulbEnabled: _boolean(opts.lightbulb ? opts.lightbulb.enabled : false, defaults.lightbulbEnabled)
};
}
}
@@ -1766,7 +1784,8 @@ export class InternalEditorOptionsFactory {
showFoldingControls: opts.contribInfo.showFoldingControls,
matchBrackets: (accessibilityIsOn ? false : opts.contribInfo.matchBrackets), // DISABLED WHEN SCREEN READER IS ATTACHED
find: opts.contribInfo.find,
colorDecorators: opts.contribInfo.colorDecorators
colorDecorators: opts.contribInfo.colorDecorators,
lightbulbEnabled: opts.contribInfo.lightbulbEnabled
}
};
}
@@ -2205,6 +2224,7 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = {
seedSearchStringFromSelection: true,
autoFindInSelection: false
},
colorDecorators: true
colorDecorators: true,
lightbulbEnabled: true
},
};
@@ -45,6 +45,11 @@
.monaco-editor .parameter-hints-widget .docs {
padding: 0 10px 0 5px;
white-space: pre-wrap;
}
.monaco-editor .parameter-hints-widget .docs.markdown-docs {
white-space: initial;
}
.monaco-editor .parameter-hints-widget .docs .code {
@@ -336,8 +336,10 @@ export class ParameterHintsWidget implements IContentWidget, IDisposable {
if (activeParameter && activeParameter.documentation) {
const documentation = $('span.documentation');
if (typeof activeParameter.documentation === 'string') {
dom.removeClass(this.docs, 'markdown-docs');
documentation.textContent = activeParameter.documentation;
} else {
dom.addClass(this.docs, 'markdown-docs');
documentation.appendChild(this.markdownRenderer.render(activeParameter.documentation));
}
dom.append(this.docs, $('p', null, documentation));
@@ -29,12 +29,12 @@ export class LightBulbWidget implements IDisposable, IContentWidget {
private _futureFixes = new CancellationTokenSource();
constructor(editor: ICodeEditor) {
this._editor = editor;
this._editor.addContentWidget(this);
this._domNode = document.createElement('div');
this._domNode.className = 'lightbulb-glyph';
this._editor = editor;
this._editor.addContentWidget(this);
this._disposables.push(dom.addStandardDisposableListener(this._domNode, 'click', e => {
// a bit of extra work to make sure the menu
// doesn't cover the line-text
@@ -66,6 +66,12 @@ export class LightBulbWidget implements IDisposable, IContentWidget {
dom.removeClass(this._domNode, 'hidden');
});
}));
this._disposables.push(this._editor.onDidChangeConfiguration(e => {
// hide when told to do so
if (e.contribInfo && !this._editor.getConfiguration().contribInfo.lightbulbEnabled) {
this.hide();
}
}));
}
dispose(): void {
@@ -124,11 +130,14 @@ export class LightBulbWidget implements IDisposable, IContentWidget {
}
private _show(): void {
const { fontInfo } = this._editor.getConfiguration();
const config = this._editor.getConfiguration();
if (!config.contribInfo.lightbulbEnabled) {
return;
}
const { lineNumber } = this._model.position;
const model = this._editor.getModel();
const indent = model.getIndentLevel(lineNumber);
const lineHasSpace = fontInfo.spaceWidth * indent > 22;
const lineHasSpace = config.fontInfo.spaceWidth * indent > 22;
let effectiveLineNumber = lineNumber;
if (!lineHasSpace) {
@@ -174,7 +174,6 @@ export abstract class PeekViewWidget extends ZoneWidget {
if (!this._isShowing && heightInPixel < 0) {
// Looks like the view zone got folded away!
this.dispose();
this._onDidClose.fire(this);
return;
}
@@ -228,6 +228,11 @@
.monaco-editor .suggest-widget .details > .monaco-scrollable-element > .body > .docs {
margin: 0;
padding: 4px 5px;
white-space: pre-wrap;
}
.monaco-editor .suggest-widget .details > .monaco-scrollable-element > .body > .docs.markdown-docs {
white-space: initial;
}
.monaco-editor .suggest-widget .details > .monaco-scrollable-element > .body > .docs .code {
@@ -249,8 +249,10 @@ class SuggestionDetails {
}
removeClass(this.el, 'no-docs');
if (typeof item.suggestion.documentation === 'string') {
removeClass(this.docs, 'markdown-docs');
this.docs.textContent = item.suggestion.documentation;
} else {
addClass(this.docs, 'markdown-docs');
this.docs.innerHTML = this.markdownRenderer.render(item.suggestion.documentation).innerHTML;
}
@@ -7,7 +7,6 @@
import 'vs/css!./zoneWidget';
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { Widget } from 'vs/base/browser/ui/widget';
import * as objects from 'vs/base/common/objects';
import * as dom from 'vs/base/browser/dom';
import { Sash, Orientation, IHorizontalSashLayoutProvider, ISashEvent } from 'vs/base/browser/ui/sash/sash';
@@ -157,7 +156,7 @@ class Arrow {
}
}
export abstract class ZoneWidget extends Widget implements IHorizontalSashLayoutProvider {
export abstract class ZoneWidget implements IHorizontalSashLayoutProvider {
private _arrow: Arrow;
private _overlayWidget: OverlayWidgetDelegate;
@@ -174,7 +173,6 @@ export abstract class ZoneWidget extends Widget implements IHorizontalSashLayout
constructor(editor: ICodeEditor, options: IOptions = {}) {
super();
this.editor = editor;
this.options = objects.clone(options);
objects.mixin(this.options, defaultOptions, false);

Some files were not shown because too many files have changed in this diff Show More