diff --git a/build/gulpfile.editor.js b/build/gulpfile.editor.js
index 3e0d4629694..afbe0a8b7d4 100644
--- a/build/gulpfile.editor.js
+++ b/build/gulpfile.editor.js
@@ -30,7 +30,7 @@ var editorEntryPoints = [
prepend: [ 'vs/loader.js' ],
append: [ 'vs/base/worker/workerMain' ],
dest: 'vs/base/worker/workerMain.js'
- },
+ }
];
var editorResources = [
diff --git a/build/gulpfile.hygiene.js b/build/gulpfile.hygiene.js
index 34768b9c23e..fc7d78fcf34 100644
--- a/build/gulpfile.hygiene.js
+++ b/build/gulpfile.hygiene.js
@@ -9,6 +9,7 @@ const gulp = require('gulp');
const filter = require('gulp-filter');
const es = require('event-stream');
const gulptslint = require('gulp-tslint');
+const tsfmt = require('typescript-formatter');
const tslint = require('tslint');
const all = [
@@ -47,9 +48,6 @@ const indentationFilter = [
'!**/package.json',
'!**/npm-shrinkwrap.json',
'!**/octicons/**',
- '!**/vs/languages/sass/test/common/example.scss',
- '!**/vs/languages/less/common/parser/less.grammar.txt',
- '!**/vs/languages/css/common/buildscripts/css-schema.xml',
'!**/vs/base/common/marked/raw.marked.js',
'!**/vs/base/common/winjs.base.raw.js',
'!**/vs/base/node/terminateProcess.sh',
@@ -89,7 +87,6 @@ const tslintFilter = [
'!src/vs/base/**/*.test.ts',
'!extensions/typescript/test/colorize-fixtures/**',
'!extensions/vscode-api-tests/testWorkspace/**',
- '!src/vs/languages/**/*.test.ts',
'!src/vs/workbench/**/*.test.ts',
'!extensions/**/*.test.ts'
];
@@ -163,6 +160,24 @@ const hygiene = exports.hygiene = (some, options) => {
this.emit('data', file);
});
+ const formatting = es.map(function (file, cb) {
+
+ tsfmt.processString(file.path, file.contents.toString('utf8'), {
+ verify: true,
+ tsfmt: true,
+ // verbose: true
+ }).then(result => {
+ if (result.error) {
+ console.error(result.message);
+ errorCount++;
+ }
+ cb(null, file);
+
+ }, err => {
+ cb(err);
+ });
+ });
+
const tsl = es.through(function(file) {
const configuration = tslint.findConfiguration(null, '.');
const options = { configuration, formatter: 'json', rulesDirectory: 'build/lib/tslint' };
@@ -187,6 +202,7 @@ const hygiene = exports.hygiene = (some, options) => {
.pipe(filter(copyrightFilter))
.pipe(copyrights)
.pipe(filter(tslintFilter))
+ .pipe(formatting)
.pipe(tsl)
.pipe(es.through(null, function () {
if (errorCount > 0) {
diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js
index dabac01f5ab..d7edf4902b8 100644
--- a/build/gulpfile.vscode.js
+++ b/build/gulpfile.vscode.js
@@ -39,15 +39,13 @@ const nodeModules = ['electron', 'original-fs']
// Build
const builtInExtensions = [
- { name: 'ms-vscode.node-debug', version: '1.6.8' },
+ { name: 'ms-vscode.node-debug', version: '1.7.1' },
{ name: 'ms-vscode.node-debug2', version: '0.0.7' }
];
const vscodeEntryPoints = _.flatten([
buildfile.entrypoint('vs/workbench/workbench.main'),
buildfile.base,
- buildfile.editor,
- buildfile.languages,
buildfile.workbench,
buildfile.code
]);
@@ -60,8 +58,6 @@ const vscodeResources = [
'out-build/paths.js',
'out-build/vs/**/*.{svg,png,cur}',
'out-build/vs/base/node/{stdForkStart.js,terminateProcess.sh}',
- 'out-build/vs/base/worker/workerMainCompatibility.html',
- 'out-build/vs/base/worker/workerMain.{js,js.map}',
'out-build/vs/base/browser/ui/octiconLabel/octicons/**',
'out-build/vs/workbench/browser/media/*-theme.css',
'out-build/vs/workbench/electron-browser/bootstrap/**',
@@ -94,7 +90,7 @@ gulp.task('optimize-vscode', ['clean-optimized-vscode', 'compile-build', 'compil
out: 'out-vscode'
}));
-const baseUrl = `https://ticino.blob.core.windows.net/sourcemaps/${ commit }/core`;
+const baseUrl = `https://ticino.blob.core.windows.net/sourcemaps/${commit}/core`;
gulp.task('clean-minified-vscode', util.rimraf('out-vscode-min'));
gulp.task('minify-vscode', ['clean-minified-vscode', 'optimize-vscode'], common.minifyTask('out-vscode', baseUrl));
@@ -153,7 +149,7 @@ const languages = ['chs', 'cht', 'jpn', 'kor', 'deu', 'fra', 'esn', 'rus', 'ita'
*/
function computeChecksums(out, filenames) {
var result = {};
- filenames.forEach(function(filename) {
+ filenames.forEach(function (filename) {
var fullPath = path.join(process.cwd(), out, filename);
result[filename] = computeChecksum(fullPath);
});
@@ -214,29 +210,23 @@ function packageTask(platform, arch, opts) {
'!extensions/typescript/bin/**',
'!extensions/vscode-api-tests/**',
'!extensions/vscode-colorize-tests/**',
- ...builtInExtensions.map(e => `!extensions/${ e.name }/**`)
+ ...builtInExtensions.map(e => `!extensions/${e.name}/**`)
];
- const extensions = gulp.src(extensionsList, { base: '.' });
-
- const marketplaceExtensions = es.merge(...builtInExtensions.map(extension => {
- return ext.src(extension.name, extension.version)
- .pipe(rename(p => p.dirname = `extensions/${ extension.name }/${ p.dirname }`));
- }));
-
- const allExtensions = es.merge(
- extensions,
- marketplaceExtensions
- );
-
const nlsFilter = filter('**/*.nls.json', { restore: true });
-
- const sources = es.merge(src, allExtensions)
+ const extensions = gulp.src(extensionsList, { base: '.' })
// TODO@Dirk: this filter / buffer is here to make sure the nls.json files are buffered
.pipe(nlsFilter)
.pipe(buffer())
.pipe(nlsDev.createAdditionalLanguageFiles(languages, path.join(__dirname, '..', 'i18n')))
- .pipe(nlsFilter.restore)
+ .pipe(nlsFilter.restore);
+
+ const marketplaceExtensions = es.merge(...builtInExtensions.map(extension => {
+ return ext.src(extension.name, extension.version)
+ .pipe(rename(p => p.dirname = `extensions/${extension.name}/${p.dirname}`));
+ }));
+
+ const sources = es.merge(src, extensions, marketplaceExtensions)
.pipe(filter(['**', '!**/*.js.map']))
.pipe(util.handleAzureJson({ platform }));
@@ -268,6 +258,7 @@ function packageTask(platform, arch, opts) {
.pipe(util.cleanNodeModule('oniguruma', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['**/*.node']))
.pipe(util.cleanNodeModule('windows-mutex', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node']))
.pipe(util.cleanNodeModule('native-keymap', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['**/*.node']))
+ .pipe(util.cleanNodeModule('windows-foreground-love', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node']))
.pipe(util.cleanNodeModule('gc-signals', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['**/*.node', 'src/index.js']))
.pipe(util.cleanNodeModule('pty.js', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['build/Release/**']));
@@ -343,7 +334,7 @@ gulp.task('vscode-linux-arm-min', ['minify-vscode', 'clean-vscode-linux-arm'], p
gulp.task('upload-vscode-sourcemaps', ['minify-vscode'], () => {
const vs = gulp.src('out-vscode-min/**/*.map', { base: 'out-vscode-min' })
.pipe(es.mapSync(f => {
- f.path = `${ f.base }/core/${ f.relative }`;
+ f.path = `${f.base}/core/${f.relative}`;
return f;
}));
diff --git a/build/monaco/package.json b/build/monaco/package.json
index e9b918f6983..2d5c119e81b 100644
--- a/build/monaco/package.json
+++ b/build/monaco/package.json
@@ -1,7 +1,7 @@
{
"name": "monaco-editor-core",
"private": true,
- "version": "0.7.1",
+ "version": "0.7.3",
"description": "A browser based code editor",
"author": "Microsoft Corporation",
"license": "MIT",
diff --git a/build/npm/update-grammar.js b/build/npm/update-grammar.js
index fafa91aa6cc..4b0408b89b2 100644
--- a/build/npm/update-grammar.js
+++ b/build/npm/update-grammar.js
@@ -5,15 +5,44 @@
'use strict';
-var download = require('../lib/download');
var path = require('path');
var fs = require('fs');
var plist = require('fast-plist');
var cson = require('cson-parser');
+var https = require('https');
+var url = require('url');
+
+function getOptions(urlString) {
+ var _url = url.parse(urlString);
+ return {
+ protocol: _url.protocol,
+ host: _url.host,
+ port: _url.port,
+ path: _url.path,
+ headers: {
+ 'User-Agent': 'NodeJS'
+ }
+ }
+}
+
+function download(url) {
+return new Promise((c, e) => {
+ var content = '';
+ var request = https.get(getOptions(url), function (response) {
+ response.on('data', function (data) {
+ content += data.toString();
+ }).on('end', function () {
+ c(content);
+ });
+ }).on('error', function (err) {
+ e(err.message);
+ });
+});
+}
function getCommitSha(repoId, repoPath) {
var commitInfo = 'https://api.github.com/repos/' + repoId + '/commits?path=' + repoPath;
- return download.toString(commitInfo).then(function (content) {
+ return download(commitInfo).then(function (content) {
try {
let lastCommit = JSON.parse(content)[0];
return Promise.resolve({
@@ -32,7 +61,7 @@ function getCommitSha(repoId, repoPath) {
exports.update = function (repoId, repoPath, dest, modifyGrammar) {
var contentPath = 'https://raw.githubusercontent.com/' + repoId + '/master/' + repoPath;
console.log('Reading from ' + contentPath);
- return download.toString(contentPath).then(function (content) {
+ return download(contentPath).then(function (content) {
var ext = path.extname(repoPath);
var grammar;
if (ext === '.tmLanguage' || ext === '.plist') {
@@ -66,11 +95,9 @@ exports.update = function (repoId, repoPath, dest, modifyGrammar) {
}, console.error);
}
+
if (path.basename(process.argv[1]) === 'update-grammar.js') {
for (var i = 3; i < process.argv.length; i+=2) {
exports.update(process.argv[2], process.argv[i], process.argv[i+1]);
}
}
-
-
-
diff --git a/extensions/coffeescript/package.json b/extensions/coffeescript/package.json
index d75312ee3cd..f957b842f7b 100644
--- a/extensions/coffeescript/package.json
+++ b/extensions/coffeescript/package.json
@@ -3,6 +3,9 @@
"version": "0.1.0",
"publisher": "vscode",
"engines": { "vscode": "*" },
+ "scripts": {
+ "update-grammar": "node ../../build/npm/update-grammar.js textmate/coffee-script.tmbundle Syntaxes/CoffeeScript.tmLanguage ./syntaxes/coffeescript.json"
+ },
"contributes": {
"languages": [{
"id": "coffeescript",
@@ -13,7 +16,7 @@
"grammars": [{
"language": "coffeescript",
"scopeName": "source.coffee",
- "path": "./syntaxes/CoffeeScript.tmLanguage"
+ "path": "./syntaxes/coffeescript.json"
}],
"debuggers": [{
"type": "node",
diff --git a/extensions/coffeescript/syntaxes/CoffeeScript.tmLanguage b/extensions/coffeescript/syntaxes/CoffeeScript.tmLanguage
deleted file mode 100644
index f2588d68d3e..00000000000
--- a/extensions/coffeescript/syntaxes/CoffeeScript.tmLanguage
+++ /dev/null
@@ -1,1214 +0,0 @@
-
-
-
-
- comment
- CoffeeScript
- fileTypes
-
- coffee
- Cakefile
- coffee.erb
-
- injections
-
- string.regexp.block.coffee
-
- patterns
-
-
- include
- #interpolated_coffee
-
-
- include
- #embedded_comment
-
-
-
-
- keyEquivalent
- ^~C
- name
- CoffeeScript
- patterns
-
-
- captures
-
- 1
-
- name
- punctuation.definition.parameters.begin.coffee
-
- 2
-
- patterns
-
-
- captures
-
- 1
-
- name
- variable.parameter.function.coffee
-
- 2
-
- name
- punctuation.separator.key-value.coffee
-
- 3
-
- name
- string.quoted.double.coffee
-
- 4
-
- name
- punctuation.definition.string.begin.coffee
-
- 5
-
- name
- punctuation.definition.string.end.coffee
-
- 6
-
- name
- string.quoted.single.coffee
-
- 7
-
- name
- punctuation.definition.string.begin.coffee
-
- 8
-
- name
- punctuation.definition.string.end.coffee
-
-
- match
- (?x)
- ([^()\s,]+)
- \s+(=)\s+
- (?:
- ((")[^"]*("))
- | ((')[^']*('))
- )
-
-
- match
- [^()\s,]+
- name
- variable.parameter.function.coffee
-
-
- match
- ,
- name
- punctuation.separator.arguments.coffee
-
-
-
- 3
-
- name
- punctuation.definition.parameters.begin.coffee
-
- 4
-
- name
- storage.type.function.coffee
-
-
- comment
- match stuff like: a -> …
- match
- (\()([^()]*?)(\))\s*([=-]>)
- name
- meta.inline.function.coffee
-
-
- captures
-
- 1
-
- name
- keyword.operator.new.coffee
-
- 2
-
- name
- entity.name.type.instance.coffee
-
-
- match
- (new)\s+(\w+(?:\.\w*)*)
- name
- meta.class.instance.constructor
-
-
- begin
- '''
- beginCaptures
-
- 0
-
- name
- punctuation.definition.string.begin.coffee
-
-
- end
- '''
- endCaptures
-
- 0
-
- name
- punctuation.definition.string.end.coffee
-
-
- name
- string.unquoted.heredoc.coffee
-
-
- begin
- """
- beginCaptures
-
- 0
-
- name
- punctuation.definition.string.begin.coffee
-
-
- end
- """
- endCaptures
-
- 0
-
- name
- punctuation.definition.string.end.coffee
-
-
- name
- string.quoted.double.heredoc.coffee
- patterns
-
-
- match
- \\.
- name
- constant.character.escape.coffee
-
-
- include
- #interpolated_coffee
-
-
-
-
- begin
- `
- beginCaptures
-
- 0
-
- name
- punctuation.definition.string.begin.coffee
-
-
- end
- `
- endCaptures
-
- 0
-
- name
- punctuation.definition.string.end.coffee
-
-
- name
- string.interpolated.javascript.coffee
- patterns
-
-
- match
- (?x)
- \\
- (
- x\h{2}
- | [0-2][0-7]{0,2}
- | 3[0-6][0-7]
- | 37[0-7]?
- | [4-7][0-7]?
- | .
- )
- name
- constant.character.escape.coffee
-
-
-
-
- begin
- (?<!#)###(?!#)
- captures
-
- 0
-
- name
- punctuation.definition.comment.coffee
-
-
- end
- ###(?:[ \t]*\n)
- name
- comment.block.coffee
- patterns
-
-
- match
- @\w*
- name
- storage.type.annotation.coffeescript
-
-
-
-
- begin
- (#)(?!\{)
- beginCaptures
-
- 1
-
- name
- punctuation.definition.comment.coffee
-
-
- end
- \n
- name
- comment.line.number-sign.coffee
-
-
- begin
- /{3}
- beginCaptures
-
- 0
-
- name
- punctuation.definition.string.begin.coffee
-
-
- end
- (/{3})[imgy]{0,4}
- endCaptures
-
- 1
-
- name
- punctuation.definition.string.end.coffee
-
-
- name
- string.regexp.block.coffee
- patterns
-
-
- include
- source.js.regexp
-
-
-
-
- begin
- /(?![\s=/*+{}?])(?=.*/[igmy]{0,4}(?![a-zA-Z0-9]))
- beginCaptures
-
- 0
-
- name
- punctuation.definition.string.begin.coffee
-
-
- end
- (/)[igmy]{0,4}(?![a-zA-Z0-9])
- endCaptures
-
- 1
-
- name
- punctuation.definition.string.end.coffee
-
-
- name
- string.regexp.coffee
- patterns
-
-
- include
- source.js.regexp
-
-
-
-
- match
- (?x)
- \b
- (?<![\.\$])
- (
- break
- | by
- | catch
- | continue
- | else
- | finally
- | for
- | in
- | of
- | if
- | return
- | switch
- | then
- | throw
- | try
- | unless
- | when
- | while
- | until
- | loop
- | do
- | (?<=for)\s+own
- )
- (?!\s*:)
- \b
-
- name
- keyword.control.coffee
-
-
- match
- (?x)
- and=
- | or=
- | !
- | %
- | &
- | \^
- | \*
- | \/
- | (\-)?\-(?!>)
- | \+\+
- | \+
- | ~
- | ==
- | =(?!>)
- | !=
- | <=
- | >=
- | <<=
- | >>=
- | >>>=
- | <>
- | <
- | >
- | !
- | &&
- | \.\.(\.)?
- | \?
- | \|
- | \|\|
- | \:
- | \*=
- | (?<!\()/=
- | %=
- | \+=
- | \-=
- | &=
- | \^=
- | \b(?<![\.\$])(instanceof|new|delete|typeof|and|or|is|isnt|not|super)\b
-
- name
- keyword.operator.coffee
-
-
- captures
-
- 1
-
- name
- variable.other.assignment.coffee
-
- 4
-
- name
- punctuation.separator.key-value
-
- 5
-
- name
- keyword.operator.coffee
-
-
- match
- (?x)
- (?:
- ([a-zA-Z\$_](\w|\$|\.)*)
- \s*
- (?!\::)
- ((:)|(=)(?!>))
- (?!
- (
- \s*\(.*\)
- )?
- \s*
- ([=-]>)
- )
- )
-
-
- begin
- (?x)
- (?<=\s|^)
- ([\[\{])
- (?=.*?[\]\}]\s+[:=])
- beginCaptures
-
- 0
-
- name
- keyword.operator.coffee
-
-
- end
- ([\]\}]\s*[:=])
- endCaptures
-
- 0
-
- name
- keyword.operator.coffee
-
-
- name
- meta.variable.assignment.destructured.coffee
- patterns
-
-
- include
- #variable_name
-
-
- include
- #instance_variable
-
-
- include
- #single_quoted_string
-
-
- include
- #double_quoted_string
-
-
- include
- #numeric
-
-
-
-
- captures
-
- 1
-
- name
- entity.name.function.coffee
-
- 2
-
- name
- entity.name.function.coffee
-
- 4
-
- name
- punctuation.definition.parameters.begin.coffee
-
- 5
-
- patterns
-
-
- captures
-
- 1
-
- name
- variable.parameter.function.coffee
-
- 2
-
- name
- punctuation.separator.key-value.coffee
-
- 3
-
- name
- string.quoted.double.coffee
-
- 4
-
- name
- punctuation.definition.string.begin.coffee
-
- 5
-
- name
- punctuation.definition.string.end.coffee
-
- 6
-
- name
- string.quoted.single.coffee
-
- 7
-
- name
- punctuation.definition.string.begin.coffee
-
- 8
-
- name
- punctuation.definition.string.end.coffee
-
-
- match
- (?x)
- ([^()\s,]+)
- \s+(=)\s+
- (?:
- ((")[^"]*("))
- | ((')[^']*('))
- )
-
-
- match
- [^()\s,]+
- name
- variable.parameter.function.coffee
-
-
- match
- ,
- name
- punctuation.separator.arguments.coffee
-
-
-
- 6
-
- name
- punctuation.definition.parameters.begin.coffee
-
- 7
-
- name
- storage.type.function.coffee
-
-
- match
- (?x)
- (?<=^|\s)
- (?=@?[a-zA-Z\$_])
- (
- @?[a-zA-Z\$_](\w|\$|:|\.)*
- \s*
- (?=
- [:=]
- (\s*(\()(.*)(\)))?
- \s*
- ([=-]>)
- )
- )
-
- name
- meta.function.coffee
-
-
- match
- [=-]>
- name
- storage.type.function.coffee
-
-
- match
- (?x)
- \b
- (?<!\.)
- (true|on|yes)
- (?!\s*[:=])
- \b
- name
- constant.language.boolean.true.coffee
-
-
- match
- (?x)
- \b
- (?<!\.)
- (false|off|no)
- (?!\s*[:=])
- \b
- name
- constant.language.boolean.false.coffee
-
-
- match
- (?x)
- \b
- (?<!\.)
- null
- (?!\s*[:=])
- \b
- name
- constant.language.null.coffee
-
-
- match
- (?x)
- \b
- (?<!\.)
- (this|extends)
- (?!\s*[:=])
- \b
- name
- variable.language.coffee
-
-
- captures
-
- 1
-
- name
- storage.type.class.coffee
-
- 2
-
- name
- keyword.control.inheritance.coffee
-
- 3
-
- name
- entity.other.inherited-class.coffee
-
-
- match
- (?x)
- (class\b)
- (?:
- \s+(extends)\s+
- (@?[a-zA-Z\$\._][\w\.]*)
- )
- name
- meta.class.coffee
-
-
- captures
-
- 1
-
- name
- storage.type.class.coffee
-
- 2
-
- name
- entity.name.type.class.coffee
-
- 3
-
- name
- keyword.control.inheritance.coffee
-
- 4
-
- name
- entity.other.inherited-class.coffee
-
-
- match
- (?x)
- (class\b)
- \s+
- (@?[a-zA-Z\$_][\w\.]*)?
- (?:
- \s+(extends)\s+
- (@?[a-zA-Z\$\._][\w\.]*)
- )?
- name
- meta.class.coffee
-
-
- match
- \b(debugger|\\)\b
- name
- keyword.other.coffee
-
-
- match
- (?x)
- \b(
- Array
- | ArrayBuffer
- | Blob
- | Boolean
- | Date
- | document
- | Function
- | Int(8|16|32|64)Array
- | Math
- | Map
- | Number
- | Object
- | Proxy
- | RegExp
- | Set
- | String
- | WeakMap
- | window
- | Uint(8|16|32|64)Array
- | XMLHttpRequest
- )\b
- name
- support.class.coffee
-
-
- match
- \b(console)\b
- name
- entity.name.type.object.coffee
-
-
- match
- ((?<=console\.)(debug|warn|info|log|error|time|timeEnd|assert))\b
- name
- support.function.console.coffee
-
-
- match
- (?x)
- \b(
- decodeURI(Component)?
- | encodeURI(Component)?
- | eval
- | parse(Float|Int)
- | require
- )\b
- name
- support.function.coffee
-
-
- match
- (?x)
- (
- (?<=\.)
- (
- apply
- | call
- | concat
- | every
- | filter
- | forEach
- | from
- | hasOwnProperty
- | indexOf
- | isPrototypeOf
- | join
- | lastIndexOf
- | map
- | of
- | pop
- | propertyIsEnumerable
- | push
- | reduce(Right)?
- | reverse
- | shift
- | slice
- | some
- | sort
- | splice
- | to(Locale)?String
- | unshift
- | valueOf
- )
- )\b
- name
- support.function.method.array.coffee
-
-
- match
- ((?<=Array\.)(isArray))\b
- name
- support.function.static.array.coffee
-
-
- match
- (?x)
- (
- (?<=Object\.)
- (
- create
- | definePropert(ies|y)
- | freeze
- | getOwnProperty(Descriptors?|Names)
- | getProperty(Descriptor|Names)
- | getPrototypeOf
- | is(Extensible|Frozen|Sealed)?
- | isnt
- | keys
- | preventExtensions
- | seal
- )
- )\b
- name
- support.function.static.object.coffee
-
-
- match
- (?x)
- (
- (?<=Math\.)
- (
- abs
- | acos
- | acosh
- | asin
- | asinh
- | atan
- | atan2
- | atanh
- | ceil
- | cos
- | cosh
- | exp
- | expm1
- | floor
- | hypot
- | log
- | log10
- | log1p
- | log2
- | max
- | min
- | pow
- | random
- | round
- | sign
- | sin
- | sinh
- | sqrt
- | tan
- | tanh
- | trunc
- )
- )\b
- name
- support.function.static.math.coffee
-
-
- match
- (?x)
- (
- (?<=Number\.)
- (
- is(Finite|Integer|NaN)
- | toInteger
- )
- )\b
- name
- support.function.static.number.coffee
-
-
- match
- \b(Infinity|NaN|undefined)\b
- name
- constant.language.coffee
-
-
- match
- \;
- name
- punctuation.terminator.statement.coffee
-
-
- match
- ,[ |\t]*
- name
- meta.delimiter.object.comma.coffee
-
-
- match
- \.
- name
- meta.delimiter.method.period.coffee
-
-
- match
- \{|\}
- name
- meta.brace.curly.coffee
-
-
- match
- \(|\)
- name
- meta.brace.round.coffee
-
-
- match
- \[|\]\s*
- name
- meta.brace.square.coffee
-
-
- include
- #instance_variable
-
-
- include
- #single_quoted_string
-
-
- include
- #double_quoted_string
-
-
- include
- #numeric
-
-
- repository
-
- double_quoted_string
-
- patterns
-
-
- begin
- "
- beginCaptures
-
- 0
-
- name
- punctuation.definition.string.begin.coffee
-
-
- end
- "
- endCaptures
-
- 0
-
- name
- punctuation.definition.string.end.coffee
-
-
- name
- string.quoted.double.coffee
- patterns
-
-
- match
- (?x)
- \\(
- x\h{2}
- | [0-2][0-7]{0,2}
- | 3[0-6][0-7]
- | 37[0-7]?
- | [4-7][0-7]?
- | .
- )
- name
- constant.character.escape.coffee
-
-
- include
- #interpolated_coffee
-
-
-
-
-
- embedded_comment
-
- patterns
-
-
- captures
-
- 1
-
- name
- punctuation.definition.comment.coffee
-
-
- match
- (?<!\\)(#).*$\n?
- name
- comment.line.number-sign.coffee
-
-
-
- instance_variable
-
- patterns
-
-
- captures
-
- 1
-
- name
- punctuation.definition.variable.coffee
-
-
- match
- (@)([a-zA-Z_\$]\w*)?
- name
- variable.other.readwrite.instance.coffee
-
-
-
- interpolated_coffee
-
- patterns
-
-
- begin
- #\{
- beginCaptures
-
- 0
-
- name
- punctuation.section.embedded.begin.coffee
-
-
- contentName
- source.coffee
- end
- (\})
- endCaptures
-
- 0
-
- name
- punctuation.section.embedded.end.coffee
-
- 1
-
- name
- source.coffee
-
-
- name
- meta.embedded.line.coffee
- patterns
-
-
- include
- $self
-
-
-
-
-
- numeric
-
- patterns
-
-
- match
- (?x)
- (?<!\$)\b
- (
- (0([box])[0-9a-fA-F]+)
- | ([0-9]+(\.[0-9]+)?(e[+\-]?[0-9]+)?)
- )\b
- name
- constant.numeric.coffee
-
-
-
- single_quoted_string
-
- patterns
-
-
- begin
- '
- beginCaptures
-
- 0
-
- name
- punctuation.definition.string.begin.coffee
-
-
- end
- '
- endCaptures
-
- 0
-
- name
- punctuation.definition.string.end.coffee
-
-
- name
- string.quoted.single.coffee
- patterns
-
-
- match
- (?x)
- \\(
- x\h{2}
- | [0-2][0-7]{0,2}
- | 3[0-6][0-7]?
- | 37[0-7]?
- | [4-7][0-7]?
- | .
- )
- name
- constant.character.escape.coffee
-
-
-
-
-
- variable_name
-
- patterns
-
-
- match
- ([a-zA-Z\$_]\w*(\.\w+)*)
- name
- variable.other.assignment.coffee
-
-
-
-
- scopeName
- source.coffee
- uuid
- 5B520980-A7D5-4E10-8582-1A4C889A8DE5
-
-
\ No newline at end of file
diff --git a/extensions/coffeescript/syntaxes/coffeescript.json b/extensions/coffeescript/syntaxes/coffeescript.json
new file mode 100644
index 00000000000..2ab6ca68c3d
--- /dev/null
+++ b/extensions/coffeescript/syntaxes/coffeescript.json
@@ -0,0 +1,668 @@
+{
+ "comment": "CoffeeScript",
+ "fileTypes": [
+ "coffee",
+ "Cakefile",
+ "coffee.erb",
+ "cake",
+ "cjsx",
+ "cson",
+ "iced"
+ ],
+ "injections": {
+ "string.regexp.block.coffee": {
+ "patterns": [
+ {
+ "include": "#interpolated_coffee"
+ },
+ {
+ "include": "#embedded_comment"
+ }
+ ]
+ }
+ },
+ "keyEquivalent": "^~C",
+ "name": "CoffeeScript",
+ "patterns": [
+ {
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.parameters.begin.coffee"
+ },
+ "2": {
+ "patterns": [
+ {
+ "captures": {
+ "1": {
+ "name": "variable.parameter.function.coffee"
+ },
+ "2": {
+ "name": "punctuation.separator.key-value.coffee"
+ },
+ "3": {
+ "name": "string.quoted.double.coffee"
+ },
+ "4": {
+ "name": "punctuation.definition.string.begin.coffee"
+ },
+ "5": {
+ "name": "punctuation.definition.string.end.coffee"
+ },
+ "6": {
+ "name": "string.quoted.single.coffee"
+ },
+ "7": {
+ "name": "punctuation.definition.string.begin.coffee"
+ },
+ "8": {
+ "name": "punctuation.definition.string.end.coffee"
+ }
+ },
+ "match": "(?x)\n\t\t\t\t\t\t\t\t([^()\\s,]+)\n\t\t\t\t\t\t\t\t\\s+(=)\\s+\n\t\t\t\t\t\t\t\t(?:\n\t\t\t\t\t\t\t\t\t((\")[^\"]*(\"))\n\t\t\t\t\t\t\t\t | ((')[^']*('))\n\t\t\t\t\t\t\t\t)"
+ },
+ {
+ "match": "[^()\\s,]+",
+ "name": "variable.parameter.function.coffee"
+ },
+ {
+ "match": ",",
+ "name": "punctuation.separator.arguments.coffee"
+ }
+ ]
+ },
+ "3": {
+ "name": "punctuation.definition.parameters.begin.coffee"
+ },
+ "4": {
+ "name": "storage.type.function.coffee"
+ }
+ },
+ "comment": "match stuff like: a -> … ",
+ "match": "(\\()([^()]*?)(\\))\\s*([=-]>)",
+ "name": "meta.inline.function.coffee"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "keyword.operator.new.coffee"
+ },
+ "4": {
+ "name": "storage.type.class.coffee"
+ },
+ "6": {
+ "name": "entity.name.type.instance.coffee"
+ },
+ "7": {
+ "name": "entity.name.type.instance.coffee"
+ }
+ },
+ "match": "(new)\\s+(((class)(\\s+(\\w+(?:\\.\\w*)*))?)|(\\w+(?:\\.\\w*)*))",
+ "name": "meta.class.instance.constructor"
+ },
+ {
+ "begin": "'''",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.coffee"
+ }
+ },
+ "end": "'''",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.coffee"
+ }
+ },
+ "name": "string.unquoted.heredoc.coffee"
+ },
+ {
+ "begin": "\"\"\"",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.coffee"
+ }
+ },
+ "end": "\"\"\"",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.coffee"
+ }
+ },
+ "name": "string.quoted.double.heredoc.coffee",
+ "patterns": [
+ {
+ "match": "\\\\.",
+ "name": "constant.character.escape.coffee"
+ },
+ {
+ "include": "#interpolated_coffee"
+ }
+ ]
+ },
+ {
+ "begin": "(?=`)",
+ "end": "(?<=`)",
+ "name": "meta.embedded.line.coffee",
+ "patterns": [
+ {
+ "begin": "`",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.coffee"
+ }
+ },
+ "contentName": "source.js",
+ "end": "(`)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.coffee"
+ },
+ "1": {
+ "name": "source.js"
+ }
+ },
+ "name": "string.other.embedded.javascript.coffee",
+ "patterns": [
+ {
+ "include": "source.js"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "begin": "(?>>?|(?*%+\\-&^])?=(?!>)\n | [!%^*\\/~?:]\n | \\-?\\-(?!>)\n | \\+\\+?\n | <>\n | <\n | >\n | &&?\n | \\.\\.\\.?\n | \\|\\|?\n | \\b(?=]))\n\t\t\t\t\t(?!\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\\s*\\(.*\\)\n\t\t\t\t\t\t)?\n\t\t\t\t\t\t\\s*\n\t\t\t\t\t\t([=-]>)\n\t\t\t\t\t)\n\t\t\t\t)"
+ },
+ {
+ "begin": "(?<=\\s|^)(\\{)(?=.+?\\}\\s+[:=])",
+ "beginCaptures": {
+ "0": {
+ "name": "keyword.operator.coffee"
+ }
+ },
+ "end": "(\\}\\s*[:=])",
+ "endCaptures": {
+ "0": {
+ "name": "keyword.operator.coffee"
+ }
+ },
+ "name": "meta.variable.assignment.destructured.object.coffee",
+ "patterns": [
+ {
+ "include": "#variable_name"
+ },
+ {
+ "include": "#instance_variable"
+ },
+ {
+ "include": "#single_quoted_string"
+ },
+ {
+ "include": "#double_quoted_string"
+ },
+ {
+ "include": "#numeric"
+ }
+ ]
+ },
+ {
+ "begin": "(?<=\\s|^)(\\[)(?=.+?\\]\\s+[:=])",
+ "beginCaptures": {
+ "0": {
+ "name": "keyword.operator.coffee"
+ }
+ },
+ "end": "(\\]\\s*[:=])",
+ "endCaptures": {
+ "0": {
+ "name": "keyword.operator.coffee"
+ }
+ },
+ "name": "meta.variable.assignment.destructured.array.coffee",
+ "patterns": [
+ {
+ "include": "#variable_name"
+ },
+ {
+ "include": "#instance_variable"
+ },
+ {
+ "include": "#single_quoted_string"
+ },
+ {
+ "include": "#double_quoted_string"
+ },
+ {
+ "include": "#numeric"
+ }
+ ]
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "entity.name.function.coffee"
+ },
+ "4": {
+ "name": "punctuation.definition.parameters.begin.coffee"
+ },
+ "5": {
+ "patterns": [
+ {
+ "captures": {
+ "1": {
+ "name": "variable.parameter.function.coffee"
+ },
+ "2": {
+ "name": "punctuation.separator.key-value.coffee"
+ },
+ "3": {
+ "name": "string.quoted.double.coffee"
+ },
+ "4": {
+ "name": "punctuation.definition.string.begin.coffee"
+ },
+ "5": {
+ "name": "punctuation.definition.string.end.coffee"
+ },
+ "6": {
+ "name": "string.quoted.single.coffee"
+ },
+ "7": {
+ "name": "punctuation.definition.string.begin.coffee"
+ },
+ "8": {
+ "name": "punctuation.definition.string.end.coffee"
+ }
+ },
+ "match": "(?x)\n\t\t\t\t\t\t\t\t([^()\\s,]+)\n\t\t\t\t\t\t\t\t\\s+(=)\\s+\n\t\t\t\t\t\t\t\t(?:\n\t\t\t\t\t\t\t\t\t((\")[^\"]*(\"))\n\t\t\t\t\t\t\t\t | ((')[^']*('))\n\t\t\t\t\t\t\t\t)"
+ },
+ {
+ "match": "[^()\\s,]+",
+ "name": "variable.parameter.function.coffee"
+ },
+ {
+ "match": ",",
+ "name": "punctuation.separator.arguments.coffee"
+ }
+ ]
+ },
+ "6": {
+ "name": "punctuation.definition.parameters.begin.coffee"
+ },
+ "7": {
+ "name": "storage.type.function.coffee"
+ }
+ },
+ "match": "(?x)\n\t\t\t\t(?<=^|\\s)\n\t\t\t\t(?=@?[a-zA-Z\\$_])\n\t\t\t\t(\n\t\t\t\t\t@?[a-zA-Z\\$_](\\w|\\$|:|\\.)*\n\t\t\t\t\t\\s*\n\t\t\t\t\t(?=\n\t\t\t\t\t\t[:=]\n\t\t\t\t\t\t(\\s*(\\()(.*)(\\)))?\n\t\t\t\t\t\t\\s*\n\t\t\t\t\t\t([=-]>)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t",
+ "name": "meta.function.coffee"
+ },
+ {
+ "match": "(?x)\n\t\t\t\t\\b\n\t\t\t\t(?|\\-\\d|\\[|\\{|\"|'))|(?=\\())",
+ "name": "entity.name.function.coffee"
+ },
+ {
+ "match": "[=-]>",
+ "name": "storage.type.function.coffee"
+ },
+ {
+ "match": "(?x)\n\t\t\t\t\\b\n\t\t\t\t(? The
let colorsDecorationType = window.createTextEditorDecorationType(decorationType);
disposables.push(colorsDecorationType);
- let pendingUpdateRequests : { [key:string]: NodeJS.Timer; } = {};
+ let pendingUpdateRequests: { [key: string]: NodeJS.Timer; } = {};
// we care about all visible editors
window.visibleTextEditors.forEach(editor => {
diff --git a/extensions/css/client/src/cssMain.ts b/extensions/css/client/src/cssMain.ts
index 64e05cc5d1d..59fe3a74bb4 100644
--- a/extensions/css/client/src/cssMain.ts
+++ b/extensions/css/client/src/cssMain.ts
@@ -6,9 +6,9 @@
import * as path from 'path';
-import {languages, window, commands, ExtensionContext} from 'vscode';
-import {LanguageClient, LanguageClientOptions, ServerOptions, TransportKind, RequestType, Range, TextEdit, Protocol2Code} from 'vscode-languageclient';
-import {activateColorDecorations} from './colorDecorators';
+import { languages, window, commands, ExtensionContext } from 'vscode';
+import { LanguageClient, LanguageClientOptions, ServerOptions, TransportKind, RequestType, Range, TextEdit, Protocol2Code } from 'vscode-languageclient';
+import { activateColorDecorations } from './colorDecorators';
import * as nls from 'vscode-nls';
let localize = nls.loadMessageBundle();
diff --git a/extensions/css/server/src/cssServerMain.ts b/extensions/css/server/src/cssServerMain.ts
index 751be2baefd..32a6523a751 100644
--- a/extensions/css/server/src/cssServerMain.ts
+++ b/extensions/css/server/src/cssServerMain.ts
@@ -9,8 +9,8 @@ import {
TextDocuments, TextDocument, InitializeParams, InitializeResult, RequestType
} from 'vscode-languageserver';
-import {getCSSLanguageService, getSCSSLanguageService, getLESSLanguageService, LanguageSettings, LanguageService, Stylesheet} from 'vscode-css-languageservice';
-import {getLanguageModelCache} from './languageModelCache';
+import { getCSSLanguageService, getSCSSLanguageService, getLESSLanguageService, LanguageSettings, LanguageService, Stylesheet } from 'vscode-css-languageservice';
+import { getLanguageModelCache } from './languageModelCache';
namespace ColorSymbolRequest {
export const type: RequestType = { get method() { return 'css/colorSymbols'; } };
@@ -62,7 +62,7 @@ connection.onInitialize((params: InitializeParams): InitializeResult => {
};
});
-let languageServices : { [id:string]: LanguageService} = {
+let languageServices: { [id: string]: LanguageService } = {
css: getCSSLanguageService(),
scss: getSCSSLanguageService(),
less: getLESSLanguageService()
@@ -90,7 +90,7 @@ function updateConfiguration(settings: Settings) {
documents.all().forEach(triggerValidation);
}
-let pendingValidationRequests : { [uri:string]: NodeJS.Timer } = {};
+let pendingValidationRequests: { [uri: string]: NodeJS.Timer } = {};
const validationDelayMs = 200;
// The content of a text document has changed. This event is emitted
diff --git a/extensions/css/server/src/languageModelCache.ts b/extensions/css/server/src/languageModelCache.ts
index dce68bed9a3..b12f77b52a6 100644
--- a/extensions/css/server/src/languageModelCache.ts
+++ b/extensions/css/server/src/languageModelCache.ts
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
-import {TextDocument} from 'vscode-languageserver';
+import { TextDocument } from 'vscode-languageserver';
export interface LanguageModelCache {
get(document: TextDocument): T;
@@ -12,8 +12,8 @@ export interface LanguageModelCache {
dispose(): void;
}
-export function getLanguageModelCache(maxEntries: number, cleanupIntervalTimeInSec: number, parse: (document: TextDocument) => T) : LanguageModelCache {
- let languageModels: { [uri:string]: {version:number, languageId: string, cTime: number, languageModel: T}} = {};
+export function getLanguageModelCache(maxEntries: number, cleanupIntervalTimeInSec: number, parse: (document: TextDocument) => T): LanguageModelCache {
+ let languageModels: { [uri: string]: { version: number, languageId: string, cTime: number, languageModel: T } } = {};
let nModels = 0;
let cleanupInterval = void 0;
@@ -32,7 +32,7 @@ export function getLanguageModelCache(maxEntries: number, cleanupIntervalTime
}
return {
- get(document: TextDocument) : T {
+ get(document: TextDocument): T {
let version = document.version;
let languageId = document.languageId;
let languageModelInfo = languageModels[document.uri];
@@ -41,7 +41,7 @@ export function getLanguageModelCache(maxEntries: number, cleanupIntervalTime
return languageModelInfo.languageModel;
}
let languageModel = parse(document);
- languageModels[document.uri] = { languageModel, version, languageId, cTime: Date.now()};
+ languageModels[document.uri] = { languageModel, version, languageId, cTime: Date.now() };
if (!languageModelInfo) {
nModels++;
}
diff --git a/extensions/css/server/src/typings/promise.d.ts b/extensions/css/server/src/typings/promise.d.ts
index 31b97cb9580..925c943df50 100644
--- a/extensions/css/server/src/typings/promise.d.ts
+++ b/extensions/css/server/src/typings/promise.d.ts
@@ -31,8 +31,8 @@ interface Thenable {
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of which ever callback is executed.
*/
- then(onfulfilled?: (value: R) => TResult | Thenable, onrejected?: (reason: any) => TResult | Thenable): Thenable;
- then(onfulfilled?: (value: R) => TResult | Thenable, onrejected?: (reason: any) => void): Thenable;
+ then(onfulfilled?: (value: R) => TResult | Thenable, onrejected?: (reason: any) => TResult | Thenable): Thenable;
+ then(onfulfilled?: (value: R) => TResult | Thenable, onrejected?: (reason: any) => void): Thenable;
}
/**
@@ -45,15 +45,15 @@ interface Promise extends Thenable {
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of which ever callback is executed.
*/
- then(onfulfilled?: (value: T) => TResult | Thenable, onrejected?: (reason: any) => TResult | Thenable): Promise;
- then(onfulfilled?: (value: T) => TResult | Thenable, onrejected?: (reason: any) => void): Promise;
+ then(onfulfilled?: (value: T) => TResult | Thenable, onrejected?: (reason: any) => TResult | Thenable): Promise;
+ then(onfulfilled?: (value: T) => TResult | Thenable, onrejected?: (reason: any) => void): Promise;
/**
* Attaches a callback for only the rejection of the Promise.
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of the callback.
*/
- catch(onrejected?: (reason: any) => T | Thenable): Promise;
+ catch(onrejected?: (reason: any) => T | Thenable): Promise;
}
interface PromiseConstructor {
@@ -63,7 +63,7 @@ interface PromiseConstructor {
* a resolve callback used resolve the promise with a value or the result of another promise,
* and a reject callback used to reject the promise with a provided reason or error.
*/
- new (executor: (resolve: (value?: T | Thenable) => void, reject: (reason?: any) => void) => void): Promise;
+ new (executor: (resolve: (value?: T | Thenable) => void, reject: (reason?: any) => void) => void): Promise;
/**
* Creates a Promise that is resolved with an array of results when all of the provided Promises
@@ -71,7 +71,7 @@ interface PromiseConstructor {
* @param values An array of Promises.
* @returns A new Promise.
*/
- all(values: Array>): Promise;
+ all(values: Array>): Promise;
/**
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
@@ -79,34 +79,34 @@ interface PromiseConstructor {
* @param values An array of Promises.
* @returns A new Promise.
*/
- race(values: Array>): Promise;
+ race(values: Array>): Promise;
/**
* Creates a new rejected promise for the provided reason.
* @param reason The reason the promise was rejected.
* @returns A new rejected Promise.
*/
- reject(reason: any): Promise;
+ reject(reason: any): Promise;
/**
* Creates a new rejected promise for the provided reason.
* @param reason The reason the promise was rejected.
* @returns A new rejected Promise.
*/
- reject(reason: any): Promise;
+ reject(reason: any): Promise;
/**
* Creates a new resolved promise for the provided value.
* @param value A promise.
* @returns A promise whose internal state matches the provided promise.
*/
- resolve(value: T | Thenable): Promise;
+ resolve(value: T | Thenable): Promise;
/**
* Creates a new resolved promise .
* @returns A resolved promise.
*/
- resolve(): Promise;
+ resolve(): Promise;
}
declare var Promise: PromiseConstructor;
diff --git a/extensions/git/README.md b/extensions/git/README.md
new file mode 100644
index 00000000000..df55c13765d
--- /dev/null
+++ b/extensions/git/README.md
@@ -0,0 +1,65 @@
+# git README
+
+This is the README for your extension "git". After writing up a brief description, we recommend including the following sections.
+
+## Features
+
+Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file.
+
+For example if there is an image subfolder under your extension project workspace:
+
+\!\[feature X\]\(images/feature-x.png\)
+
+> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow.
+
+## Requirements
+
+If you have any requirements or dependencies, add a section describing those and how to install and configure them.
+
+## Extension Settings
+
+Include if your extension adds any VS Code settings through the `contributes.configuration` extension point.
+
+For example:
+
+This extension contributes the following settings:
+
+* `myExtension.enable`: enable/disable this extension
+* `myExtension.thing`: set to `blah` to do something
+
+## Known Issues
+
+Calling out known issues can help limit users opening duplicate issues against your extension.
+
+## Release Notes
+
+Users appreciate release notes as you update your extension.
+
+### 1.0.0
+
+Initial release of ...
+
+### 1.0.1
+
+Fixed issue #.
+
+### 1.1.0
+
+Added features X, Y, and Z.
+
+-----------------------------------------------------------------------------------------------------------
+
+## Working with Markdown
+
+**Note:** You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:
+
+* Split the editor (`Cmd+\` on OSX or `Ctrl+\` on Windows and Linux)
+* Toggle preview (`Shift+CMD+V` on OSX or `Shift+Ctrl+V` on Windows and Linux)
+* Press `Ctrl+Space` (Windows, Linux) or `Cmd+Space` (OSX) to see a list of Markdown snippets
+
+### For more information
+
+* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown)
+* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/)
+
+**Enjoy!**
\ No newline at end of file
diff --git a/extensions/git/package.json b/extensions/git/package.json
index 9c1a593b4fc..97460332837 100644
--- a/extensions/git/package.json
+++ b/extensions/git/package.json
@@ -1,34 +1,51 @@
{
- "name": "gitmode",
- "version": "0.1.0",
- "publisher": "vscode",
- "engines": { "vscode": "*" },
- "contributes": {
- "languages": [
- {
- "id": "git-commit",
- "aliases": ["Git Commit Message", "git-commit"],
- "filenames": ["COMMIT_EDITMSG", "MERGE_MSG"],
- "configuration": "./git-commit.language-configuration.json"
- },
- {
- "id": "git-rebase",
- "aliases": ["Git Rebase Message", "git-rebase"],
- "filenames": ["git-rebase-todo"],
- "configuration": "./git-rebase.language-configuration.json"
- }
- ],
- "grammars": [
- {
- "language": "git-commit",
- "scopeName": "text.git-commit",
- "path": "./syntaxes/git-commit.tmLanguage"
- },
- {
- "language": "git-rebase",
- "scopeName": "text.git-rebase",
- "path": "./syntaxes/git-rebase.tmLanguage"
- }
- ]
- }
+ "name": "git",
+ "displayName": "git",
+ "description": "Git",
+ "version": "0.0.1",
+ "publisher": "joaomoreno",
+ "engines": {
+ "vscode": "^1.5.0"
+ },
+ "categories": [
+ "Other"
+ ],
+ "activationEvents": [
+ "*"
+ ],
+ "main": "./out/extension",
+ "contributes": {
+ "commands": [],
+ "languages": [
+ {
+ "id": "git-commit",
+ "aliases": ["Git Commit Message", "git-commit"],
+ "filenames": ["COMMIT_EDITMSG", "MERGE_MSG"],
+ "configuration": "./git-commit.language-configuration.json"
+ },
+ {
+ "id": "git-rebase",
+ "aliases": ["Git Rebase Message", "git-rebase"],
+ "filenames": ["git-rebase-todo"],
+ "configuration": "./git-rebase.language-configuration.json"
+ }
+ ],
+ "grammars": [
+ {
+ "language": "git-commit",
+ "scopeName": "text.git-commit",
+ "path": "./syntaxes/git-commit.tmLanguage"
+ },
+ {
+ "language": "git-rebase",
+ "scopeName": "text.git-rebase",
+ "path": "./syntaxes/git-rebase.tmLanguage"
+ }
+ ]
+ },
+ "scripts": {
+ "vscode:prepublish": "tsc -p ./",
+ "compile": "tsc -watch -p ./",
+ "postinstall": "node ./node_modules/vscode/bin/install"
+ }
}
\ No newline at end of file
diff --git a/extensions/git/src/dirtydiff.ts b/extensions/git/src/dirtydiff.ts
new file mode 100644
index 00000000000..3cce6c700eb
--- /dev/null
+++ b/extensions/git/src/dirtydiff.ts
@@ -0,0 +1,81 @@
+/*---------------------------------------------------------------------------------------------
+ * 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 { Event, TextEditor, window, workspace } from 'vscode';
+import { IDisposable, dispose, mapEvent } from './util';
+
+type TextEditorsEvent = Event;
+
+type IDecoration = void;
+
+class ResourceDecorator implements IDisposable {
+
+ private textEditors: TextEditor[] = [];
+
+ constructor(private path: string) {
+ // console.log(`creating: ${this.path}`);
+ }
+
+ add(textEditor: TextEditor): void {
+ this.remove(textEditor);
+ this.textEditors.push(textEditor);
+ }
+
+ remove(textEditor: TextEditor): void {
+ this.textEditors = this.textEditors.filter(e => e !== textEditor);
+ }
+
+ get count(): number {
+ return this.textEditors.length;
+ }
+
+ dispose(): void {
+ // console.log(`disposing: ${this.path}`);
+ }
+}
+
+export class DirtyDiff implements IDisposable {
+
+ private textEditors: { editor: TextEditor; path: string; }[] = [];
+ private decorators: { [uri: string]: ResourceDecorator } = Object.create(null);
+ private disposables: IDisposable[] = [];
+
+ constructor() {
+ const onVisibleTextEditorsChange = mapEvent(window.onDidChangeActiveTextEditor, () => window.visibleTextEditors);
+ onVisibleTextEditorsChange(this.onDidVisibleEditorsChange, this, this.disposables);
+ this.onDidVisibleEditorsChange(window.visibleTextEditors);
+
+ const watcher = workspace.createFileSystemWatcher('**');
+
+ this.disposables.push(watcher);
+ }
+
+ private onDidVisibleEditorsChange(textEditors: TextEditor[]) {
+ const added = textEditors.filter(a => this.textEditors.every(({ editor }) => a !== editor)).map(editor => ({ editor, path: workspace.asRelativePath(editor.document.uri) }));
+ const removed = this.textEditors.filter(({ editor }) => textEditors.every(b => editor !== b));
+ this.textEditors = textEditors.map(editor => ({ editor, path: workspace.asRelativePath(editor.document.uri) }));
+
+ removed.forEach(({ editor, path }) => {
+ const decorator = this.decorators[path];
+ decorator.remove(editor);
+
+ if (decorator.count === 0) {
+ decorator.dispose();
+ delete this.decorators[path];
+ }
+ });
+
+ added.forEach(({ editor, path }) => {
+ const decorator = this.decorators[path] || (this.decorators[path] = new ResourceDecorator(path));
+ decorator.add(editor);
+ });
+ }
+
+ dispose(): void {
+ this.disposables = dispose(this.disposables);
+ }
+}
\ No newline at end of file
diff --git a/src/vs/languages/razor/common/vsxmlTokenTypes.ts b/extensions/git/src/extension.ts
similarity index 61%
rename from src/vs/languages/razor/common/vsxmlTokenTypes.ts
rename to extensions/git/src/extension.ts
index ee4602cdb9c..adf9e441941 100644
--- a/src/vs/languages/razor/common/vsxmlTokenTypes.ts
+++ b/extensions/git/src/extension.ts
@@ -2,7 +2,18 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
+
'use strict';
-export const TOKEN_VALUE = 'support.property-value.constant.other.json';
-export const TOKEN_KEY = 'support.type.property-name.json';
\ No newline at end of file
+import { ExtensionContext } from 'vscode';
+import { DirtyDiff } from './dirtydiff';
+
+export function activate(context: ExtensionContext) {
+ context.subscriptions.push(
+ new DirtyDiff()
+ );
+}
+
+export function deactivate() {
+
+}
\ No newline at end of file
diff --git a/src/vs/languages/handlebars/common/handlebarsTokenTypes.ts b/extensions/git/src/typings/ref.d.ts
similarity index 54%
rename from src/vs/languages/handlebars/common/handlebarsTokenTypes.ts
rename to extensions/git/src/typings/ref.d.ts
index 2a04f51cc9a..95498a3fb9c 100644
--- a/src/vs/languages/handlebars/common/handlebarsTokenTypes.ts
+++ b/extensions/git/src/typings/ref.d.ts
@@ -2,9 +2,9 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
-'use strict';
-export const EMBED = 'punctuation.expression.unescaped.handlebars';
-export const EMBED_UNESCAPED = 'punctuation.expression.handlebars';
-export const KEYWORD = 'keyword.helper.handlebars';
-export const VARIABLE = 'variable.parameter.handlebars';
\ No newline at end of file
+///
+///
+///
+///
+///
\ No newline at end of file
diff --git a/extensions/git/src/util.ts b/extensions/git/src/util.ts
new file mode 100644
index 00000000000..756c554374c
--- /dev/null
+++ b/extensions/git/src/util.ts
@@ -0,0 +1,62 @@
+/*---------------------------------------------------------------------------------------------
+ * 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 { Event } from 'vscode';
+
+export interface IDisposable {
+ dispose(): void;
+}
+
+export function dispose(disposables: T[]): T[] {
+ disposables.forEach(d => d.dispose());
+ return [];
+}
+
+export function combinedDisposable(disposables: IDisposable[]): IDisposable {
+ return { dispose: () => dispose(disposables) };
+}
+
+export function mapEvent(event: Event, map: (i: I) => O): Event {
+ return (listener, thisArgs = null, disposables?) => event(i => listener.call(thisArgs, map(i)), null, disposables);
+}
+
+export function filterEvent(event: Event, filter: (e: T) => boolean): Event {
+ return (listener, thisArgs = null, disposables?) => event(e => filter(e) && listener.call(thisArgs, e), null, disposables);
+}
+
+export function any(...events: Event[]): Event {
+ return (listener, thisArgs = null, disposables?) => combinedDisposable(events.map(event => event(i => listener.call(thisArgs, i), disposables)));
+}
+
+interface IListener {
+ (e: T): any;
+}
+
+export class Emitter {
+
+ private listeners: IListener[];
+
+ get event(): Event {
+ return (listener: IListener, thisArgs = null, disposables?: IDisposable[]) => {
+ const _listener = thisArgs ? listener.bind(thisArgs) : listener;
+ this.listeners.push(_listener);
+
+ const dispose = () => { this.listeners = this.listeners.filter(l => l !== _listener); };
+ const result = { dispose };
+
+ if (disposables) {
+ disposables.push(result);
+ }
+
+ return result;
+ };
+ }
+
+ fire(e: T = null): void {
+
+ }
+}
\ No newline at end of file
diff --git a/extensions/git/test/extension.test.ts b/extensions/git/test/extension.test.ts
new file mode 100644
index 00000000000..10747590799
--- /dev/null
+++ b/extensions/git/test/extension.test.ts
@@ -0,0 +1,18 @@
+/*---------------------------------------------------------------------------------------------
+ * 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 * as vscode from 'vscode';
+// import * as myExtension from '../src/extension';
+
+// Defines a Mocha test suite to group tests of similar kind together
+// suite("Extension Tests", () => {
+
+// // Defines a Mocha unit test
+// test("Something 1", () => {
+// assert.equal(-1, [1, 2, 3].indexOf(5));
+// assert.equal(-1, [1, 2, 3].indexOf(0));
+// });
+// });
\ No newline at end of file
diff --git a/src/vs/languages/razor/common/razorTokenTypes.ts b/extensions/git/test/index.ts
similarity index 71%
rename from src/vs/languages/razor/common/razorTokenTypes.ts
rename to extensions/git/test/index.ts
index e0e0afe7b89..2ece79acc5c 100644
--- a/src/vs/languages/razor/common/razorTokenTypes.ts
+++ b/extensions/git/test/index.ts
@@ -2,6 +2,12 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
-'use strict';
-export const EMBED_CS = 'support.function.cshtml';
+const testRunner = require('vscode/lib/testrunner');
+
+testRunner.configure({
+ ui: 'tdd',
+ useColors: true
+});
+
+module.exports = testRunner;
\ No newline at end of file
diff --git a/extensions/git/tsconfig.json b/extensions/git/tsconfig.json
new file mode 100644
index 00000000000..8cb16334377
--- /dev/null
+++ b/extensions/git/tsconfig.json
@@ -0,0 +1,11 @@
+{
+ "compilerOptions": {
+ "noLib": true,
+ "target": "es5",
+ "module": "commonjs",
+ "outDir": "./out"
+ },
+ "exclude": [
+ "node_modules"
+ ]
+}
\ No newline at end of file
diff --git a/extensions/git/vsc-extension-quickstart.md b/extensions/git/vsc-extension-quickstart.md
new file mode 100644
index 00000000000..6cdea2b5dad
--- /dev/null
+++ b/extensions/git/vsc-extension-quickstart.md
@@ -0,0 +1,33 @@
+# Welcome to your first VS Code Extension
+
+## What's in the folder
+* This folder contains all of the files necessary for your extension
+* `package.json` - this is the manifest file in which you declare your extension and command.
+The sample plugin registers a command and defines its title and command name. With this information
+VS Code can show the command in the command palette. It doesn’t yet need to load the plugin.
+* `src/extension.ts` - this is the main file where you will provide the implementation of your command.
+The file exports one function, `activate`, which is called the very first time your extension is
+activated (in this case by executing the command). Inside the `activate` function we call `registerCommand`.
+We pass the function containing the implementation of the command as the second parameter to
+`registerCommand`.
+
+## Get up and running straight away
+* press `F5` to open a new window with your extension loaded
+* run your command from the command palette by pressing (`Ctrl+Shift+P` or `Cmd+Shift+P` on Mac) and typing `Hello World`
+* set breakpoints in your code inside `src/extension.ts` to debug your extension
+* find output from your extension in the debug console
+
+## Make changes
+* you can relaunch the extension from the debug toolbar after changing code in `src/extension.ts`
+* you can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes
+
+## Explore the API
+* you can open the full set of our API when you open the file `node_modules/vscode/vscode.d.ts`
+
+## Run tests
+* open the debug viewlet (`Ctrl+Shift+D` or `Cmd+Shift+D` on Mac) and from the launch configuration dropdown pick `Launch Tests`
+* press `F5` to run the tests in a new window with your extension loaded
+* see the output of the test result in the debug console
+* make changes to `test/extension.test.ts` or create new test files inside the `test` folder
+ * by convention, the test runner will only consider files matching the name pattern `**.test.ts`
+ * you can create folders inside the `test` folder to structure your tests any way you want
\ No newline at end of file
diff --git a/extensions/html/client/src/htmlEmptyTagsShared.ts b/extensions/html/client/src/htmlEmptyTagsShared.ts
index 250fa18be0e..872b3880aba 100644
--- a/extensions/html/client/src/htmlEmptyTagsShared.ts
+++ b/extensions/html/client/src/htmlEmptyTagsShared.ts
@@ -3,4 +3,4 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
-export const EMPTY_ELEMENTS:string[] = ['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'menuitem', 'meta', 'param', 'source', 'track', 'wbr'];
+export const EMPTY_ELEMENTS: string[] = ['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'menuitem', 'meta', 'param', 'source', 'track', 'wbr'];
diff --git a/extensions/html/client/src/htmlMain.ts b/extensions/html/client/src/htmlMain.ts
index 2273bc99c8d..11e09c8d0ec 100644
--- a/extensions/html/client/src/htmlMain.ts
+++ b/extensions/html/client/src/htmlMain.ts
@@ -6,9 +6,9 @@
import * as path from 'path';
-import {languages, ExtensionContext, IndentAction} from 'vscode';
-import {LanguageClient, LanguageClientOptions, ServerOptions, TransportKind} from 'vscode-languageclient';
-import {EMPTY_ELEMENTS} from './htmlEmptyTagsShared';
+import { languages, ExtensionContext, IndentAction } from 'vscode';
+import { LanguageClient, LanguageClientOptions, ServerOptions, TransportKind } from 'vscode-languageclient';
+import { EMPTY_ELEMENTS } from './htmlEmptyTagsShared';
import * as nls from 'vscode-nls';
let localize = nls.loadMessageBundle();
@@ -50,7 +50,7 @@ export function activate(context: ExtensionContext) {
languages.setLanguageConfiguration('html', {
wordPattern: /("(?:[^\\\"]*(?:\\.)?)*"?)|('(?:[^\\\']*(?:\\.)?)*'?)|[^\s<>={}\[\],]+/,
- onEnterRules:[
+ onEnterRules: [
{
beforeText: new RegExp(`<(?!(?:${EMPTY_ELEMENTS.join('|')}))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`, 'i'),
afterText: /^<\/([_:\w][_:\w-.\d]*)\s*>$/i,
@@ -65,7 +65,7 @@ export function activate(context: ExtensionContext) {
languages.setLanguageConfiguration('handlebars', {
wordPattern: /("(?:[^\\\"]*(?:\\.)?)*"?)|('(?:[^\\\']*(?:\\.)?)*'?)|[^\s<>={}\[\],]+/,
- onEnterRules:[
+ onEnterRules: [
{
beforeText: new RegExp(`<(?!(?:${EMPTY_ELEMENTS.join('|')}))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`, 'i'),
afterText: /^<\/([_:\w][_:\w-.\d]*)\s*>$/i,
@@ -80,7 +80,7 @@ export function activate(context: ExtensionContext) {
languages.setLanguageConfiguration('razor', {
wordPattern: /("(?:[^\\\"]*(?:\\.)?)*"?)|('(?:[^\\\']*(?:\\.)?)*'?)|[^\s<>={}\[\],]+/,
- onEnterRules:[
+ onEnterRules: [
{
beforeText: new RegExp(`<(?!(?:${EMPTY_ELEMENTS.join('|')}))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`, 'i'),
afterText: /^<\/([_:\w][_:\w-.\d]*)\s*>$/i,
diff --git a/extensions/html/server/npm-shrinkwrap.json b/extensions/html/server/npm-shrinkwrap.json
index 64aeac42218..cda02f587b9 100644
--- a/extensions/html/server/npm-shrinkwrap.json
+++ b/extensions/html/server/npm-shrinkwrap.json
@@ -3,9 +3,9 @@
"version": "1.0.0",
"dependencies": {
"vscode-html-languageservice": {
- "version": "1.0.0-next.4",
+ "version": "1.0.0-next.5",
"from": "vscode-html-languageservice@next",
- "resolved": "https://registry.npmjs.org/vscode-html-languageservice/-/vscode-html-languageservice-1.0.0-next.4.tgz"
+ "resolved": "https://registry.npmjs.org/vscode-html-languageservice/-/vscode-html-languageservice-1.0.0-next.5.tgz"
},
"vscode-jsonrpc": {
"version": "2.4.0",
diff --git a/extensions/html/server/package.json b/extensions/html/server/package.json
index 24f4e6e6720..a6a02e95e00 100644
--- a/extensions/html/server/package.json
+++ b/extensions/html/server/package.json
@@ -8,7 +8,7 @@
"node": "*"
},
"dependencies": {
- "vscode-html-languageservice": "^1.0.0-next.4",
+ "vscode-html-languageservice": "^1.0.0-next.5",
"vscode-languageserver": "^2.6.0-next.3",
"vscode-nls": "^1.0.4"
},
diff --git a/extensions/html/server/src/htmlServerMain.ts b/extensions/html/server/src/htmlServerMain.ts
index 89fc06408e2..40c1cbe8746 100644
--- a/extensions/html/server/src/htmlServerMain.ts
+++ b/extensions/html/server/src/htmlServerMain.ts
@@ -4,10 +4,11 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
-import {createConnection, IConnection, TextDocuments, InitializeParams, InitializeResult} from 'vscode-languageserver';
+import { createConnection, IConnection, TextDocuments, InitializeParams, InitializeResult } from 'vscode-languageserver';
-import {HTMLDocument, getLanguageService, CompletionConfiguration, HTMLFormatConfiguration} from 'vscode-html-languageservice';
-import {getLanguageModelCache} from './languageModelCache';
+import { HTMLDocument, getLanguageService, CompletionConfiguration, HTMLFormatConfiguration, DocumentContext } from 'vscode-html-languageservice';
+import { getLanguageModelCache } from './languageModelCache';
+import * as url from 'url';
import * as nls from 'vscode-nls';
@@ -116,7 +117,8 @@ connection.onDocumentRangeFormatting(formatParams => {
connection.onDocumentLinks(documentLinkParam => {
let document = documents.get(documentLinkParam.textDocument.uri);
- return languageService.findDocumentLinks(document, workspacePath);
+ let documentContext: DocumentContext = { resolveReference: ref => url.resolve(document.uri, ref) };
+ return languageService.findDocumentLinks(document, documentContext);
});
diff --git a/extensions/html/server/src/languageModelCache.ts b/extensions/html/server/src/languageModelCache.ts
index dce68bed9a3..b12f77b52a6 100644
--- a/extensions/html/server/src/languageModelCache.ts
+++ b/extensions/html/server/src/languageModelCache.ts
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
-import {TextDocument} from 'vscode-languageserver';
+import { TextDocument } from 'vscode-languageserver';
export interface LanguageModelCache {
get(document: TextDocument): T;
@@ -12,8 +12,8 @@ export interface LanguageModelCache {
dispose(): void;
}
-export function getLanguageModelCache(maxEntries: number, cleanupIntervalTimeInSec: number, parse: (document: TextDocument) => T) : LanguageModelCache {
- let languageModels: { [uri:string]: {version:number, languageId: string, cTime: number, languageModel: T}} = {};
+export function getLanguageModelCache(maxEntries: number, cleanupIntervalTimeInSec: number, parse: (document: TextDocument) => T): LanguageModelCache {
+ let languageModels: { [uri: string]: { version: number, languageId: string, cTime: number, languageModel: T } } = {};
let nModels = 0;
let cleanupInterval = void 0;
@@ -32,7 +32,7 @@ export function getLanguageModelCache(maxEntries: number, cleanupIntervalTime
}
return {
- get(document: TextDocument) : T {
+ get(document: TextDocument): T {
let version = document.version;
let languageId = document.languageId;
let languageModelInfo = languageModels[document.uri];
@@ -41,7 +41,7 @@ export function getLanguageModelCache(maxEntries: number, cleanupIntervalTime
return languageModelInfo.languageModel;
}
let languageModel = parse(document);
- languageModels[document.uri] = { languageModel, version, languageId, cTime: Date.now()};
+ languageModels[document.uri] = { languageModel, version, languageId, cTime: Date.now() };
if (!languageModelInfo) {
nModels++;
}
diff --git a/extensions/html/server/src/typings/promise.d.ts b/extensions/html/server/src/typings/promise.d.ts
index 31b97cb9580..925c943df50 100644
--- a/extensions/html/server/src/typings/promise.d.ts
+++ b/extensions/html/server/src/typings/promise.d.ts
@@ -31,8 +31,8 @@ interface Thenable {
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of which ever callback is executed.
*/
- then(onfulfilled?: (value: R) => TResult | Thenable, onrejected?: (reason: any) => TResult | Thenable): Thenable;
- then(onfulfilled?: (value: R) => TResult | Thenable, onrejected?: (reason: any) => void): Thenable;
+ then(onfulfilled?: (value: R) => TResult | Thenable, onrejected?: (reason: any) => TResult | Thenable): Thenable;
+ then(onfulfilled?: (value: R) => TResult | Thenable, onrejected?: (reason: any) => void): Thenable;
}
/**
@@ -45,15 +45,15 @@ interface Promise extends Thenable {
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of which ever callback is executed.
*/
- then(onfulfilled?: (value: T) => TResult | Thenable, onrejected?: (reason: any) => TResult | Thenable): Promise;
- then(onfulfilled?: (value: T) => TResult | Thenable, onrejected?: (reason: any) => void): Promise;
+ then(onfulfilled?: (value: T) => TResult | Thenable, onrejected?: (reason: any) => TResult | Thenable): Promise;
+ then(onfulfilled?: (value: T) => TResult | Thenable, onrejected?: (reason: any) => void): Promise;
/**
* Attaches a callback for only the rejection of the Promise.
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of the callback.
*/
- catch(onrejected?: (reason: any) => T | Thenable): Promise;
+ catch(onrejected?: (reason: any) => T | Thenable): Promise;
}
interface PromiseConstructor {
@@ -63,7 +63,7 @@ interface PromiseConstructor {
* a resolve callback used resolve the promise with a value or the result of another promise,
* and a reject callback used to reject the promise with a provided reason or error.
*/
- new (executor: (resolve: (value?: T | Thenable) => void, reject: (reason?: any) => void) => void): Promise;
+ new (executor: (resolve: (value?: T | Thenable) => void, reject: (reason?: any) => void) => void): Promise;
/**
* Creates a Promise that is resolved with an array of results when all of the provided Promises
@@ -71,7 +71,7 @@ interface PromiseConstructor {
* @param values An array of Promises.
* @returns A new Promise.
*/
- all(values: Array>): Promise;
+ all(values: Array>): Promise;
/**
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
@@ -79,34 +79,34 @@ interface PromiseConstructor {
* @param values An array of Promises.
* @returns A new Promise.
*/
- race(values: Array>): Promise;
+ race(values: Array>): Promise;
/**
* Creates a new rejected promise for the provided reason.
* @param reason The reason the promise was rejected.
* @returns A new rejected Promise.
*/
- reject(reason: any): Promise;
+ reject(reason: any): Promise;
/**
* Creates a new rejected promise for the provided reason.
* @param reason The reason the promise was rejected.
* @returns A new rejected Promise.
*/
- reject(reason: any): Promise;
+ reject(reason: any): Promise;
/**
* Creates a new resolved promise for the provided value.
* @param value A promise.
* @returns A promise whose internal state matches the provided promise.
*/
- resolve(value: T | Thenable): Promise;
+ resolve(value: T | Thenable): Promise;
/**
* Creates a new resolved promise .
* @returns A resolved promise.
*/
- resolve(): Promise;
+ resolve(): Promise;
}
declare var Promise: PromiseConstructor;
diff --git a/extensions/java/package.json b/extensions/java/package.json
index 13e31ed33d4..07e901cc20f 100644
--- a/extensions/java/package.json
+++ b/extensions/java/package.json
@@ -3,6 +3,9 @@
"version": "0.1.0",
"publisher": "vscode",
"engines": { "vscode": "*" },
+ "scripts": {
+ "update-grammar": "node ../../build/npm/update-grammar.js textmate/java.tmbundle Syntaxes/Java.plist ./syntaxes/java.json"
+ },
"contributes": {
"languages": [{
"id": "java",
@@ -13,7 +16,7 @@
"grammars": [{
"language": "java",
"scopeName": "source.java",
- "path": "./syntaxes/Java.plist"
+ "path": "./syntaxes/java.json"
}]
}
}
\ No newline at end of file
diff --git a/extensions/java/syntaxes/Java.plist b/extensions/java/syntaxes/Java.plist
deleted file mode 100644
index 5e51c5df13a..00000000000
--- a/extensions/java/syntaxes/Java.plist
+++ /dev/null
@@ -1,1612 +0,0 @@
-
-
-
-
- fileTypes
-
- java
- bsh
-
- keyEquivalent
- ^~J
- name
- Java
- patterns
-
-
- captures
-
- 1
-
- name
- keyword.other.package.java
-
- 2
-
- name
- storage.modifier.package.java
-
- 3
-
- name
- punctuation.terminator.java
-
-
- match
- ^\s*(package)\b(?:\s*([^ ;$]+)\s*(;)?)?
- name
- meta.package.java
-
-
- begin
- (import static)\b\s*
- beginCaptures
-
- 1
-
- name
- keyword.other.import.static.java
-
-
- captures
-
- 1
-
- name
- keyword.other.import.java
-
- 2
-
- name
- storage.modifier.import.java
-
- 3
-
- name
- punctuation.terminator.java
-
-
- contentName
- storage.modifier.import.java
- end
- \s*(?:$|(;))
- endCaptures
-
- 1
-
- name
- punctuation.terminator.java
-
-
- name
- meta.import.java
- patterns
-
-
- match
- \.
- name
- punctuation.separator.java
-
-
- match
- \s
- name
- invalid.illegal.character_not_allowed_here.java
-
-
-
-
- begin
- (import)\b\s*
- beginCaptures
-
- 1
-
- name
- keyword.other.import.java
-
-
- captures
-
- 1
-
- name
- keyword.other.import.java
-
- 2
-
- name
- storage.modifier.import.java
-
- 3
-
- name
- punctuation.terminator.java
-
-
- contentName
- storage.modifier.import.java
- end
- \s*(?:$|(;))
- endCaptures
-
- 1
-
- name
- punctuation.terminator.java
-
-
- name
- meta.import.java
- patterns
-
-
- match
- \.
- name
- punctuation.separator.java
-
-
- match
- \s
- name
- invalid.illegal.character_not_allowed_here.java
-
-
-
-
- include
- #code
-
-
- repository
-
- all-types
-
- patterns
-
-
- include
- #primitive-arrays
-
-
- include
- #primitive-types
-
-
- include
- #object-types
-
-
-
- annotations
-
- patterns
-
-
- begin
- (@[^ (]+)(\()
- beginCaptures
-
- 1
-
- name
- storage.type.annotation.java
-
- 2
-
- name
- punctuation.definition.annotation-arguments.begin.java
-
-
- end
- (\))
- endCaptures
-
- 1
-
- name
- punctuation.definition.annotation-arguments.end.java
-
-
- name
- meta.declaration.annotation.java
- patterns
-
-
- captures
-
- 1
-
- name
- constant.other.key.java
-
- 2
-
- name
- keyword.operator.assignment.java
-
-
- match
- (\w*)\s*(=)
-
-
- include
- #code
-
-
- match
- ,
- name
- punctuation.separator.property.java
-
-
-
-
- match
- @\w*
- name
- storage.type.annotation.java
-
-
-
- anonymous-classes-and-new
-
- begin
- \bnew\b
- beginCaptures
-
- 0
-
- name
- keyword.control.new.java
-
-
- end
- (?<=\)|\])(?!\s*{)|(?<=})|(?=;)
- patterns
-
-
- begin
- (\w+)\s*(?=\[)
- beginCaptures
-
- 1
-
- name
- storage.type.java
-
-
- end
- (})|(?=\s*(?:,|;|\)))
- endCaptures
-
- 1
-
- name
- punctuation.section.block.end.java
-
-
- patterns
-
-
- begin
- \[
- end
- \]
- patterns
-
-
- include
- #code
-
-
-
-
- begin
- {
- beginCaptures
-
- 0
-
- name
- punctuation.section.block.begin.java
-
-
- end
- (?=})
- patterns
-
-
- include
- #code
-
-
-
-
-
-
- begin
- (?=\w.*\()
- end
- (?<=\))
- patterns
-
-
- include
- #object-types
-
-
- begin
- \(
- beginCaptures
-
- 1
-
- name
- storage.type.java
-
-
- end
- \)
- patterns
-
-
- include
- #code
-
-
-
-
-
-
- begin
- {
- beginCaptures
-
- 0
-
- name
- punctuation.section.inner-class.begin.java
-
-
- end
- }
- endCaptures
-
- 0
-
- name
- punctuation.section.inner-class.end.java
-
-
- name
- meta.inner-class.java
- patterns
-
-
- include
- #class-body
-
-
-
-
-
- assertions
-
- patterns
-
-
- begin
- \b(assert)\s
- beginCaptures
-
- 1
-
- name
- keyword.control.assert.java
-
-
- end
- $
- name
- meta.declaration.assertion.java
- patterns
-
-
- match
- :
- name
- keyword.operator.assert.expression-seperator.java
-
-
- include
- #code
-
-
-
-
-
- class
-
- begin
- (?=\w?[\w\s]*(?:class|(?:@)?interface|enum)\s+\w+)
- end
- }
- endCaptures
-
- 0
-
- name
- punctuation.section.class.end.java
-
-
- name
- meta.class.java
- patterns
-
-
- include
- #storage-modifiers
-
-
- include
- #comments
-
-
- captures
-
- 1
-
- name
- storage.modifier.java
-
- 2
-
- name
- entity.name.type.class.java
-
-
- match
- (class|(?:@)?interface|enum)\s+(\w+)
- name
- meta.class.identifier.java
-
-
- begin
- extends
- beginCaptures
-
- 0
-
- name
- storage.modifier.extends.java
-
-
- end
- (?={|implements)
- name
- meta.definition.class.inherited.classes.java
- patterns
-
-
- include
- #object-types-inherited
-
-
- include
- #comments
-
-
-
-
- begin
- (implements)\s
- beginCaptures
-
- 1
-
- name
- storage.modifier.implements.java
-
-
- end
- (?=\s*extends|\{)
- name
- meta.definition.class.implemented.interfaces.java
- patterns
-
-
- include
- #object-types-inherited
-
-
- include
- #comments
-
-
-
-
- begin
- {
- beginCaptures
-
- 0
-
- name
- punctuation.section.class.begin.java
-
-
- end
- (?=})
- name
- meta.class.body.java
- patterns
-
-
- include
- #class-body
-
-
-
-
-
- class-body
-
- patterns
-
-
- include
- #comments
-
-
- include
- #class
-
-
- include
- #enums
-
-
- include
- #variables
-
-
- include
- #methods
-
-
- include
- #annotations
-
-
- include
- #storage-modifiers
-
-
- include
- #code
-
-
-
- code
-
- patterns
-
-
- include
- #comments
-
-
- include
- #class
-
-
- begin
- {
- beginCaptures
-
- 0
-
- name
- punctuation.section.block.begin.java
-
-
- end
- }
- endCaptures
-
- 0
-
- name
- punctuation.section.block.end.java
-
-
- patterns
-
-
- include
- #code
-
-
-
-
- include
- #assertions
-
-
- include
- #parens
-
-
- include
- #constants-and-special-vars
-
-
- include
- #anonymous-classes-and-new
-
-
- include
- #keywords
-
-
- include
- #storage-modifiers
-
-
- include
- #method-call
-
-
- include
- #strings
-
-
- include
- #all-types
-
-
-
- comments
-
- patterns
-
-
- captures
-
- 0
-
- name
- punctuation.definition.comment.java
-
-
- match
- /\*\*/
- name
- comment.block.empty.java
-
-
- include
- text.html.javadoc
-
-
- include
- #comments-inline
-
-
-
- comments-inline
-
- patterns
-
-
- begin
- /\*
- captures
-
- 0
-
- name
- punctuation.definition.comment.java
-
-
- end
- \*/
- name
- comment.block.java
-
-
- begin
- (^[ \t]+)?(?=//)
- beginCaptures
-
- 1
-
- name
- punctuation.whitespace.comment.leading.java
-
-
- end
- (?!\G)
- patterns
-
-
- begin
- //
- beginCaptures
-
- 0
-
- name
- punctuation.definition.comment.java
-
-
- end
- \n
- name
- comment.line.double-slash.java
-
-
-
-
-
- constants-and-special-vars
-
- patterns
-
-
- match
- \b(true|false|null)\b
- name
- constant.language.java
-
-
- match
- \b(this|super)\b
- name
- variable.language.java
-
-
- match
- \b0[xX]\h([\h_]*\h)?[lL]?(?!\w|\.)
- name
- constant.numeric.hex.java
-
-
- match
- \b0[0-7_]*[0-7][lL]?\b
- name
- constant.numeric.octal.java
-
-
- match
- \b0[bB][01]([01_]*[01])?[lL]?\b
- name
- constant.numeric.binary.java
-
-
- match
- \b(0|[1-9]([0-9_]*[0-9])?)[lL]?(?!\w|\.)
- name
- constant.numeric.integer.java
-
-
- match
- (?x)
- (?<!\w) # Ensure word boundry
- (?>
- 0[xX] # Start literal
- (\h([\h_]*\h)?)? # Optional Number
- (
- (?<=\h)\. # A number must exist on
- | \.(?=\h) # one side of the decimal
- | (?<=\h) # Decimal not required
- )
- (\h([\h_]*\h)?)? # Optional Number
- [pP] # Exponent Indicator
- [+-]?(0|[1-9]([0-9_]*[0-9])?) # Signed Integer
- [fFdD]? # Float Type Suffix
- )
- (?!\w) # Ensure word boundry
-
- name
- constant.numeric.hex-float.java
-
-
- match
- (?x)
- (?<!\w) # Ensure word boundry
- (?>
- (
- (0|[1-9]([0-9_]*[0-9])?) # Leading digits
- (?=[eEfFdD.]) # Allow for numbers without .
- )?
- (
- (?<=[0-9])(?=[eEfFdD]) # Allow for numbers without .
- | \.
- )
- (
- [0-9]([0-9_]*[0-9])? # Numbers after .
- )?
- (
- [eE][+-]?(0|[1-9]([0-9_]*[0-9])?) # Exponent
- )?
- [fFdD]? # Float Type Suffix
- )
- (?!\w) # Ensure word boundry
-
- name
- constant.numeric.float.java
-
-
- captures
-
- 1
-
- name
- keyword.operator.dereference.java
-
-
- match
- (\.)?\b([A-Z][A-Z0-9_]+)(?!<|\.class|\s*\w+\s*=)\b
- name
- constant.other.java
-
-
-
- enums
-
- begin
- ^(?=\s*[A-Z0-9_]+\s*({|\(|,))
- end
- (?=;|})
- patterns
-
-
- begin
- \w+
- beginCaptures
-
- 0
-
- name
- constant.other.enum.java
-
-
- end
- (?=,|;|})
- name
- meta.enum.java
- patterns
-
-
- include
- #parens
-
-
- begin
- {
- beginCaptures
-
- 0
-
- name
- punctuation.section.enum.begin.java
-
-
- end
- }
- endCaptures
-
- 0
-
- name
- punctuation.section.enum.end.java
-
-
- patterns
-
-
- include
- #class-body
-
-
-
-
-
-
- include
- #comments
-
-
- include
- #annotations
-
-
-
- keywords
-
- patterns
-
-
- match
- \b(try|catch|finally|throw)\b
- name
- keyword.control.catch-exception.java
-
-
- match
- \?|:
- name
- keyword.control.ternary.java
-
-
- match
- \b(return|break|case|continue|default|do|while|for|switch|if|else)\b
- name
- keyword.control.java
-
-
- match
- \b(instanceof)\b
- name
- keyword.operator.java
-
-
- match
- (<<|>>>?|~|\^)
- name
- keyword.operator.bitwise.java
-
-
- match
- ((&|\^|\||<<|>>>?)=)
- name
- keyword.operator.assignment.bitwise.java
-
-
- match
- (===?|!=|<=|>=|<>|<|>)
- name
- keyword.operator.comparison.java
-
-
- match
- ([+*/%-]=)
- name
- keyword.operator.assignment.arithmetic.java
-
-
- match
- (=)
- name
- keyword.operator.assignment.java
-
-
- match
- (\-\-|\+\+)
- name
- keyword.operator.increment-decrement.java
-
-
- match
- (\-|\+|\*|\/|%)
- name
- keyword.operator.arithmetic.java
-
-
- match
- (!|&&|\|\|)
- name
- keyword.operator.logical.java
-
-
- match
- (\||&)
- name
- keyword.operator.bitwise.java
-
-
- match
- (?<=\S)\.(?=\S)
- name
- keyword.operator.dereference.java
-
-
- match
- ;
- name
- punctuation.terminator.java
-
-
-
- method-call
-
- begin
- ([\w$]+)(\()
- beginCaptures
-
- 1
-
- name
- meta.method.java
-
- 2
-
- name
- punctuation.definition.method-parameters.begin.java
-
-
- end
- \)
- endCaptures
-
- 0
-
- name
- punctuation.definition.method-parameters.end.java
-
-
- name
- meta.method-call.java
- patterns
-
-
- match
- ,
- name
- punctuation.definition.seperator.parameter.java
-
-
- include
- #code
-
-
-
- methods
-
- begin
- (?!new)(?=[\w<].*\s+)(?=([^=/]|/(?!/))+\()
- end
- (})|(?=;)
- endCaptures
-
- 1
-
- name
- punctuation.section.method.end.java
-
-
- name
- meta.method.java
- patterns
-
-
- include
- #storage-modifiers
-
-
- begin
- (\w+)\s*\(
- beginCaptures
-
- 1
-
- name
- entity.name.function.java
-
-
- end
- \)
- name
- meta.method.identifier.java
- patterns
-
-
- include
- #parameters
-
-
- include
- #comments
-
-
-
-
- begin
- <
- end
- >
- name
- storage.type.token.java
- patterns
-
-
- include
- #object-types
-
-
- begin
- <
- comment
- This is just to support <>'s with no actual type prefix
- end
- >|[^\w\s,\[\]<]
- name
- storage.type.generic.java
-
-
-
-
- begin
- (?=\w.*\s+\w+\s*\()
- end
- (?=\w+\s*\()
- name
- meta.method.return-type.java
- patterns
-
-
- include
- #all-types
-
-
- include
- #comments
-
-
-
-
- include
- #throws
-
-
- begin
- {
- beginCaptures
-
- 0
-
- name
- punctuation.section.method.begin.java
-
-
- end
- (?=})
- name
- meta.method.body.java
- patterns
-
-
- include
- #code
-
-
-
-
- include
- #comments
-
-
-
- object-types
-
- patterns
-
-
- begin
- \b((?:[a-z]\w*\.)*[A-Z]+\w*)<
- end
- >|[^\w\s,\?<\[\]]
- name
- storage.type.generic.java
- patterns
-
-
- include
- #object-types
-
-
- begin
- <
- comment
- This is just to support <>'s with no actual type prefix
- end
- >|[^\w\s,\[\]<]
- name
- storage.type.generic.java
-
-
-
-
- begin
- \b((?:[a-z]\w*\.)*[A-Z]+\w*)(?=\[)
- end
- (?=[^\]\s])
- name
- storage.type.object.array.java
- patterns
-
-
- begin
- \[
- end
- \]
- patterns
-
-
- include
- #code
-
-
-
-
-
-
- captures
-
- 1
-
- name
- keyword.operator.dereference.java
-
-
- match
- \b(?:[a-z]\w*(\.))*[A-Z]+\w*\b
- name
- storage.type.java
-
-
-
- object-types-inherited
-
- patterns
-
-
- begin
- \b((?:[a-z]\w*\.)*[A-Z]+\w*)<
- end
- >|[^\w\s,<]
- name
- entity.other.inherited-class.java
- patterns
-
-
- include
- #object-types
-
-
- begin
- <
- comment
- This is just to support <>'s with no actual type prefix
- end
- >|[^\w\s,<]
- name
- storage.type.generic.java
-
-
-
-
- captures
-
- 1
-
- name
- keyword.operator.dereference.java
-
-
- match
- \b(?:[a-z]\w*(\.))*[A-Z]+\w*
- name
- entity.other.inherited-class.java
-
-
-
- parameters
-
- patterns
-
-
- match
- final
- name
- storage.modifier.java
-
-
- include
- #annotations
-
-
- include
- #primitive-arrays
-
-
- include
- #primitive-types
-
-
- include
- #object-types
-
-
- match
- \w+
- name
- variable.parameter.java
-
-
-
- parens
-
- begin
- \(
- end
- \)
- patterns
-
-
- include
- #code
-
-
-
- primitive-arrays
-
- patterns
-
-
- match
- \b(?:void|boolean|byte|char|short|int|float|long|double)(\[\])*\b
- name
- storage.type.primitive.array.java
-
-
-
- primitive-types
-
- patterns
-
-
- match
- \b(?:void|boolean|byte|char|short|int|float|long|double)\b
- name
- storage.type.primitive.java
-
-
-
- storage-modifiers
-
- captures
-
- 1
-
- name
- storage.modifier.java
-
-
- match
- \b(public|private|protected|static|final|native|synchronized|volatile|abstract|threadsafe|transient)\b
-
- strings
-
- patterns
-
-
- begin
- "
- beginCaptures
-
- 0
-
- name
- punctuation.definition.string.begin.java
-
-
- end
- "
- endCaptures
-
- 0
-
- name
- punctuation.definition.string.end.java
-
-
- name
- string.quoted.double.java
- patterns
-
-
- match
- \\.
- name
- constant.character.escape.java
-
-
-
-
- begin
- '
- beginCaptures
-
- 0
-
- name
- punctuation.definition.string.begin.java
-
-
- end
- '
- endCaptures
-
- 0
-
- name
- punctuation.definition.string.end.java
-
-
- name
- string.quoted.single.java
- patterns
-
-
- match
- \\.
- name
- constant.character.escape.java
-
-
-
-
-
- throws
-
- begin
- throws
- beginCaptures
-
- 0
-
- name
- storage.modifier.java
-
-
- end
- (?={|;)
- name
- meta.throwables.java
- patterns
-
-
- include
- #object-types
-
-
-
- values
-
- patterns
-
-
- include
- #strings
-
-
- include
- #object-types
-
-
- include
- #constants-and-special-vars
-
-
-
- variables
-
- applyEndPatternLast
- 1
- patterns
-
-
- begin
- (?x:(?=
- (?:
- (?:private|protected|public|native|synchronized|volatile|abstract|threadsafe|transient|static|final) # visibility/modifier
- |
- (?:def)
- |
- (?:void|boolean|byte|char|short|int|float|long|double)
- |
- (?:(?:[a-z]\w*\.)*[A-Z]+\w*) # object type
- )
- \s+
- (?!private|protected|public|native|synchronized|volatile|abstract|threadsafe|transient|static|final|def|void|boolean|byte|char|short|int|float|long|double)
- [\w\d_<>\[\],\?][\w\d_<>\[\],\? \t]*
- (?:=|$)
-
- ))
- end
- (?=;)
- name
- meta.definition.variable.java
- patterns
-
-
- match
- \s
-
-
- captures
-
- 1
-
- name
- constant.other.variable.java
-
-
- match
- ([A-Z_0-9]+)\s+(?=\=)
-
-
- captures
-
- 1
-
- name
- meta.definition.variable.name.java
-
-
- match
- (\w[^\s,]*)\s+(?=\=)
-
-
- begin
- =
- beginCaptures
-
- 0
-
- name
- keyword.operator.assignment.java
-
-
- end
- (?=;)
- patterns
-
-
- include
- #code
-
-
-
-
- captures
-
- 1
-
- name
- meta.definition.variable.name.java
-
-
- match
- (\w[^\s=]*)(?=\s*;)
-
-
- include
- #code
-
-
-
-
-
-
- scopeName
- source.java
- uuid
- 2B449DF6-6B1D-11D9-94EC-000D93589AF6
-
-
\ No newline at end of file
diff --git a/extensions/java/syntaxes/java.json b/extensions/java/syntaxes/java.json
new file mode 100644
index 00000000000..f0fcef2d065
--- /dev/null
+++ b/extensions/java/syntaxes/java.json
@@ -0,0 +1,1030 @@
+{
+ "fileTypes": [
+ "java",
+ "bsh"
+ ],
+ "keyEquivalent": "^~J",
+ "name": "Java",
+ "patterns": [
+ {
+ "captures": {
+ "1": {
+ "name": "keyword.other.package.java"
+ },
+ "2": {
+ "name": "storage.modifier.package.java"
+ },
+ "3": {
+ "name": "punctuation.terminator.java"
+ }
+ },
+ "match": "^\\s*(package)\\b(?:\\s*([^ ;$]+)\\s*(;)?)?",
+ "name": "meta.package.java"
+ },
+ {
+ "begin": "(import static)\\b\\s*",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.other.import.static.java"
+ }
+ },
+ "captures": {
+ "1": {
+ "name": "keyword.other.import.java"
+ },
+ "2": {
+ "name": "storage.modifier.import.java"
+ },
+ "3": {
+ "name": "punctuation.terminator.java"
+ }
+ },
+ "contentName": "storage.modifier.import.java",
+ "end": "\\s*(?:$|(;))",
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.terminator.java"
+ }
+ },
+ "name": "meta.import.java",
+ "patterns": [
+ {
+ "match": "\\.",
+ "name": "punctuation.separator.java"
+ },
+ {
+ "match": "\\s",
+ "name": "invalid.illegal.character_not_allowed_here.java"
+ }
+ ]
+ },
+ {
+ "begin": "(import)\\b\\s*",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.other.import.java"
+ }
+ },
+ "captures": {
+ "1": {
+ "name": "keyword.other.import.java"
+ },
+ "2": {
+ "name": "storage.modifier.import.java"
+ },
+ "3": {
+ "name": "punctuation.terminator.java"
+ }
+ },
+ "contentName": "storage.modifier.import.java",
+ "end": "\\s*(?:$|(;))",
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.terminator.java"
+ }
+ },
+ "name": "meta.import.java",
+ "patterns": [
+ {
+ "match": "\\.",
+ "name": "punctuation.separator.java"
+ },
+ {
+ "match": "\\s",
+ "name": "invalid.illegal.character_not_allowed_here.java"
+ }
+ ]
+ },
+ {
+ "include": "#code"
+ }
+ ],
+ "repository": {
+ "all-types": {
+ "patterns": [
+ {
+ "include": "#primitive-arrays"
+ },
+ {
+ "include": "#primitive-types"
+ },
+ {
+ "include": "#object-types"
+ }
+ ]
+ },
+ "annotations": {
+ "patterns": [
+ {
+ "begin": "(@[^ (]+)(\\()",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.type.annotation.java"
+ },
+ "2": {
+ "name": "punctuation.definition.annotation-arguments.begin.java"
+ }
+ },
+ "end": "(\\))",
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.definition.annotation-arguments.end.java"
+ }
+ },
+ "name": "meta.declaration.annotation.java",
+ "patterns": [
+ {
+ "captures": {
+ "1": {
+ "name": "constant.other.key.java"
+ },
+ "2": {
+ "name": "keyword.operator.assignment.java"
+ }
+ },
+ "match": "(\\w*)\\s*(=)"
+ },
+ {
+ "include": "#code"
+ },
+ {
+ "match": ",",
+ "name": "punctuation.separator.property.java"
+ }
+ ]
+ },
+ {
+ "match": "@\\w*",
+ "name": "storage.type.annotation.java"
+ }
+ ]
+ },
+ "anonymous-classes-and-new": {
+ "begin": "\\bnew\\b",
+ "beginCaptures": {
+ "0": {
+ "name": "keyword.control.new.java"
+ }
+ },
+ "end": "(?<=\\)|\\])(?!\\s*{)|(?<=})|(?=;)",
+ "patterns": [
+ {
+ "begin": "(\\w+)\\s*(?=\\[)",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.type.java"
+ }
+ },
+ "end": "(})|(?=\\s*(?:,|;|\\)))",
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.section.block.end.java"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "\\[",
+ "end": "\\]",
+ "patterns": [
+ {
+ "include": "#code"
+ }
+ ]
+ },
+ {
+ "begin": "{",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.section.block.begin.java"
+ }
+ },
+ "end": "(?=})",
+ "patterns": [
+ {
+ "include": "#code"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "begin": "(?=\\w.*\\()",
+ "end": "(?<=\\))",
+ "patterns": [
+ {
+ "include": "#object-types"
+ },
+ {
+ "begin": "\\(",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.type.java"
+ }
+ },
+ "end": "\\)",
+ "patterns": [
+ {
+ "include": "#code"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "begin": "{",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.section.inner-class.begin.java"
+ }
+ },
+ "end": "}",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.section.inner-class.end.java"
+ }
+ },
+ "name": "meta.inner-class.java",
+ "patterns": [
+ {
+ "include": "#class-body"
+ }
+ ]
+ }
+ ]
+ },
+ "assertions": {
+ "patterns": [
+ {
+ "begin": "\\b(assert)\\s",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.control.assert.java"
+ }
+ },
+ "end": "$",
+ "name": "meta.declaration.assertion.java",
+ "patterns": [
+ {
+ "match": ":",
+ "name": "keyword.operator.assert.expression-seperator.java"
+ },
+ {
+ "include": "#code"
+ }
+ ]
+ }
+ ]
+ },
+ "class": {
+ "begin": "(?=\\w?[\\w\\s]*(?:class|(?:@)?interface|enum)\\s+\\w+)",
+ "end": "}",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.section.class.end.java"
+ }
+ },
+ "name": "meta.class.java",
+ "patterns": [
+ {
+ "include": "#storage-modifiers"
+ },
+ {
+ "include": "#comments"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "storage.modifier.java"
+ },
+ "2": {
+ "name": "entity.name.type.class.java"
+ }
+ },
+ "match": "(class|(?:@)?interface|enum)\\s+(\\w+)",
+ "name": "meta.class.identifier.java"
+ },
+ {
+ "begin": "extends",
+ "beginCaptures": {
+ "0": {
+ "name": "storage.modifier.extends.java"
+ }
+ },
+ "end": "(?={|implements)",
+ "name": "meta.definition.class.inherited.classes.java",
+ "patterns": [
+ {
+ "include": "#object-types-inherited"
+ },
+ {
+ "include": "#comments"
+ }
+ ]
+ },
+ {
+ "begin": "(implements)\\s",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.modifier.implements.java"
+ }
+ },
+ "end": "(?=\\s*extends|\\{)",
+ "name": "meta.definition.class.implemented.interfaces.java",
+ "patterns": [
+ {
+ "include": "#object-types-inherited"
+ },
+ {
+ "include": "#comments"
+ }
+ ]
+ },
+ {
+ "begin": "{",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.section.class.begin.java"
+ }
+ },
+ "end": "(?=})",
+ "name": "meta.class.body.java",
+ "patterns": [
+ {
+ "include": "#class-body"
+ }
+ ]
+ }
+ ]
+ },
+ "class-body": {
+ "patterns": [
+ {
+ "include": "#comments"
+ },
+ {
+ "include": "#class"
+ },
+ {
+ "include": "#enums"
+ },
+ {
+ "include": "#variables"
+ },
+ {
+ "include": "#methods"
+ },
+ {
+ "include": "#annotations"
+ },
+ {
+ "include": "#storage-modifiers"
+ },
+ {
+ "include": "#code"
+ }
+ ]
+ },
+ "code": {
+ "patterns": [
+ {
+ "include": "#comments"
+ },
+ {
+ "include": "#class"
+ },
+ {
+ "begin": "{",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.section.block.begin.java"
+ }
+ },
+ "end": "}",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.section.block.end.java"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#code"
+ }
+ ]
+ },
+ {
+ "include": "#assertions"
+ },
+ {
+ "include": "#parens"
+ },
+ {
+ "include": "#constants-and-special-vars"
+ },
+ {
+ "include": "#anonymous-classes-and-new"
+ },
+ {
+ "include": "#annotations"
+ },
+ {
+ "include": "#keywords"
+ },
+ {
+ "include": "#storage-modifiers"
+ },
+ {
+ "include": "#method-call"
+ },
+ {
+ "include": "#strings"
+ },
+ {
+ "include": "#all-types"
+ }
+ ]
+ },
+ "comments": {
+ "patterns": [
+ {
+ "captures": {
+ "0": {
+ "name": "punctuation.definition.comment.java"
+ }
+ },
+ "match": "/\\*\\*/",
+ "name": "comment.block.empty.java"
+ },
+ {
+ "include": "text.html.javadoc"
+ },
+ {
+ "include": "#comments-inline"
+ }
+ ]
+ },
+ "comments-inline": {
+ "patterns": [
+ {
+ "begin": "/\\*",
+ "captures": {
+ "0": {
+ "name": "punctuation.definition.comment.java"
+ }
+ },
+ "end": "\\*/",
+ "name": "comment.block.java"
+ },
+ {
+ "begin": "(^[ \\t]+)?(?=//)",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.whitespace.comment.leading.java"
+ }
+ },
+ "end": "(?!\\G)",
+ "patterns": [
+ {
+ "begin": "//",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.comment.java"
+ }
+ },
+ "end": "\\n",
+ "name": "comment.line.double-slash.java"
+ }
+ ]
+ }
+ ]
+ },
+ "constants-and-special-vars": {
+ "patterns": [
+ {
+ "match": "\\b(true|false|null)\\b",
+ "name": "constant.language.java"
+ },
+ {
+ "match": "\\b(this|super)\\b",
+ "name": "variable.language.java"
+ },
+ {
+ "match": "\\b0[xX]\\h([\\h_]*\\h)?[lL]?(?!\\w|\\.)",
+ "name": "constant.numeric.hex.java"
+ },
+ {
+ "match": "\\b0[0-7_]*[0-7][lL]?\\b",
+ "name": "constant.numeric.octal.java"
+ },
+ {
+ "match": "\\b0[bB][01]([01_]*[01])?[lL]?\\b",
+ "name": "constant.numeric.binary.java"
+ },
+ {
+ "match": "\\b(0|[1-9]([0-9_]*[0-9])?)[lL]?(?!\\w|\\.)",
+ "name": "constant.numeric.integer.java"
+ },
+ {
+ "match": "(?x)\n\t\t\t\t\t\t(?\n\t\t\t\t\t\t\t0[xX]\t\t\t\t\t\t\t\t\t# Start literal\n\t\t\t\t\t\t\t(\\h([\\h_]*\\h)?)?\t\t\t\t\t\t# Optional Number\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t(?<=\\h)\\.\t\t\t\t\t\t\t# A number must exist on\n\t\t\t\t\t\t | \\.(?=\\h)\t\t\t\t\t\t\t# one side of the decimal\n\t\t\t\t\t\t | (?<=\\h)\t\t\t\t\t\t\t\t# Decimal not required\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t(\\h([\\h_]*\\h)?)?\t\t\t\t\t\t# Optional Number\n\t\t\t\t\t\t\t[pP]\t\t\t\t\t\t\t\t\t# Exponent Indicator\n\t\t\t\t\t\t\t[+-]?(0|[1-9]([0-9_]*[0-9])?)\t\t\t# Signed Integer\n\t\t\t\t\t\t\t[fFdD]?\t\t\t\t\t\t\t\t\t# Float Type Suffix\n\t\t\t\t\t\t)\n\t\t\t\t\t\t(?!\\w)\t\t\t\t\t\t\t\t\t\t# Ensure word boundry\n\t\t\t\t\t",
+ "name": "constant.numeric.hex-float.java"
+ },
+ {
+ "match": "(?x)\n\t\t\t\t\t\t(?\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t(0|[1-9]([0-9_]*[0-9])?)\t\t\t\t# Leading digits\n\t\t\t\t\t\t\t\t(?=[eEfFdD.])\t\t\t\t\t\t\t# Allow for numbers without .\n\t\t\t\t\t\t\t)?\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t(?<=[0-9])(?=[eEfFdD])\t\t\t\t\t# Allow for numbers without .\n\t\t\t\t\t\t\t | \\.\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t[0-9]([0-9_]*[0-9])?\t\t\t\t\t# Numbers after .\n\t\t\t\t\t\t\t)?\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t[eE][+-]?(0|[1-9]([0-9_]*[0-9])?)\t\t# Exponent\n\t\t\t\t\t\t\t)?\n\t\t\t\t\t\t\t[fFdD]?\t\t\t\t\t\t\t\t\t\t# Float Type Suffix\n\t\t\t\t\t\t)\n\t\t\t\t\t\t(?!\\w)\t\t\t\t\t\t\t\t\t\t\t# Ensure word boundry\n\t\t\t\t\t",
+ "name": "constant.numeric.float.java"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "keyword.operator.dereference.java"
+ }
+ },
+ "match": "(\\.)?\\b([A-Z][A-Z0-9_]+)(?!<|\\.class|\\s*\\w+\\s*=)\\b",
+ "name": "constant.other.java"
+ }
+ ]
+ },
+ "enums": {
+ "begin": "^(?=\\s*[A-Z0-9_]+\\s*({|\\(|,))",
+ "end": "(?=;|})",
+ "patterns": [
+ {
+ "begin": "\\w+",
+ "beginCaptures": {
+ "0": {
+ "name": "constant.other.enum.java"
+ }
+ },
+ "end": "(?=,|;|})",
+ "name": "meta.enum.java",
+ "patterns": [
+ {
+ "include": "#parens"
+ },
+ {
+ "begin": "{",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.section.enum.begin.java"
+ }
+ },
+ "end": "}",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.section.enum.end.java"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#class-body"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "include": "#comments"
+ },
+ {
+ "include": "#annotations"
+ }
+ ]
+ },
+ "keywords": {
+ "patterns": [
+ {
+ "match": "\\b(try|catch|finally|throw)\\b",
+ "name": "keyword.control.catch-exception.java"
+ },
+ {
+ "match": "\\?|:",
+ "name": "keyword.control.ternary.java"
+ },
+ {
+ "match": "\\b(return|break|case|continue|default|do|while|for|switch|if|else)\\b",
+ "name": "keyword.control.java"
+ },
+ {
+ "match": "\\b(instanceof)\\b",
+ "name": "keyword.operator.java"
+ },
+ {
+ "match": "(<<|>>>?|~|\\^)",
+ "name": "keyword.operator.bitwise.java"
+ },
+ {
+ "match": "((&|\\^|\\||<<|>>>?)=)",
+ "name": "keyword.operator.assignment.bitwise.java"
+ },
+ {
+ "match": "(===?|!=|<=|>=|<>|<|>)",
+ "name": "keyword.operator.comparison.java"
+ },
+ {
+ "match": "([+*/%-]=)",
+ "name": "keyword.operator.assignment.arithmetic.java"
+ },
+ {
+ "match": "(=)",
+ "name": "keyword.operator.assignment.java"
+ },
+ {
+ "match": "(\\-\\-|\\+\\+)",
+ "name": "keyword.operator.increment-decrement.java"
+ },
+ {
+ "match": "(\\-|\\+|\\*|\\/|%)",
+ "name": "keyword.operator.arithmetic.java"
+ },
+ {
+ "match": "(!|&&|\\|\\|)",
+ "name": "keyword.operator.logical.java"
+ },
+ {
+ "match": "(\\||&)",
+ "name": "keyword.operator.bitwise.java"
+ },
+ {
+ "match": "(?<=\\S)\\.(?=\\S)",
+ "name": "keyword.operator.dereference.java"
+ },
+ {
+ "match": ";",
+ "name": "punctuation.terminator.java"
+ }
+ ]
+ },
+ "method-call": {
+ "begin": "([\\w$]+)(\\()",
+ "beginCaptures": {
+ "1": {
+ "name": "meta.method.java"
+ },
+ "2": {
+ "name": "punctuation.definition.method-parameters.begin.java"
+ }
+ },
+ "end": "\\)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.method-parameters.end.java"
+ }
+ },
+ "name": "meta.method-call.java",
+ "patterns": [
+ {
+ "match": ",",
+ "name": "punctuation.definition.seperator.parameter.java"
+ },
+ {
+ "include": "#code"
+ }
+ ]
+ },
+ "methods": {
+ "begin": "(?!new)(?=[\\w<].*\\s+)(?=([^=/]|/(?!/))+\\()",
+ "end": "(})|(?=;)",
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.section.method.end.java"
+ }
+ },
+ "name": "meta.method.java",
+ "patterns": [
+ {
+ "include": "#storage-modifiers"
+ },
+ {
+ "begin": "(\\w+)\\s*\\(",
+ "beginCaptures": {
+ "1": {
+ "name": "entity.name.function.java"
+ }
+ },
+ "end": "\\)",
+ "name": "meta.method.identifier.java",
+ "patterns": [
+ {
+ "include": "#parameters"
+ },
+ {
+ "include": "#comments"
+ }
+ ]
+ },
+ {
+ "begin": "<",
+ "end": ">",
+ "name": "storage.type.token.java",
+ "patterns": [
+ {
+ "include": "#object-types"
+ },
+ {
+ "begin": "<",
+ "comment": "This is just to support <>'s with no actual type prefix",
+ "end": ">|[^\\w\\s,\\[\\]<]",
+ "name": "storage.type.generic.java"
+ }
+ ]
+ },
+ {
+ "begin": "(?=\\w.*\\s+\\w+\\s*\\()",
+ "end": "(?=\\w+\\s*\\()",
+ "name": "meta.method.return-type.java",
+ "patterns": [
+ {
+ "include": "#all-types"
+ },
+ {
+ "include": "#comments"
+ }
+ ]
+ },
+ {
+ "include": "#throws"
+ },
+ {
+ "begin": "{",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.section.method.begin.java"
+ }
+ },
+ "end": "(?=})",
+ "name": "meta.method.body.java",
+ "patterns": [
+ {
+ "include": "#code"
+ }
+ ]
+ },
+ {
+ "include": "#comments"
+ }
+ ]
+ },
+ "object-types": {
+ "patterns": [
+ {
+ "begin": "\\b((?:[a-z]\\w*\\.)*[A-Z]+\\w*)<",
+ "end": ">|[^\\w\\s,\\?<\\[\\]]",
+ "name": "storage.type.generic.java",
+ "patterns": [
+ {
+ "include": "#object-types"
+ },
+ {
+ "begin": "<",
+ "comment": "This is just to support <>'s with no actual type prefix",
+ "end": ">|[^\\w\\s,\\[\\]<]",
+ "name": "storage.type.generic.java"
+ }
+ ]
+ },
+ {
+ "begin": "\\b((?:[a-z]\\w*\\.)*[A-Z]+\\w*)(?=\\[)",
+ "end": "(?=[^\\]\\s])",
+ "name": "storage.type.object.array.java",
+ "patterns": [
+ {
+ "begin": "\\[",
+ "end": "\\]",
+ "patterns": [
+ {
+ "include": "#code"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "keyword.operator.dereference.java"
+ }
+ },
+ "match": "\\b(?:[a-z]\\w*(\\.))*[A-Z]+\\w*\\b",
+ "name": "storage.type.java"
+ }
+ ]
+ },
+ "object-types-inherited": {
+ "patterns": [
+ {
+ "begin": "\\b((?:[a-z]\\w*\\.)*[A-Z]+\\w*)<",
+ "end": ">|[^\\w\\s,<]",
+ "name": "entity.other.inherited-class.java",
+ "patterns": [
+ {
+ "include": "#object-types"
+ },
+ {
+ "begin": "<",
+ "comment": "This is just to support <>'s with no actual type prefix",
+ "end": ">|[^\\w\\s,<]",
+ "name": "storage.type.generic.java"
+ }
+ ]
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "keyword.operator.dereference.java"
+ }
+ },
+ "match": "\\b(?:[a-z]\\w*(\\.))*[A-Z]+\\w*",
+ "name": "entity.other.inherited-class.java"
+ }
+ ]
+ },
+ "parameters": {
+ "patterns": [
+ {
+ "match": "final",
+ "name": "storage.modifier.java"
+ },
+ {
+ "include": "#annotations"
+ },
+ {
+ "include": "#primitive-arrays"
+ },
+ {
+ "include": "#primitive-types"
+ },
+ {
+ "include": "#object-types"
+ },
+ {
+ "match": "\\w+",
+ "name": "variable.parameter.java"
+ }
+ ]
+ },
+ "parens": {
+ "begin": "\\(",
+ "end": "\\)",
+ "patterns": [
+ {
+ "include": "#code"
+ }
+ ]
+ },
+ "primitive-arrays": {
+ "patterns": [
+ {
+ "match": "\\b(?:void|boolean|byte|char|short|int|float|long|double)(\\[\\])*\\b",
+ "name": "storage.type.primitive.array.java"
+ }
+ ]
+ },
+ "primitive-types": {
+ "patterns": [
+ {
+ "match": "\\b(?:void|boolean|byte|char|short|int|float|long|double)\\b",
+ "name": "storage.type.primitive.java"
+ }
+ ]
+ },
+ "storage-modifiers": {
+ "captures": {
+ "1": {
+ "name": "storage.modifier.java"
+ }
+ },
+ "match": "\\b(public|private|protected|static|final|native|synchronized|volatile|abstract|threadsafe|transient)\\b"
+ },
+ "strings": {
+ "patterns": [
+ {
+ "begin": "\"",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.java"
+ }
+ },
+ "end": "\"",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.java"
+ }
+ },
+ "name": "string.quoted.double.java",
+ "patterns": [
+ {
+ "match": "\\\\.",
+ "name": "constant.character.escape.java"
+ }
+ ]
+ },
+ {
+ "begin": "'",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.java"
+ }
+ },
+ "end": "'",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.java"
+ }
+ },
+ "name": "string.quoted.single.java",
+ "patterns": [
+ {
+ "match": "\\\\.",
+ "name": "constant.character.escape.java"
+ }
+ ]
+ }
+ ]
+ },
+ "throws": {
+ "begin": "throws",
+ "beginCaptures": {
+ "0": {
+ "name": "storage.modifier.java"
+ }
+ },
+ "end": "(?={|;)",
+ "name": "meta.throwables.java",
+ "patterns": [
+ {
+ "include": "#object-types"
+ }
+ ]
+ },
+ "values": {
+ "patterns": [
+ {
+ "include": "#strings"
+ },
+ {
+ "include": "#object-types"
+ },
+ {
+ "include": "#constants-and-special-vars"
+ }
+ ]
+ },
+ "variables": {
+ "applyEndPatternLast": 1,
+ "patterns": [
+ {
+ "begin": "(?x:(?=\n (?:\n (?:private|protected|public|native|synchronized|volatile|abstract|threadsafe|transient|static|final) # visibility/modifier\n |\n (?:def)\n |\n (?:void|boolean|byte|char|short|int|float|long|double)\n |\n (?:(?:[a-z]\\w*\\.)*[A-Z]+\\w*) # object type\n )\n \\s+\n (?!private|protected|public|native|synchronized|volatile|abstract|threadsafe|transient|static|final|def|void|boolean|byte|char|short|int|float|long|double)\n [\\w\\d_<>\\[\\],\\?][\\w\\d_<>\\[\\],\\? \\t]*\n (?:=|$)\n \n\t\t\t\t\t))",
+ "end": "(?=;)",
+ "name": "meta.definition.variable.java",
+ "patterns": [
+ {
+ "match": "\\s"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "constant.other.variable.java"
+ }
+ },
+ "match": "([A-Z_0-9]+)\\s+(?=\\=)"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "meta.definition.variable.name.java"
+ }
+ },
+ "match": "(\\w[^\\s,]*)\\s+(?=\\=)"
+ },
+ {
+ "begin": "=",
+ "beginCaptures": {
+ "0": {
+ "name": "keyword.operator.assignment.java"
+ }
+ },
+ "end": "(?=;)",
+ "patterns": [
+ {
+ "include": "#code"
+ }
+ ]
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "meta.definition.variable.name.java"
+ }
+ },
+ "match": "(\\w[^\\s=]*)(?=\\s*;)"
+ },
+ {
+ "include": "#code"
+ }
+ ]
+ }
+ ]
+ }
+ },
+ "scopeName": "source.java",
+ "uuid": "2B449DF6-6B1D-11D9-94EC-000D93589AF6",
+ "version": "https://github.com/textmate/java.tmbundle/commit/faffa518d0b22b68b4e5e6b4c939722522b97d40"
+}
\ No newline at end of file
diff --git a/extensions/javascript/src/features/bowerJSONContribution.ts b/extensions/javascript/src/features/bowerJSONContribution.ts
index c2034433ce8..42a26dbb695 100644
--- a/extensions/javascript/src/features/bowerJSONContribution.ts
+++ b/extensions/javascript/src/features/bowerJSONContribution.ts
@@ -4,37 +4,37 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
-import {MarkedString, CompletionItemKind, CompletionItem, DocumentSelector} from 'vscode';
-import {IJSONContribution, ISuggestionsCollector} from './jsonContributions';
-import {XHRRequest} from 'request-light';
-import {Location} from 'jsonc-parser';
-import {textToMarkedString} from './markedTextUtil';
+import { MarkedString, CompletionItemKind, CompletionItem, DocumentSelector } from 'vscode';
+import { IJSONContribution, ISuggestionsCollector } from './jsonContributions';
+import { XHRRequest } from 'request-light';
+import { Location } from 'jsonc-parser';
+import { textToMarkedString } from './markedTextUtil';
import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();
export class BowerJSONContribution implements IJSONContribution {
- private topRanked = ['twitter','bootstrap','angular-1.1.6','angular-latest','angulerjs','d3','myjquery','jq','abcdef1234567890','jQuery','jquery-1.11.1','jquery',
- 'sushi-vanilla-x-data','font-awsome','Font-Awesome','font-awesome','fontawesome','html5-boilerplate','impress.js','homebrew',
- 'backbone','moment1','momentjs','moment','linux','animate.css','animate-css','reveal.js','jquery-file-upload','blueimp-file-upload','threejs','express','chosen',
- 'normalize-css','normalize.css','semantic','semantic-ui','Semantic-UI','modernizr','underscore','underscore1',
- 'material-design-icons','ionic','chartjs','Chart.js','nnnick-chartjs','select2-ng','select2-dist','phantom','skrollr','scrollr','less.js','leancss','parser-lib',
- 'hui','bootstrap-languages','async','gulp','jquery-pjax','coffeescript','hammer.js','ace','leaflet','jquery-mobile','sweetalert','typeahead.js','soup','typehead.js',
- 'sails','codeigniter2'];
+ private topRanked = ['twitter', 'bootstrap', 'angular-1.1.6', 'angular-latest', 'angulerjs', 'd3', 'myjquery', 'jq', 'abcdef1234567890', 'jQuery', 'jquery-1.11.1', 'jquery',
+ 'sushi-vanilla-x-data', 'font-awsome', 'Font-Awesome', 'font-awesome', 'fontawesome', 'html5-boilerplate', 'impress.js', 'homebrew',
+ 'backbone', 'moment1', 'momentjs', 'moment', 'linux', 'animate.css', 'animate-css', 'reveal.js', 'jquery-file-upload', 'blueimp-file-upload', 'threejs', 'express', 'chosen',
+ 'normalize-css', 'normalize.css', 'semantic', 'semantic-ui', 'Semantic-UI', 'modernizr', 'underscore', 'underscore1',
+ 'material-design-icons', 'ionic', 'chartjs', 'Chart.js', 'nnnick-chartjs', 'select2-ng', 'select2-dist', 'phantom', 'skrollr', 'scrollr', 'less.js', 'leancss', 'parser-lib',
+ 'hui', 'bootstrap-languages', 'async', 'gulp', 'jquery-pjax', 'coffeescript', 'hammer.js', 'ace', 'leaflet', 'jquery-mobile', 'sweetalert', 'typeahead.js', 'soup', 'typehead.js',
+ 'sails', 'codeigniter2'];
public constructor(private xhr: XHRRequest) {
}
public getDocumentSelector(): DocumentSelector {
- return [{ language: 'json', pattern: '**/bower.json' }, { language: 'json', pattern: '**/.bower.json' }];
+ return [{ language: 'json', pattern: '**/bower.json' }, { language: 'json', pattern: '**/.bower.json' }];
}
public collectDefaultSuggestions(resource: string, collector: ISuggestionsCollector): Thenable {
let defaultValue = {
'name': '{{name}}',
'description': '{{description}}',
- 'authors': [ '{{author}}' ],
+ 'authors': ['{{author}}'],
'version': '{{1.0.0}}',
'main': '{{pathToMain}}',
'dependencies': {}
@@ -46,19 +46,19 @@ export class BowerJSONContribution implements IJSONContribution {
return Promise.resolve(null);
}
- public collectPropertySuggestions(resource: string, location: Location, currentWord: string, addValue: boolean, isLast:boolean, collector: ISuggestionsCollector) : Thenable {
+ public collectPropertySuggestions(resource: string, location: Location, currentWord: string, addValue: boolean, isLast: boolean, collector: ISuggestionsCollector): Thenable {
if ((location.matches(['dependencies']) || location.matches(['devDependencies']))) {
if (currentWord.length > 0) {
let queryUrl = 'https://bower.herokuapp.com/packages/search/' + encodeURIComponent(currentWord);
return this.xhr({
- url : queryUrl
+ url: queryUrl
}).then((success) => {
if (success.status === 200) {
try {
let obj = JSON.parse(success.responseText);
if (Array.isArray(obj)) {
- let results = <{name:string; description:string;}[]> obj;
+ let results = <{ name: string; description: string; }[]>obj;
for (let i = 0; i < results.length; i++) {
let name = results[i].name;
let description = results[i].description || '';
@@ -126,7 +126,7 @@ export class BowerJSONContribution implements IJSONContribution {
return Promise.resolve(null);
}
- public resolveSuggestion(item: CompletionItem) : Thenable {
+ public resolveSuggestion(item: CompletionItem): Thenable {
if (item.kind === CompletionItemKind.Property && item.documentation === '') {
return this.getInfo(item.label).then(documentation => {
if (documentation) {
@@ -143,12 +143,12 @@ export class BowerJSONContribution implements IJSONContribution {
let queryUrl = 'https://bower.herokuapp.com/packages/' + encodeURIComponent(pack);
return this.xhr({
- url : queryUrl
+ url: queryUrl
}).then((success) => {
try {
let obj = JSON.parse(success.responseText);
if (obj && obj.url) {
- let url : string = obj.url;
+ let url: string = obj.url;
if (url.indexOf('git://') === 0) {
url = url.substring(6);
}
@@ -170,7 +170,7 @@ export class BowerJSONContribution implements IJSONContribution {
if ((location.matches(['dependencies', '*']) || location.matches(['devDependencies', '*']))) {
let pack = location.path[location.path.length - 1];
if (typeof pack === 'string') {
- let htmlContent : MarkedString[] = [];
+ let htmlContent: MarkedString[] = [];
htmlContent.push(localize('json.bower.package.hover', '{0}', pack));
return this.getInfo(pack).then(documentation => {
if (documentation) {
diff --git a/extensions/javascript/src/features/jsonContributions.ts b/extensions/javascript/src/features/jsonContributions.ts
index ffa70cbdc17..e82f8b193e4 100644
--- a/extensions/javascript/src/features/jsonContributions.ts
+++ b/extensions/javascript/src/features/jsonContributions.ts
@@ -4,34 +4,36 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
-import {Location, getLocation, createScanner, SyntaxKind, ScanError} from 'jsonc-parser';
-import {basename} from 'path';
-import {BowerJSONContribution} from './bowerJSONContribution';
-import {PackageJSONContribution} from './packageJSONContribution';
-import {XHRRequest} from 'request-light';
+import { Location, getLocation, createScanner, SyntaxKind, ScanError } from 'jsonc-parser';
+import { basename } from 'path';
+import { BowerJSONContribution } from './bowerJSONContribution';
+import { PackageJSONContribution } from './packageJSONContribution';
+import { XHRRequest } from 'request-light';
-import {CompletionItem, CompletionItemProvider, CompletionList, TextDocument, Position, Hover, HoverProvider,
- CancellationToken, Range, TextEdit, MarkedString, DocumentSelector, languages, Disposable} from 'vscode';
+import {
+ CompletionItem, CompletionItemProvider, CompletionList, TextDocument, Position, Hover, HoverProvider,
+ CancellationToken, Range, TextEdit, MarkedString, DocumentSelector, languages, Disposable
+} from 'vscode';
export interface ISuggestionsCollector {
add(suggestion: CompletionItem): void;
- error(message:string): void;
- log(message:string): void;
+ error(message: string): void;
+ log(message: string): void;
setAsIncomplete(): void;
}
export interface IJSONContribution {
getDocumentSelector(): DocumentSelector;
- getInfoContribution(fileName: string, location: Location) : Thenable;
- collectPropertySuggestions(fileName: string, location: Location, currentWord: string, addValue: boolean, isLast:boolean, result: ISuggestionsCollector) : Thenable;
+ getInfoContribution(fileName: string, location: Location): Thenable;
+ collectPropertySuggestions(fileName: string, location: Location, currentWord: string, addValue: boolean, isLast: boolean, result: ISuggestionsCollector): Thenable;
collectValueSuggestions(fileName: string, location: Location, result: ISuggestionsCollector): Thenable;
collectDefaultSuggestions(fileName: string, result: ISuggestionsCollector): Thenable;
resolveSuggestion?(item: CompletionItem): Thenable;
}
-export function addJSONProviders(xhr: XHRRequest) : Disposable {
+export function addJSONProviders(xhr: XHRRequest): Disposable {
let contributions = [new PackageJSONContribution(xhr), new BowerJSONContribution(xhr)];
- let subscriptions : Disposable[] = [];
+ let subscriptions: Disposable[] = [];
contributions.forEach(contribution => {
let selector = contribution.getDocumentSelector();
subscriptions.push(languages.registerCompletionItemProvider(selector, new JSONCompletionItemProvider(contribution), '.', '$'));
@@ -72,7 +74,7 @@ export class JSONCompletionItemProvider implements CompletionItemProvider {
constructor(private jsonContribution: IJSONContribution) {
}
- public resolveCompletionItem(item: CompletionItem, token: CancellationToken) : Thenable {
+ public resolveCompletionItem(item: CompletionItem, token: CancellationToken): Thenable {
if (this.jsonContribution.resolveSuggestion) {
let resolver = this.jsonContribution.resolveSuggestion(item);
if (resolver) {
@@ -87,7 +89,7 @@ export class JSONCompletionItemProvider implements CompletionItemProvider {
let fileName = basename(document.fileName);
let currentWord = this.getCurrentWord(document, position);
- let overwriteRange : Range;
+ let overwriteRange: Range;
let items: CompletionItem[] = [];
let isIncomplete = false;
@@ -116,7 +118,7 @@ export class JSONCompletionItemProvider implements CompletionItemProvider {
log: (message: string) => console.log(message)
};
- let collectPromise : Thenable = null;
+ let collectPromise: Thenable = null;
if (location.isAtPropertyKey) {
let addValue = !location.previousNode || !location.previousNode.columnOffset;
@@ -146,15 +148,15 @@ export class JSONCompletionItemProvider implements CompletionItemProvider {
while (i >= 0 && ' \t\n\r\v":{[,'.indexOf(text.charAt(i)) === -1) {
i--;
}
- return text.substring(i+1, position.character);
+ return text.substring(i + 1, position.character);
}
- private isLast(document: TextDocument, position: Position):boolean {
+ private isLast(document: TextDocument, position: Position): boolean {
let scanner = createScanner(document.getText(), true);
scanner.setPosition(document.offsetAt(position));
let nextToken = scanner.scan();
if (nextToken === SyntaxKind.StringLiteral && scanner.getTokenError() === ScanError.UnexpectedEndOfString) {
- nextToken= scanner.scan();
+ nextToken = scanner.scan();
}
return nextToken === SyntaxKind.CloseBraceToken || nextToken === SyntaxKind.EOF;
}
diff --git a/extensions/javascript/src/features/markedTextUtil.ts b/extensions/javascript/src/features/markedTextUtil.ts
index 97f3198b80c..b4a9aaaf3e9 100644
--- a/extensions/javascript/src/features/markedTextUtil.ts
+++ b/extensions/javascript/src/features/markedTextUtil.ts
@@ -4,8 +4,8 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
-import {MarkedString} from 'vscode';
+import { MarkedString } from 'vscode';
-export function textToMarkedString(text: string) : MarkedString {
+export function textToMarkedString(text: string): MarkedString {
return text.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash
}
\ No newline at end of file
diff --git a/extensions/javascript/src/features/packageJSONContribution.ts b/extensions/javascript/src/features/packageJSONContribution.ts
index e7107bef811..6c8a54f261d 100644
--- a/extensions/javascript/src/features/packageJSONContribution.ts
+++ b/extensions/javascript/src/features/packageJSONContribution.ts
@@ -4,11 +4,11 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
-import {MarkedString, CompletionItemKind, CompletionItem, DocumentSelector} from 'vscode';
-import {IJSONContribution, ISuggestionsCollector} from './jsonContributions';
-import {XHRRequest} from 'request-light';
-import {Location} from 'jsonc-parser';
-import {textToMarkedString} from './markedTextUtil';
+import { MarkedString, CompletionItemKind, CompletionItem, DocumentSelector } from 'vscode';
+import { IJSONContribution, ISuggestionsCollector } from './jsonContributions';
+import { XHRRequest } from 'request-light';
+import { Location } from 'jsonc-parser';
+import { textToMarkedString } from './markedTextUtil';
import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();
@@ -17,7 +17,7 @@ let LIMIT = 40;
export class PackageJSONContribution implements IJSONContribution {
- private mostDependedOn = [ 'lodash', 'async', 'underscore', 'request', 'commander', 'express', 'debug', 'chalk', 'colors', 'q', 'coffee-script',
+ private mostDependedOn = ['lodash', 'async', 'underscore', 'request', 'commander', 'express', 'debug', 'chalk', 'colors', 'q', 'coffee-script',
'mkdirp', 'optimist', 'through2', 'yeoman-generator', 'moment', 'bluebird', 'glob', 'gulp-util', 'minimist', 'cheerio', 'jade', 'redis', 'node-uuid',
'socket', 'io', 'uglify-js', 'winston', 'through', 'fs-extra', 'handlebars', 'body-parser', 'rimraf', 'mime', 'semver', 'mongodb', 'jquery',
'grunt', 'connect', 'yosay', 'underscore', 'string', 'xml2js', 'ejs', 'mongoose', 'marked', 'extend', 'mocha', 'superagent', 'js-yaml', 'xtend',
@@ -25,7 +25,7 @@ export class PackageJSONContribution implements IJSONContribution {
'jsdom', 'stylus', 'when', 'readable-stream', 'aws-sdk', 'concat-stream', 'chai', 'Thenable', 'wrench'];
public getDocumentSelector(): DocumentSelector {
- return [{ language: 'json', pattern: '**/package.json' }];
+ return [{ language: 'json', pattern: '**/package.json' }];
}
public constructor(private xhr: XHRRequest) {
@@ -47,20 +47,20 @@ export class PackageJSONContribution implements IJSONContribution {
return Promise.resolve(null);
}
- public collectPropertySuggestions(resource: string, location: Location, currentWord: string, addValue: boolean, isLast:boolean, collector: ISuggestionsCollector) : Thenable {
+ public collectPropertySuggestions(resource: string, location: Location, currentWord: string, addValue: boolean, isLast: boolean, collector: ISuggestionsCollector): Thenable {
if ((location.matches(['dependencies']) || location.matches(['devDependencies']) || location.matches(['optionalDependencies']) || location.matches(['peerDependencies']))) {
- let queryUrl : string;
+ let queryUrl: string;
if (currentWord.length > 0) {
- queryUrl = 'https://skimdb.npmjs.com/registry/_design/app/_view/browseAll?group_level=1&limit=' + LIMIT + '&start_key=%5B%22' + encodeURIComponent(currentWord) + '%22%5D&end_key=%5B%22'+ encodeURIComponent(currentWord + 'z') + '%22,%7B%7D%5D';
+ queryUrl = 'https://skimdb.npmjs.com/registry/_design/app/_view/browseAll?group_level=1&limit=' + LIMIT + '&start_key=%5B%22' + encodeURIComponent(currentWord) + '%22%5D&end_key=%5B%22' + encodeURIComponent(currentWord + 'z') + '%22,%7B%7D%5D';
return this.xhr({
- url : queryUrl
+ url: queryUrl
}).then((success) => {
if (success.status === 200) {
try {
let obj = JSON.parse(success.responseText);
if (obj && Array.isArray(obj.rows)) {
- let results = <{ key: string[]; }[]> obj.rows;
+ let results = <{ key: string[]; }[]>obj.rows;
for (let i = 0; i < results.length; i++) {
let keys = results[i].key;
if (Array.isArray(keys) && keys.length > 0) {
@@ -124,7 +124,7 @@ export class PackageJSONContribution implements IJSONContribution {
if (typeof currentKey === 'string') {
let queryUrl = 'http://registry.npmjs.org/' + encodeURIComponent(currentKey).replace('%40', '@');
return this.xhr({
- url : queryUrl
+ url: queryUrl
}).then((success) => {
try {
let obj = JSON.parse(success.responseText);
@@ -163,7 +163,7 @@ export class PackageJSONContribution implements IJSONContribution {
return null;
}
- public resolveSuggestion(item: CompletionItem) : Thenable {
+ public resolveSuggestion(item: CompletionItem): Thenable {
if (item.kind === CompletionItemKind.Property && item.documentation === '') {
return this.getInfo(item.label).then(infos => {
if (infos.length > 0) {
@@ -183,12 +183,12 @@ export class PackageJSONContribution implements IJSONContribution {
let queryUrl = 'http://registry.npmjs.org/' + encodeURIComponent(pack).replace('%40', '@');
return this.xhr({
- url : queryUrl
+ url: queryUrl
}).then((success) => {
try {
let obj = JSON.parse(success.responseText);
if (obj) {
- let result : string[] = [];
+ let result: string[] = [];
if (obj.description) {
result.push(obj.description);
}
@@ -211,7 +211,7 @@ export class PackageJSONContribution implements IJSONContribution {
if ((location.matches(['dependencies', '*']) || location.matches(['devDependencies', '*']) || location.matches(['optionalDependencies', '*']) || location.matches(['peerDependencies', '*']))) {
let pack = location.path[location.path.length - 1];
if (typeof pack === 'string') {
- let htmlContent : MarkedString[] = [];
+ let htmlContent: MarkedString[] = [];
htmlContent.push(localize('json.npm.package.hover', '{0}', pack));
return this.getInfo(pack).then(infos => {
infos.forEach(info => {
diff --git a/extensions/javascript/src/javascriptMain.ts b/extensions/javascript/src/javascriptMain.ts
index e386e14e4ed..92dc3e82b70 100644
--- a/extensions/javascript/src/javascriptMain.ts
+++ b/extensions/javascript/src/javascriptMain.ts
@@ -5,15 +5,15 @@
'use strict';
-import {addJSONProviders} from './features/jsonContributions';
+import { addJSONProviders } from './features/jsonContributions';
import * as httpRequest from 'request-light';
-import {ExtensionContext, env, workspace} from 'vscode';
+import { ExtensionContext, env, workspace } from 'vscode';
import * as nls from 'vscode-nls';
export function activate(context: ExtensionContext): any {
- nls.config({locale: env.language});
+ nls.config({ locale: env.language });
configureHttpRequest();
workspace.onDidChangeConfiguration(e => configureHttpRequest());
diff --git a/extensions/json/client/src/jsonMain.ts b/extensions/json/client/src/jsonMain.ts
index 2b86fc57dd6..10ef18a39dc 100644
--- a/extensions/json/client/src/jsonMain.ts
+++ b/extensions/json/client/src/jsonMain.ts
@@ -6,8 +6,8 @@
import * as path from 'path';
-import {workspace, languages, ExtensionContext, extensions, Uri} from 'vscode';
-import {LanguageClient, LanguageClientOptions, RequestType, ServerOptions, TransportKind, NotificationType} from 'vscode-languageclient';
+import { workspace, languages, ExtensionContext, extensions, Uri } from 'vscode';
+import { LanguageClient, LanguageClientOptions, RequestType, ServerOptions, TransportKind, NotificationType } from 'vscode-languageclient';
import TelemetryReporter from 'vscode-extension-telemetry';
import * as nls from 'vscode-nls';
@@ -97,8 +97,8 @@ export function activate(context: ExtensionContext) {
});
}
-function getSchemaAssociation(context: ExtensionContext) : ISchemaAssociations {
- let associations : ISchemaAssociations = {};
+function getSchemaAssociation(context: ExtensionContext): ISchemaAssociations {
+ let associations: ISchemaAssociations = {};
extensions.all.forEach(extension => {
let packageJSON = extension.packageJSON;
if (packageJSON && packageJSON.contributes && packageJSON.contributes.jsonValidation) {
diff --git a/extensions/json/client/src/typings/vscode-extension-telemetry.d.ts b/extensions/json/client/src/typings/vscode-extension-telemetry.d.ts
index 4b2981b9b24..f6177ef27a6 100644
--- a/extensions/json/client/src/typings/vscode-extension-telemetry.d.ts
+++ b/extensions/json/client/src/typings/vscode-extension-telemetry.d.ts
@@ -1,6 +1,6 @@
declare module 'vscode-extension-telemetry' {
export default class TelemetryReporter {
- constructor(extensionId: string,extensionVersion: string, key: string);
+ constructor(extensionId: string, extensionVersion: string, key: string);
sendTelemetryEvent(eventName: string, properties?: { [key: string]: string }, measures?: { [key: string]: number }): void;
}
}
\ No newline at end of file
diff --git a/extensions/json/server/src/jsonServerMain.ts b/extensions/json/server/src/jsonServerMain.ts
index 3340ba905f4..93f510d8770 100644
--- a/extensions/json/server/src/jsonServerMain.ts
+++ b/extensions/json/server/src/jsonServerMain.ts
@@ -9,17 +9,17 @@ import {
TextDocuments, TextDocument, InitializeParams, InitializeResult, NotificationType, RequestType
} from 'vscode-languageserver';
-import {xhr, XHRResponse, configure as configureHttpRequests, getErrorStatusDescription} from 'request-light';
+import { xhr, XHRResponse, configure as configureHttpRequests, getErrorStatusDescription } from 'request-light';
import path = require('path');
import fs = require('fs');
import URI from './utils/uri';
import * as URL from 'url';
import Strings = require('./utils/strings');
-import {JSONDocument, JSONSchema, LanguageSettings, getLanguageService} from 'vscode-json-languageservice';
-import {ProjectJSONContribution} from './jsoncontributions/projectJSONContribution';
-import {GlobPatternContribution} from './jsoncontributions/globPatternContribution';
-import {FileAssociationContribution} from './jsoncontributions/fileAssociationContribution';
-import {getLanguageModelCache} from './languageModelCache';
+import { JSONDocument, JSONSchema, LanguageSettings, getLanguageService } from 'vscode-json-languageservice';
+import { ProjectJSONContribution } from './jsoncontributions/projectJSONContribution';
+import { GlobPatternContribution } from './jsoncontributions/globPatternContribution';
+import { FileAssociationContribution } from './jsoncontributions/fileAssociationContribution';
+import { getLanguageModelCache } from './languageModelCache';
import * as nls from 'vscode-nls';
nls.config(process.env['VSCODE_NLS_CONFIG']);
@@ -76,7 +76,7 @@ let workspaceContext = {
}
};
-let schemaRequestService = (uri:string): Thenable => {
+let schemaRequestService = (uri: string): Thenable => {
if (Strings.startsWith(uri, 'file://')) {
let fsPath = URI.parse(uri).fsPath;
return new Promise((c, e) => {
@@ -153,7 +153,7 @@ connection.onNotification(SchemaAssociationNotification.type, associations => {
});
function updateConfiguration() {
- let languageSettings : LanguageSettings = {
+ let languageSettings: LanguageSettings = {
validate: true,
allowComments: true,
schemas: []
@@ -204,7 +204,7 @@ documents.onDidClose(event => {
connection.sendDiagnostics({ uri: event.document.uri, diagnostics: [] });
});
-let pendingValidationRequests : { [uri: string]: NodeJS.Timer; } = {};
+let pendingValidationRequests: { [uri: string]: NodeJS.Timer; } = {};
const validationDelayMs = 200;
function cleanPendingValidation(textDocument: TextDocument): void {
diff --git a/extensions/json/server/src/jsoncontributions/fileAssociationContribution.ts b/extensions/json/server/src/jsoncontributions/fileAssociationContribution.ts
index 0b9b2b57537..3d5a6e669fb 100644
--- a/extensions/json/server/src/jsoncontributions/fileAssociationContribution.ts
+++ b/extensions/json/server/src/jsoncontributions/fileAssociationContribution.ts
@@ -4,9 +4,9 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
-import {MarkedString, CompletionItemKind, CompletionItem} from 'vscode-languageserver';
+import { MarkedString, CompletionItemKind, CompletionItem } from 'vscode-languageserver';
import Strings = require('../utils/strings');
-import {JSONWorkerContribution, JSONPath, CompletionsCollector} from 'vscode-json-languageservice';
+import { JSONWorkerContribution, JSONPath, CompletionsCollector } from 'vscode-json-languageservice';
import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();
@@ -17,12 +17,12 @@ let globProperties: CompletionItem[] = [
];
export class FileAssociationContribution implements JSONWorkerContribution {
- private languageIds:string[];
+ private languageIds: string[];
constructor() {
}
- public setLanguageIds(ids:string[]): void {
+ public setLanguageIds(ids: string[]): void {
this.languageIds = ids;
}
diff --git a/extensions/json/server/src/jsoncontributions/globPatternContribution.ts b/extensions/json/server/src/jsoncontributions/globPatternContribution.ts
index d2a3b873eec..bb3eb6bd802 100644
--- a/extensions/json/server/src/jsoncontributions/globPatternContribution.ts
+++ b/extensions/json/server/src/jsoncontributions/globPatternContribution.ts
@@ -4,9 +4,9 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
-import {MarkedString, CompletionItemKind, CompletionItem} from 'vscode-languageserver';
+import { MarkedString, CompletionItemKind, CompletionItem } from 'vscode-languageserver';
import Strings = require('../utils/strings');
-import {JSONWorkerContribution, JSONPath, CompletionsCollector} from 'vscode-json-languageservice';
+import { JSONWorkerContribution, JSONPath, CompletionsCollector } from 'vscode-json-languageservice';
import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();
diff --git a/extensions/json/server/src/jsoncontributions/projectJSONContribution.ts b/extensions/json/server/src/jsoncontributions/projectJSONContribution.ts
index 6a458db385c..7fa207b3627 100644
--- a/extensions/json/server/src/jsoncontributions/projectJSONContribution.ts
+++ b/extensions/json/server/src/jsoncontributions/projectJSONContribution.ts
@@ -4,11 +4,11 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
-import {MarkedString, CompletionItemKind, CompletionItem} from 'vscode-languageserver';
+import { MarkedString, CompletionItemKind, CompletionItem } from 'vscode-languageserver';
import Strings = require('../utils/strings');
-import {XHRResponse, getErrorStatusDescription} from 'request-light';
-import {JSONWorkerContribution, JSONPath, CompletionsCollector} from 'vscode-json-languageservice';
-import {xhr} from 'request-light';
+import { XHRResponse, getErrorStatusDescription } from 'request-light';
+import { JSONWorkerContribution, JSONPath, CompletionsCollector } from 'vscode-json-languageservice';
+import { xhr } from 'request-light';
import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();
@@ -29,7 +29,7 @@ interface NugetServices {
export class ProjectJSONContribution implements JSONWorkerContribution {
- private cachedProjects: { [id: string]: { version: string, description: string, time: number }} = {};
+ private cachedProjects: { [id: string]: { version: string, description: string, time: number } } = {};
private cacheSize: number = 0;
private nugetIndexPromise: Thenable;
@@ -40,7 +40,7 @@ export class ProjectJSONContribution implements JSONWorkerContribution {
return Strings.endsWith(resource, '/project.json');
}
- private completeWithCache(id: string, item: CompletionItem) : boolean {
+ private completeWithCache(id: string, item: CompletionItem): boolean {
let entry = this.cachedProjects[id];
if (entry) {
if (new Date().getTime() - entry.time > CACHE_EXPIRY) {
@@ -57,10 +57,10 @@ export class ProjectJSONContribution implements JSONWorkerContribution {
}
private addCached(id: string, version: string, description: string) {
- this.cachedProjects[id] = { version, description, time: new Date().getTime()};
+ this.cachedProjects[id] = { version, description, time: new Date().getTime() };
this.cacheSize++;
if (this.cacheSize > 50) {
- let currentTime = new Date().getTime() ;
+ let currentTime = new Date().getTime();
for (let id in this.cachedProjects) {
let entry = this.cachedProjects[id];
if (currentTime - entry.time > CACHE_EXPIRY) {
@@ -71,12 +71,12 @@ export class ProjectJSONContribution implements JSONWorkerContribution {
}
}
- private getNugetIndex() : Thenable {
+ private getNugetIndex(): Thenable {
if (!this.nugetIndexPromise) {
this.nugetIndexPromise = this.makeJSONRequest(FEED_INDEX_URL).then(indexContent => {
- let services : NugetServices = {};
+ let services: NugetServices = {};
if (indexContent && Array.isArray(indexContent.resources)) {
- let resources = indexContent.resources;
+ let resources = indexContent.resources;
for (let i = resources.length - 1; i >= 0; i--) {
let type = resources[i]['@type'];
let id = resources[i]['@id'];
@@ -91,7 +91,7 @@ export class ProjectJSONContribution implements JSONWorkerContribution {
return this.nugetIndexPromise;
}
- private getNugetService(serviceType: string) : Thenable {
+ private getNugetService(serviceType: string): Thenable {
return this.getNugetIndex().then(services => {
let serviceURL = services[serviceType];
if (!serviceURL) {
@@ -116,13 +116,13 @@ export class ProjectJSONContribution implements JSONWorkerContribution {
return null;
}
- private makeJSONRequest(url: string) : Thenable {
+ private makeJSONRequest(url: string): Thenable {
return xhr({
- url : url
+ url: url
}).then(success => {
if (success.status === 200) {
try {
- return JSON.parse(success.responseText);
+ return JSON.parse(success.responseText);
} catch (e) {
return Promise.reject(localize('json.nugget.error.invalidformat', '{0} is not a valid JSON document', url));
}
@@ -133,19 +133,19 @@ export class ProjectJSONContribution implements JSONWorkerContribution {
});
}
- public collectPropertyCompletions(resource: string, location: JSONPath, currentWord: string, addValue: boolean, isLast:boolean, result: CompletionsCollector) : Thenable {
+ public collectPropertyCompletions(resource: string, location: JSONPath, currentWord: string, addValue: boolean, isLast: boolean, result: CompletionsCollector): Thenable {
if (this.isProjectJSONFile(resource) && (matches(location, ['dependencies']) || matches(location, ['frameworks', '*', 'dependencies']) || matches(location, ['frameworks', '*', 'frameworkAssemblies']))) {
return this.getNugetService('SearchAutocompleteService').then(service => {
- let queryUrl : string;
+ let queryUrl: string;
if (currentWord.length > 0) {
- queryUrl = service + '?q=' + encodeURIComponent(currentWord) +'&take=' + LIMIT;
+ queryUrl = service + '?q=' + encodeURIComponent(currentWord) + '&take=' + LIMIT;
} else {
queryUrl = service + '?take=' + LIMIT;
}
return this.makeJSONRequest(queryUrl).then(resultObj => {
if (Array.isArray(resultObj.data)) {
- let results = resultObj.data;
+ let results = resultObj.data;
for (let i = 0; i < results.length; i++) {
let name = results[i];
let insertText = JSON.stringify(name);
@@ -155,7 +155,7 @@ export class ProjectJSONContribution implements JSONWorkerContribution {
insertText += ',';
}
}
- let item : CompletionItem = { kind: CompletionItemKind.Property, label: name, insertText: insertText, filterText: JSON.stringify(name)};
+ let item: CompletionItem = { kind: CompletionItemKind.Property, label: name, insertText: insertText, filterText: JSON.stringify(name) };
if (!this.completeWithCache(name, item)) {
item.data = RESOLVE_ID + name;
}
@@ -181,7 +181,7 @@ export class ProjectJSONContribution implements JSONWorkerContribution {
let queryUrl = service + currentKey + '/index.json';
return this.makeJSONRequest(queryUrl).then(obj => {
if (Array.isArray(obj.versions)) {
- let results = obj.versions;
+ let results = obj.versions;
for (let i = 0; i < results.length; i++) {
let curr = results[i];
let name = JSON.stringify(curr);
@@ -205,15 +205,15 @@ export class ProjectJSONContribution implements JSONWorkerContribution {
public getInfoContribution(resource: string, location: JSONPath): Thenable {
if (this.isProjectJSONFile(resource) && (matches(location, ['dependencies', '*']) || matches(location, ['frameworks', '*', 'dependencies', '*']) || matches(location, ['frameworks', '*', 'frameworkAssemblies', '*']))) {
- let pack = location[location.length - 1];
+ let pack = location[location.length - 1];
return this.getNugetService('SearchQueryService').then(service => {
- let queryUrl = service + '?q=' + encodeURIComponent(pack) +'&take=' + 5;
+ let queryUrl = service + '?q=' + encodeURIComponent(pack) + '&take=' + 5;
return this.makeJSONRequest(queryUrl).then(resultObj => {
- let htmlContent : MarkedString[] = [];
+ let htmlContent: MarkedString[] = [];
htmlContent.push(localize('json.nugget.package.hover', '{0}', pack));
if (Array.isArray(resultObj.data)) {
- let results = resultObj.data;
+ let results = resultObj.data;
for (let i = 0; i < results.length; i++) {
let res = results[i];
this.addCached(res.id, res.version, res.description);
@@ -233,24 +233,24 @@ export class ProjectJSONContribution implements JSONWorkerContribution {
return null;
});
}, (error) => {
- return null;
+ return null;
});
}
return null;
}
- public resolveSuggestion(item: CompletionItem) : Thenable {
+ public resolveSuggestion(item: CompletionItem): Thenable {
if (item.data && Strings.startsWith(item.data, RESOLVE_ID)) {
let pack = item.data.substring(RESOLVE_ID.length);
if (this.completeWithCache(pack, item)) {
return Promise.resolve(item);
}
return this.getNugetService('SearchQueryService').then(service => {
- let queryUrl = service + '?q=' + encodeURIComponent(pack) +'&take=' + 10;
+ let queryUrl = service + '?q=' + encodeURIComponent(pack) + '&take=' + 10;
return this.makeJSONRequest(queryUrl).then(resultObj => {
let itemResolved = false;
if (Array.isArray(resultObj.data)) {
- let results = resultObj.data;
+ let results = resultObj.data;
for (let i = 0; i < results.length; i++) {
let curr = results[i];
this.addCached(curr.id, curr.version, curr.description);
diff --git a/extensions/json/server/src/languageModelCache.ts b/extensions/json/server/src/languageModelCache.ts
index dce68bed9a3..b12f77b52a6 100644
--- a/extensions/json/server/src/languageModelCache.ts
+++ b/extensions/json/server/src/languageModelCache.ts
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
-import {TextDocument} from 'vscode-languageserver';
+import { TextDocument } from 'vscode-languageserver';
export interface LanguageModelCache {
get(document: TextDocument): T;
@@ -12,8 +12,8 @@ export interface LanguageModelCache {
dispose(): void;
}
-export function getLanguageModelCache(maxEntries: number, cleanupIntervalTimeInSec: number, parse: (document: TextDocument) => T) : LanguageModelCache {
- let languageModels: { [uri:string]: {version:number, languageId: string, cTime: number, languageModel: T}} = {};
+export function getLanguageModelCache(maxEntries: number, cleanupIntervalTimeInSec: number, parse: (document: TextDocument) => T): LanguageModelCache {
+ let languageModels: { [uri: string]: { version: number, languageId: string, cTime: number, languageModel: T } } = {};
let nModels = 0;
let cleanupInterval = void 0;
@@ -32,7 +32,7 @@ export function getLanguageModelCache(maxEntries: number, cleanupIntervalTime
}
return {
- get(document: TextDocument) : T {
+ get(document: TextDocument): T {
let version = document.version;
let languageId = document.languageId;
let languageModelInfo = languageModels[document.uri];
@@ -41,7 +41,7 @@ export function getLanguageModelCache(maxEntries: number, cleanupIntervalTime
return languageModelInfo.languageModel;
}
let languageModel = parse(document);
- languageModels[document.uri] = { languageModel, version, languageId, cTime: Date.now()};
+ languageModels[document.uri] = { languageModel, version, languageId, cTime: Date.now() };
if (!languageModelInfo) {
nModels++;
}
diff --git a/extensions/json/server/src/typings/promise.d.ts b/extensions/json/server/src/typings/promise.d.ts
index 31b97cb9580..925c943df50 100644
--- a/extensions/json/server/src/typings/promise.d.ts
+++ b/extensions/json/server/src/typings/promise.d.ts
@@ -31,8 +31,8 @@ interface Thenable {
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of which ever callback is executed.
*/
- then(onfulfilled?: (value: R) => TResult | Thenable, onrejected?: (reason: any) => TResult | Thenable): Thenable;
- then(onfulfilled?: (value: R) => TResult | Thenable, onrejected?: (reason: any) => void): Thenable;
+ then(onfulfilled?: (value: R) => TResult | Thenable, onrejected?: (reason: any) => TResult | Thenable): Thenable;
+ then(onfulfilled?: (value: R) => TResult | Thenable, onrejected?: (reason: any) => void): Thenable;
}
/**
@@ -45,15 +45,15 @@ interface Promise extends Thenable {
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of which ever callback is executed.
*/
- then(onfulfilled?: (value: T) => TResult | Thenable, onrejected?: (reason: any) => TResult | Thenable): Promise;
- then(onfulfilled?: (value: T) => TResult | Thenable