LKG update

This commit is contained in:
Ryan Cavanaugh
2017-02-15 14:44:31 -08:00
parent 3115771a61
commit 8b9fa4ce74
23 changed files with 82444 additions and 66079 deletions
+41 -11
View File
@@ -15,6 +15,15 @@ and limitations under the License.
"use strict";
var fs = require("fs");
function pipeExists(name) {
try {
fs.statSync(name);
return true;
}
catch (e) {
return false;
}
}
function createCancellationToken(args) {
var cancellationPipeName;
for (var i = 0; i < args.length - 1; i++) {
@@ -24,18 +33,39 @@ function createCancellationToken(args) {
}
}
if (!cancellationPipeName) {
return { isCancellationRequested: function () { return false; } };
return {
isCancellationRequested: function () { return false; },
setRequest: function (_requestId) { return void 0; },
resetRequest: function (_requestId) { return void 0; }
};
}
return {
isCancellationRequested: function () {
try {
fs.statSync(cancellationPipeName);
return true;
}
catch (e) {
return false;
}
if (cancellationPipeName.charAt(cancellationPipeName.length - 1) === "*") {
var namePrefix_1 = cancellationPipeName.slice(0, -1);
if (namePrefix_1.length === 0 || namePrefix_1.indexOf("*") >= 0) {
throw new Error("Invalid name for template cancellation pipe: it should have length greater than 2 characters and contain only one '*'.");
}
};
var perRequestPipeName_1;
var currentRequestId_1;
return {
isCancellationRequested: function () { return perRequestPipeName_1 !== undefined && pipeExists(perRequestPipeName_1); },
setRequest: function (requestId) {
currentRequestId_1 = currentRequestId_1;
perRequestPipeName_1 = namePrefix_1 + requestId;
},
resetRequest: function (requestId) {
if (currentRequestId_1 !== requestId) {
throw new Error("Mismatched request id, expected " + currentRequestId_1 + ", actual " + requestId);
}
perRequestPipeName_1 = undefined;
}
};
}
else {
return {
isCancellationRequested: function () { return pipeExists(cancellationPipeName); },
setRequest: function (_requestId) { return void 0; },
resetRequest: function (_requestId) { return void 0; }
};
}
}
module.exports = createCancellationToken;
+1599 -418
View File
File diff suppressed because it is too large Load Diff
+1583 -384
View File
File diff suppressed because it is too large Load Diff
+4 -4
View File
@@ -24,7 +24,7 @@ interface Map<K, V> {
forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void;
get(key: K): V | undefined;
has(key: K): boolean;
set(key: K, value?: V): this;
set(key: K, value: V): this;
readonly size: number;
}
@@ -42,16 +42,16 @@ interface ReadonlyMap<K, V> {
readonly size: number;
}
interface WeakMap<K, V> {
interface WeakMap<K extends object, V> {
delete(key: K): boolean;
get(key: K): V | undefined;
has(key: K): boolean;
set(key: K, value?: V): this;
set(key: K, value: V): this;
}
interface WeakMapConstructor {
new (): WeakMap<any, any>;
new <K, V>(entries?: [K, V][]): WeakMap<K, V>;
new <K extends object, V>(entries?: [K, V][]): WeakMap<K, V>;
readonly prototype: WeakMap<any, any>;
}
declare var WeakMap: WeakMapConstructor;
+1 -1
View File
@@ -345,7 +345,7 @@ interface ObjectConstructor {
* @param o The object to change its prototype.
* @param proto The value of the new prototype or null.
*/
setPrototypeOf(o: any, proto: any): any;
setPrototypeOf(o: any, proto: object | null): any;
/**
* Gets the own property descriptor of the specified object.
+3 -3
View File
@@ -119,10 +119,10 @@ interface MapConstructor {
new <K, V>(iterable: Iterable<[K, V]>): Map<K, V>;
}
interface WeakMap<K, V> { }
interface WeakMap<K extends object, V> { }
interface WeakMapConstructor {
new <K, V>(iterable: Iterable<[K, V]>): WeakMap<K, V>;
new <K extends object, V>(iterable: Iterable<[K, V]>): WeakMap<K, V>;
}
interface Set<T> {
@@ -462,4 +462,4 @@ interface Float64ArrayConstructor {
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array;
}
}
-51
View File
@@ -18,57 +18,6 @@ and limitations under the License.
/// <reference no-default-lib="true"/>
/**
* Represents the completion of an asynchronous operation
*/
interface Promise<T> {
/**
* Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved.
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of which ever callback is executed.
*/
then(onfulfilled?: ((value: T) => T | PromiseLike<T>) | undefined | null, onrejected?: ((reason: any) => T | PromiseLike<T>) | undefined | null): Promise<T>;
/**
* Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved.
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of which ever callback is executed.
*/
then<TResult>(onfulfilled: ((value: T) => T | PromiseLike<T>) | undefined | null, onrejected: (reason: any) => TResult | PromiseLike<TResult>): Promise<T | TResult>;
/**
* Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved.
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of which ever callback is executed.
*/
then<TResult>(onfulfilled: (value: T) => TResult | PromiseLike<TResult>, onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<TResult>;
/**
* Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved.
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of which ever callback is executed.
*/
then<TResult1, TResult2>(onfulfilled: (value: T) => TResult1 | PromiseLike<TResult1>, onrejected: (reason: any) => TResult2 | PromiseLike<TResult2>): Promise<TResult1 | TResult2>;
/**
* Attaches a callback for only the rejection of the Promise.
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of the callback.
*/
catch(onrejected?: ((reason: any) => T | PromiseLike<T>) | undefined | null): Promise<T>;
/**
* Attaches a callback for only the rejection of the Promise.
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of the callback.
*/
catch<TResult>(onrejected: (reason: any) => TResult | PromiseLike<TResult>): Promise<T | TResult>;
}
interface PromiseConstructor {
/**
* A reference to the prototype.
+2 -2
View File
@@ -19,7 +19,7 @@ and limitations under the License.
interface ProxyHandler<T> {
getPrototypeOf? (target: T): {} | null;
getPrototypeOf? (target: T): object | null;
setPrototypeOf? (target: T, v: any): boolean;
isExtensible? (target: T): boolean;
preventExtensions? (target: T): boolean;
@@ -32,7 +32,7 @@ interface ProxyHandler<T> {
enumerate? (target: T): PropertyKey[];
ownKeys? (target: T): PropertyKey[];
apply? (target: T, thisArg: any, argArray?: any): any;
construct? (target: T, argArray: any, newTarget?: any): {};
construct? (target: T, argArray: any, newTarget?: any): object
}
interface ProxyConstructor {
+1 -1
View File
@@ -23,7 +23,7 @@ interface Symbol {
toString(): string;
/** Returns the primitive value of the specified object. */
valueOf(): Object;
valueOf(): symbol;
}
interface SymbolConstructor {
+2 -2
View File
@@ -130,7 +130,7 @@ interface Map<K, V> {
readonly [Symbol.toStringTag]: "Map";
}
interface WeakMap<K, V>{
interface WeakMap<K extends object, V>{
readonly [Symbol.toStringTag]: "WeakMap";
}
@@ -344,4 +344,4 @@ interface Float32Array {
*/
interface Float64Array {
readonly [Symbol.toStringTag]: "Float64Array";
}
}
+16 -34
View File
@@ -157,23 +157,17 @@ interface ObjectConstructor {
getOwnPropertyNames(o: any): string[];
/**
* Creates an object that has null prototype.
* @param o Object to use as a prototype. May be null
* Creates an object that has the specified prototype or that has null prototype.
* @param o Object to use as a prototype. May be null.
*/
create(o: null): any;
/**
* Creates an object that has the specified prototype, and that optionally contains specified properties.
* @param o Object to use as a prototype. May be null
*/
create<T>(o: T): T;
create<T extends object>(o: T | null): T | object;
/**
* Creates an object that has the specified prototype, and that optionally contains specified properties.
* @param o Object to use as a prototype. May be null
* @param properties JavaScript object that contains one or more property descriptors.
*/
create(o: any, properties: PropertyDescriptorMap): any;
create(o: object | null, properties: PropertyDescriptorMap): any;
/**
* Adds a property to an object, or modifies attributes of an existing property.
@@ -361,14 +355,14 @@ interface String {
/**
* Replaces text in a string, using a regular expression or search string.
* @param searchValue A string that represents the regular expression.
* @param searchValue A string to search for.
* @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.
*/
replace(searchValue: string, replaceValue: string): string;
/**
* Replaces text in a string, using a regular expression or search string.
* @param searchValue A string that represents the regular expression.
* @param searchValue A string to search for.
* @param replacer A function that returns the replacement text.
*/
replace(searchValue: string, replacer: (substring: string, ...args: any[]) => string): string;
@@ -1336,39 +1330,27 @@ interface PromiseLike<T> {
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of which ever callback is executed.
*/
then(
onfulfilled?: ((value: T) => T | PromiseLike<T>) | undefined | null,
onrejected?: ((reason: any) => T | PromiseLike<T>) | undefined | null): PromiseLike<T>;
then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): PromiseLike<TResult1 | TResult2>;
}
/**
* Represents the completion of an asynchronous operation
*/
interface Promise<T> {
/**
* Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved.
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of which ever callback is executed.
*/
then<TResult>(
onfulfilled: ((value: T) => T | PromiseLike<T>) | undefined | null,
onrejected: (reason: any) => TResult | PromiseLike<TResult>): PromiseLike<T | TResult>;
then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
/**
* Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved.
* Attaches a callback for only the rejection of the Promise.
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of which ever callback is executed.
* @returns A Promise for the completion of the callback.
*/
then<TResult>(
onfulfilled: (value: T) => TResult | PromiseLike<TResult>,
onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): PromiseLike<TResult>;
/**
* Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved.
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of which ever callback is executed.
*/
then<TResult1, TResult2>(
onfulfilled: (value: T) => TResult1 | PromiseLike<TResult1>,
onrejected: (reason: any) => TResult2 | PromiseLike<TResult2>): PromiseLike<TResult1 | TResult2>;
catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;
}
interface ArrayLike<T> {
+1611 -479
View File
File diff suppressed because it is too large Load Diff
+636 -161
View File
File diff suppressed because it is too large Load Diff
+31 -6
View File
@@ -734,9 +734,9 @@ declare namespace ts.server.protocol {
*/
formatOptions?: FormatCodeSettings;
/**
* The host's additional supported file extensions
* The host's additional supported .js file extensions
*/
extraFileExtensions?: FileExtensionInfo[];
extraFileExtensions?: JsFileExtensionInfo[];
}
/**
* Configure request; value of command field is "configure". Specifies
@@ -905,6 +905,10 @@ declare namespace ts.server.protocol {
* List of files names that should be recompiled
*/
fileNames: string[];
/**
* true if project uses outFile or out compiler option
*/
projectUsesOutFile: boolean;
}
/**
* Response for CompileOnSaveAffectedFileListRequest request;
@@ -1352,6 +1356,17 @@ declare namespace ts.server.protocol {
command: CommandTypes.Geterr;
arguments: GeterrRequestArgs;
}
type RequestCompletedEventName = "requestCompleted";
/**
* Event that is sent when server have finished processing request with specified id.
*/
interface RequestCompletedEvent extends Event {
event: RequestCompletedEventName;
body: RequestCompletedEventBody;
}
interface RequestCompletedEventBody {
request_seq: number;
}
/**
* Item of diagnostic information found in a DiagnosticEvent message.
*/
@@ -1775,6 +1790,7 @@ declare namespace ts.server.protocol {
outDir?: string;
outFile?: string;
paths?: MapLike<string[]>;
plugins?: PluginImport[];
preserveConstEnums?: boolean;
project?: string;
reactNamespace?: string;
@@ -1798,9 +1814,10 @@ declare namespace ts.server.protocol {
namespace JsxEmit {
type None = "None";
type Preserve = "Preserve";
type ReactNative = "ReactNative";
type React = "React";
}
type JsxEmit = JsxEmit.None | JsxEmit.Preserve | JsxEmit.React;
type JsxEmit = JsxEmit.None | JsxEmit.Preserve | JsxEmit.React | JsxEmit.ReactNative;
namespace ModuleKind {
type None = "None";
type CommonJS = "CommonJS";
@@ -1856,17 +1873,25 @@ declare namespace ts.server.protocol {
[option: string]: string[] | boolean | undefined;
}
interface FileExtensionInfo {
interface JsFileExtensionInfo {
extension: string;
scriptKind: ScriptKind;
isMixedContent: boolean;
}
/**
* Type of objects whose values are all of the same type.
* The `in` and `for-in` operators can *not* be safely used,
* since `Object.prototype` may be modified by outside code.
*/
interface MapLike<T> {
[index: string]: T;
}
type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike<string[]>;
interface PluginImport {
name: string;
}
type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike<string[]> | PluginImport[];
}
declare namespace ts {
// these types are empty stubs for types from services and should not be used directly
+8912 -7676
View File
File diff suppressed because it is too large Load Diff
+22809 -19692
View File
File diff suppressed because it is too large Load Diff
+975 -546
View File
File diff suppressed because it is too large Load Diff
+14880 -11770
View File
File diff suppressed because it is too large Load Diff
+750 -210
View File
File diff suppressed because it is too large Load Diff
+13683 -12035
View File
File diff suppressed because it is too large Load Diff
+750 -210
View File
File diff suppressed because it is too large Load Diff
+13683 -12035
View File
File diff suppressed because it is too large Load Diff
+472 -348
View File
File diff suppressed because it is too large Load Diff