mirror of
https://github.com/Microsoft/vscode
synced 2024-10-12 22:37:41 +00:00
Merge branch 'Microsoft/master' into update-css-intellisense
This commit is contained in:
commit
70208296a0
21
.travis.yml
21
.travis.yml
|
@ -1,8 +1,9 @@
|
|||
sudo: false
|
||||
language: node_js
|
||||
language: cpp
|
||||
|
||||
node_js:
|
||||
- "0.12"
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
|
||||
addons:
|
||||
apt:
|
||||
|
@ -17,8 +18,20 @@ addons:
|
|||
- libgtk2.0-0
|
||||
|
||||
before_install:
|
||||
- export CXX="g++-4.9" CC="gcc-4.9"
|
||||
- git submodule update --init --recursive
|
||||
- git clone https://github.com/creationix/nvm.git ./.nvm
|
||||
- source ./.nvm/nvm.sh
|
||||
- nvm install 0.12
|
||||
- nvm use 0.12
|
||||
- npm config set python `which python`
|
||||
- npm install -g gulp
|
||||
- if [ $TRAVIS_OS_NAME == "linux" ]; then
|
||||
export CXX="g++-4.9" CC="gcc-4.9";
|
||||
fi
|
||||
|
||||
install:
|
||||
- ./scripts/npm.sh install
|
||||
- gulp electron compile
|
||||
|
||||
script:
|
||||
- ./test/run.sh
|
||||
|
|
|
@ -9,53 +9,13 @@ var copyright = [
|
|||
' *--------------------------------------------------------------------------------------------*/'
|
||||
].join('\n');
|
||||
|
||||
var ignoreList = [
|
||||
'/src/vs/languages/typescript/common/lib/lib.d.ts',
|
||||
'/src/vs/languages/typescript/common/lib/lib.es6.d.ts',
|
||||
'/src/vs/languages/typescript/common/lib/typescriptServices.d.ts',
|
||||
'/src/vs/workbench/parts/emmet/node/emmet.d.ts',
|
||||
'/src/vs/editor/standalone-languages/swift.ts',
|
||||
'/src/vs/workbench/browser/media/octicons/octicons.css',
|
||||
'/src/vs/base/test/node/encoding/fixtures/some_utf16be.css',
|
||||
'/src/vs/base/test/node/encoding/fixtures/some_utf16le.css',
|
||||
'/src/vs/workbench/services/search/test/node/fixtures/site.css',
|
||||
'/src/vs/workbench/services/search/test/node/fixtures/some_utf16be.css',
|
||||
'/src/vs/workbench/services/search/test/node/fixtures/some_utf16le.css',
|
||||
'/src/vs/workbench/services/files/test/node/fixtures/service/some_utf16le.css',
|
||||
'/extensions/lib.core.d.ts',
|
||||
'/extensions/node.d.ts',
|
||||
'/extensions/csharp-o/src/typings/applicationinsights.d.ts',
|
||||
'/extensions/typescript/out/lib/lib.core.d.ts',
|
||||
'/extensions/typescript/out/lib/lib.core.es6.d.ts',
|
||||
'/extensions/typescript/out/lib/lib.d.ts',
|
||||
'/extensions/typescript/out/lib/lib.dom.d.ts',
|
||||
'/extensions/typescript/out/lib/lib.es6.d.ts',
|
||||
'/extensions/typescript/out/lib/lib.scriptHost.d.ts',
|
||||
'/extensions/typescript/out/lib/lib.webworker.d.ts',
|
||||
'/extensions/typescript/src/lib/lib.core.d.ts',
|
||||
'/extensions/typescript/src/lib/lib.core.es6.d.ts',
|
||||
'/extensions/typescript/src/lib/lib.d.ts',
|
||||
'/extensions/typescript/src/lib/lib.dom.d.ts',
|
||||
'/extensions/typescript/src/lib/lib.es6.d.ts',
|
||||
'/extensions/typescript/src/lib/lib.scriptHost.d.ts',
|
||||
'/extensions/typescript/src/lib/lib.webworker.d.ts',
|
||||
'/extensions/csharp-o/src/typings/semver/semver.d.ts'
|
||||
];
|
||||
|
||||
function ignore(filePath) {
|
||||
filePath = path.posix.normalize(filePath);
|
||||
|
||||
return ignoreList.some(function(p) {
|
||||
return filePath.indexOf(p) !== -1;
|
||||
});
|
||||
}
|
||||
|
||||
exports.copyrights = function () {
|
||||
return es.mapSync(function (file) {
|
||||
if (file.contents) {
|
||||
var contents = file.contents.toString('utf8');
|
||||
|
||||
if (contents.indexOf(copyright) !== 0 && !ignore(file.path)) {
|
||||
if (contents.indexOf(copyright) !== 0) {
|
||||
throw new Error('File ' + file.path + ' does not contain copyright statement.');
|
||||
}
|
||||
}
|
||||
|
@ -67,7 +27,7 @@ exports.insertCopyrights = function() {
|
|||
if (file.contents) {
|
||||
var contents = file.contents.toString('utf8');
|
||||
|
||||
if (contents.indexOf(copyright) !== 0 && !ignore(file.path)) {
|
||||
if (contents.indexOf(copyright) !== 0) {
|
||||
contents = copyright + '\n\n' + contents;
|
||||
fs.writeFileSync(file.path, contents, 'utf8');
|
||||
}
|
||||
|
|
|
@ -6,13 +6,13 @@
|
|||
"contributes": {
|
||||
"languages": [{
|
||||
"id": "c",
|
||||
"extensions": [ ".c", ".h" ],
|
||||
"extensions": [ ".c" ],
|
||||
"aliases": [ "C", "c" ],
|
||||
"configuration": "./cpp.configuration.json"
|
||||
},
|
||||
{
|
||||
"id": "cpp",
|
||||
"extensions": [ ".cpp", ".cc", ".cxx", ".hpp", ".hh", ".hxx" ],
|
||||
"extensions": [ ".cpp", ".cc", ".cxx", ".hpp", ".hh", ".hxx", ".h" ],
|
||||
"aliases": [ "C++", "Cpp", "cpp"],
|
||||
"configuration": "./cpp.configuration.json"
|
||||
}],
|
||||
|
|
13
extensions/csharp-o/typings/mocha.d.ts
vendored
Normal file
13
extensions/csharp-o/typings/mocha.d.ts
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
declare function run(): void;
|
||||
|
||||
declare function suite(name: string, fn: (err?)=>void);
|
||||
declare function test(name: string, fn: (done?: (err?)=>void)=>void);
|
||||
declare function suiteSetup(fn: (done?: (err?)=>void)=>void);
|
||||
declare function suiteTeardown(fn: (done?: (err?)=>void)=>void);
|
||||
declare function setup(fn: (done?: (err?)=>void)=>void);
|
||||
declare function teardown(fn: (done?: (err?)=>void)=>void);
|
|
@ -2,10 +2,9 @@
|
|||
"transition property": {
|
||||
"prefix": "transition",
|
||||
"body": [
|
||||
"transition: ${property} ${duration} ${timing-function} ${delay};",
|
||||
"-webkit-transition: ${property} ${duration} ${timing-function} ${delay};",
|
||||
"-o-transition: ${property} ${duration} ${timing-function} ${delay};",
|
||||
"-moz-transition: ${property} ${duration} ${timing-function} ${delay};"
|
||||
"-moz-transition: ${property} ${duration} ${timing-function} ${delay};",
|
||||
"transition: ${property} ${duration} ${timing-function} ${delay};"
|
||||
],
|
||||
"description": "The transition property across browsers"
|
||||
},
|
||||
|
|
|
@ -708,7 +708,7 @@
|
|||
<array>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\b(a|abbr|acronym|address|area|article|aside|audio|b|base|big|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|datalist|dd|del|details|dfn|dialog|div|dl|dt|em|eventsource|fieldset|figure|figcaption|footer|form|frame|frameset|(h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|label|legend|li|link|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|samp|script|section|select|small|span|strike|strong|style|sub|summary|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|ul|var|video)\b</string>
|
||||
<string>\b(a|abbr|address|area|article|aside|audio|b|base|bdi|bdo|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|data|datalist|dd|del|details|dfn|dialog|div|dl|dt|em|embed|fieldset|figcaption|figure|footer|form|(h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|label|legend|li|link|main|map|mark|menu|menuitem|meta|meter|nav|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|rb|rp|rt|rtc|ruby|s|samp|script|section|select|small|source|span|strong|style|sub|summary|sup|svg|table|tbody|td|template|textarea|tfoot|th|thead|time|title|tr|track|u|ul|var|video|wbr)\b</string>
|
||||
<key>name</key>
|
||||
<string>entity.name.tag.css</string>
|
||||
</dict>
|
||||
|
|
|
@ -639,7 +639,7 @@
|
|||
<key>match</key>
|
||||
<string>(?<!\w)([\p{L}\p{Nl}$_][\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*)(?=\()</string>
|
||||
<key>name</key>
|
||||
<string>meta.function.js</string>
|
||||
<string>meta.function-call.js</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>repository</key>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"account": "monacobuild",
|
||||
"container": "debuggers",
|
||||
"zip": "ad2bb1d/node-debug.zip",
|
||||
"zip": "a7f6203/node-debug.zip",
|
||||
"output": ""
|
||||
}
|
||||
|
|
13
extensions/php/typings/mocha.d.ts
vendored
Normal file
13
extensions/php/typings/mocha.d.ts
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
declare function run(): void;
|
||||
|
||||
declare function suite(name: string, fn: (err?)=>void);
|
||||
declare function test(name: string, fn: (done?: (err?)=>void)=>void);
|
||||
declare function suiteSetup(fn: (done?: (err?)=>void)=>void);
|
||||
declare function suiteTeardown(fn: (done?: (err?)=>void)=>void);
|
||||
declare function setup(fn: (done?: (err?)=>void)=>void);
|
||||
declare function teardown(fn: (done?: (err?)=>void)=>void);
|
|
@ -522,7 +522,7 @@
|
|||
<key>function</key>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>((?i:function|filter|configuration|workflow))\s+((?:\p{L}|\d|_|-|\.)+)</string>
|
||||
<string>(?<!\S)(?i)(function|filter|configuration|workflow)\s+(?:(global|local|script|private):)?((?:\p{L}|\d|_|-|\.)+)</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
|
@ -538,7 +538,12 @@
|
|||
<key>2</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>entity.name.function</string>
|
||||
<string>storage.modifier.scope.powershell</string>
|
||||
</dict>
|
||||
<key>3</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>entity.name.function.powershell</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 { workspace, TextDocument, TextDocumentChangeEvent, TextDocumentContentChangeEvent, Disposable } from 'vscode';
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 { CompletionItem, TextDocument, Position, CompletionItemKind, CompletionItemProvider, CancellationToken } from 'vscode';
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 { workspace } from 'vscode';
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 { workspace, DefinitionProvider, TextDocument, Position, Range, CancellationToken, Location } from 'vscode';
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 { workspace, DocumentHighlightProvider, DocumentHighlight, DocumentHighlightKind, TextDocument, Position, Range, CancellationToken } from 'vscode';
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 { workspace, DocumentSymbolProvider, SymbolInformation, SymbolKind, TextDocument, Position, Range, CancellationToken } from 'vscode';
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 { workspace, DocumentRangeFormattingEditProvider, OnTypeFormattingEditProvider, FormattingOptions, TextDocument, Position, Range, CancellationToken, TextEdit } from 'vscode';
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 { workspace, HoverProvider, Hover, TextDocument, Position, Range, CancellationToken } from 'vscode';
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 { workspace, ReferenceProvider, Location, TextDocument, Position, Range, CancellationToken } from 'vscode';
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 { workspace, RenameProvider, WorkspaceEdit, TextDocument, Position, Range, CancellationToken } from 'vscode';
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 { workspace, SignatureHelpProvider, SignatureHelp, SignatureInformation, ParameterInformation, TextDocument, Position, CancellationToken } from 'vscode';
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 { workspace, Uri, WorkspaceSymbolProvider, SymbolInformation, SymbolKind, TextDocument, Position, Range, CancellationToken } from 'vscode';
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 class Kind {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
"noLib": true,
|
||||
"target": "ES5",
|
||||
"module": "commonjs",
|
||||
"sourceMap": true,
|
||||
"outDir": "../out"
|
||||
},
|
||||
"exclude": [
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Includes code from typescript-sublime-plugin project, obtained from
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 { CancellationToken, Uri } from 'vscode';
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 * as cp from 'child_process';
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 interface ITask<T> {
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 path = require('path');
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
var net = require('net'),
|
||||
fs = require('fs'),
|
||||
stream = require('stream'),
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const toString = Object.prototype.toString;
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 stream = require('stream');
|
||||
|
|
13
extensions/typescript/typings/mocha.d.ts
vendored
Normal file
13
extensions/typescript/typings/mocha.d.ts
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
declare function run(): void;
|
||||
|
||||
declare function suite(name: string, fn: (err?)=>void);
|
||||
declare function test(name: string, fn: (done?: (err?)=>void)=>void);
|
||||
declare function suiteSetup(fn: (done?: (err?)=>void)=>void);
|
||||
declare function suiteTeardown(fn: (done?: (err?)=>void)=>void);
|
||||
declare function setup(fn: (done?: (err?)=>void)=>void);
|
||||
declare function teardown(fn: (done?: (err?)=>void)=>void);
|
|
@ -1,3 +1,8 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
function farboo() {
|
||||
return 42;
|
||||
}
|
13
extensions/vscode-api-tests/typings/mocha.d.ts
vendored
Normal file
13
extensions/vscode-api-tests/typings/mocha.d.ts
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
declare function run(): void;
|
||||
|
||||
declare function suite(name: string, fn: (err?)=>void);
|
||||
declare function test(name: string, fn: (done?: (err?)=>void)=>void);
|
||||
declare function suiteSetup(fn: (done?: (err?)=>void)=>void);
|
||||
declare function suiteTeardown(fn: (done?: (err?)=>void)=>void);
|
||||
declare function setup(fn: (done?: (err?)=>void)=>void);
|
||||
declare function teardown(fn: (done?: (err?)=>void)=>void);
|
13
gulpfile.js
13
gulpfile.js
|
@ -163,12 +163,21 @@ gulp.task('fix-whitespace-style', function() {
|
|||
return gulp.src(WHITESPACE_FILES, { base: '.' }).pipe(style({whitespace:true})).pipe(gulp.dest('.'));
|
||||
});
|
||||
|
||||
var COPYRIGHTS_FILES = WHITESPACE_FILES.concat([
|
||||
'!**/*.json',
|
||||
'!**/*.html',
|
||||
'!**/test/**',
|
||||
'!**/*.md',
|
||||
'!**/*.sh',
|
||||
'!**/*.txt',
|
||||
'!src/vs/editor/standalone-languages/swift.ts',
|
||||
]);
|
||||
gulp.task('copyrights', function() {
|
||||
return gulp.src(['src/vs/**/*.ts', 'src/vs/**/*.css', 'extensions/**/*.ts', 'extensions/**/*.css']).pipe(copyrights.copyrights());
|
||||
return gulp.src(COPYRIGHTS_FILES, { base: '.' }).pipe(copyrights.copyrights());
|
||||
});
|
||||
|
||||
gulp.task('insert-copyrights', function() {
|
||||
return gulp.src(['src/vs/**/*.ts', 'src/vs/**/*.css', 'extensions/**/*.ts', 'extensions/**/*.css']).pipe(copyrights.insertCopyrights());
|
||||
return gulp.src(COPYRIGHTS_FILES, { base: '.' }).pipe(copyrights.insertCopyrights());
|
||||
});
|
||||
|
||||
gulp.task('test', function () {
|
||||
|
|
|
@ -15,7 +15,7 @@ export function tail<T>(array: T[], n: number = 0): T {
|
|||
|
||||
/**
|
||||
* Iterates the provided array and allows to remove
|
||||
* element while iterating.
|
||||
* elements while iterating.
|
||||
*/
|
||||
export function forEach<T>(array: T[], callback: (element: T, remove: Function) => void): void {
|
||||
for (var i = 0, len = array.length; i < len; i++) {
|
||||
|
@ -76,7 +76,7 @@ export function binarySearch(array: any[], key: any, comparator: (op1: any, op2:
|
|||
/**
|
||||
* Takes a sorted array and a function p. The array is sorted in such a way that all elements where p(x) is false
|
||||
* are located before all elements where p(x) is true.
|
||||
* Returns the least x for which p(x) is true or array.length if no element fullfills the given function
|
||||
* @returns the least x for which p(x) is true or array.length if no element fullfills the given function.
|
||||
*/
|
||||
export function findFirst<T>(array: T[], p: (x: T) => boolean): number {
|
||||
var low = 0, high = array.length;
|
||||
|
@ -118,7 +118,7 @@ export function merge<T>(arrays: T[][], hashFn?: (element: T) => string): T[] {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns a new array with all undefined or null values removed. The original array is not modified at all.
|
||||
* @returns a new array with all undefined or null values removed. The original array is not modified at all.
|
||||
*/
|
||||
export function coalesce<T>(array: T[]): T[] {
|
||||
if (!array) {
|
||||
|
@ -129,7 +129,7 @@ export function coalesce<T>(array: T[]): T[] {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns true if the given item is contained in the array
|
||||
* @returns true if the given item is contained in the array.
|
||||
*/
|
||||
export function contains<T>(array: T[], item: T): boolean {
|
||||
return array.indexOf(item) >= 0;
|
||||
|
@ -154,7 +154,7 @@ export function move(array: any[], from: number, to: number): void {
|
|||
}
|
||||
|
||||
/**
|
||||
* @returns false if the provided object is an array
|
||||
* @returns {{false}} if the provided object is an array
|
||||
* and not empty.
|
||||
*/
|
||||
export function isFalsyOrEmpty(obj: any): boolean {
|
||||
|
|
|
@ -477,7 +477,7 @@ export class RunOnceScheduler {
|
|||
}
|
||||
|
||||
/**
|
||||
* Cancel current scheduled runner (if any)
|
||||
* Cancel current scheduled runner (if any).
|
||||
*/
|
||||
public cancel(): void {
|
||||
if (this.timeoutToken !== -1) {
|
||||
|
|
|
@ -35,7 +35,7 @@ export function createNumberDictionary<V>():INumberDictionary<V> {
|
|||
* @param what The key.
|
||||
* @param from A native JavaScript object that stores items.
|
||||
* @param alternate A default value this is return in case an item with
|
||||
* the key isn't found
|
||||
* the key isn't found.
|
||||
*/
|
||||
export function lookup<T>(from:IStringDictionary<T>, what:string, alternate?:T):T;
|
||||
export function lookup<T>(from:INumberDictionary<T>, what:number, alternate?:T):T;
|
||||
|
|
|
@ -22,7 +22,7 @@ export interface ErrorListenerUnbind {
|
|||
(): void;
|
||||
}
|
||||
|
||||
// avoid circular dependency on EventEmitter by implementing a subset of the interface
|
||||
// Avoid circular dependency on EventEmitter by implementing a subset of the interface.
|
||||
export class ErrorHandler {
|
||||
private unexpectedErrorHandler: (e: any) => void;
|
||||
private listeners: ErrorListenerCallback[];
|
||||
|
@ -255,6 +255,7 @@ function _exceptionToErrorMessage(exception: any, verbose: boolean): string {
|
|||
/**
|
||||
* Tries to generate a human readable error message out of the error. If the verbose parameter
|
||||
* is set to true, the error message will include stacktrace details if provided.
|
||||
* @returns A string containing the error message.
|
||||
*/
|
||||
export function toErrorMessage(error: any = null, verbose: boolean = false): string {
|
||||
if (!error) {
|
||||
|
|
|
@ -19,7 +19,7 @@ export interface IMatch {
|
|||
// Combined filters
|
||||
|
||||
/**
|
||||
* Returns a filter which combines the provided set
|
||||
* @returns A filter which combines the provided set
|
||||
* of filters with an or. The *first* filters that
|
||||
* matches defined the return value of the returned
|
||||
* filter.
|
||||
|
@ -37,7 +37,7 @@ export function or(...filter:IFilter[]):IFilter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns a filter which combines the provided set
|
||||
* @returns A filter which combines the provided set
|
||||
* of filters with an and. The combines matches are
|
||||
* returned if *all* filters match.
|
||||
*/
|
||||
|
|
|
@ -11,11 +11,11 @@ import Platform = require('vs/base/common/platform');
|
|||
/**
|
||||
* Virtual Key Codes, the value does not hold any inherent meaning.
|
||||
* Inspired somewhat from https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx
|
||||
* But these are "more general", as they should work across browsers & OS`s
|
||||
* But these are "more general", as they should work across browsers & OS`s.
|
||||
*/
|
||||
export enum KeyCode {
|
||||
/**
|
||||
* Placed first to cover the 0 value of the enum
|
||||
* Placed first to cover the 0 value of the enum.
|
||||
*/
|
||||
Unknown,
|
||||
|
||||
|
|
|
@ -289,7 +289,7 @@ export class URL extends URI implements objects.IEqualable {
|
|||
/**
|
||||
* Creates a new URL from the provided value
|
||||
* by decoding it first.
|
||||
* @param value A encoded url value.
|
||||
* @param value An encoded url value.
|
||||
*/
|
||||
public static fromEncoded(value:string):URL {
|
||||
return new URL(decodeURIComponent(value));
|
||||
|
@ -354,7 +354,7 @@ export class URL extends URI implements objects.IEqualable {
|
|||
}
|
||||
|
||||
/**
|
||||
* Strip out the hash part of the URL
|
||||
* Strips out the hash part of the URL.
|
||||
* http://www.test.com:8000/this/that/theother.html?query=foo for http://www.test.com:8000/this/that/theother.html?query=foo#hash
|
||||
*/
|
||||
public toUnique():string {
|
||||
|
|
|
@ -9,7 +9,7 @@ import * as Types from 'vs/base/common/types';
|
|||
/**
|
||||
* Equalable objects can compute a
|
||||
* hash-code and can also tell if they
|
||||
* are equal to other objects
|
||||
* are equal to other objects.
|
||||
*/
|
||||
export interface IEqualable {
|
||||
hashCode(): number;
|
||||
|
|
|
@ -97,7 +97,7 @@ export function dirnames(path: string): { next: () => { done: boolean; value: st
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the directory name of a path.
|
||||
* @returns the directory name of a path.
|
||||
*/
|
||||
export function dirname(path: string): string {
|
||||
var idx = ~path.lastIndexOf('/') || ~path.lastIndexOf('\\');
|
||||
|
@ -111,7 +111,7 @@ export function dirname(path: string): string {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the base name of a path.
|
||||
* @returns the base name of a path.
|
||||
*/
|
||||
export function basename(path: string): string {
|
||||
var idx = ~path.lastIndexOf('/') || ~path.lastIndexOf('\\');
|
||||
|
@ -125,7 +125,7 @@ export function basename(path: string): string {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns {{.far}} from boo.far or the empty string.
|
||||
* @returns {{.far}} from boo.far or the empty string.
|
||||
*/
|
||||
export function extname(path: string): string {
|
||||
path = basename(path);
|
||||
|
|
|
@ -15,7 +15,7 @@ import { ValidationStatus, ValidationState, ILogger, Parser, ISystemVariables }
|
|||
|
||||
|
||||
/**
|
||||
* Options to be passed to the external program or shell
|
||||
* Options to be passed to the external program or shell.
|
||||
*/
|
||||
export interface CommandOptions {
|
||||
/**
|
||||
|
@ -33,25 +33,25 @@ export interface CommandOptions {
|
|||
|
||||
export interface Executable {
|
||||
/**
|
||||
* The command to be executed. Can be an external program or a shell
|
||||
* command.
|
||||
*/
|
||||
* The command to be executed. Can be an external program or a shell
|
||||
* command.
|
||||
*/
|
||||
command: string;
|
||||
|
||||
/**
|
||||
* Specifies whether the command is a shell command and therefore must
|
||||
* be executed in a shell interpreter (e.g. cmd.exe, bash, ...).
|
||||
*/
|
||||
* Specifies whether the command is a shell command and therefore must
|
||||
* be executed in a shell interpreter (e.g. cmd.exe, bash, ...).
|
||||
*/
|
||||
isShellCommand: boolean;
|
||||
|
||||
/**
|
||||
* The arguments passed to the command.
|
||||
*/
|
||||
* The arguments passed to the command.
|
||||
*/
|
||||
args: string[];
|
||||
|
||||
/**
|
||||
* The command options used when the command is executed. Can be omitted.
|
||||
*/
|
||||
* The command options used when the command is executed. Can be omitted.
|
||||
*/
|
||||
options?: CommandOptions;
|
||||
}
|
||||
|
||||
|
@ -90,68 +90,68 @@ export interface TerminateResponse {
|
|||
|
||||
export namespace Config {
|
||||
/**
|
||||
* Options to be passed to the external program or shell
|
||||
*/
|
||||
* Options to be passed to the external program or shell
|
||||
*/
|
||||
export interface CommandOptions {
|
||||
/**
|
||||
* The current working directory of the executed program or shell.
|
||||
* If omitted VSCode's current workspace root is used.
|
||||
*/
|
||||
* The current working directory of the executed program or shell.
|
||||
* If omitted VSCode's current workspace root is used.
|
||||
*/
|
||||
cwd?: string;
|
||||
|
||||
/**
|
||||
* The additional environment of the executed program or shell. If omitted
|
||||
* the parent process' environment is used.
|
||||
*/
|
||||
* The additional environment of the executed program or shell. If omitted
|
||||
* the parent process' environment is used.
|
||||
*/
|
||||
env?: IStringDictionary<string>;
|
||||
|
||||
/**
|
||||
* Index signature
|
||||
*/
|
||||
* Index signature
|
||||
*/
|
||||
[key:string]: string | string[] | IStringDictionary<string>;
|
||||
}
|
||||
|
||||
export interface BaseExecutable {
|
||||
/**
|
||||
* The command to be executed. Can be an external program or a shell
|
||||
* command.
|
||||
*/
|
||||
* The command to be executed. Can be an external program or a shell
|
||||
* command.
|
||||
*/
|
||||
command?: string;
|
||||
|
||||
/**
|
||||
* Specifies whether the command is a shell command and therefore must
|
||||
* be executed in a shell interpreter (e.g. cmd.exe, bash, ...).
|
||||
*
|
||||
* Defaults to false if omitted.
|
||||
*/
|
||||
* Specifies whether the command is a shell command and therefore must
|
||||
* be executed in a shell interpreter (e.g. cmd.exe, bash, ...).
|
||||
*
|
||||
* Defaults to false if omitted.
|
||||
*/
|
||||
isShellCommand?: boolean;
|
||||
|
||||
/**
|
||||
* The arguments passed to the command. Can be omitted.
|
||||
*/
|
||||
* The arguments passed to the command. Can be omitted.
|
||||
*/
|
||||
args?: string[];
|
||||
|
||||
/**
|
||||
* The command options used when the command is executed. Can be omitted.
|
||||
*/
|
||||
* The command options used when the command is executed. Can be omitted.
|
||||
*/
|
||||
options?: CommandOptions;
|
||||
}
|
||||
|
||||
export interface Executable extends BaseExecutable {
|
||||
|
||||
/**
|
||||
* Windows specific executable configuration
|
||||
*/
|
||||
* Windows specific executable configuration
|
||||
*/
|
||||
windows?: BaseExecutable;
|
||||
|
||||
/**
|
||||
* Mac specific executable configuration
|
||||
*/
|
||||
* Mac specific executable configuration
|
||||
*/
|
||||
osx?: BaseExecutable;
|
||||
|
||||
/**
|
||||
* Linux specific executable configuration
|
||||
*/
|
||||
* Linux specific executable configuration
|
||||
*/
|
||||
linux?: BaseExecutable;
|
||||
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ import nls = require('vs/nls');
|
|||
export var empty = '';
|
||||
|
||||
/**
|
||||
* Returns the provided number with the given number of preceding zeros.
|
||||
* @returns the provided number with the given number of preceding zeros.
|
||||
*/
|
||||
export function pad(n: number, l: number, char: string = '0'): string {
|
||||
var str = '' + n;
|
||||
|
@ -262,9 +262,14 @@ export function createRegExp(searchString: string, isRegex: boolean, matchCase:
|
|||
}
|
||||
|
||||
export function regExpLeadsToEndlessLoop(regexp: RegExp): boolean {
|
||||
// Exit early if it's one of these special cases which are meant to match
|
||||
// against an empty string
|
||||
if (regexp.source === "^" || regexp.source === "^$" || regexp.source === "$") {
|
||||
return false;
|
||||
}
|
||||
|
||||
// We check against an empty string. If the regular expression doesn't advance
|
||||
// (e.g. ends in an endless loop) it will match an empty string.
|
||||
|
||||
var match = regexp.exec('');
|
||||
return (match && <any>regexp.lastIndex === 0);
|
||||
}
|
||||
|
@ -273,7 +278,7 @@ export function regExpLeadsToEndlessLoop(regexp: RegExp): boolean {
|
|||
* The normalize() method returns the Unicode Normalization Form of a given string. The form will be
|
||||
* the Normalization Form Canonical Composition.
|
||||
*
|
||||
* See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize
|
||||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize}
|
||||
*/
|
||||
export var canNormalize = typeof ((<any>'').normalize) === 'function';
|
||||
export function normalizeNFC(str: string, cache?:{[str: string]: string}): string {
|
||||
|
@ -435,7 +440,7 @@ export function equalsIgnoreCase(a: string, b: string): boolean {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the length of the common prefix of the two strings.
|
||||
* @returns the length of the common prefix of the two strings.
|
||||
*/
|
||||
export function commonPrefixLength(a: string, b: string): number {
|
||||
|
||||
|
@ -452,7 +457,7 @@ export function commonPrefixLength(a: string, b: string): number {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the length of the common suffix of the two strings.
|
||||
* @returns the length of the common suffix of the two strings.
|
||||
*/
|
||||
export function commonSuffixLength(a: string, b: string): number {
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
|
||||
/**
|
||||
* Returns whether the provided parameter is a JavaScript Array or not.
|
||||
* @returns whether the provided parameter is a JavaScript Array or not.
|
||||
*/
|
||||
export function isArray(array: any): array is any[] {
|
||||
if (Array.isArray) {
|
||||
|
@ -22,7 +22,7 @@ export function isArray(array: any): array is any[] {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns whether the provided parameter is a JavaScript String or not.
|
||||
* @returns whether the provided parameter is a JavaScript String or not.
|
||||
*/
|
||||
export function isString(str: any): str is string {
|
||||
if (typeof (str) === 'string' || str instanceof String) {
|
||||
|
@ -33,15 +33,14 @@ export function isString(str: any): str is string {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns whether the provided parameter is a JavaScript Array and each element in the
|
||||
* array is a string.
|
||||
* @returns whether the provided parameter is a JavaScript Array and each element in the array is a string.
|
||||
*/
|
||||
export function isStringArray(value: any): value is string[] {
|
||||
return isArray(value) && (<any[]>value).every(elem => isString(elem));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the provided parameter is a JavaScript Object or not.
|
||||
* @returns whether the provided parameter is a JavaScript Object or not.
|
||||
*/
|
||||
export function isObject(obj: any): obj is any {
|
||||
|
||||
|
@ -54,7 +53,7 @@ export function isObject(obj: any): obj is any {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns whether the provided parameter is a JavaScript Number or not.
|
||||
* @returns whether the provided parameter is a JavaScript Number or not.
|
||||
*/
|
||||
export function isNumber(obj: any): obj is number {
|
||||
if ((typeof (obj) === 'number' || obj instanceof Number) && !isNaN(obj)) {
|
||||
|
@ -65,21 +64,21 @@ export function isNumber(obj: any): obj is number {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns whether the provided parameter is a JavaScript Boolean or not.
|
||||
* @returns whether the provided parameter is a JavaScript Boolean or not.
|
||||
*/
|
||||
export function isBoolean(obj: any): obj is boolean {
|
||||
return obj === true || obj === false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the provided parameter is undefined.
|
||||
* @returns whether the provided parameter is undefined.
|
||||
*/
|
||||
export function isUndefined(obj: any): boolean {
|
||||
return typeof (obj) === 'undefined';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the provided parameter is undefined or null.
|
||||
* @returns whether the provided parameter is undefined or null.
|
||||
*/
|
||||
export function isUndefinedOrNull(obj: any): boolean {
|
||||
return isUndefined(obj) || obj === null;
|
||||
|
@ -89,7 +88,7 @@ export function isUndefinedOrNull(obj: any): boolean {
|
|||
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
|
||||
/**
|
||||
* Returns whether the provided parameter is an empty JavaScript Object or not.
|
||||
* @returns whether the provided parameter is an empty JavaScript Object or not.
|
||||
*/
|
||||
export function isEmptyObject(obj: any): obj is any {
|
||||
if (!isObject(obj)) {
|
||||
|
@ -106,14 +105,14 @@ export function isEmptyObject(obj: any): obj is any {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns whether the provided parameter is a JavaScript Function or not.
|
||||
* @returns whether the provided parameter is a JavaScript Function or not.
|
||||
*/
|
||||
export function isFunction(obj: any): obj is Function {
|
||||
return Object.prototype.toString.call(obj) === '[object Function]';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the provided parameters is are JavaScript Function or not.
|
||||
* @returns whether the provided parameters is are JavaScript Function or not.
|
||||
*/
|
||||
export function areFunctions(...objects: any[]): boolean {
|
||||
return objects && objects.length > 0 && objects.every((object) => isFunction(object));
|
||||
|
|
|
@ -18,7 +18,7 @@ function fixedEncodeURIComponent(str: string): string {
|
|||
* (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation
|
||||
* and encoding.
|
||||
*
|
||||
* foo://example.com:8042/over/there?name=ferret#nose
|
||||
* foo://example.com:8042/over/there?name=ferret#nose
|
||||
* \_/ \______________/\_________/ \_________/ \__/
|
||||
* | | | | |
|
||||
* scheme authority path query fragment
|
||||
|
|
|
@ -10,8 +10,7 @@
|
|||
export interface UUID {
|
||||
|
||||
/**
|
||||
* Returns the canonical representation in sets of
|
||||
* hexadecimal numbers separated by dashes.
|
||||
* @returns the canonical representation in sets of hexadecimal numbers separated by dashes.
|
||||
*/
|
||||
asHex():string;
|
||||
|
||||
|
|
|
@ -10,9 +10,12 @@ import extfs = require('vs/base/node/extfs');
|
|||
import paths = require('vs/base/common/paths');
|
||||
import { dirname, join } from 'path';
|
||||
import { nfcall } from 'vs/base/common/async';
|
||||
|
||||
import fs = require('fs');
|
||||
|
||||
export function isRoot(path: string): boolean {
|
||||
return path === dirname(path);
|
||||
}
|
||||
|
||||
export function readdir(path: string): TPromise<string[]> {
|
||||
return nfcall(extfs.readdir, path);
|
||||
}
|
||||
|
@ -38,6 +41,10 @@ export function mkdirp(path: string, mode?: number): TPromise<boolean> {
|
|||
return TPromise.wrapError<boolean>(err);
|
||||
});
|
||||
|
||||
if (isRoot(path)) {
|
||||
return TPromise.as(true);
|
||||
}
|
||||
|
||||
return mkdir().then(null, (err: NodeJS.ErrnoException) => {
|
||||
if (err.code === 'ENOENT') {
|
||||
return mkdirp(dirname(path), mode).then(mkdir);
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
var net = require('net'),
|
||||
fs = require('fs'),
|
||||
stream = require('stream'),
|
||||
|
|
|
@ -979,10 +979,17 @@ export class TextModel extends OrderGuaranteeEventEmitter implements EditorCommo
|
|||
|
||||
private _findMatchesInLine(searchRegex:RegExp, text:string, lineNumber:number, deltaOffset:number, counter:number, result:EditorCommon.IEditorRange[], limitResultCount:number): number {
|
||||
var m:RegExpExecArray;
|
||||
// Reset regex to search from the beginning
|
||||
searchRegex.lastIndex = 0;
|
||||
do {
|
||||
m = searchRegex.exec(text);
|
||||
if (m) {
|
||||
result.push(new Range(lineNumber, m.index + 1 + deltaOffset, lineNumber, m.index + 1 + m[0].length + deltaOffset));
|
||||
var range = new Range(lineNumber, m.index + 1 + deltaOffset, lineNumber, m.index + 1 + m[0].length + deltaOffset);
|
||||
// Exit early if the regex matches the same range
|
||||
if (range.equalsRange(result[result.length - 1])) {
|
||||
return counter;
|
||||
}
|
||||
result.push(range);
|
||||
counter++;
|
||||
if (counter >= limitResultCount) {
|
||||
return counter;
|
||||
|
|
|
@ -187,13 +187,17 @@ export class ModeServiceImpl implements IModeService {
|
|||
if (this._activationPromises.hasOwnProperty(modeId)) {
|
||||
return this._activationPromises[modeId];
|
||||
}
|
||||
var c, e;
|
||||
var promise = new TPromise((cc,ee,pp) => { c = cc; e = ee; });
|
||||
this._activationPromises[modeId] = promise;
|
||||
|
||||
this._activationPromises[modeId] = this._createMode(modeId).then((mode) => {
|
||||
this._createMode(modeId).then((mode) => {
|
||||
this._instantiatedModes[modeId] = mode;
|
||||
delete this._activationPromises[modeId];
|
||||
return this._instantiatedModes[modeId];
|
||||
});
|
||||
return this._activationPromises[modeId];
|
||||
}).then(c, e);
|
||||
|
||||
return promise;
|
||||
}
|
||||
|
||||
protected _createMode(modeId:string): TPromise<Modes.IMode> {
|
||||
|
|
|
@ -9,7 +9,7 @@ import {EditorBrowserRegistry} from 'vs/editor/browser/editorBrowserExtensions';
|
|||
import {CommonEditorRegistry, ContextKey, EditorActionDescriptor} from 'vs/editor/common/editorCommonExtensions';
|
||||
import {EditorAction, Behaviour} from 'vs/editor/common/editorAction';
|
||||
import FindWidget = require('./findWidget');
|
||||
import FindModel = require('./findModel');
|
||||
import FindModel = require('vs/editor/contrib/find/common/findModel');
|
||||
import nls = require('vs/nls');
|
||||
import EventEmitter = require('vs/base/common/eventEmitter');
|
||||
import EditorBrowser = require('vs/editor/browser/editorBrowser');
|
||||
|
|
|
@ -16,7 +16,7 @@ import InputBox = require('vs/base/browser/ui/inputbox/inputBox');
|
|||
import Findinput = require('vs/base/browser/ui/findinput/findInput');
|
||||
import EditorBrowser = require('vs/editor/browser/editorBrowser');
|
||||
import EditorCommon = require('vs/editor/common/editorCommon');
|
||||
import FindModel = require('./findModel');
|
||||
import FindModel = require('vs/editor/contrib/find/common/findModel');
|
||||
import Lifecycle = require('vs/base/common/lifecycle');
|
||||
import {CommonKeybindings} from 'vs/base/common/keyCodes';
|
||||
|
||||
|
|
|
@ -214,7 +214,7 @@ export class FindModelBoundToEditorModel extends Events.EventEmitter implements
|
|||
this.findScopeDecorationId = decorations[0];
|
||||
}
|
||||
|
||||
this.addMatchesDecorations(changeAccessor, this.editor.getModel().findMatches(this.searchString, this._getSearchRange(), this.isRegex, this.matchCase, this.wholeWord));
|
||||
this.addMatchesDecorations(changeAccessor, this._findMatches());
|
||||
});
|
||||
this.highlightedDecorationId = null;
|
||||
|
||||
|
@ -326,7 +326,6 @@ export class FindModelBoundToEditorModel extends Events.EventEmitter implements
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private setSelectionToDecoration(decorationId:string): void {
|
||||
this.editor.changeDecorations((changeAccessor: EditorCommon.IModelDecorationsChangeAccessor) => {
|
||||
if (this.highlightedDecorationId !== null) {
|
||||
|
@ -346,8 +345,10 @@ export class FindModelBoundToEditorModel extends Events.EventEmitter implements
|
|||
if (!this.isRegex) {
|
||||
return this.replaceString;
|
||||
}
|
||||
var regexp = Strings.createRegExp(this.searchString, this.isRegex, this.matchCase, this.wholeWord);
|
||||
return matchedString.replace(regexp, this.replaceString);
|
||||
let regexp = Strings.createRegExp(this.searchString, this.isRegex, this.matchCase, this.wholeWord);
|
||||
// Parse the replace string to support that \t or \n mean the right thing
|
||||
let parsedReplaceString = parseReplaceString(this.replaceString);
|
||||
return matchedString.replace(regexp, parsedReplaceString);
|
||||
}
|
||||
|
||||
public replace(): void {
|
||||
|
@ -379,6 +380,10 @@ export class FindModelBoundToEditorModel extends Events.EventEmitter implements
|
|||
}
|
||||
}
|
||||
|
||||
private _findMatches(limitResultCount?:number): EditorCommon.IEditorRange[] {
|
||||
return this.editor.getModel().findMatches(this.searchString, this._getSearchRange(), this.isRegex, this.matchCase, this.wholeWord, limitResultCount);
|
||||
}
|
||||
|
||||
public replaceAll(): void {
|
||||
if (this.decorations.length === 0) {
|
||||
return;
|
||||
|
@ -387,7 +392,7 @@ export class FindModelBoundToEditorModel extends Events.EventEmitter implements
|
|||
let model = this.editor.getModel();
|
||||
|
||||
// Get all the ranges (even more than the highlighted ones)
|
||||
let ranges = this.editor.getModel().findMatches(this.searchString, this._getSearchRange(), this.isRegex, this.matchCase, this.wholeWord, Number.MAX_VALUE);
|
||||
let ranges = this._findMatches(Number.MAX_VALUE);
|
||||
|
||||
// Remove all decorations
|
||||
this.editor.changeDecorations((changeAccessor:EditorCommon.IModelDecorationsChangeAccessor) => {
|
||||
|
@ -474,3 +479,64 @@ export class FindModelBoundToEditorModel extends Events.EventEmitter implements
|
|||
|
||||
}
|
||||
|
||||
const BACKSLASH_CHAR_CODE = '\\'.charCodeAt(0);
|
||||
const n_CHAR_CODE = 'n'.charCodeAt(0);
|
||||
const t_CHAR_CODE = 't'.charCodeAt(0);
|
||||
|
||||
/**
|
||||
* \n => LF
|
||||
* \t => TAB
|
||||
* \\ => \
|
||||
* everything else stays untouched
|
||||
*/
|
||||
export function parseReplaceString(input:string): string {
|
||||
if (!input || input.length === 0) {
|
||||
return input;
|
||||
}
|
||||
|
||||
let substrFrom = 0, result = '';
|
||||
for (let i = 0, len = input.length; i < len; i++) {
|
||||
let chCode = input.charCodeAt(i);
|
||||
|
||||
if (chCode === BACKSLASH_CHAR_CODE) {
|
||||
|
||||
// move to next char
|
||||
i++;
|
||||
|
||||
if (i >= len) {
|
||||
// string ends with a \
|
||||
break;
|
||||
}
|
||||
|
||||
let nextChCode = input.charCodeAt(i);
|
||||
let replaceWithCharacter: string = null;
|
||||
|
||||
switch (nextChCode) {
|
||||
case BACKSLASH_CHAR_CODE:
|
||||
// \\ => \
|
||||
replaceWithCharacter = '\\';
|
||||
break;
|
||||
case n_CHAR_CODE:
|
||||
// \n => LF
|
||||
replaceWithCharacter = '\n';
|
||||
break;
|
||||
case t_CHAR_CODE:
|
||||
// \t => TAB
|
||||
replaceWithCharacter = '\t';
|
||||
break;
|
||||
}
|
||||
|
||||
if (replaceWithCharacter) {
|
||||
result += input.substring(substrFrom, i - 1) + replaceWithCharacter;
|
||||
substrFrom = i + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (substrFrom === 0) {
|
||||
// no replacement occured
|
||||
return input;
|
||||
}
|
||||
|
||||
return result + input.substring(substrFrom);
|
||||
}
|
48
src/vs/editor/contrib/find/test/common/findModel.test.ts
Normal file
48
src/vs/editor/contrib/find/test/common/findModel.test.ts
Normal file
|
@ -0,0 +1,48 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 assert = require('assert');
|
||||
import {FindModelBoundToEditorModel, parseReplaceString} from 'vs/editor/contrib/find/common/findModel';
|
||||
|
||||
suite('FindModel', () => {
|
||||
|
||||
test('parseFindWidgetString', () => {
|
||||
let testParse = (input:string, expected:string) => {
|
||||
let actual = parseReplaceString(input);
|
||||
assert.equal(actual, expected);
|
||||
|
||||
let actual2 = parseReplaceString('hello' + input + 'hi');
|
||||
assert.equal(actual2, 'hello' + expected + 'hi');
|
||||
};
|
||||
|
||||
// no backslash => no treatment
|
||||
testParse('hello', 'hello');
|
||||
|
||||
// \t => TAB
|
||||
testParse('\\thello', '\thello');
|
||||
|
||||
// \n => LF
|
||||
testParse('\\nhello', '\nhello');
|
||||
|
||||
// \\t => \t
|
||||
testParse('\\\\thello', '\\thello');
|
||||
|
||||
// \\\t => \TAB
|
||||
testParse('\\\\\\thello', '\\\thello');
|
||||
|
||||
// \\\\t => \\t
|
||||
testParse('\\\\\\\\thello', '\\\\thello');
|
||||
|
||||
// \ at the end => no treatment
|
||||
testParse('hello\\', 'hello\\');
|
||||
|
||||
// \ with unknown char => no treatment
|
||||
testParse('hello\\x', 'hello\\x');
|
||||
|
||||
// \ with back reference => no treatment
|
||||
testParse('hello\\0', 'hello\\0');
|
||||
});
|
||||
});
|
|
@ -603,5 +603,57 @@ suite('Editor Model - Find', () => {
|
|||
rangeEqual(matches[i], ranges[i][0], ranges[i][1], ranges[i][2], ranges[i][3]);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
test('/^/ find', () => {
|
||||
var ranges = [
|
||||
[1, 1, 1, 1],
|
||||
[2, 1, 2, 1],
|
||||
[3, 1, 3, 1],
|
||||
[4, 1, 4, 1],
|
||||
[5, 1, 5, 1]
|
||||
];
|
||||
var matches = thisModel.findMatches('^', false, true, false, false);
|
||||
assert.equal(matches.length, ranges.length);
|
||||
for (var i = 0; i < matches.length; i++) {
|
||||
rangeEqual(matches[i], ranges[i][0], ranges[i][1], ranges[i][2], ranges[i][3]);
|
||||
}
|
||||
});
|
||||
|
||||
test('/$/ find', () => {
|
||||
var ranges = [
|
||||
[1, 74, 1, 74],
|
||||
[2, 69, 2, 69],
|
||||
[3, 54, 3, 54],
|
||||
[4, 65, 4, 65],
|
||||
[5, 31, 5, 31]
|
||||
];
|
||||
var matches = thisModel.findMatches('$', false, true, false, false);
|
||||
assert.equal(matches.length, ranges.length);
|
||||
for (var i = 0; i < matches.length; i++) {
|
||||
rangeEqual(matches[i], ranges[i][0], ranges[i][1], ranges[i][2], ranges[i][3]);
|
||||
}
|
||||
});
|
||||
|
||||
test('/^$/ find', () => {
|
||||
var text = [
|
||||
'This is some foo - bar text which contains foo and bar - as in Barcelona.',
|
||||
'',
|
||||
'And here\'s a dull line with nothing interesting in it',
|
||||
'',
|
||||
'Again nothing interesting here'
|
||||
];
|
||||
var model = new Model.Model(text.join('\n'), null);
|
||||
|
||||
var ranges = [
|
||||
[2, 1, 2, 1],
|
||||
[4, 1, 4, 1]
|
||||
];
|
||||
var matches = model.findMatches('^$', false, true, false, false);
|
||||
assert.equal(matches.length, ranges.length);
|
||||
for (var i = 0; i < matches.length; i++) {
|
||||
rangeEqual(matches[i], ranges[i][0], ranges[i][1], ranges[i][2], ranges[i][3]);
|
||||
}
|
||||
|
||||
model.dispose();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
/*---------------------------------------------------------
|
||||
* Copyright (C) Microsoft Corporation. All rights reserved.
|
||||
*---------------------------------------------------------*/
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
// file generated from css-schema.xml using css-exclude_generate_browserjs.js
|
||||
define(["require", "exports"], function(require, exports) {
|
||||
|
||||
|
|
|
@ -206,7 +206,7 @@ export var html5Tags = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'aud
|
|||
'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer',
|
||||
'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link',
|
||||
'main', 'map', 'mark', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'pre', 'progress', 'q', 'rb',
|
||||
'rp', 'rt', 'rtc', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template',
|
||||
'rp', 'rt', 'rtc', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'svg', 'table', 'tbody', 'td', 'template',
|
||||
'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr' ];
|
||||
|
||||
export function isColorConstructor(node:nodes.Function): boolean {
|
||||
|
@ -302,6 +302,7 @@ export function getBrowserLabel(b: Browsers): string {
|
|||
}
|
||||
|
||||
export interface Browsers {
|
||||
E:string;
|
||||
FF:string;
|
||||
IE:string;
|
||||
O:string;
|
||||
|
@ -326,7 +327,7 @@ export interface IEntry {
|
|||
}
|
||||
|
||||
function evalBrowserEntry(browsers: string) {
|
||||
var browserEntry : Browsers = { all: false, FF: '', S: '', C: '', IE: '', O: '', count: 0};
|
||||
var browserEntry : Browsers = { all: false, E: '', FF: '', S: '', C: '', IE: '', O: '', count: 0};
|
||||
var count = 0;
|
||||
if (browsers) {
|
||||
browsers.split(',').forEach(
|
||||
|
@ -474,6 +475,7 @@ export function getPseudoClasses(): IEntry[]{
|
|||
}
|
||||
|
||||
export var browserNames = {
|
||||
E : 'Edge',
|
||||
FF : 'Firefox',
|
||||
S : 'Safari',
|
||||
C : 'Chrome',
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
import strings = require('vs/base/common/strings');
|
||||
import arrays = require('vs/base/common/arrays');
|
||||
|
||||
var emptyElements:string[] = ['area', 'base', 'basefont', 'br', 'col', 'command', 'embed', 'frame', 'hr', 'img', 'input', 'isindex', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr'];
|
||||
var emptyElements:string[] = ['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'menuitem', 'meta', 'param', 'source', 'track', 'wbr'];
|
||||
|
||||
export function isEmptyElement(e: string) : boolean {
|
||||
return arrays.binarySearch(emptyElements, e,(s1: string, s2: string) => s1.localeCompare(s2)) >= 0;
|
||||
|
@ -26,6 +26,7 @@ export function getHTML5TagProvider(): IHTMLTagProvider {
|
|||
head: none,
|
||||
title: none,
|
||||
noscript: none,
|
||||
main: none,
|
||||
section: none,
|
||||
nav: none,
|
||||
article: none,
|
||||
|
@ -44,7 +45,7 @@ export function getHTML5TagProvider(): IHTMLTagProvider {
|
|||
hr: none,
|
||||
pre: none,
|
||||
blockquote: ['cite'],
|
||||
ol: ['reversed:v', 'start'],
|
||||
ol: ['reversed:v', 'start', 'type:lt'],
|
||||
ul: none,
|
||||
li: ['value'],
|
||||
dl: none,
|
||||
|
@ -53,7 +54,7 @@ export function getHTML5TagProvider(): IHTMLTagProvider {
|
|||
figure: none,
|
||||
figcaption: none,
|
||||
div: none,
|
||||
a: ['href', 'target', 'ping', 'rel', 'media', 'hreflang', 'type'],
|
||||
a: ['href', 'target', 'download', 'ping', 'rel', 'hreflang', 'type'],
|
||||
em: none,
|
||||
strong: none,
|
||||
small: none,
|
||||
|
@ -63,7 +64,7 @@ export function getHTML5TagProvider(): IHTMLTagProvider {
|
|||
dfn: none,
|
||||
abbr: none,
|
||||
data: ['value'],
|
||||
time: ['datetime', 'pubdate'],
|
||||
time: ['datetime'],
|
||||
code: none,
|
||||
var: none,
|
||||
samp: none,
|
||||
|
@ -75,8 +76,10 @@ export function getHTML5TagProvider(): IHTMLTagProvider {
|
|||
u: none,
|
||||
mark: none,
|
||||
ruby: none,
|
||||
rt: none,
|
||||
rb: none,
|
||||
rp: none,
|
||||
rt: none,
|
||||
rtc: none,
|
||||
bdi: none,
|
||||
bdo: none,
|
||||
span: none,
|
||||
|
@ -85,25 +88,26 @@ export function getHTML5TagProvider(): IHTMLTagProvider {
|
|||
ins: ['cite', 'datetime'],
|
||||
del: ['cite', 'datetime'],
|
||||
img: ['alt', 'src', 'srcset', 'crossorigin:xo', 'usemap', 'ismap:v', 'width', 'height'],
|
||||
iframe: ['src', 'srcdoc', 'name', 'sandbox', 'seamless', 'width', 'height'],
|
||||
iframe: ['src', 'srcdoc', 'name', 'sandbox:sb', 'seamless:v', 'allowfullscreen:v', 'width', 'height'],
|
||||
embed: ['src', 'type', 'width', 'height'],
|
||||
object: ['data', 'type', 'typemustmatch:v', 'name', 'usemap', 'form', 'width', 'height'],
|
||||
param: ['name', 'value'],
|
||||
video: ['src', 'crossorigin:xo', 'poster', 'preload', 'autoplay:v', 'mediagroup', 'loop:v', 'muted:v', 'controls:v', 'width', 'height'],
|
||||
audio: ['src', 'crossorigin:xo', 'preload', 'autoplay:v', 'mediagroup', 'loop:v', 'muted:v', 'controls:v'],
|
||||
source: ['src', 'type', 'media'],
|
||||
track: ['default:v', 'kind', 'label', 'src', 'srclang'],
|
||||
video: ['src', 'crossorigin:xo', 'poster', 'preload:pl', 'autoplay:v', 'mediagroup', 'loop:v', 'muted:v', 'controls:v', 'width', 'height'],
|
||||
audio: ['src', 'crossorigin:xo', 'preload:pl', 'autoplay:v', 'mediagroup', 'loop:v', 'muted:v', 'controls:v'],
|
||||
source: ['src', 'type'],
|
||||
track: ['default:v', 'kind:tk', 'label', 'src', 'srclang'],
|
||||
canvas: ['width', 'height'],
|
||||
map: ['name'],
|
||||
area: ['alt', 'coords', 'shape', 'href', 'target', 'ping', 'rel', 'media', 'hreflang', 'type'],
|
||||
area: ['alt', 'coords', 'shape:sh', 'href', 'target', 'download', 'ping', 'rel', 'hreflang', 'type'],
|
||||
base: ['href', 'target'],
|
||||
link: ['href', 'rel', 'media', 'hreflang', 'type', 'sizes'],
|
||||
link: ['href', 'crossorigin:xo', 'rel', 'media', 'hreflang', 'type', 'sizes'],
|
||||
meta: ['name', 'http-equiv', 'content', 'charset'],
|
||||
style: ['media', 'type', 'scoped:v'],
|
||||
script: ['src', 'async:v', 'defer:v', 'type', 'charset'],
|
||||
body: ['onafterprint', 'onbeforeprint', 'onbeforeunload', 'onblur', 'onerror', 'onfocus', 'onhashchange', 'onload', 'onmessage',
|
||||
'onoffline', 'ononline', 'onpagehide', 'onpageshow', 'onpopstate', 'onresize', 'onscroll', 'onstorage', 'onunload'],
|
||||
table: none,
|
||||
style: ['media', 'nonce', 'type', 'scoped:v'],
|
||||
script: ['src', 'type', 'charset', 'async:v', 'defer:v', 'crossorigin:xo', 'nonce'],
|
||||
template: none,
|
||||
body: ['onafterprint', 'onbeforeprint', 'onbeforeunload', 'onhashchange', 'onlanguagechange', 'onmessage', 'onoffline', 'ononline', 'onpagehide',
|
||||
'onpageshow', 'onpopstate', 'onstorage', 'onunload'],
|
||||
table: ['sortable:v', 'border'],
|
||||
caption: none,
|
||||
colgroup: ['span'],
|
||||
col: ['span'],
|
||||
|
@ -112,28 +116,28 @@ export function getHTML5TagProvider(): IHTMLTagProvider {
|
|||
tfoot: none,
|
||||
tr: none,
|
||||
td: ['colspan', 'rowspan', 'headers'],
|
||||
th: ['colspan', 'rowspan', 'headers', 'scope', 'abbr'],
|
||||
form: ['accept-charset', 'action', 'autocomplete:o', 'enctype', 'method:m', 'name', 'novalidate:v', 'target'],
|
||||
th: ['colspan', 'rowspan', 'headers', 'scope:s', 'sorted', 'abbr'],
|
||||
form: ['accept-charset', 'action', 'autocomplete:o', 'enctype:et', 'method:m', 'name', 'novalidate:v', 'target'],
|
||||
fieldset: ['disabled:v', 'form', 'name'],
|
||||
legend: none,
|
||||
label: ['form', 'for'],
|
||||
input: ['accept', 'alt', 'autocomplete:o', 'autofocus:v', 'checked:v', 'dirname', 'disabled:v', 'form', 'formaction', 'formenctype',
|
||||
'formmethod:m', 'formnovalidate:v', 'formtarget', 'height', 'inputmode', 'list', 'max', 'maxlength', 'min', 'multiple:v', 'name',
|
||||
'pattern', 'placeholder', 'readonly:v', 'required', 'size', 'src', 'step', 'type:t', 'value', 'width'],
|
||||
button: ['autofocus:v', 'disabled:v', 'form', 'formaction', 'formenctype', 'formmethod:m', 'formnovalidate:v', 'formtarget', 'name', 'type:bt', 'value'],
|
||||
select: ['autofocus:v', 'disabled:v', 'form', 'multiple:v', 'name', 'required:v', 'size'],
|
||||
datalist: ['option'],
|
||||
input: ['accept', 'alt', 'autocomplete:o', 'autofocus:v', 'checked:v', 'dirname', 'disabled:v', 'form', 'formaction', 'formenctype:et',
|
||||
'formmethod:fm', 'formnovalidate:v', 'formtarget', 'height', 'inputmode:im', 'list', 'max', 'maxlength', 'min', 'minlength', 'multiple:v', 'name',
|
||||
'pattern', 'placeholder', 'readonly:v', 'required:v', 'size', 'src', 'step', 'type:t', 'value', 'width'],
|
||||
button: ['autofocus:v', 'disabled:v', 'form', 'formaction', 'formenctype:et', 'formmethod:fm', 'formnovalidate:v', 'formtarget', 'name', 'type:bt', 'value'],
|
||||
select: ['autocomplete:o', 'autofocus:v', 'disabled:v', 'form', 'multiple:v', 'name', 'required:v', 'size'],
|
||||
datalist: none,
|
||||
optgroup: ['disabled:v', 'label'],
|
||||
option: ['disabled:v', 'label', 'selected:v', 'value'],
|
||||
textarea: ['autocomplete:o', 'autofocus:v', 'cols', 'dirname', 'disabled:v', 'form', 'inputmode', 'maxlength', 'name', 'placeholder', 'readonly:v', 'required:v', 'rows', 'wrap'],
|
||||
textarea: ['autocomplete:o', 'autofocus:v', 'cols', 'dirname', 'disabled:v', 'form', 'inputmode:im', 'maxlength', 'minlength', 'name', 'placeholder', 'readonly:v', 'required:v', 'rows', 'wrap:w'],
|
||||
keygen: ['autofocus:v', 'challenge', 'disabled:v', 'form', 'keytype', 'name'],
|
||||
output: ['for', 'form', 'name'],
|
||||
progress: ['value', 'max'],
|
||||
meter: ['value', 'min', 'max', 'low', 'high', 'optimum'],
|
||||
details: ['open:v'],
|
||||
summary: none,
|
||||
command: ['type', 'label', 'icon', 'disabled:v', 'checked:v', 'radiogroup', 'command'],
|
||||
menu: ['type', 'label'],
|
||||
menu: ['type:mt', 'label'],
|
||||
menuitem: ['type:mit', 'label', 'icon', 'disabled:v', 'checked:v', 'radiogroup', 'default:v', 'command'],
|
||||
dialog: ['open:v']
|
||||
};
|
||||
|
||||
|
@ -142,24 +146,36 @@ export function getHTML5TagProvider(): IHTMLTagProvider {
|
|||
'aria-describedby', 'aria-disabled:b', 'aria-dropeffect:dropeffect', 'aria-errormessage', 'aria-expanded:u', 'aria-flowto', 'aria-grabbed:u', 'aria-haspopup:b', 'aria-hidden:b', 'aria-invalid:invalid', 'aria-kbdshortcuts',
|
||||
'aria-label', 'aria-labelledby', 'aria-level', 'aria-live:live', 'aria-modal:b', 'aria-multiline:b', 'aria-multiselectable:b', 'aria-orientation:orientation', 'aria-owns', 'aria-placeholder', 'aria-posinset', 'aria-pressed:tristate',
|
||||
'aria-readonly:b','aria-relevant:relevant', 'aria-required:b', 'aria-roledescription', 'aria-rowcount', 'aria-rowindex', 'aria-rowspan', 'aria-selected:u', 'aria-setsize', 'aria-sort:sort', 'aria-valuemax', 'aria-valuemin', 'aria-valuenow', 'aria-valuetext',
|
||||
'accesskey', 'class', 'contenteditable:b', 'contextmenu', 'dir:d', 'draggable:a', 'dropzone', 'hidden:v', 'id', 'inert:v', 'itemid', 'itemprop', 'itemref', 'itemscope:v', 'itemtype', 'lang', 'role:roles', 'spellcheck:b', 'style', 'tabindex',
|
||||
'title', 'translate'];
|
||||
'accesskey', 'class', 'contenteditable:b', 'contextmenu', 'dir:d', 'draggable:b', 'dropzone', 'hidden:v', 'id', 'itemid', 'itemprop', 'itemref', 'itemscope:v', 'itemtype', 'lang', 'role:roles', 'spellcheck:b', 'style', 'tabindex',
|
||||
'title', 'translate:y'];
|
||||
|
||||
var eventHandlers = ['onabort', 'onblur', 'oncanplay', 'oncanplaythrough', 'onchange', 'onclick', 'oncontextmenu', 'ondblclick', 'ondrag', 'ondragend', 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart',
|
||||
'ondrop', 'ondurationchange', 'onemptied', 'onended', 'onerror', 'onfocus', 'onformchange', 'onforminput', 'oninput', 'oninvalid', 'onkeydown', 'onkeypress', 'onkeyup', 'onload', 'onloadeddata', 'onloadedmetadata',
|
||||
'onloadstart', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onmousewheel', 'onpause', 'onplay', 'onplaying', 'onprogress', 'onratechange', 'onreset', 'onreadystatechange', 'onseeked',
|
||||
'onseeking', 'onselect', 'onshow', 'onstalled', 'onsubmit', 'onsuspend', 'ontimeupdate', 'onvolumechange', 'onwaiting'];
|
||||
'onloadstart', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onmousewheel', 'onpause', 'onplay', 'onplaying', 'onprogress', 'onratechange', 'onreset', 'onresize', 'onreadystatechange', 'onscroll',
|
||||
'onseeked', 'onseeking', 'onselect', 'onshow', 'onstalled', 'onsubmit', 'onsuspend', 'ontimeupdate', 'onvolumechange', 'onwaiting'];
|
||||
|
||||
var valueSets : { [tag:string]: string[]} = {
|
||||
b: ['true', 'false'],
|
||||
a: ['true', 'false', 'auto'],
|
||||
u: ['true', 'false', 'undefined'],
|
||||
d: ['ltr', 'rtl'],
|
||||
m: ['get', 'post'],
|
||||
o: ['on', 'off'],
|
||||
y: ['yes', 'no'],
|
||||
w: ['soft', 'hard'],
|
||||
d: ['ltr', 'rtl', 'auto'],
|
||||
m: ['GET', 'POST', 'dialog'],
|
||||
fm: ['GET', 'POST'],
|
||||
s: ['row', 'col', 'rowgroup', 'colgroup'],
|
||||
t: ['hidden', 'text', 'search', 'tel', 'url', 'email', 'password', 'datetime', 'date', 'month', 'week', 'time', 'datetime-local', 'number', 'range', 'color', 'checkbox', 'radio', 'file', 'submit', 'image', 'reset', 'button'],
|
||||
bt: ['button', 'submit', 'reset'],
|
||||
im: ['verbatim', 'latin', 'latin-name', 'latin-prose', 'full-width-latin', 'kana', 'kana-name', 'katakana', 'numeric', 'tel', 'email', 'url'],
|
||||
bt: ['button', 'submit', 'reset', 'menu'],
|
||||
lt: ['1', 'a', 'A', 'i', 'I'],
|
||||
mt: ['context', 'toolbar'],
|
||||
mit: ['command', 'checkbox', 'radio'],
|
||||
et: ['application/x-www-form-urlencoded', 'multipart/form-data', 'text/plain'],
|
||||
tk: ['subtitles', 'captions', 'descriptions', 'chapters', 'metadata'],
|
||||
pl: ['none', 'metadata', 'auto'],
|
||||
sh: ['circle', 'default', 'poly', 'rect'],
|
||||
xo: ['anonymous', 'use-credentials'],
|
||||
sb: ['allow-forms', 'allow-modals', 'allow-pointer-lock', 'allow-popups', 'allow-popups-to-escape-sandbox', 'allow-same-origin', 'allow-scripts', 'allow-top-navigation'],
|
||||
tristate: ['true', 'false', 'mixed', 'undefined'],
|
||||
autocomplete: ['inline', 'list', 'both', 'none'],
|
||||
current: ['page', 'step', 'location', 'date', 'time', 'true', 'false'],
|
||||
|
|
|
@ -52,7 +52,7 @@ export const language =
|
|||
root: [
|
||||
|
||||
// headers (with #)
|
||||
[/^(\s*)(#+)((?:[^\\#]|@escapes)+)((?:#+)?)/, ['white', markdownTokenTypes.TOKEN_HEADER_LEAD, markdownTokenTypes.TOKEN_HEADER, markdownTokenTypes.TOKEN_HEADER]],
|
||||
[/^(\s{0,3})(#+)((?:[^\\#]|@escapes)+)((?:#+)?)/, ['white', markdownTokenTypes.TOKEN_HEADER_LEAD, markdownTokenTypes.TOKEN_HEADER, markdownTokenTypes.TOKEN_HEADER]],
|
||||
|
||||
// headers (with =)
|
||||
[/^\s*(=+|\-+)\s*$/, markdownTokenTypes.TOKEN_EXT_HEADER],
|
||||
|
|
|
@ -8,10 +8,10 @@ export const TOKEN_HEADER_LEAD = 'entity.name.type';
|
|||
export const TOKEN_HEADER = 'entity.name.type';
|
||||
export const TOKEN_EXT_HEADER = 'entity.other.atribute-name';
|
||||
export const TOKEN_SEPARATOR = 'meta.separator';
|
||||
export const TOKEN_QUOTE = 'meta.tag';
|
||||
export const TOKEN_LIST = 'punctuation.section.embedded';
|
||||
export const TOKEN_QUOTE = 'comment';
|
||||
export const TOKEN_LIST = 'keyword';
|
||||
export const TOKEN_BLOCK = 'string';
|
||||
export const TOKEN_BLOCK_CODE = 'string.source';
|
||||
export const TOKEN_BLOCK_CODE = 'variable.source';
|
||||
|
||||
/*
|
||||
// old settings
|
||||
|
|
|
@ -67,7 +67,7 @@ export interface ProblemPattern {
|
|||
|
||||
mostSignifikant?: boolean;
|
||||
|
||||
[key:string]: any;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export let problemPatternProperties = ['file', 'message', 'location', 'line', 'column', 'endLine', 'endColumn', 'code', 'severity', 'loop', 'mostSignifikant'];
|
||||
|
@ -110,7 +110,7 @@ export interface ProblemMatcher {
|
|||
fileLocation: FileLocationKind;
|
||||
filePrefix?: string;
|
||||
pattern: ProblemPattern | ProblemPattern[];
|
||||
severity?:Severity;
|
||||
severity?: Severity;
|
||||
watching?: WatchingMatcher;
|
||||
}
|
||||
|
||||
|
@ -122,7 +122,7 @@ export function isNamedProblemMatcher(value: ProblemMatcher): value is NamedProb
|
|||
return Types.isString((<NamedProblemMatcher>value).name);
|
||||
}
|
||||
|
||||
let valueMap: {[key:string]:string;} = {
|
||||
let valueMap: { [key: string]: string; } = {
|
||||
E: 'error',
|
||||
W: 'warning',
|
||||
I: 'info',
|
||||
|
@ -137,7 +137,7 @@ interface Location {
|
|||
|
||||
interface ProblemData {
|
||||
file?: string;
|
||||
location?:string;
|
||||
location?: string;
|
||||
line?: string;
|
||||
column?: string;
|
||||
endLine?: string;
|
||||
|
@ -145,7 +145,7 @@ interface ProblemData {
|
|||
message?: string;
|
||||
severity?: string;
|
||||
code?: string;
|
||||
[key:string]: string;
|
||||
[key: string]: string;
|
||||
}
|
||||
|
||||
export interface ProblemMatch {
|
||||
|
@ -159,7 +159,7 @@ export interface HandleResult {
|
|||
continue: boolean;
|
||||
}
|
||||
|
||||
export function getResource(filename:string, matcher: ProblemMatcher): URI {
|
||||
export function getResource(filename: string, matcher: ProblemMatcher): URI {
|
||||
let kind = matcher.fileLocation;
|
||||
let fullPath: string;
|
||||
if (kind === FileLocationKind.Absolute) {
|
||||
|
@ -233,7 +233,7 @@ class AbstractLineMatcher implements ILineMatcher {
|
|||
protected getMarkerMatch(data: ProblemData): ProblemMatch {
|
||||
let location = this.getLocation(data);
|
||||
if (data.file && location && data.message) {
|
||||
let marker:IMarkerData = {
|
||||
let marker: IMarkerData = {
|
||||
severity: this.getSeverity(data),
|
||||
startLineNumber: location.startLineNumber,
|
||||
startColumn: location.startColumn,
|
||||
|
@ -252,7 +252,7 @@ class AbstractLineMatcher implements ILineMatcher {
|
|||
}
|
||||
}
|
||||
|
||||
protected getResource(filename:string):URI {
|
||||
protected getResource(filename: string): URI {
|
||||
return getResource(filename, this.matcher);
|
||||
}
|
||||
|
||||
|
@ -266,11 +266,11 @@ class AbstractLineMatcher implements ILineMatcher {
|
|||
let startLine = parseInt(data.line);
|
||||
let startColumn = data.column ? parseInt(data.column) : undefined;
|
||||
let endLine = data.endLine ? parseInt(data.endLine) : undefined;
|
||||
let endColumn = data.endColumn ? parseInt(data.endColumn): undefined;
|
||||
let endColumn = data.endColumn ? parseInt(data.endColumn) : undefined;
|
||||
return this.createLocation(startLine, startColumn, endLine, endColumn);
|
||||
}
|
||||
|
||||
private parseLocationInfo(value:string):Location {
|
||||
private parseLocationInfo(value: string): Location {
|
||||
if (!value || !value.match(/(\d+|\d+,\d+|\d+,\d+,\d+,\d+)/)) {
|
||||
return null;
|
||||
}
|
||||
|
@ -284,9 +284,9 @@ class AbstractLineMatcher implements ILineMatcher {
|
|||
}
|
||||
}
|
||||
|
||||
private createLocation(startLine:number, startColumn:number, endLine:number, endColumn:number):Location {
|
||||
private createLocation(startLine: number, startColumn: number, endLine: number, endColumn: number): Location {
|
||||
if (startLine && startColumn && endLine && endColumn) {
|
||||
return {startLineNumber: startLine, startColumn: startColumn, endLineNumber: endLine, endColumn: endColumn };
|
||||
return { startLineNumber: startLine, startColumn: startColumn, endLineNumber: endLine, endColumn: endColumn };
|
||||
}
|
||||
if (startLine && startColumn) {
|
||||
return { startLineNumber: startLine, startColumn: startColumn, endLineNumber: startLine, endColumn: startColumn };
|
||||
|
@ -294,8 +294,8 @@ class AbstractLineMatcher implements ILineMatcher {
|
|||
return { startLineNumber: startLine, startColumn: 1, endLineNumber: startLine, endColumn: Number.MAX_VALUE };
|
||||
}
|
||||
|
||||
private getSeverity(data: ProblemData):Severity {
|
||||
let result:Severity = null;
|
||||
private getSeverity(data: ProblemData): Severity {
|
||||
let result: Severity = null;
|
||||
if (data.severity) {
|
||||
let value = data.severity;
|
||||
if (value && value.length > 0) {
|
||||
|
@ -366,7 +366,7 @@ class MultiLineMatcher extends AbstractLineMatcher {
|
|||
let pattern = this.patterns[i];
|
||||
let matches = pattern.regexp.exec(lines[i + start]);
|
||||
if (!matches) {
|
||||
return { match: null, continue: false};
|
||||
return { match: null, continue: false };
|
||||
} else {
|
||||
// Only the last pattern can loop
|
||||
if (pattern.loop && i === this.patterns.length - 1) {
|
||||
|
@ -379,7 +379,7 @@ class MultiLineMatcher extends AbstractLineMatcher {
|
|||
if (!loop) {
|
||||
this.data = null;
|
||||
}
|
||||
return { match: this.getMarkerMatch(data), continue: loop };
|
||||
return { match: this.getMarkerMatch(data), continue: loop };
|
||||
}
|
||||
|
||||
public next(line: string): ProblemMatch {
|
||||
|
@ -396,7 +396,7 @@ class MultiLineMatcher extends AbstractLineMatcher {
|
|||
}
|
||||
}
|
||||
|
||||
let _defaultPatterns:{ [name:string]: ProblemPattern | ProblemPattern[];} = Object.create(null);
|
||||
let _defaultPatterns: { [name: string]: ProblemPattern | ProblemPattern[]; } = Object.create(null);
|
||||
_defaultPatterns['msCompile'] = {
|
||||
regexp: /^([^\s].*)\((\d+|\d+,\d+|\d+,\d+,\d+,\d+)\):\s+(error|warning|info)\s+(\w{1,2}\d+)\s*:\s*(.*)$/,
|
||||
file: 1,
|
||||
|
@ -600,7 +600,7 @@ export namespace Config {
|
|||
*/
|
||||
loop?: boolean;
|
||||
|
||||
[key:string]: any;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -856,7 +856,7 @@ export class ProblemMatcherParser extends Parser {
|
|||
private createProblemPattern(value: string | Config.ProblemPattern | Config.ProblemPattern[]): ProblemPattern | ProblemPattern[] {
|
||||
let pattern: ProblemPattern;
|
||||
if (Types.isString(value)) {
|
||||
let variableName:string = <string>value;
|
||||
let variableName: string = <string>value;
|
||||
if (variableName.length > 1 && variableName[0] === '$') {
|
||||
return defaultPattern(variableName.substring(1));
|
||||
}
|
||||
|
@ -889,7 +889,7 @@ export class ProblemMatcherParser extends Parser {
|
|||
return null;
|
||||
}
|
||||
|
||||
private createSingleProblemPattern(value: Config.ProblemPattern, setDefaults:boolean): ProblemPattern {
|
||||
private createSingleProblemPattern(value: Config.ProblemPattern, setDefaults: boolean): ProblemPattern {
|
||||
let result: ProblemPattern = {
|
||||
regexp: this.createRegularExpression(value.regexp)
|
||||
};
|
||||
|
@ -969,7 +969,7 @@ export class ProblemMatcherParser extends Parser {
|
|||
}
|
||||
}
|
||||
|
||||
private createWatchingPattern(external: string| Config.WatchingPattern): WatchingPattern {
|
||||
private createWatchingPattern(external: string | Config.WatchingPattern): WatchingPattern {
|
||||
if (Types.isUndefinedOrNull(external)) {
|
||||
return null;
|
||||
}
|
||||
|
@ -986,10 +986,10 @@ export class ProblemMatcherParser extends Parser {
|
|||
if (!regexp) {
|
||||
return null;
|
||||
}
|
||||
return file ? { regexp, file} : { regexp };
|
||||
return file ? { regexp, file } : { regexp };
|
||||
}
|
||||
|
||||
private createRegularExpression(value:string):RegExp {
|
||||
private createRegularExpression(value: string): RegExp {
|
||||
let result: RegExp = null;
|
||||
if (!value) {
|
||||
return result;
|
||||
|
|
|
@ -8,7 +8,7 @@ import {TPromise} from 'vs/base/common/winjs.base';
|
|||
import types = require('vs/base/common/types');
|
||||
import {isBinaryMime} from 'vs/base/common/mime';
|
||||
import {EventType} from 'vs/base/common/events';
|
||||
import {EditorModel, IFileEditorInput, EditorInput, IInputStatus, DiffEditorInput as CommonDiffEditorInput} from 'vs/workbench/common/editor';
|
||||
import {EditorModel, IFileEditorInput, EditorInput, IInputStatus, BaseDiffEditorInput} from 'vs/workbench/common/editor';
|
||||
import {BaseTextEditorModel} from 'vs/workbench/browser/parts/editor/textEditorModel';
|
||||
import {DiffEditorModel} from 'vs/workbench/browser/parts/editor/diffEditorModel';
|
||||
import {TextDiffEditor} from 'vs/workbench/browser/parts/editor/textDiffEditor';
|
||||
|
@ -20,7 +20,7 @@ import {BinaryResourceDiffEditor} from 'vs/workbench/browser/parts/editor/binary
|
|||
* The base editor input for the diff editor. It is made up of two editor inputs, the original version
|
||||
* and the modified version.
|
||||
*/
|
||||
export class DiffEditorInput extends CommonDiffEditorInput {
|
||||
export class DiffEditorInput extends BaseDiffEditorInput {
|
||||
|
||||
public static ID = 'workbench.editors.diffEditorInput';
|
||||
|
||||
|
|
|
@ -136,12 +136,10 @@ export abstract class BaseTextEditor extends BaseEditor {
|
|||
this._editorContainer = parent;
|
||||
this.editorControl = this.createEditorControl(parent);
|
||||
|
||||
// Hook Listener for Selection changes (and only react to api, mouse or keyboard source, not any internal source of the editor)
|
||||
// Hook Listener for Selection changes
|
||||
this.toUnbind.push(this.editorControl.addListener(EventType.CursorPositionChanged, (event: ICursorPositionChangedEvent) => {
|
||||
if (event.source === 'api' || event.source === 'mouse' || event.source === 'keyboard') {
|
||||
let selection = this.editorControl.getSelection();
|
||||
this.eventService.emit(WorkbenchEventType.TEXT_EDITOR_SELECTION_CHANGED, new TextEditorSelectionEvent(selection, this, this.getId(), this.input, null, this.position, event));
|
||||
}
|
||||
let selection = this.editorControl.getSelection();
|
||||
this.eventService.emit(WorkbenchEventType.TEXT_EDITOR_SELECTION_CHANGED, new TextEditorSelectionEvent(selection, this, this.getId(), this.input, null, this.position, event));
|
||||
}));
|
||||
|
||||
// Hook Listener for mode changes
|
||||
|
|
|
@ -125,7 +125,7 @@ export abstract class EditorInput extends EventEmitter implements IEditorInput {
|
|||
/**
|
||||
* The base class of editor inputs that have an original and modified side.
|
||||
*/
|
||||
export abstract class DiffEditorInput extends EditorInput {
|
||||
export abstract class BaseDiffEditorInput extends EditorInput {
|
||||
private _originalInput: EditorInput;
|
||||
private _modifiedInput: EditorInput;
|
||||
|
||||
|
@ -477,8 +477,8 @@ export function asFileEditorInput(obj: any, supportDiff?: boolean): IFileEditorI
|
|||
}
|
||||
|
||||
// Check for diff if we are asked to
|
||||
if (supportDiff && types.isFunction((<DiffEditorInput>obj).getModifiedInput)) {
|
||||
obj = (<DiffEditorInput>obj).getModifiedInput();
|
||||
if (supportDiff && types.isFunction((<BaseDiffEditorInput>obj).getModifiedInput)) {
|
||||
obj = (<BaseDiffEditorInput>obj).getModifiedInput();
|
||||
}
|
||||
|
||||
let i = <IFileEditorInput>obj;
|
||||
|
|
|
@ -47,10 +47,10 @@ configurationRegistry.registerConfiguration({
|
|||
'title': nls.localize('windowConfigurationTitle', "Window configuration"),
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'window.openInNewWindow': {
|
||||
'window.openFilesInNewWindow': {
|
||||
'type': 'boolean',
|
||||
'default': true,
|
||||
'description': nls.localize('openInNewWindow', "When enabled, will open files in a new window instead of reusing an existing instance.")
|
||||
'description': nls.localize('openFilesInNewWindow', "When enabled, will open files in a new window instead of reusing an existing instance.")
|
||||
},
|
||||
'window.reopenFolders': {
|
||||
'type': 'string',
|
||||
|
|
|
@ -369,8 +369,12 @@ export class WindowsManager {
|
|||
|
||||
// Let the user settings override how files are open in a new window or same window
|
||||
let openFilesInNewWindow = openConfig.forceNewWindow;
|
||||
if (openFilesInNewWindow && !openConfig.cli.pluginDevelopmentPath) {
|
||||
openFilesInNewWindow = settings.manager.getValue('window.openInNewWindow', openFilesInNewWindow); // can be overriden via settings (not for PDE though!)
|
||||
if (openFilesInNewWindow && !openConfig.cli.pluginDevelopmentPath) { // can be overriden via settings (not for PDE though!)
|
||||
if (settings.manager.getValue('window.openInNewWindow', null) !== null) {
|
||||
openFilesInNewWindow = settings.manager.getValue('window.openInNewWindow', openFilesInNewWindow); // TODO@Ben remove legacy setting in a couple of versions
|
||||
} else {
|
||||
openFilesInNewWindow = settings.manager.getValue('window.openFilesInNewWindow', openFilesInNewWindow);
|
||||
}
|
||||
}
|
||||
|
||||
// Open Files in last instance if any and flag tells us so
|
||||
|
|
|
@ -217,7 +217,7 @@ export class StackFrame implements debug.IStackFrame {
|
|||
if (!this.scopes) {
|
||||
this.scopes = debugService.getActiveSession().scopes({ frameId: this.frameId }).then(response => {
|
||||
return response.body.scopes.map(rs => new Scope(this.threadId, rs.name, rs.variablesReference, rs.expensive));
|
||||
});
|
||||
}, err => []);
|
||||
}
|
||||
|
||||
return this.scopes;
|
||||
|
|
|
@ -221,11 +221,11 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
|
|||
this.toDispose.push(this.session.addListener2(debug.SessionEvents.THREAD, (event: DebugProtocol.ThreadEvent) => {
|
||||
if (event.body.reason === 'started') {
|
||||
this.session.threads().done((result) => {
|
||||
var threads = result.body.threads.filter(thread => thread.id === event.body.threadId);
|
||||
if (threads.length === 1) {
|
||||
const thread = result.body.threads.filter(thread => thread.id === event.body.threadId).pop();
|
||||
if (thread) {
|
||||
this.model.rawUpdate({
|
||||
threadId: threads[0].id,
|
||||
thread: threads[0]
|
||||
threadId: thread.id,
|
||||
thread: thread
|
||||
});
|
||||
}
|
||||
}, errors.onUnexpectedError);
|
||||
|
@ -266,14 +266,14 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
|
|||
private getThreadData(threadId: number): Promise {
|
||||
return this.model.getThreads()[threadId] ? Promise.as(true) :
|
||||
this.session.threads().then((response: DebugProtocol.ThreadsResponse) => {
|
||||
var threads = response.body.threads.filter(t => t.id === threadId);
|
||||
if (threads.length !== 1) {
|
||||
throw new Error('Did not get exactly one thread from debug adapter with id ' + threadId);
|
||||
const thread = response.body.threads.filter(t => t.id === threadId).pop();
|
||||
if (!thread) {
|
||||
throw new Error('Did not get a thread from debug adapter with id ' + threadId);
|
||||
}
|
||||
|
||||
this.model.rawUpdate({
|
||||
threadId: threads[0].id,
|
||||
thread: threads[0]
|
||||
threadId: thread.id,
|
||||
thread: thread
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -588,11 +588,14 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
|
|||
|
||||
// No task running, execute the preLaunchTask.
|
||||
this.outputService.showOutput('Tasks', true, true);
|
||||
this.taskService.run(filteredTasks[0].id).then(result => {
|
||||
|
||||
const taskPromise = this.taskService.run(filteredTasks[0].id).then(result => {
|
||||
this.lastTaskEvent = null;
|
||||
}, err => {
|
||||
this.lastTaskEvent = null;
|
||||
});
|
||||
|
||||
return filteredTasks[0].isWatching ? Promise.as(true) : taskPromise;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,9 @@ export abstract class DerivedFrameEditorInput extends IFrameEditorInput {
|
|||
|
||||
public abstract createNew(resource: URI): DerivedFrameEditorInput;
|
||||
|
||||
/**
|
||||
* This is the resource that this input is derived from.
|
||||
*/
|
||||
public getResource(): URI {
|
||||
return this.resource;
|
||||
}
|
||||
|
|
|
@ -2068,8 +2068,8 @@ export class CloseFileAction extends Action {
|
|||
|
||||
// Otherwise just dispose
|
||||
else {
|
||||
if (input instanceof workbenchEditorCommon.DiffEditorInput) {
|
||||
input = (<workbenchEditorCommon.DiffEditorInput>input).getModifiedInput();
|
||||
if (input instanceof DiffEditorInput) {
|
||||
input = (<DiffEditorInput>input).getModifiedInput();
|
||||
}
|
||||
|
||||
// File Input
|
||||
|
|
|
@ -25,8 +25,6 @@ suite('FileService', () => {
|
|||
let testDir: string;
|
||||
|
||||
setup(function (done) {
|
||||
this.timeout(20000);
|
||||
|
||||
let id = uuid.generateUuid();
|
||||
testDir = path.join(parentDir, id);
|
||||
let sourceDir = require.toUrl('./fixtures/service');
|
||||
|
@ -59,6 +57,8 @@ suite('FileService', () => {
|
|||
});
|
||||
|
||||
test('createFile', function(done: () => void) {
|
||||
this.timeout(10000); // test tends to need longer?
|
||||
|
||||
let contents = 'Hello World';
|
||||
service.createFile(uri.file(path.join(testDir, 'test.txt')), contents).done(s => {
|
||||
assert.equal(s.name, 'test.txt');
|
||||
|
|
Loading…
Reference in a new issue