mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-14 19:16:17 -06:00
Merge branch 'master' into singletonScanner
This commit is contained in:
commit
030276d517
646
bin/tsc.js
646
bin/tsc.js
File diff suppressed because it is too large
Load Diff
1254
bin/tsserver.js
1254
bin/tsserver.js
File diff suppressed because it is too large
Load Diff
54
bin/typescript.d.ts
vendored
54
bin/typescript.d.ts
vendored
@ -124,16 +124,16 @@ declare module "typescript" {
|
||||
VoidKeyword = 99,
|
||||
WhileKeyword = 100,
|
||||
WithKeyword = 101,
|
||||
AsKeyword = 102,
|
||||
ImplementsKeyword = 103,
|
||||
InterfaceKeyword = 104,
|
||||
LetKeyword = 105,
|
||||
PackageKeyword = 106,
|
||||
PrivateKeyword = 107,
|
||||
ProtectedKeyword = 108,
|
||||
PublicKeyword = 109,
|
||||
StaticKeyword = 110,
|
||||
YieldKeyword = 111,
|
||||
ImplementsKeyword = 102,
|
||||
InterfaceKeyword = 103,
|
||||
LetKeyword = 104,
|
||||
PackageKeyword = 105,
|
||||
PrivateKeyword = 106,
|
||||
ProtectedKeyword = 107,
|
||||
PublicKeyword = 108,
|
||||
StaticKeyword = 109,
|
||||
YieldKeyword = 110,
|
||||
AsKeyword = 111,
|
||||
AnyKeyword = 112,
|
||||
BooleanKeyword = 113,
|
||||
ConstructorKeyword = 114,
|
||||
@ -258,8 +258,8 @@ declare module "typescript" {
|
||||
LastReservedWord = 101,
|
||||
FirstKeyword = 66,
|
||||
LastKeyword = 125,
|
||||
FirstFutureReservedWord = 103,
|
||||
LastFutureReservedWord = 111,
|
||||
FirstFutureReservedWord = 102,
|
||||
LastFutureReservedWord = 110,
|
||||
FirstTypeNode = 141,
|
||||
LastTypeNode = 149,
|
||||
FirstPunctuation = 14,
|
||||
@ -310,6 +310,7 @@ declare module "typescript" {
|
||||
}
|
||||
interface Identifier extends PrimaryExpression {
|
||||
text: string;
|
||||
originalKeywordKind?: SyntaxKind;
|
||||
}
|
||||
interface QualifiedName extends Node {
|
||||
left: EntityName;
|
||||
@ -1181,6 +1182,34 @@ declare module "typescript" {
|
||||
function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean;
|
||||
function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean;
|
||||
}
|
||||
declare module "typescript" {
|
||||
function getDefaultLibFileName(options: CompilerOptions): string;
|
||||
function textSpanEnd(span: TextSpan): number;
|
||||
function textSpanIsEmpty(span: TextSpan): boolean;
|
||||
function textSpanContainsPosition(span: TextSpan, position: number): boolean;
|
||||
function textSpanContainsTextSpan(span: TextSpan, other: TextSpan): boolean;
|
||||
function textSpanOverlapsWith(span: TextSpan, other: TextSpan): boolean;
|
||||
function textSpanOverlap(span1: TextSpan, span2: TextSpan): TextSpan;
|
||||
function textSpanIntersectsWithTextSpan(span: TextSpan, other: TextSpan): boolean;
|
||||
function textSpanIntersectsWith(span: TextSpan, start: number, length: number): boolean;
|
||||
function textSpanIntersectsWithPosition(span: TextSpan, position: number): boolean;
|
||||
function textSpanIntersection(span1: TextSpan, span2: TextSpan): TextSpan;
|
||||
function createTextSpan(start: number, length: number): TextSpan;
|
||||
function createTextSpanFromBounds(start: number, end: number): TextSpan;
|
||||
function textChangeRangeNewSpan(range: TextChangeRange): TextSpan;
|
||||
function textChangeRangeIsUnchanged(range: TextChangeRange): boolean;
|
||||
function createTextChangeRange(span: TextSpan, newLength: number): TextChangeRange;
|
||||
let unchangedTextChangeRange: TextChangeRange;
|
||||
/**
|
||||
* Called to merge all the changes that occurred across several versions of a script snapshot
|
||||
* into a single change. i.e. if a user keeps making successive edits to a script we will
|
||||
* have a text change from V1 to V2, V2 to V3, ..., Vn.
|
||||
*
|
||||
* This function will then merge those changes into a single change range valid between V1 and
|
||||
* Vn.
|
||||
*/
|
||||
function collapseTextChangeRangesAcrossMultipleVersions(changes: TextChangeRange[]): TextChangeRange;
|
||||
}
|
||||
declare module "typescript" {
|
||||
function getNodeConstructor(kind: SyntaxKind): new () => Node;
|
||||
function createNode(kind: SyntaxKind): Node;
|
||||
@ -1260,7 +1289,6 @@ declare module "typescript" {
|
||||
getDocumentationComment(): SymbolDisplayPart[];
|
||||
}
|
||||
interface SourceFile {
|
||||
getNamedDeclarations(): Declaration[];
|
||||
getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
|
||||
getLineStarts(): number[];
|
||||
getPositionOfLineAndCharacter(line: number, character: number): number;
|
||||
|
||||
1449
bin/typescript.js
1449
bin/typescript.js
File diff suppressed because it is too large
Load Diff
54
bin/typescriptServices.d.ts
vendored
54
bin/typescriptServices.d.ts
vendored
@ -124,16 +124,16 @@ declare module ts {
|
||||
VoidKeyword = 99,
|
||||
WhileKeyword = 100,
|
||||
WithKeyword = 101,
|
||||
AsKeyword = 102,
|
||||
ImplementsKeyword = 103,
|
||||
InterfaceKeyword = 104,
|
||||
LetKeyword = 105,
|
||||
PackageKeyword = 106,
|
||||
PrivateKeyword = 107,
|
||||
ProtectedKeyword = 108,
|
||||
PublicKeyword = 109,
|
||||
StaticKeyword = 110,
|
||||
YieldKeyword = 111,
|
||||
ImplementsKeyword = 102,
|
||||
InterfaceKeyword = 103,
|
||||
LetKeyword = 104,
|
||||
PackageKeyword = 105,
|
||||
PrivateKeyword = 106,
|
||||
ProtectedKeyword = 107,
|
||||
PublicKeyword = 108,
|
||||
StaticKeyword = 109,
|
||||
YieldKeyword = 110,
|
||||
AsKeyword = 111,
|
||||
AnyKeyword = 112,
|
||||
BooleanKeyword = 113,
|
||||
ConstructorKeyword = 114,
|
||||
@ -258,8 +258,8 @@ declare module ts {
|
||||
LastReservedWord = 101,
|
||||
FirstKeyword = 66,
|
||||
LastKeyword = 125,
|
||||
FirstFutureReservedWord = 103,
|
||||
LastFutureReservedWord = 111,
|
||||
FirstFutureReservedWord = 102,
|
||||
LastFutureReservedWord = 110,
|
||||
FirstTypeNode = 141,
|
||||
LastTypeNode = 149,
|
||||
FirstPunctuation = 14,
|
||||
@ -310,6 +310,7 @@ declare module ts {
|
||||
}
|
||||
interface Identifier extends PrimaryExpression {
|
||||
text: string;
|
||||
originalKeywordKind?: SyntaxKind;
|
||||
}
|
||||
interface QualifiedName extends Node {
|
||||
left: EntityName;
|
||||
@ -1181,6 +1182,34 @@ declare module ts {
|
||||
function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean;
|
||||
function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean;
|
||||
}
|
||||
declare module ts {
|
||||
function getDefaultLibFileName(options: CompilerOptions): string;
|
||||
function textSpanEnd(span: TextSpan): number;
|
||||
function textSpanIsEmpty(span: TextSpan): boolean;
|
||||
function textSpanContainsPosition(span: TextSpan, position: number): boolean;
|
||||
function textSpanContainsTextSpan(span: TextSpan, other: TextSpan): boolean;
|
||||
function textSpanOverlapsWith(span: TextSpan, other: TextSpan): boolean;
|
||||
function textSpanOverlap(span1: TextSpan, span2: TextSpan): TextSpan;
|
||||
function textSpanIntersectsWithTextSpan(span: TextSpan, other: TextSpan): boolean;
|
||||
function textSpanIntersectsWith(span: TextSpan, start: number, length: number): boolean;
|
||||
function textSpanIntersectsWithPosition(span: TextSpan, position: number): boolean;
|
||||
function textSpanIntersection(span1: TextSpan, span2: TextSpan): TextSpan;
|
||||
function createTextSpan(start: number, length: number): TextSpan;
|
||||
function createTextSpanFromBounds(start: number, end: number): TextSpan;
|
||||
function textChangeRangeNewSpan(range: TextChangeRange): TextSpan;
|
||||
function textChangeRangeIsUnchanged(range: TextChangeRange): boolean;
|
||||
function createTextChangeRange(span: TextSpan, newLength: number): TextChangeRange;
|
||||
let unchangedTextChangeRange: TextChangeRange;
|
||||
/**
|
||||
* Called to merge all the changes that occurred across several versions of a script snapshot
|
||||
* into a single change. i.e. if a user keeps making successive edits to a script we will
|
||||
* have a text change from V1 to V2, V2 to V3, ..., Vn.
|
||||
*
|
||||
* This function will then merge those changes into a single change range valid between V1 and
|
||||
* Vn.
|
||||
*/
|
||||
function collapseTextChangeRangesAcrossMultipleVersions(changes: TextChangeRange[]): TextChangeRange;
|
||||
}
|
||||
declare module ts {
|
||||
function getNodeConstructor(kind: SyntaxKind): new () => Node;
|
||||
function createNode(kind: SyntaxKind): Node;
|
||||
@ -1260,7 +1289,6 @@ declare module ts {
|
||||
getDocumentationComment(): SymbolDisplayPart[];
|
||||
}
|
||||
interface SourceFile {
|
||||
getNamedDeclarations(): Declaration[];
|
||||
getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
|
||||
getLineStarts(): number[];
|
||||
getPositionOfLineAndCharacter(line: number, character: number): number;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -54,6 +54,7 @@ function buildInfoFileOutput(messageTable: InputDiagnosticMessageTable, nameMap:
|
||||
var result =
|
||||
'// <auto-generated />\r\n' +
|
||||
'/// <reference path="types.ts" />\r\n' +
|
||||
'/* @internal */\r\n' +
|
||||
'module ts {\r\n' +
|
||||
' export var Diagnostics = {\r\n';
|
||||
var names = Utilities.getObjectKeys(messageTable);
|
||||
|
||||
@ -2904,16 +2904,17 @@ module ts {
|
||||
}
|
||||
|
||||
function getPropertiesOfType(type: Type): Symbol[] {
|
||||
if (type.flags & TypeFlags.Union) {
|
||||
return getPropertiesOfUnionType(<UnionType>type);
|
||||
}
|
||||
return getPropertiesOfObjectType(getApparentType(type));
|
||||
type = getApparentType(type);
|
||||
return type.flags & TypeFlags.Union ? getPropertiesOfUnionType(<UnionType>type) : getPropertiesOfObjectType(type);
|
||||
}
|
||||
|
||||
// For a type parameter, return the base constraint of the type parameter. For the string, number,
|
||||
// boolean, and symbol primitive types, return the corresponding object types. Otherwise return the
|
||||
// type itself. Note that the apparent type of a union type is the union type itself.
|
||||
function getApparentType(type: Type): Type {
|
||||
if (type.flags & TypeFlags.Union) {
|
||||
type = getReducedTypeOfUnionType(<UnionType>type);
|
||||
}
|
||||
if (type.flags & TypeFlags.TypeParameter) {
|
||||
do {
|
||||
type = getConstraintOfTypeParameter(<TypeParameter>type);
|
||||
@ -2986,27 +2987,27 @@ module ts {
|
||||
// necessary, maps primitive types and type parameters are to their apparent types, and augments with properties from
|
||||
// Object and Function as appropriate.
|
||||
function getPropertyOfType(type: Type, name: string): Symbol {
|
||||
type = getApparentType(type);
|
||||
if (type.flags & TypeFlags.ObjectType) {
|
||||
let resolved = resolveObjectOrUnionTypeMembers(type);
|
||||
if (hasProperty(resolved.members, name)) {
|
||||
let symbol = resolved.members[name];
|
||||
if (symbolIsValue(symbol)) {
|
||||
return symbol;
|
||||
}
|
||||
}
|
||||
if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) {
|
||||
let symbol = getPropertyOfObjectType(globalFunctionType, name);
|
||||
if (symbol) {
|
||||
return symbol;
|
||||
}
|
||||
}
|
||||
return getPropertyOfObjectType(globalObjectType, name);
|
||||
}
|
||||
if (type.flags & TypeFlags.Union) {
|
||||
return getPropertyOfUnionType(<UnionType>type, name);
|
||||
}
|
||||
if (!(type.flags & TypeFlags.ObjectType)) {
|
||||
type = getApparentType(type);
|
||||
if (!(type.flags & TypeFlags.ObjectType)) {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
let resolved = resolveObjectOrUnionTypeMembers(type);
|
||||
if (hasProperty(resolved.members, name)) {
|
||||
let symbol = resolved.members[name];
|
||||
if (symbolIsValue(symbol)) {
|
||||
return symbol;
|
||||
}
|
||||
}
|
||||
if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) {
|
||||
let symbol = getPropertyOfObjectType(globalFunctionType, name);
|
||||
if (symbol) return symbol;
|
||||
}
|
||||
return getPropertyOfObjectType(globalObjectType, name);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function getSignaturesOfObjectOrUnionType(type: Type, kind: SignatureKind): Signature[] {
|
||||
@ -3581,6 +3582,10 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
// The noSubtypeReduction flag is there because it isn't possible to always do subtype reduction. The flag
|
||||
// is true when creating a union type from a type node and when instantiating a union type. In both of those
|
||||
// cases subtype reduction has to be deferred to properly support recursive union types. For example, a
|
||||
// type alias of the form "type Item = string | (() => Item)" cannot be reduced during its declaration.
|
||||
function getUnionType(types: Type[], noSubtypeReduction?: boolean): Type {
|
||||
if (types.length === 0) {
|
||||
return emptyObjectType;
|
||||
@ -3605,10 +3610,19 @@ module ts {
|
||||
if (!type) {
|
||||
type = unionTypes[id] = <UnionType>createObjectType(TypeFlags.Union | getWideningFlagsOfTypes(sortedTypes));
|
||||
type.types = sortedTypes;
|
||||
type.reducedType = noSubtypeReduction ? undefined : type;
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
function getReducedTypeOfUnionType(type: UnionType): Type {
|
||||
// If union type was created without subtype reduction, perform the deferred reduction now
|
||||
if (!type.reducedType) {
|
||||
type.reducedType = getUnionType(type.types, /*noSubtypeReduction*/ false);
|
||||
}
|
||||
return type.reducedType;
|
||||
}
|
||||
|
||||
function getTypeFromUnionTypeNode(node: UnionTypeNode): Type {
|
||||
let links = getNodeLinks(node);
|
||||
if (!links.resolvedType) {
|
||||
@ -9412,7 +9426,10 @@ module ts {
|
||||
}
|
||||
|
||||
if (isArrayLikeType(inputType)) {
|
||||
return getIndexTypeOfType(inputType, IndexKind.Number);
|
||||
let indexType = getIndexTypeOfType(inputType, IndexKind.Number);
|
||||
if (indexType) {
|
||||
return indexType;
|
||||
}
|
||||
}
|
||||
|
||||
error(errorNode, Diagnostics.Type_0_is_not_an_array_type, typeToString(inputType));
|
||||
|
||||
@ -659,10 +659,6 @@ module ts {
|
||||
"\u0085": "\\u0085" // nextLine
|
||||
};
|
||||
|
||||
export function getDefaultLibFileName(options: CompilerOptions): string {
|
||||
return options.target === ScriptTarget.ES6 ? "lib.es6.d.ts" : "lib.d.ts";
|
||||
}
|
||||
|
||||
export interface ObjectAllocator {
|
||||
getNodeConstructor(kind: SyntaxKind): new () => Node;
|
||||
getSymbolConstructor(): new (flags: SymbolFlags, name: string) => Symbol;
|
||||
|
||||
@ -2043,19 +2043,19 @@
|
||||
},
|
||||
"'import ... =' can only be used in a .ts file.": {
|
||||
"category": "Error",
|
||||
"code": 8002
|
||||
"code": 8002
|
||||
},
|
||||
"'export=' can only be used in a .ts file.": {
|
||||
"category": "Error",
|
||||
"code": 8003
|
||||
"code": 8003
|
||||
},
|
||||
"'type parameter declarations' can only be used in a .ts file.": {
|
||||
"category": "Error",
|
||||
"code": 8004
|
||||
"code": 8004
|
||||
},
|
||||
"'implements clauses' can only be used in a .ts file.": {
|
||||
"category": "Error",
|
||||
"code": 8005
|
||||
"code": 8005
|
||||
},
|
||||
"'interface declarations' can only be used in a .ts file.": {
|
||||
"category": "Error",
|
||||
|
||||
@ -121,7 +121,6 @@ module ts {
|
||||
WhileKeyword,
|
||||
WithKeyword,
|
||||
// Strict mode reserved words
|
||||
AsKeyword,
|
||||
ImplementsKeyword,
|
||||
InterfaceKeyword,
|
||||
LetKeyword,
|
||||
@ -132,6 +131,7 @@ module ts {
|
||||
StaticKeyword,
|
||||
YieldKeyword,
|
||||
// Contextual keywords
|
||||
AsKeyword,
|
||||
AnyKeyword,
|
||||
BooleanKeyword,
|
||||
ConstructorKeyword,
|
||||
@ -1512,6 +1512,8 @@ module ts {
|
||||
export interface UnionType extends Type {
|
||||
types: Type[]; // Constituent types
|
||||
/* @internal */
|
||||
reducedType: Type; // Reduced union type (all subtypes removed)
|
||||
/* @internal */
|
||||
resolvedProperties: SymbolTable; // Cache of resolved properties
|
||||
}
|
||||
|
||||
|
||||
@ -271,7 +271,6 @@ module ts {
|
||||
};
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
export function getSpanOfTokenAtPosition(sourceFile: SourceFile, pos: number): TextSpan {
|
||||
let scanner = createScanner(sourceFile.languageVersion, /*skipTrivia*/ true, sourceFile.text);
|
||||
scanner.setTextPos(pos);
|
||||
@ -408,7 +407,6 @@ module ts {
|
||||
|
||||
export let fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*<reference\s+path\s*=\s*)('|")(.+?)\2.*?\/>/
|
||||
|
||||
|
||||
// Warning: This has the same semantics as the forEach family of functions,
|
||||
// in that traversal terminates in the event that 'visitor' supplies a truthy value.
|
||||
export function forEachReturnStatement<T>(body: Block, visitor: (stmt: ReturnStatement) => T): T {
|
||||
@ -439,7 +437,6 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
export function isVariableLike(node: Node): boolean {
|
||||
if (node) {
|
||||
switch (node.kind) {
|
||||
@ -1151,218 +1148,7 @@ module ts {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
export function textSpanEnd(span: TextSpan) {
|
||||
return span.start + span.length
|
||||
}
|
||||
|
||||
export function textSpanIsEmpty(span: TextSpan) {
|
||||
return span.length === 0
|
||||
}
|
||||
|
||||
export function textSpanContainsPosition(span: TextSpan, position: number) {
|
||||
return position >= span.start && position < textSpanEnd(span);
|
||||
}
|
||||
|
||||
// Returns true if 'span' contains 'other'.
|
||||
export function textSpanContainsTextSpan(span: TextSpan, other: TextSpan) {
|
||||
return other.start >= span.start && textSpanEnd(other) <= textSpanEnd(span);
|
||||
}
|
||||
|
||||
export function textSpanOverlapsWith(span: TextSpan, other: TextSpan) {
|
||||
let overlapStart = Math.max(span.start, other.start);
|
||||
let overlapEnd = Math.min(textSpanEnd(span), textSpanEnd(other));
|
||||
return overlapStart < overlapEnd;
|
||||
}
|
||||
|
||||
export function textSpanOverlap(span1: TextSpan, span2: TextSpan) {
|
||||
let overlapStart = Math.max(span1.start, span2.start);
|
||||
let overlapEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2));
|
||||
if (overlapStart < overlapEnd) {
|
||||
return createTextSpanFromBounds(overlapStart, overlapEnd);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export function textSpanIntersectsWithTextSpan(span: TextSpan, other: TextSpan) {
|
||||
return other.start <= textSpanEnd(span) && textSpanEnd(other) >= span.start
|
||||
}
|
||||
|
||||
export function textSpanIntersectsWith(span: TextSpan, start: number, length: number) {
|
||||
let end = start + length;
|
||||
return start <= textSpanEnd(span) && end >= span.start;
|
||||
}
|
||||
|
||||
export function textSpanIntersectsWithPosition(span: TextSpan, position: number) {
|
||||
return position <= textSpanEnd(span) && position >= span.start;
|
||||
}
|
||||
|
||||
export function textSpanIntersection(span1: TextSpan, span2: TextSpan) {
|
||||
let intersectStart = Math.max(span1.start, span2.start);
|
||||
let intersectEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2));
|
||||
if (intersectStart <= intersectEnd) {
|
||||
return createTextSpanFromBounds(intersectStart, intersectEnd);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export function createTextSpan(start: number, length: number): TextSpan {
|
||||
if (start < 0) {
|
||||
throw new Error("start < 0");
|
||||
}
|
||||
if (length < 0) {
|
||||
throw new Error("length < 0");
|
||||
}
|
||||
|
||||
return { start, length };
|
||||
}
|
||||
|
||||
export function createTextSpanFromBounds(start: number, end: number) {
|
||||
return createTextSpan(start, end - start);
|
||||
}
|
||||
|
||||
export function textChangeRangeNewSpan(range: TextChangeRange) {
|
||||
return createTextSpan(range.span.start, range.newLength);
|
||||
}
|
||||
|
||||
export function textChangeRangeIsUnchanged(range: TextChangeRange) {
|
||||
return textSpanIsEmpty(range.span) && range.newLength === 0;
|
||||
}
|
||||
|
||||
export function createTextChangeRange(span: TextSpan, newLength: number): TextChangeRange {
|
||||
if (newLength < 0) {
|
||||
throw new Error("newLength < 0");
|
||||
}
|
||||
|
||||
return { span, newLength };
|
||||
}
|
||||
|
||||
export let unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0);
|
||||
|
||||
/**
|
||||
* Called to merge all the changes that occurred across several versions of a script snapshot
|
||||
* into a single change. i.e. if a user keeps making successive edits to a script we will
|
||||
* have a text change from V1 to V2, V2 to V3, ..., Vn.
|
||||
*
|
||||
* This function will then merge those changes into a single change range valid between V1 and
|
||||
* Vn.
|
||||
*/
|
||||
export function collapseTextChangeRangesAcrossMultipleVersions(changes: TextChangeRange[]): TextChangeRange {
|
||||
if (changes.length === 0) {
|
||||
return unchangedTextChangeRange;
|
||||
}
|
||||
|
||||
if (changes.length === 1) {
|
||||
return changes[0];
|
||||
}
|
||||
|
||||
// We change from talking about { { oldStart, oldLength }, newLength } to { oldStart, oldEnd, newEnd }
|
||||
// as it makes things much easier to reason about.
|
||||
let change0 = changes[0];
|
||||
|
||||
let oldStartN = change0.span.start;
|
||||
let oldEndN = textSpanEnd(change0.span);
|
||||
let newEndN = oldStartN + change0.newLength;
|
||||
|
||||
for (let i = 1; i < changes.length; i++) {
|
||||
let nextChange = changes[i];
|
||||
|
||||
// Consider the following case:
|
||||
// i.e. two edits. The first represents the text change range { { 10, 50 }, 30 }. i.e. The span starting
|
||||
// at 10, with length 50 is reduced to length 30. The second represents the text change range { { 30, 30 }, 40 }.
|
||||
// i.e. the span starting at 30 with length 30 is increased to length 40.
|
||||
//
|
||||
// 0 10 20 30 40 50 60 70 80 90 100
|
||||
// -------------------------------------------------------------------------------------------------------
|
||||
// | /
|
||||
// | /----
|
||||
// T1 | /----
|
||||
// | /----
|
||||
// | /----
|
||||
// -------------------------------------------------------------------------------------------------------
|
||||
// | \
|
||||
// | \
|
||||
// T2 | \
|
||||
// | \
|
||||
// | \
|
||||
// -------------------------------------------------------------------------------------------------------
|
||||
//
|
||||
// Merging these turns out to not be too difficult. First, determining the new start of the change is trivial
|
||||
// it's just the min of the old and new starts. i.e.:
|
||||
//
|
||||
// 0 10 20 30 40 50 60 70 80 90 100
|
||||
// ------------------------------------------------------------*------------------------------------------
|
||||
// | /
|
||||
// | /----
|
||||
// T1 | /----
|
||||
// | /----
|
||||
// | /----
|
||||
// ----------------------------------------$-------------------$------------------------------------------
|
||||
// . | \
|
||||
// . | \
|
||||
// T2 . | \
|
||||
// . | \
|
||||
// . | \
|
||||
// ----------------------------------------------------------------------*--------------------------------
|
||||
//
|
||||
// (Note the dots represent the newly inferrred start.
|
||||
// Determining the new and old end is also pretty simple. Basically it boils down to paying attention to the
|
||||
// absolute positions at the asterixes, and the relative change between the dollar signs. Basically, we see
|
||||
// which if the two $'s precedes the other, and we move that one forward until they line up. in this case that
|
||||
// means:
|
||||
//
|
||||
// 0 10 20 30 40 50 60 70 80 90 100
|
||||
// --------------------------------------------------------------------------------*----------------------
|
||||
// | /
|
||||
// | /----
|
||||
// T1 | /----
|
||||
// | /----
|
||||
// | /----
|
||||
// ------------------------------------------------------------$------------------------------------------
|
||||
// . | \
|
||||
// . | \
|
||||
// T2 . | \
|
||||
// . | \
|
||||
// . | \
|
||||
// ----------------------------------------------------------------------*--------------------------------
|
||||
//
|
||||
// In other words (in this case), we're recognizing that the second edit happened after where the first edit
|
||||
// ended with a delta of 20 characters (60 - 40). Thus, if we go back in time to where the first edit started
|
||||
// that's the same as if we started at char 80 instead of 60.
|
||||
//
|
||||
// As it so happens, the same logic applies if the second edit precedes the first edit. In that case rahter
|
||||
// than pusing the first edit forward to match the second, we'll push the second edit forward to match the
|
||||
// first.
|
||||
//
|
||||
// In this case that means we have { oldStart: 10, oldEnd: 80, newEnd: 70 } or, in TextChangeRange
|
||||
// semantics: { { start: 10, length: 70 }, newLength: 60 }
|
||||
//
|
||||
// The math then works out as follows.
|
||||
// If we have { oldStart1, oldEnd1, newEnd1 } and { oldStart2, oldEnd2, newEnd2 } then we can compute the
|
||||
// final result like so:
|
||||
//
|
||||
// {
|
||||
// oldStart3: Min(oldStart1, oldStart2),
|
||||
// oldEnd3 : Max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)),
|
||||
// newEnd3 : Max(newEnd2, newEnd2 + (newEnd1 - oldEnd2))
|
||||
// }
|
||||
|
||||
let oldStart1 = oldStartN;
|
||||
let oldEnd1 = oldEndN;
|
||||
let newEnd1 = newEndN;
|
||||
|
||||
let oldStart2 = nextChange.span.start;
|
||||
let oldEnd2 = textSpanEnd(nextChange.span);
|
||||
let newEnd2 = oldStart2 + nextChange.newLength;
|
||||
|
||||
oldStartN = Math.min(oldStart1, oldStart2);
|
||||
oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1));
|
||||
newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2));
|
||||
}
|
||||
|
||||
return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), /*newLength:*/ newEndN - oldStartN);
|
||||
}
|
||||
|
||||
|
||||
export function nodeStartsNewLexicalEnvironment(n: Node): boolean {
|
||||
return isFunctionLike(n) || n.kind === SyntaxKind.ModuleDeclaration || n.kind === SyntaxKind.SourceFile;
|
||||
}
|
||||
@ -1379,7 +1165,6 @@ module ts {
|
||||
return node;
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
export function createDiagnosticCollection(): DiagnosticCollection {
|
||||
let nonFileDiagnostics: Diagnostic[] = [];
|
||||
let fileDiagnostics: Map<Diagnostic[]> = {};
|
||||
@ -1854,3 +1639,220 @@ module ts {
|
||||
return symbol && symbol.valueDeclaration && (symbol.valueDeclaration.flags & NodeFlags.Default) ? symbol.valueDeclaration.localSymbol : undefined;
|
||||
}
|
||||
}
|
||||
|
||||
module ts {
|
||||
export function getDefaultLibFileName(options: CompilerOptions): string {
|
||||
return options.target === ScriptTarget.ES6 ? "lib.es6.d.ts" : "lib.d.ts";
|
||||
}
|
||||
|
||||
export function textSpanEnd(span: TextSpan) {
|
||||
return span.start + span.length
|
||||
}
|
||||
|
||||
export function textSpanIsEmpty(span: TextSpan) {
|
||||
return span.length === 0
|
||||
}
|
||||
|
||||
export function textSpanContainsPosition(span: TextSpan, position: number) {
|
||||
return position >= span.start && position < textSpanEnd(span);
|
||||
}
|
||||
|
||||
// Returns true if 'span' contains 'other'.
|
||||
export function textSpanContainsTextSpan(span: TextSpan, other: TextSpan) {
|
||||
return other.start >= span.start && textSpanEnd(other) <= textSpanEnd(span);
|
||||
}
|
||||
|
||||
export function textSpanOverlapsWith(span: TextSpan, other: TextSpan) {
|
||||
let overlapStart = Math.max(span.start, other.start);
|
||||
let overlapEnd = Math.min(textSpanEnd(span), textSpanEnd(other));
|
||||
return overlapStart < overlapEnd;
|
||||
}
|
||||
|
||||
export function textSpanOverlap(span1: TextSpan, span2: TextSpan) {
|
||||
let overlapStart = Math.max(span1.start, span2.start);
|
||||
let overlapEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2));
|
||||
if (overlapStart < overlapEnd) {
|
||||
return createTextSpanFromBounds(overlapStart, overlapEnd);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export function textSpanIntersectsWithTextSpan(span: TextSpan, other: TextSpan) {
|
||||
return other.start <= textSpanEnd(span) && textSpanEnd(other) >= span.start
|
||||
}
|
||||
|
||||
export function textSpanIntersectsWith(span: TextSpan, start: number, length: number) {
|
||||
let end = start + length;
|
||||
return start <= textSpanEnd(span) && end >= span.start;
|
||||
}
|
||||
|
||||
export function textSpanIntersectsWithPosition(span: TextSpan, position: number) {
|
||||
return position <= textSpanEnd(span) && position >= span.start;
|
||||
}
|
||||
|
||||
export function textSpanIntersection(span1: TextSpan, span2: TextSpan) {
|
||||
let intersectStart = Math.max(span1.start, span2.start);
|
||||
let intersectEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2));
|
||||
if (intersectStart <= intersectEnd) {
|
||||
return createTextSpanFromBounds(intersectStart, intersectEnd);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export function createTextSpan(start: number, length: number): TextSpan {
|
||||
if (start < 0) {
|
||||
throw new Error("start < 0");
|
||||
}
|
||||
if (length < 0) {
|
||||
throw new Error("length < 0");
|
||||
}
|
||||
|
||||
return { start, length };
|
||||
}
|
||||
|
||||
export function createTextSpanFromBounds(start: number, end: number) {
|
||||
return createTextSpan(start, end - start);
|
||||
}
|
||||
|
||||
export function textChangeRangeNewSpan(range: TextChangeRange) {
|
||||
return createTextSpan(range.span.start, range.newLength);
|
||||
}
|
||||
|
||||
export function textChangeRangeIsUnchanged(range: TextChangeRange) {
|
||||
return textSpanIsEmpty(range.span) && range.newLength === 0;
|
||||
}
|
||||
|
||||
export function createTextChangeRange(span: TextSpan, newLength: number): TextChangeRange {
|
||||
if (newLength < 0) {
|
||||
throw new Error("newLength < 0");
|
||||
}
|
||||
|
||||
return { span, newLength };
|
||||
}
|
||||
|
||||
export let unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0);
|
||||
|
||||
/**
|
||||
* Called to merge all the changes that occurred across several versions of a script snapshot
|
||||
* into a single change. i.e. if a user keeps making successive edits to a script we will
|
||||
* have a text change from V1 to V2, V2 to V3, ..., Vn.
|
||||
*
|
||||
* This function will then merge those changes into a single change range valid between V1 and
|
||||
* Vn.
|
||||
*/
|
||||
export function collapseTextChangeRangesAcrossMultipleVersions(changes: TextChangeRange[]): TextChangeRange {
|
||||
if (changes.length === 0) {
|
||||
return unchangedTextChangeRange;
|
||||
}
|
||||
|
||||
if (changes.length === 1) {
|
||||
return changes[0];
|
||||
}
|
||||
|
||||
// We change from talking about { { oldStart, oldLength }, newLength } to { oldStart, oldEnd, newEnd }
|
||||
// as it makes things much easier to reason about.
|
||||
let change0 = changes[0];
|
||||
|
||||
let oldStartN = change0.span.start;
|
||||
let oldEndN = textSpanEnd(change0.span);
|
||||
let newEndN = oldStartN + change0.newLength;
|
||||
|
||||
for (let i = 1; i < changes.length; i++) {
|
||||
let nextChange = changes[i];
|
||||
|
||||
// Consider the following case:
|
||||
// i.e. two edits. The first represents the text change range { { 10, 50 }, 30 }. i.e. The span starting
|
||||
// at 10, with length 50 is reduced to length 30. The second represents the text change range { { 30, 30 }, 40 }.
|
||||
// i.e. the span starting at 30 with length 30 is increased to length 40.
|
||||
//
|
||||
// 0 10 20 30 40 50 60 70 80 90 100
|
||||
// -------------------------------------------------------------------------------------------------------
|
||||
// | /
|
||||
// | /----
|
||||
// T1 | /----
|
||||
// | /----
|
||||
// | /----
|
||||
// -------------------------------------------------------------------------------------------------------
|
||||
// | \
|
||||
// | \
|
||||
// T2 | \
|
||||
// | \
|
||||
// | \
|
||||
// -------------------------------------------------------------------------------------------------------
|
||||
//
|
||||
// Merging these turns out to not be too difficult. First, determining the new start of the change is trivial
|
||||
// it's just the min of the old and new starts. i.e.:
|
||||
//
|
||||
// 0 10 20 30 40 50 60 70 80 90 100
|
||||
// ------------------------------------------------------------*------------------------------------------
|
||||
// | /
|
||||
// | /----
|
||||
// T1 | /----
|
||||
// | /----
|
||||
// | /----
|
||||
// ----------------------------------------$-------------------$------------------------------------------
|
||||
// . | \
|
||||
// . | \
|
||||
// T2 . | \
|
||||
// . | \
|
||||
// . | \
|
||||
// ----------------------------------------------------------------------*--------------------------------
|
||||
//
|
||||
// (Note the dots represent the newly inferrred start.
|
||||
// Determining the new and old end is also pretty simple. Basically it boils down to paying attention to the
|
||||
// absolute positions at the asterixes, and the relative change between the dollar signs. Basically, we see
|
||||
// which if the two $'s precedes the other, and we move that one forward until they line up. in this case that
|
||||
// means:
|
||||
//
|
||||
// 0 10 20 30 40 50 60 70 80 90 100
|
||||
// --------------------------------------------------------------------------------*----------------------
|
||||
// | /
|
||||
// | /----
|
||||
// T1 | /----
|
||||
// | /----
|
||||
// | /----
|
||||
// ------------------------------------------------------------$------------------------------------------
|
||||
// . | \
|
||||
// . | \
|
||||
// T2 . | \
|
||||
// . | \
|
||||
// . | \
|
||||
// ----------------------------------------------------------------------*--------------------------------
|
||||
//
|
||||
// In other words (in this case), we're recognizing that the second edit happened after where the first edit
|
||||
// ended with a delta of 20 characters (60 - 40). Thus, if we go back in time to where the first edit started
|
||||
// that's the same as if we started at char 80 instead of 60.
|
||||
//
|
||||
// As it so happens, the same logic applies if the second edit precedes the first edit. In that case rahter
|
||||
// than pusing the first edit forward to match the second, we'll push the second edit forward to match the
|
||||
// first.
|
||||
//
|
||||
// In this case that means we have { oldStart: 10, oldEnd: 80, newEnd: 70 } or, in TextChangeRange
|
||||
// semantics: { { start: 10, length: 70 }, newLength: 60 }
|
||||
//
|
||||
// The math then works out as follows.
|
||||
// If we have { oldStart1, oldEnd1, newEnd1 } and { oldStart2, oldEnd2, newEnd2 } then we can compute the
|
||||
// final result like so:
|
||||
//
|
||||
// {
|
||||
// oldStart3: Min(oldStart1, oldStart2),
|
||||
// oldEnd3 : Max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)),
|
||||
// newEnd3 : Max(newEnd2, newEnd2 + (newEnd1 - oldEnd2))
|
||||
// }
|
||||
|
||||
let oldStart1 = oldStartN;
|
||||
let oldEnd1 = oldEndN;
|
||||
let newEnd1 = newEndN;
|
||||
|
||||
let oldStart2 = nextChange.span.start;
|
||||
let oldEnd2 = textSpanEnd(nextChange.span);
|
||||
let newEnd2 = oldStart2 + nextChange.newLength;
|
||||
|
||||
oldStartN = Math.min(oldStart1, oldStart2);
|
||||
oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1));
|
||||
newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2));
|
||||
}
|
||||
|
||||
return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), /*newLength:*/ newEndN - oldStartN);
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,5 @@
|
||||
interface TypeWriterResult {
|
||||
line: number;
|
||||
column: number;
|
||||
syntaxKind: number;
|
||||
sourceText: string;
|
||||
type: string;
|
||||
@ -29,90 +28,43 @@ class TypeWriterWalker {
|
||||
}
|
||||
|
||||
private visitNode(node: ts.Node): void {
|
||||
switch (node.kind) {
|
||||
// Should always log expressions that are not tokens
|
||||
// Also, always log the "this" keyword
|
||||
// TODO: Ideally we should log all expressions, but to compare to the
|
||||
// old typeWriter baselines, suppress tokens
|
||||
case ts.SyntaxKind.ThisKeyword:
|
||||
case ts.SyntaxKind.SuperKeyword:
|
||||
case ts.SyntaxKind.ArrayLiteralExpression:
|
||||
case ts.SyntaxKind.ObjectLiteralExpression:
|
||||
case ts.SyntaxKind.ElementAccessExpression:
|
||||
case ts.SyntaxKind.CallExpression:
|
||||
case ts.SyntaxKind.NewExpression:
|
||||
case ts.SyntaxKind.TypeAssertionExpression:
|
||||
case ts.SyntaxKind.ParenthesizedExpression:
|
||||
case ts.SyntaxKind.FunctionExpression:
|
||||
case ts.SyntaxKind.ArrowFunction:
|
||||
case ts.SyntaxKind.TypeOfExpression:
|
||||
case ts.SyntaxKind.VoidExpression:
|
||||
case ts.SyntaxKind.DeleteExpression:
|
||||
case ts.SyntaxKind.PrefixUnaryExpression:
|
||||
case ts.SyntaxKind.PostfixUnaryExpression:
|
||||
case ts.SyntaxKind.BinaryExpression:
|
||||
case ts.SyntaxKind.ConditionalExpression:
|
||||
case ts.SyntaxKind.SpreadElementExpression:
|
||||
this.log(node, this.getTypeOfNode(node));
|
||||
break;
|
||||
|
||||
case ts.SyntaxKind.PropertyAccessExpression:
|
||||
for (var current = node; current.kind === ts.SyntaxKind.PropertyAccessExpression; current = current.parent) {
|
||||
}
|
||||
if (current.kind !== ts.SyntaxKind.HeritageClauseElement) {
|
||||
this.log(node, this.getTypeOfNode(node));
|
||||
}
|
||||
break;
|
||||
|
||||
// Should not change expression status (maybe expressions)
|
||||
// TODO: Again, ideally should log number and string literals too,
|
||||
// but to be consistent with the old typeWriter, just log identifiers
|
||||
case ts.SyntaxKind.Identifier:
|
||||
var identifier = <ts.Identifier>node;
|
||||
if (!this.isLabel(identifier)) {
|
||||
var type = this.getTypeOfNode(identifier);
|
||||
this.log(node, type);
|
||||
}
|
||||
break;
|
||||
if (ts.isExpression(node) || node.kind === ts.SyntaxKind.Identifier) {
|
||||
this.logTypeAndSymbol(node);
|
||||
}
|
||||
|
||||
ts.forEachChild(node, child => this.visitNode(child));
|
||||
}
|
||||
|
||||
private isLabel(identifier: ts.Identifier): boolean {
|
||||
var parent = identifier.parent;
|
||||
switch (parent.kind) {
|
||||
case ts.SyntaxKind.ContinueStatement:
|
||||
case ts.SyntaxKind.BreakStatement:
|
||||
return (<ts.BreakOrContinueStatement>parent).label === identifier;
|
||||
case ts.SyntaxKind.LabeledStatement:
|
||||
return (<ts.LabeledStatement>parent).label === identifier;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private log(node: ts.Node, type: ts.Type): void {
|
||||
private logTypeAndSymbol(node: ts.Node): void {
|
||||
var actualPos = ts.skipTrivia(this.currentSourceFile.text, node.pos);
|
||||
var lineAndCharacter = this.currentSourceFile.getLineAndCharacterOfPosition(actualPos);
|
||||
var sourceText = ts.getTextOfNodeFromSourceText(this.currentSourceFile.text, node);
|
||||
|
||||
// If we got an unknown type, we temporarily want to fall back to just pretending the name
|
||||
// (source text) of the node is the type. This is to align with the old typeWriter to make
|
||||
// baseline comparisons easier. In the long term, we will want to just call typeToString
|
||||
this.results.push({
|
||||
line: lineAndCharacter.line,
|
||||
// todo(cyrusn): Not sure why column is one-based for type-writer. But I'm preserving
|
||||
// that behavior to prevent having a lot of baselines to fix up.
|
||||
column: lineAndCharacter.character + 1,
|
||||
syntaxKind: node.kind,
|
||||
sourceText: sourceText,
|
||||
type: this.checker.typeToString(type, node.parent, ts.TypeFormatFlags.NoTruncation | ts.TypeFormatFlags.WriteOwnNameForAnyLike)
|
||||
});
|
||||
}
|
||||
|
||||
private getTypeOfNode(node: ts.Node): ts.Type {
|
||||
var type = this.checker.getTypeAtLocation(node);
|
||||
ts.Debug.assert(type !== undefined, "type doesn't exist");
|
||||
return type;
|
||||
var symbol = this.checker.getSymbolAtLocation(node);
|
||||
|
||||
var typeString = this.checker.typeToString(type, node.parent, ts.TypeFormatFlags.NoTruncation);
|
||||
if (symbol) {
|
||||
var symbolString = "Symbol(" + this.checker.symbolToString(symbol, node.parent);
|
||||
if (symbol.declarations) {
|
||||
for (let declaration of symbol.declarations) {
|
||||
symbolString += ", ";
|
||||
let declSourceFile = declaration.getSourceFile();
|
||||
let declLineAndCharacter = declSourceFile.getLineAndCharacterOfPosition(declaration.pos);
|
||||
symbolString += `Decl(${ ts.getBaseFileName(declSourceFile.fileName) }, ${ declLineAndCharacter.line }, ${ declLineAndCharacter.character })`
|
||||
}
|
||||
}
|
||||
symbolString += ")";
|
||||
|
||||
typeString += ", " + symbolString;
|
||||
}
|
||||
|
||||
this.results.push({
|
||||
line: lineAndCharacter.line,
|
||||
syntaxKind: node.kind,
|
||||
sourceText: sourceText,
|
||||
type: typeString
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -118,7 +118,7 @@ module ts.server {
|
||||
|
||||
constructor(private host: ServerHost, private logger: Logger) {
|
||||
this.projectService =
|
||||
new ProjectService(host, logger, (eventName, project, fileName) => {
|
||||
new ProjectService(host, logger, (eventName,project,fileName) => {
|
||||
this.handleEvent(eventName, project, fileName);
|
||||
});
|
||||
}
|
||||
@ -263,7 +263,7 @@ module ts.server {
|
||||
}
|
||||
}
|
||||
|
||||
getDefinition({ line, offset, file: fileName }: protocol.FileLocationRequestArgs): protocol.FileSpan[] {
|
||||
getDefinition(line: number, offset: number, fileName: string): protocol.FileSpan[] {
|
||||
var file = ts.normalizePath(fileName);
|
||||
var project = this.projectService.getProjectForFile(file);
|
||||
if (!project) {
|
||||
@ -285,7 +285,7 @@ module ts.server {
|
||||
}));
|
||||
}
|
||||
|
||||
getOccurrences({ line, offset, file: fileName }: protocol.FileLocationRequestArgs): protocol.OccurrencesResponseItem[] {
|
||||
getOccurrences(line: number, offset: number, fileName: string): protocol.OccurrencesResponseItem[] {
|
||||
fileName = ts.normalizePath(fileName);
|
||||
let project = this.projectService.getProjectForFile(fileName);
|
||||
|
||||
@ -315,7 +315,7 @@ module ts.server {
|
||||
});
|
||||
}
|
||||
|
||||
getRenameLocations({line, offset, file: fileName, findInComments, findInStrings }: protocol.RenameRequestArgs): protocol.RenameResponseBody {
|
||||
getRenameLocations(line: number, offset: number, fileName: string,findInComments: boolean, findInStrings: boolean): protocol.RenameResponseBody {
|
||||
var file = ts.normalizePath(fileName);
|
||||
var project = this.projectService.getProjectForFile(file);
|
||||
if (!project) {
|
||||
@ -383,7 +383,7 @@ module ts.server {
|
||||
return { info: renameInfo, locs: bakedRenameLocs };
|
||||
}
|
||||
|
||||
getReferences({ line, offset, file: fileName }: protocol.FileLocationRequestArgs): protocol.ReferencesResponseBody {
|
||||
getReferences(line: number, offset: number, fileName: string): protocol.ReferencesResponseBody {
|
||||
// TODO: get all projects for this file; report refs for all projects deleting duplicates
|
||||
// can avoid duplicates by eliminating same ref file from subsequent projects
|
||||
var file = ts.normalizePath(fileName);
|
||||
@ -430,12 +430,12 @@ module ts.server {
|
||||
};
|
||||
}
|
||||
|
||||
openClientFile({ file: fileName }: protocol.OpenRequestArgs) {
|
||||
openClientFile(fileName: string) {
|
||||
var file = ts.normalizePath(fileName);
|
||||
this.projectService.openClientFile(file);
|
||||
}
|
||||
|
||||
getQuickInfo({ line, offset, file: fileName }: protocol.FileLocationRequestArgs): protocol.QuickInfoResponseBody {
|
||||
getQuickInfo(line: number, offset: number, fileName: string): protocol.QuickInfoResponseBody {
|
||||
var file = ts.normalizePath(fileName);
|
||||
var project = this.projectService.getProjectForFile(file);
|
||||
if (!project) {
|
||||
@ -461,7 +461,7 @@ module ts.server {
|
||||
};
|
||||
}
|
||||
|
||||
getFormattingEditsForRange({line, offset, endLine, endOffset, file: fileName}: protocol.FormatRequestArgs): protocol.CodeEdit[] {
|
||||
getFormattingEditsForRange(line: number, offset: number, endLine: number, endOffset: number, fileName: string): protocol.CodeEdit[] {
|
||||
var file = ts.normalizePath(fileName);
|
||||
var project = this.projectService.getProjectForFile(file);
|
||||
if (!project) {
|
||||
@ -488,7 +488,7 @@ module ts.server {
|
||||
});
|
||||
}
|
||||
|
||||
getFormattingEditsAfterKeystroke({line, offset, key, file: fileName}: protocol.FormatOnKeyRequestArgs): protocol.CodeEdit[] {
|
||||
getFormattingEditsAfterKeystroke(line: number, offset: number, key: string, fileName: string): protocol.CodeEdit[] {
|
||||
var file = ts.normalizePath(fileName);
|
||||
|
||||
var project = this.projectService.getProjectForFile(file);
|
||||
@ -561,7 +561,7 @@ module ts.server {
|
||||
});
|
||||
}
|
||||
|
||||
getCompletions({ line, offset, prefix, file: fileName}: protocol.CompletionsRequestArgs): protocol.CompletionEntry[] {
|
||||
getCompletions(line: number, offset: number, prefix: string, fileName: string): protocol.CompletionEntry[] {
|
||||
if (!prefix) {
|
||||
prefix = "";
|
||||
}
|
||||
@ -587,7 +587,8 @@ module ts.server {
|
||||
}, []).sort((a, b) => a.name.localeCompare(b.name));
|
||||
}
|
||||
|
||||
getCompletionEntryDetails({ line, offset, entryNames, file: fileName}: protocol.CompletionDetailsRequestArgs): protocol.CompletionEntryDetails[] {
|
||||
getCompletionEntryDetails(line: number, offset: number,
|
||||
entryNames: string[], fileName: string): protocol.CompletionEntryDetails[] {
|
||||
var file = ts.normalizePath(fileName);
|
||||
var project = this.projectService.getProjectForFile(file);
|
||||
if (!project) {
|
||||
@ -606,20 +607,20 @@ module ts.server {
|
||||
}, []);
|
||||
}
|
||||
|
||||
getSignatureHelpItems({ line, offset, file: fileName }: protocol.SignatureHelpRequestArgs): protocol.SignatureHelpItems {
|
||||
getSignatureHelpItems(line: number, offset: number, fileName: string): protocol.SignatureHelpItems {
|
||||
var file = ts.normalizePath(fileName);
|
||||
var project = this.projectService.getProjectForFile(file);
|
||||
if (!project) {
|
||||
throw Errors.NoProject;
|
||||
}
|
||||
|
||||
|
||||
var compilerService = project.compilerService;
|
||||
var position = compilerService.host.lineOffsetToPosition(file, line, offset);
|
||||
var helpItems = compilerService.languageService.getSignatureHelpItems(file, position);
|
||||
if (!helpItems) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
||||
var span = helpItems.applicableSpan;
|
||||
var result: protocol.SignatureHelpItems = {
|
||||
items: helpItems.items,
|
||||
@ -631,11 +632,11 @@ module ts.server {
|
||||
argumentIndex: helpItems.argumentIndex,
|
||||
argumentCount: helpItems.argumentCount,
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
getDiagnostics({ delay, files: fileNames }: protocol.GeterrRequestArgs): void {
|
||||
|
||||
getDiagnostics(delay: number, fileNames: string[]) {
|
||||
var checkList = fileNames.reduce((accum: PendingErrorCheck[], fileName: string) => {
|
||||
fileName = ts.normalizePath(fileName);
|
||||
var project = this.projectService.getProjectForFile(fileName);
|
||||
@ -646,11 +647,11 @@ module ts.server {
|
||||
}, []);
|
||||
|
||||
if (checkList.length > 0) {
|
||||
this.updateErrorCheck(checkList, this.changeSeq, (n) => n == this.changeSeq, delay)
|
||||
this.updateErrorCheck(checkList, this.changeSeq,(n) => n == this.changeSeq, delay)
|
||||
}
|
||||
}
|
||||
|
||||
change({ line, offset, endLine, endOffset, insertString, file: fileName }: protocol.ChangeRequestArgs): void {
|
||||
change(line: number, offset: number, endLine: number, endOffset: number, insertString: string, fileName: string) {
|
||||
var file = ts.normalizePath(fileName);
|
||||
var project = this.projectService.getProjectForFile(file);
|
||||
if (project) {
|
||||
@ -665,7 +666,7 @@ module ts.server {
|
||||
}
|
||||
}
|
||||
|
||||
reload({ file: fileName, tmpfile: tempFileName }: protocol.ReloadRequestArgs, reqSeq = 0): void {
|
||||
reload(fileName: string, tempFileName: string, reqSeq = 0) {
|
||||
var file = ts.normalizePath(fileName);
|
||||
var tmpfile = ts.normalizePath(tempFileName);
|
||||
var project = this.projectService.getProjectForFile(file);
|
||||
@ -678,7 +679,7 @@ module ts.server {
|
||||
}
|
||||
}
|
||||
|
||||
saveToTmp({ file: fileName, tmpfile: tempFileName }: protocol.SavetoRequestArgs): void {
|
||||
saveToTmp(fileName: string, tempFileName: string) {
|
||||
var file = ts.normalizePath(fileName);
|
||||
var tmpfile = ts.normalizePath(tempFileName);
|
||||
|
||||
@ -688,7 +689,7 @@ module ts.server {
|
||||
}
|
||||
}
|
||||
|
||||
closeClientFile({ file: fileName }: protocol.FileRequestArgs) {
|
||||
closeClientFile(fileName: string) {
|
||||
var file = ts.normalizePath(fileName);
|
||||
this.projectService.closeClientFile(file);
|
||||
}
|
||||
@ -712,7 +713,7 @@ module ts.server {
|
||||
}));
|
||||
}
|
||||
|
||||
getNavigationBarItems({ file: fileName }: protocol.FileRequestArgs): protocol.NavigationBarItem[]{
|
||||
getNavigationBarItems(fileName: string): protocol.NavigationBarItem[] {
|
||||
var file = ts.normalizePath(fileName);
|
||||
var project = this.projectService.getProjectForFile(file);
|
||||
if (!project) {
|
||||
@ -728,7 +729,7 @@ module ts.server {
|
||||
return this.decorateNavigationBarItem(project, fileName, items);
|
||||
}
|
||||
|
||||
getNavigateToItems({ searchValue, file: fileName, maxResultCount }: protocol.NavtoRequestArgs): protocol.NavtoItem[]{
|
||||
getNavigateToItems(searchValue: string, fileName: string, maxResultCount?: number): protocol.NavtoItem[] {
|
||||
var file = ts.normalizePath(fileName);
|
||||
var project = this.projectService.getProjectForFile(file);
|
||||
if (!project) {
|
||||
@ -767,7 +768,7 @@ module ts.server {
|
||||
});
|
||||
}
|
||||
|
||||
getBraceMatching({ line, offset, file: fileName }: protocol.FileLocationRequestArgs): protocol.TextSpan[]{
|
||||
getBraceMatching(line: number, offset: number, fileName: string): protocol.TextSpan[] {
|
||||
var file = ts.normalizePath(fileName);
|
||||
|
||||
var project = this.projectService.getProjectForFile(file);
|
||||
@ -809,91 +810,114 @@ module ts.server {
|
||||
break;
|
||||
}
|
||||
case CommandNames.Definition: {
|
||||
response = this.getDefinition(<protocol.FileLocationRequestArgs>request.arguments);
|
||||
var defArgs = <protocol.FileLocationRequestArgs>request.arguments;
|
||||
response = this.getDefinition(defArgs.line, defArgs.offset, defArgs.file);
|
||||
break;
|
||||
}
|
||||
case CommandNames.References: {
|
||||
response = this.getReferences(<protocol.FileLocationRequestArgs>request.arguments);
|
||||
var refArgs = <protocol.FileLocationRequestArgs>request.arguments;
|
||||
response = this.getReferences(refArgs.line, refArgs.offset, refArgs.file);
|
||||
break;
|
||||
}
|
||||
case CommandNames.Rename: {
|
||||
response = this.getRenameLocations(<protocol.RenameRequestArgs>request.arguments);
|
||||
var renameArgs = <protocol.RenameRequestArgs>request.arguments;
|
||||
response = this.getRenameLocations(renameArgs.line, renameArgs.offset, renameArgs.file, renameArgs.findInComments, renameArgs.findInStrings);
|
||||
break;
|
||||
}
|
||||
case CommandNames.Open: {
|
||||
this.openClientFile(<protocol.OpenRequestArgs>request.arguments);
|
||||
var openArgs = <protocol.OpenRequestArgs>request.arguments;
|
||||
this.openClientFile(openArgs.file);
|
||||
responseRequired = false;
|
||||
break;
|
||||
}
|
||||
case CommandNames.Quickinfo: {
|
||||
response = this.getQuickInfo(<protocol.FileLocationRequestArgs>request.arguments);
|
||||
var quickinfoArgs = <protocol.FileLocationRequestArgs>request.arguments;
|
||||
response = this.getQuickInfo(quickinfoArgs.line, quickinfoArgs.offset, quickinfoArgs.file);
|
||||
break;
|
||||
}
|
||||
case CommandNames.Format: {
|
||||
response = this.getFormattingEditsForRange(<protocol.FormatRequestArgs>request.arguments);
|
||||
var formatArgs = <protocol.FormatRequestArgs>request.arguments;
|
||||
response = this.getFormattingEditsForRange(formatArgs.line, formatArgs.offset, formatArgs.endLine, formatArgs.endOffset, formatArgs.file);
|
||||
break;
|
||||
}
|
||||
case CommandNames.Formatonkey: {
|
||||
response = this.getFormattingEditsAfterKeystroke(<protocol.FormatOnKeyRequestArgs>request.arguments);
|
||||
var formatOnKeyArgs = <protocol.FormatOnKeyRequestArgs>request.arguments;
|
||||
response = this.getFormattingEditsAfterKeystroke(formatOnKeyArgs.line, formatOnKeyArgs.offset, formatOnKeyArgs.key, formatOnKeyArgs.file);
|
||||
break;
|
||||
}
|
||||
case CommandNames.Completions: {
|
||||
response = this.getCompletions(<protocol.CompletionsRequestArgs>request.arguments);
|
||||
var completionsArgs = <protocol.CompletionsRequestArgs>request.arguments;
|
||||
response = this.getCompletions(completionsArgs.line, completionsArgs.offset, completionsArgs.prefix, completionsArgs.file);
|
||||
break;
|
||||
}
|
||||
case CommandNames.CompletionDetails: {
|
||||
response = this.getCompletionEntryDetails(<protocol.CompletionDetailsRequestArgs>request.arguments);
|
||||
var completionDetailsArgs = <protocol.CompletionDetailsRequestArgs>request.arguments;
|
||||
response =
|
||||
this.getCompletionEntryDetails(completionDetailsArgs.line,completionDetailsArgs.offset,
|
||||
completionDetailsArgs.entryNames,completionDetailsArgs.file);
|
||||
break;
|
||||
}
|
||||
case CommandNames.SignatureHelp: {
|
||||
response = this.getSignatureHelpItems(<protocol.SignatureHelpRequestArgs>request.arguments);
|
||||
var signatureHelpArgs = <protocol.SignatureHelpRequestArgs>request.arguments;
|
||||
response = this.getSignatureHelpItems(signatureHelpArgs.line, signatureHelpArgs.offset, signatureHelpArgs.file);
|
||||
break;
|
||||
}
|
||||
case CommandNames.Geterr: {
|
||||
this.getDiagnostics(<protocol.GeterrRequestArgs>request.arguments);
|
||||
var geterrArgs = <protocol.GeterrRequestArgs>request.arguments;
|
||||
response = this.getDiagnostics(geterrArgs.delay, geterrArgs.files);
|
||||
responseRequired = false;
|
||||
break;
|
||||
}
|
||||
case CommandNames.Change: {
|
||||
this.change(<protocol.ChangeRequestArgs>request.arguments);
|
||||
var changeArgs = <protocol.ChangeRequestArgs>request.arguments;
|
||||
this.change(changeArgs.line, changeArgs.offset, changeArgs.endLine, changeArgs.endOffset,
|
||||
changeArgs.insertString, changeArgs.file);
|
||||
responseRequired = false;
|
||||
break;
|
||||
}
|
||||
case CommandNames.Configure: {
|
||||
this.projectService.setHostConfiguration(<protocol.ConfigureRequestArguments>request.arguments);
|
||||
var configureArgs = <protocol.ConfigureRequestArguments>request.arguments;
|
||||
this.projectService.setHostConfiguration(configureArgs);
|
||||
this.output(undefined, CommandNames.Configure, request.seq);
|
||||
responseRequired = false;
|
||||
break;
|
||||
}
|
||||
case CommandNames.Reload: {
|
||||
this.reload(<protocol.ReloadRequestArgs>request.arguments);
|
||||
var reloadArgs = <protocol.ReloadRequestArgs>request.arguments;
|
||||
this.reload(reloadArgs.file, reloadArgs.tmpfile, request.seq);
|
||||
responseRequired = false;
|
||||
break;
|
||||
}
|
||||
case CommandNames.Saveto: {
|
||||
this.saveToTmp(<protocol.SavetoRequestArgs>request.arguments);
|
||||
var savetoArgs = <protocol.SavetoRequestArgs>request.arguments;
|
||||
this.saveToTmp(savetoArgs.file, savetoArgs.tmpfile);
|
||||
responseRequired = false;
|
||||
break;
|
||||
}
|
||||
case CommandNames.Close: {
|
||||
this.closeClientFile(<protocol.FileRequestArgs>request.arguments);
|
||||
var closeArgs = <protocol.FileRequestArgs>request.arguments;
|
||||
this.closeClientFile(closeArgs.file);
|
||||
responseRequired = false;
|
||||
break;
|
||||
}
|
||||
case CommandNames.Navto: {
|
||||
response = this.getNavigateToItems(<protocol.NavtoRequestArgs>request.arguments);
|
||||
var navtoArgs = <protocol.NavtoRequestArgs>request.arguments;
|
||||
response = this.getNavigateToItems(navtoArgs.searchValue, navtoArgs.file, navtoArgs.maxResultCount);
|
||||
break;
|
||||
}
|
||||
case CommandNames.Brace: {
|
||||
response = this.getBraceMatching(<protocol.FileLocationRequestArgs>request.arguments);
|
||||
var braceArguments = <protocol.FileLocationRequestArgs>request.arguments;
|
||||
response = this.getBraceMatching(braceArguments.line, braceArguments.offset, braceArguments.file);
|
||||
break;
|
||||
}
|
||||
case CommandNames.NavBar: {
|
||||
response = this.getNavigationBarItems(<protocol.FileRequestArgs>request.arguments);
|
||||
var navBarArgs = <protocol.FileRequestArgs>request.arguments;
|
||||
response = this.getNavigationBarItems(navBarArgs.file);
|
||||
break;
|
||||
}
|
||||
case CommandNames.Occurrences: {
|
||||
response = this.getOccurrences(<protocol.FileLocationRequestArgs>request.arguments);
|
||||
var { line, offset, file: fileName } = <protocol.FileLocationRequestArgs>request.arguments;
|
||||
response = this.getOccurrences(line, offset, fileName);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
|
||||
@ -10,11 +10,10 @@ module ts.NavigateTo {
|
||||
forEach(program.getSourceFiles(), sourceFile => {
|
||||
cancellationToken.throwIfCancellationRequested();
|
||||
|
||||
let declarations = sourceFile.getNamedDeclarations();
|
||||
for (let declaration of declarations) {
|
||||
var name = getDeclarationName(declaration);
|
||||
if (name !== undefined) {
|
||||
|
||||
let nameToDeclarations = sourceFile.getNamedDeclarations();
|
||||
for (let name in nameToDeclarations) {
|
||||
let declarations = getProperty(nameToDeclarations, name);
|
||||
if (declarations) {
|
||||
// First do a quick check to see if the name of the declaration matches the
|
||||
// last portion of the (possibly) dotted name they're searching for.
|
||||
let matches = patternMatcher.getMatchesForLastSegmentOfPattern(name);
|
||||
@ -23,24 +22,26 @@ module ts.NavigateTo {
|
||||
continue;
|
||||
}
|
||||
|
||||
// It was a match! If the pattern has dots in it, then also see if the
|
||||
// declaration container matches as well.
|
||||
if (patternMatcher.patternContainsDots) {
|
||||
let containers = getContainers(declaration);
|
||||
if (!containers) {
|
||||
return undefined;
|
||||
for (let declaration of declarations) {
|
||||
// It was a match! If the pattern has dots in it, then also see if the
|
||||
// declaration container matches as well.
|
||||
if (patternMatcher.patternContainsDots) {
|
||||
let containers = getContainers(declaration);
|
||||
if (!containers) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
matches = patternMatcher.getMatches(containers, name);
|
||||
|
||||
if (!matches) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
matches = patternMatcher.getMatches(containers, name);
|
||||
|
||||
if (!matches) {
|
||||
continue;
|
||||
}
|
||||
let fileName = sourceFile.fileName;
|
||||
let matchKind = bestMatchKind(matches);
|
||||
rawItems.push({ name, fileName, matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration });
|
||||
}
|
||||
|
||||
let fileName = sourceFile.fileName;
|
||||
let matchKind = bestMatchKind(matches);
|
||||
rawItems.push({ name, fileName, matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration });
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -67,30 +68,14 @@ module ts.NavigateTo {
|
||||
return true;
|
||||
}
|
||||
|
||||
function getDeclarationName(declaration: Declaration): string {
|
||||
let result = getTextOfIdentifierOrLiteral(declaration.name);
|
||||
if (result !== undefined) {
|
||||
return result;
|
||||
}
|
||||
|
||||
if (declaration.name.kind === SyntaxKind.ComputedPropertyName) {
|
||||
let expr = (<ComputedPropertyName>declaration.name).expression;
|
||||
if (expr.kind === SyntaxKind.PropertyAccessExpression) {
|
||||
return (<PropertyAccessExpression>expr).name.text;
|
||||
}
|
||||
|
||||
return getTextOfIdentifierOrLiteral(expr);
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function getTextOfIdentifierOrLiteral(node: Node) {
|
||||
if (node.kind === SyntaxKind.Identifier ||
|
||||
node.kind === SyntaxKind.StringLiteral ||
|
||||
node.kind === SyntaxKind.NumericLiteral) {
|
||||
if (node) {
|
||||
if (node.kind === SyntaxKind.Identifier ||
|
||||
node.kind === SyntaxKind.StringLiteral ||
|
||||
node.kind === SyntaxKind.NumericLiteral) {
|
||||
|
||||
return (<Identifier | LiteralExpression>node).text;
|
||||
return (<Identifier | LiteralExpression>node).text;
|
||||
}
|
||||
}
|
||||
|
||||
return undefined;
|
||||
|
||||
@ -1,180 +1,180 @@
|
||||
/* @internal */
|
||||
module ts {
|
||||
export module OutliningElementsCollector {
|
||||
export function collectElements(sourceFile: SourceFile): OutliningSpan[] {
|
||||
let elements: OutliningSpan[] = [];
|
||||
let collapseText = "...";
|
||||
|
||||
function addOutliningSpan(hintSpanNode: Node, startElement: Node, endElement: Node, autoCollapse: boolean) {
|
||||
if (hintSpanNode && startElement && endElement) {
|
||||
let span: OutliningSpan = {
|
||||
textSpan: createTextSpanFromBounds(startElement.pos, endElement.end),
|
||||
hintSpan: createTextSpanFromBounds(hintSpanNode.getStart(), hintSpanNode.end),
|
||||
bannerText: collapseText,
|
||||
autoCollapse: autoCollapse
|
||||
};
|
||||
elements.push(span);
|
||||
}
|
||||
}
|
||||
|
||||
function addOutliningSpanComments(commentSpan: CommentRange, autoCollapse: boolean) {
|
||||
if (commentSpan) {
|
||||
let span: OutliningSpan = {
|
||||
textSpan: createTextSpanFromBounds(commentSpan.pos, commentSpan.end),
|
||||
hintSpan: createTextSpanFromBounds(commentSpan.pos, commentSpan.end),
|
||||
bannerText: collapseText,
|
||||
autoCollapse: autoCollapse
|
||||
};
|
||||
elements.push(span);
|
||||
}
|
||||
}
|
||||
|
||||
function addOutliningForLeadingCommentsForNode(n: Node) {
|
||||
let comments = ts.getLeadingCommentRangesOfNode(n, sourceFile);
|
||||
|
||||
if (comments) {
|
||||
let firstSingleLineCommentStart = -1;
|
||||
let lastSingleLineCommentEnd = -1;
|
||||
let isFirstSingleLineComment = true;
|
||||
let singleLineCommentCount = 0;
|
||||
|
||||
for (let currentComment of comments) {
|
||||
|
||||
// For single line comments, combine consecutive ones (2 or more) into
|
||||
// a single span from the start of the first till the end of the last
|
||||
if (currentComment.kind === SyntaxKind.SingleLineCommentTrivia) {
|
||||
if (isFirstSingleLineComment) {
|
||||
firstSingleLineCommentStart = currentComment.pos;
|
||||
}
|
||||
isFirstSingleLineComment = false;
|
||||
lastSingleLineCommentEnd = currentComment.end;
|
||||
singleLineCommentCount++;
|
||||
}
|
||||
else if (currentComment.kind === SyntaxKind.MultiLineCommentTrivia) {
|
||||
combineAndAddMultipleSingleLineComments(singleLineCommentCount, firstSingleLineCommentStart, lastSingleLineCommentEnd);
|
||||
addOutliningSpanComments(currentComment, /*autoCollapse*/ false);
|
||||
|
||||
singleLineCommentCount = 0;
|
||||
lastSingleLineCommentEnd = -1;
|
||||
isFirstSingleLineComment = true;
|
||||
}
|
||||
}
|
||||
|
||||
combineAndAddMultipleSingleLineComments(singleLineCommentCount, firstSingleLineCommentStart, lastSingleLineCommentEnd);
|
||||
}
|
||||
}
|
||||
|
||||
function combineAndAddMultipleSingleLineComments(count: number, start: number, end: number) {
|
||||
// Only outline spans of two or more consecutive single line comments
|
||||
if (count > 1) {
|
||||
let multipleSingleLineComments = {
|
||||
pos: start,
|
||||
end: end,
|
||||
kind: SyntaxKind.SingleLineCommentTrivia
|
||||
}
|
||||
|
||||
addOutliningSpanComments(multipleSingleLineComments, /*autoCollapse*/ false);
|
||||
}
|
||||
}
|
||||
|
||||
function autoCollapse(node: Node) {
|
||||
return isFunctionBlock(node) && node.parent.kind !== SyntaxKind.ArrowFunction;
|
||||
}
|
||||
|
||||
let depth = 0;
|
||||
let maxDepth = 20;
|
||||
function walk(n: Node): void {
|
||||
if (depth > maxDepth) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isDeclaration(n)) {
|
||||
addOutliningForLeadingCommentsForNode(n);
|
||||
}
|
||||
|
||||
switch (n.kind) {
|
||||
case SyntaxKind.Block:
|
||||
if (!isFunctionBlock(n)) {
|
||||
let parent = n.parent;
|
||||
let openBrace = findChildOfKind(n, SyntaxKind.OpenBraceToken, sourceFile);
|
||||
let closeBrace = findChildOfKind(n, SyntaxKind.CloseBraceToken, sourceFile);
|
||||
|
||||
// Check if the block is standalone, or 'attached' to some parent statement.
|
||||
// If the latter, we want to collaps the block, but consider its hint span
|
||||
// to be the entire span of the parent.
|
||||
if (parent.kind === SyntaxKind.DoStatement ||
|
||||
parent.kind === SyntaxKind.ForInStatement ||
|
||||
parent.kind === SyntaxKind.ForOfStatement ||
|
||||
parent.kind === SyntaxKind.ForStatement ||
|
||||
parent.kind === SyntaxKind.IfStatement ||
|
||||
parent.kind === SyntaxKind.WhileStatement ||
|
||||
parent.kind === SyntaxKind.WithStatement ||
|
||||
parent.kind === SyntaxKind.CatchClause) {
|
||||
|
||||
addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n));
|
||||
break;
|
||||
}
|
||||
|
||||
if (parent.kind === SyntaxKind.TryStatement) {
|
||||
// Could be the try-block, or the finally-block.
|
||||
let tryStatement = <TryStatement>parent;
|
||||
if (tryStatement.tryBlock === n) {
|
||||
addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n));
|
||||
break;
|
||||
}
|
||||
else if (tryStatement.finallyBlock === n) {
|
||||
let finallyKeyword = findChildOfKind(tryStatement, SyntaxKind.FinallyKeyword, sourceFile);
|
||||
if (finallyKeyword) {
|
||||
addOutliningSpan(finallyKeyword, openBrace, closeBrace, autoCollapse(n));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// fall through.
|
||||
}
|
||||
|
||||
// Block was a standalone block. In this case we want to only collapse
|
||||
// the span of the block, independent of any parent span.
|
||||
let span = createTextSpanFromBounds(n.getStart(), n.end);
|
||||
elements.push({
|
||||
textSpan: span,
|
||||
hintSpan: span,
|
||||
bannerText: collapseText,
|
||||
autoCollapse: autoCollapse(n)
|
||||
});
|
||||
break;
|
||||
}
|
||||
// Fallthrough.
|
||||
|
||||
case SyntaxKind.ModuleBlock: {
|
||||
let openBrace = findChildOfKind(n, SyntaxKind.OpenBraceToken, sourceFile);
|
||||
let closeBrace = findChildOfKind(n, SyntaxKind.CloseBraceToken, sourceFile);
|
||||
addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n));
|
||||
break;
|
||||
}
|
||||
case SyntaxKind.ClassDeclaration:
|
||||
case SyntaxKind.InterfaceDeclaration:
|
||||
case SyntaxKind.EnumDeclaration:
|
||||
case SyntaxKind.ObjectLiteralExpression:
|
||||
case SyntaxKind.CaseBlock: {
|
||||
let openBrace = findChildOfKind(n, SyntaxKind.OpenBraceToken, sourceFile);
|
||||
let closeBrace = findChildOfKind(n, SyntaxKind.CloseBraceToken, sourceFile);
|
||||
addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n));
|
||||
break;
|
||||
}
|
||||
case SyntaxKind.ArrayLiteralExpression:
|
||||
let openBracket = findChildOfKind(n, SyntaxKind.OpenBracketToken, sourceFile);
|
||||
let closeBracket = findChildOfKind(n, SyntaxKind.CloseBracketToken, sourceFile);
|
||||
addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n));
|
||||
break;
|
||||
}
|
||||
depth++;
|
||||
forEachChild(n, walk);
|
||||
depth--;
|
||||
}
|
||||
|
||||
walk(sourceFile);
|
||||
return elements;
|
||||
}
|
||||
}
|
||||
/* @internal */
|
||||
module ts {
|
||||
export module OutliningElementsCollector {
|
||||
export function collectElements(sourceFile: SourceFile): OutliningSpan[] {
|
||||
let elements: OutliningSpan[] = [];
|
||||
let collapseText = "...";
|
||||
|
||||
function addOutliningSpan(hintSpanNode: Node, startElement: Node, endElement: Node, autoCollapse: boolean) {
|
||||
if (hintSpanNode && startElement && endElement) {
|
||||
let span: OutliningSpan = {
|
||||
textSpan: createTextSpanFromBounds(startElement.pos, endElement.end),
|
||||
hintSpan: createTextSpanFromBounds(hintSpanNode.getStart(), hintSpanNode.end),
|
||||
bannerText: collapseText,
|
||||
autoCollapse: autoCollapse
|
||||
};
|
||||
elements.push(span);
|
||||
}
|
||||
}
|
||||
|
||||
function addOutliningSpanComments(commentSpan: CommentRange, autoCollapse: boolean) {
|
||||
if (commentSpan) {
|
||||
let span: OutliningSpan = {
|
||||
textSpan: createTextSpanFromBounds(commentSpan.pos, commentSpan.end),
|
||||
hintSpan: createTextSpanFromBounds(commentSpan.pos, commentSpan.end),
|
||||
bannerText: collapseText,
|
||||
autoCollapse: autoCollapse
|
||||
};
|
||||
elements.push(span);
|
||||
}
|
||||
}
|
||||
|
||||
function addOutliningForLeadingCommentsForNode(n: Node) {
|
||||
let comments = ts.getLeadingCommentRangesOfNode(n, sourceFile);
|
||||
|
||||
if (comments) {
|
||||
let firstSingleLineCommentStart = -1;
|
||||
let lastSingleLineCommentEnd = -1;
|
||||
let isFirstSingleLineComment = true;
|
||||
let singleLineCommentCount = 0;
|
||||
|
||||
for (let currentComment of comments) {
|
||||
|
||||
// For single line comments, combine consecutive ones (2 or more) into
|
||||
// a single span from the start of the first till the end of the last
|
||||
if (currentComment.kind === SyntaxKind.SingleLineCommentTrivia) {
|
||||
if (isFirstSingleLineComment) {
|
||||
firstSingleLineCommentStart = currentComment.pos;
|
||||
}
|
||||
isFirstSingleLineComment = false;
|
||||
lastSingleLineCommentEnd = currentComment.end;
|
||||
singleLineCommentCount++;
|
||||
}
|
||||
else if (currentComment.kind === SyntaxKind.MultiLineCommentTrivia) {
|
||||
combineAndAddMultipleSingleLineComments(singleLineCommentCount, firstSingleLineCommentStart, lastSingleLineCommentEnd);
|
||||
addOutliningSpanComments(currentComment, /*autoCollapse*/ false);
|
||||
|
||||
singleLineCommentCount = 0;
|
||||
lastSingleLineCommentEnd = -1;
|
||||
isFirstSingleLineComment = true;
|
||||
}
|
||||
}
|
||||
|
||||
combineAndAddMultipleSingleLineComments(singleLineCommentCount, firstSingleLineCommentStart, lastSingleLineCommentEnd);
|
||||
}
|
||||
}
|
||||
|
||||
function combineAndAddMultipleSingleLineComments(count: number, start: number, end: number) {
|
||||
// Only outline spans of two or more consecutive single line comments
|
||||
if (count > 1) {
|
||||
let multipleSingleLineComments = {
|
||||
pos: start,
|
||||
end: end,
|
||||
kind: SyntaxKind.SingleLineCommentTrivia
|
||||
}
|
||||
|
||||
addOutliningSpanComments(multipleSingleLineComments, /*autoCollapse*/ false);
|
||||
}
|
||||
}
|
||||
|
||||
function autoCollapse(node: Node) {
|
||||
return isFunctionBlock(node) && node.parent.kind !== SyntaxKind.ArrowFunction;
|
||||
}
|
||||
|
||||
let depth = 0;
|
||||
let maxDepth = 20;
|
||||
function walk(n: Node): void {
|
||||
if (depth > maxDepth) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isDeclaration(n)) {
|
||||
addOutliningForLeadingCommentsForNode(n);
|
||||
}
|
||||
|
||||
switch (n.kind) {
|
||||
case SyntaxKind.Block:
|
||||
if (!isFunctionBlock(n)) {
|
||||
let parent = n.parent;
|
||||
let openBrace = findChildOfKind(n, SyntaxKind.OpenBraceToken, sourceFile);
|
||||
let closeBrace = findChildOfKind(n, SyntaxKind.CloseBraceToken, sourceFile);
|
||||
|
||||
// Check if the block is standalone, or 'attached' to some parent statement.
|
||||
// If the latter, we want to collaps the block, but consider its hint span
|
||||
// to be the entire span of the parent.
|
||||
if (parent.kind === SyntaxKind.DoStatement ||
|
||||
parent.kind === SyntaxKind.ForInStatement ||
|
||||
parent.kind === SyntaxKind.ForOfStatement ||
|
||||
parent.kind === SyntaxKind.ForStatement ||
|
||||
parent.kind === SyntaxKind.IfStatement ||
|
||||
parent.kind === SyntaxKind.WhileStatement ||
|
||||
parent.kind === SyntaxKind.WithStatement ||
|
||||
parent.kind === SyntaxKind.CatchClause) {
|
||||
|
||||
addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n));
|
||||
break;
|
||||
}
|
||||
|
||||
if (parent.kind === SyntaxKind.TryStatement) {
|
||||
// Could be the try-block, or the finally-block.
|
||||
let tryStatement = <TryStatement>parent;
|
||||
if (tryStatement.tryBlock === n) {
|
||||
addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n));
|
||||
break;
|
||||
}
|
||||
else if (tryStatement.finallyBlock === n) {
|
||||
let finallyKeyword = findChildOfKind(tryStatement, SyntaxKind.FinallyKeyword, sourceFile);
|
||||
if (finallyKeyword) {
|
||||
addOutliningSpan(finallyKeyword, openBrace, closeBrace, autoCollapse(n));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// fall through.
|
||||
}
|
||||
|
||||
// Block was a standalone block. In this case we want to only collapse
|
||||
// the span of the block, independent of any parent span.
|
||||
let span = createTextSpanFromBounds(n.getStart(), n.end);
|
||||
elements.push({
|
||||
textSpan: span,
|
||||
hintSpan: span,
|
||||
bannerText: collapseText,
|
||||
autoCollapse: autoCollapse(n)
|
||||
});
|
||||
break;
|
||||
}
|
||||
// Fallthrough.
|
||||
|
||||
case SyntaxKind.ModuleBlock: {
|
||||
let openBrace = findChildOfKind(n, SyntaxKind.OpenBraceToken, sourceFile);
|
||||
let closeBrace = findChildOfKind(n, SyntaxKind.CloseBraceToken, sourceFile);
|
||||
addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n));
|
||||
break;
|
||||
}
|
||||
case SyntaxKind.ClassDeclaration:
|
||||
case SyntaxKind.InterfaceDeclaration:
|
||||
case SyntaxKind.EnumDeclaration:
|
||||
case SyntaxKind.ObjectLiteralExpression:
|
||||
case SyntaxKind.CaseBlock: {
|
||||
let openBrace = findChildOfKind(n, SyntaxKind.OpenBraceToken, sourceFile);
|
||||
let closeBrace = findChildOfKind(n, SyntaxKind.CloseBraceToken, sourceFile);
|
||||
addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n));
|
||||
break;
|
||||
}
|
||||
case SyntaxKind.ArrayLiteralExpression:
|
||||
let openBracket = findChildOfKind(n, SyntaxKind.OpenBracketToken, sourceFile);
|
||||
let closeBracket = findChildOfKind(n, SyntaxKind.CloseBracketToken, sourceFile);
|
||||
addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n));
|
||||
break;
|
||||
}
|
||||
depth++;
|
||||
forEachChild(n, walk);
|
||||
depth--;
|
||||
}
|
||||
|
||||
walk(sourceFile);
|
||||
return elements;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -63,7 +63,8 @@ module ts {
|
||||
/* @internal */ scriptSnapshot: IScriptSnapshot;
|
||||
/* @internal */ nameTable: Map<string>;
|
||||
|
||||
getNamedDeclarations(): Declaration[];
|
||||
/* @internal */ getNamedDeclarations(): Map<Declaration[]>;
|
||||
|
||||
getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
|
||||
getLineStarts(): number[];
|
||||
getPositionOfLineAndCharacter(line: number, character: number): number;
|
||||
@ -749,7 +750,7 @@ module ts {
|
||||
public identifiers: Map<string>;
|
||||
public nameTable: Map<string>;
|
||||
|
||||
private namedDeclarations: Declaration[];
|
||||
private namedDeclarations: Map<Declaration[]>;
|
||||
|
||||
public update(newText: string, textChangeRange: TextChangeRange): SourceFile {
|
||||
return updateSourceFile(this, newText, textChangeRange);
|
||||
@ -767,7 +768,7 @@ module ts {
|
||||
return ts.getPositionOfLineAndCharacter(this, line, character);
|
||||
}
|
||||
|
||||
public getNamedDeclarations() {
|
||||
public getNamedDeclarations(): Map<Declaration[]> {
|
||||
if (!this.namedDeclarations) {
|
||||
this.namedDeclarations = this.computeNamedDeclarations();
|
||||
}
|
||||
@ -775,12 +776,57 @@ module ts {
|
||||
return this.namedDeclarations;
|
||||
}
|
||||
|
||||
private computeNamedDeclarations() {
|
||||
let namedDeclarations: Declaration[] = [];
|
||||
private computeNamedDeclarations(): Map<Declaration[]> {
|
||||
let result: Map<Declaration[]> = {};
|
||||
|
||||
forEachChild(this, visit);
|
||||
|
||||
return namedDeclarations;
|
||||
return result;
|
||||
|
||||
function addDeclaration(declaration: Declaration) {
|
||||
let name = getDeclarationName(declaration);
|
||||
if (name) {
|
||||
let declarations = getDeclarations(name);
|
||||
declarations.push(declaration);
|
||||
}
|
||||
}
|
||||
|
||||
function getDeclarations(name: string) {
|
||||
return getProperty(result, name) || (result[name] = []);
|
||||
}
|
||||
|
||||
function getDeclarationName(declaration: Declaration) {
|
||||
if (declaration.name) {
|
||||
let result = getTextOfIdentifierOrLiteral(declaration.name);
|
||||
if (result !== undefined) {
|
||||
return result;
|
||||
}
|
||||
|
||||
if (declaration.name.kind === SyntaxKind.ComputedPropertyName) {
|
||||
let expr = (<ComputedPropertyName>declaration.name).expression;
|
||||
if (expr.kind === SyntaxKind.PropertyAccessExpression) {
|
||||
return (<PropertyAccessExpression>expr).name.text;
|
||||
}
|
||||
|
||||
return getTextOfIdentifierOrLiteral(expr);
|
||||
}
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function getTextOfIdentifierOrLiteral(node: Node) {
|
||||
if (node) {
|
||||
if (node.kind === SyntaxKind.Identifier ||
|
||||
node.kind === SyntaxKind.StringLiteral ||
|
||||
node.kind === SyntaxKind.NumericLiteral) {
|
||||
|
||||
return (<Identifier | LiteralExpression>node).text;
|
||||
}
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function visit(node: Node): void {
|
||||
switch (node.kind) {
|
||||
@ -788,22 +834,22 @@ module ts {
|
||||
case SyntaxKind.MethodDeclaration:
|
||||
case SyntaxKind.MethodSignature:
|
||||
let functionDeclaration = <FunctionLikeDeclaration>node;
|
||||
let declarationName = getDeclarationName(functionDeclaration);
|
||||
|
||||
if (functionDeclaration.name && functionDeclaration.name.getFullWidth() > 0) {
|
||||
let lastDeclaration = namedDeclarations.length > 0 ?
|
||||
namedDeclarations[namedDeclarations.length - 1] :
|
||||
undefined;
|
||||
if (declarationName) {
|
||||
let declarations = getDeclarations(declarationName);
|
||||
let lastDeclaration = lastOrUndefined(declarations);
|
||||
|
||||
// Check whether this declaration belongs to an "overload group".
|
||||
if (lastDeclaration && functionDeclaration.symbol === lastDeclaration.symbol) {
|
||||
if (lastDeclaration && functionDeclaration.parent === lastDeclaration.parent && functionDeclaration.symbol === lastDeclaration.symbol) {
|
||||
// Overwrite the last declaration if it was an overload
|
||||
// and this one is an implementation.
|
||||
if (functionDeclaration.body && !(<FunctionLikeDeclaration>lastDeclaration).body) {
|
||||
namedDeclarations[namedDeclarations.length - 1] = functionDeclaration;
|
||||
declarations[declarations.length - 1] = functionDeclaration;
|
||||
}
|
||||
}
|
||||
else {
|
||||
namedDeclarations.push(functionDeclaration);
|
||||
declarations.push(functionDeclaration);
|
||||
}
|
||||
|
||||
forEachChild(node, visit);
|
||||
@ -824,10 +870,8 @@ module ts {
|
||||
case SyntaxKind.GetAccessor:
|
||||
case SyntaxKind.SetAccessor:
|
||||
case SyntaxKind.TypeLiteral:
|
||||
if ((<Declaration>node).name) {
|
||||
namedDeclarations.push(<Declaration>node);
|
||||
}
|
||||
// fall through
|
||||
addDeclaration(<Declaration>node);
|
||||
// fall through
|
||||
case SyntaxKind.Constructor:
|
||||
case SyntaxKind.VariableStatement:
|
||||
case SyntaxKind.VariableDeclarationList:
|
||||
@ -858,7 +902,7 @@ module ts {
|
||||
case SyntaxKind.EnumMember:
|
||||
case SyntaxKind.PropertyDeclaration:
|
||||
case SyntaxKind.PropertySignature:
|
||||
namedDeclarations.push(<Declaration>node);
|
||||
addDeclaration(<Declaration>node);
|
||||
break;
|
||||
|
||||
case SyntaxKind.ExportDeclaration:
|
||||
@ -875,7 +919,7 @@ module ts {
|
||||
// Handle default import case e.g.:
|
||||
// import d from "mod";
|
||||
if (importClause.name) {
|
||||
namedDeclarations.push(importClause);
|
||||
addDeclaration(importClause);
|
||||
}
|
||||
|
||||
// Handle named bindings in imports e.g.:
|
||||
@ -883,7 +927,7 @@ module ts {
|
||||
// import {a, b as B} from "mod";
|
||||
if (importClause.namedBindings) {
|
||||
if (importClause.namedBindings.kind === SyntaxKind.NamespaceImport) {
|
||||
namedDeclarations.push(<NamespaceImport>importClause.namedBindings);
|
||||
addDeclaration(<NamespaceImport>importClause.namedBindings);
|
||||
}
|
||||
else {
|
||||
forEach((<NamedImports>importClause.namedBindings).elements, visit);
|
||||
@ -2260,8 +2304,6 @@ module ts {
|
||||
let ruleProvider: formatting.RulesProvider;
|
||||
let program: Program;
|
||||
|
||||
// this checker is used to answer all LS questions except errors
|
||||
let typeInfoResolver: TypeChecker;
|
||||
let useCaseSensitivefileNames = false;
|
||||
let cancellationToken = new CancellationTokenObject(host.getCancellationToken && host.getCancellationToken());
|
||||
|
||||
@ -2343,8 +2385,10 @@ module ts {
|
||||
}
|
||||
|
||||
program = newProgram;
|
||||
typeInfoResolver = program.getTypeChecker();
|
||||
|
||||
// Make sure all the nodes in the program are both bound, and have their parent
|
||||
// pointers set property.
|
||||
program.getTypeChecker();
|
||||
return;
|
||||
|
||||
function getOrCreateSourceFile(fileName: string): SourceFile {
|
||||
@ -2428,15 +2472,8 @@ module ts {
|
||||
return program;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up any semantic caches that are not needed.
|
||||
* The host can call this method if it wants to jettison unused memory.
|
||||
* We will just dump the typeChecker and recreate a new one. this should have the effect of destroying all the semantic caches.
|
||||
*/
|
||||
function cleanupSemanticCache(): void {
|
||||
if (program) {
|
||||
typeInfoResolver = program.getTypeChecker();
|
||||
}
|
||||
// TODO: Should we jettison the program (or it's type checker) here?
|
||||
}
|
||||
|
||||
function dispose(): void {
|
||||
@ -2453,10 +2490,6 @@ module ts {
|
||||
return program.getSyntacticDiagnostics(getValidSourceFile(fileName));
|
||||
}
|
||||
|
||||
function isJavaScript(fileName: string) {
|
||||
return fileExtensionIs(fileName, ".js");
|
||||
}
|
||||
|
||||
/**
|
||||
* getSemanticDiagnostiscs return array of Diagnostics. If '-d' is not enabled, only report semantic errors
|
||||
* If '-d' enabled, report both semantic and emitter errors
|
||||
@ -2704,32 +2737,8 @@ module ts {
|
||||
return unescapeIdentifier(displayName);
|
||||
}
|
||||
|
||||
function createCompletionEntry(symbol: Symbol, typeChecker: TypeChecker, location: Node): CompletionEntry {
|
||||
// Try to get a valid display name for this symbol, if we could not find one, then ignore it.
|
||||
// We would like to only show things that can be added after a dot, so for instance numeric properties can
|
||||
// not be accessed with a dot (a.1 <- invalid)
|
||||
let displayName = getCompletionEntryDisplayNameForSymbol(symbol, program.getCompilerOptions().target, /*performCharacterChecks:*/ true);
|
||||
if (!displayName) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// TODO(drosen): Right now we just permit *all* semantic meanings when calling
|
||||
// 'getSymbolKind' which is permissible given that it is backwards compatible; but
|
||||
// really we should consider passing the meaning for the node so that we don't report
|
||||
// that a suggestion for a value is an interface. We COULD also just do what
|
||||
// 'getSymbolModifiers' does, which is to use the first declaration.
|
||||
|
||||
// Use a 'sortText' of 0' so that all symbol completion entries come before any other
|
||||
// entries (like JavaScript identifier entries).
|
||||
return {
|
||||
name: displayName,
|
||||
kind: getSymbolKind(symbol, typeChecker, location),
|
||||
kindModifiers: getSymbolModifiers(symbol),
|
||||
sortText: "0",
|
||||
};
|
||||
}
|
||||
|
||||
function getCompletionData(fileName: string, position: number) {
|
||||
let typeChecker = program.getTypeChecker();
|
||||
let syntacticStart = new Date().getTime();
|
||||
let sourceFile = getValidSourceFile(fileName);
|
||||
|
||||
@ -2813,29 +2822,29 @@ module ts {
|
||||
isNewIdentifierLocation = false;
|
||||
|
||||
if (node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.QualifiedName || node.kind === SyntaxKind.PropertyAccessExpression) {
|
||||
let symbol = typeInfoResolver.getSymbolAtLocation(node);
|
||||
let symbol = typeChecker.getSymbolAtLocation(node);
|
||||
|
||||
// This is an alias, follow what it aliases
|
||||
if (symbol && symbol.flags & SymbolFlags.Alias) {
|
||||
symbol = typeInfoResolver.getAliasedSymbol(symbol);
|
||||
symbol = typeChecker.getAliasedSymbol(symbol);
|
||||
}
|
||||
|
||||
if (symbol && symbol.flags & SymbolFlags.HasExports) {
|
||||
// Extract module or enum members
|
||||
let exportedSymbols = typeInfoResolver.getExportsOfModule(symbol);
|
||||
let exportedSymbols = typeChecker.getExportsOfModule(symbol);
|
||||
forEach(exportedSymbols, symbol => {
|
||||
if (typeInfoResolver.isValidPropertyAccess(<PropertyAccessExpression>(node.parent), symbol.name)) {
|
||||
if (typeChecker.isValidPropertyAccess(<PropertyAccessExpression>(node.parent), symbol.name)) {
|
||||
symbols.push(symbol);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
let type = typeInfoResolver.getTypeAtLocation(node);
|
||||
let type = typeChecker.getTypeAtLocation(node);
|
||||
if (type) {
|
||||
// Filter private properties
|
||||
forEach(type.getApparentProperties(), symbol => {
|
||||
if (typeInfoResolver.isValidPropertyAccess(<PropertyAccessExpression>(node.parent), symbol.name)) {
|
||||
if (typeChecker.isValidPropertyAccess(<PropertyAccessExpression>(node.parent), symbol.name)) {
|
||||
symbols.push(symbol);
|
||||
}
|
||||
});
|
||||
@ -2849,12 +2858,12 @@ module ts {
|
||||
isMemberCompletion = true;
|
||||
isNewIdentifierLocation = true;
|
||||
|
||||
let contextualType = typeInfoResolver.getContextualType(containingObjectLiteral);
|
||||
let contextualType = typeChecker.getContextualType(containingObjectLiteral);
|
||||
if (!contextualType) {
|
||||
return false;
|
||||
}
|
||||
|
||||
let contextualTypeMembers = typeInfoResolver.getPropertiesOfType(contextualType);
|
||||
let contextualTypeMembers = typeChecker.getPropertiesOfType(contextualType);
|
||||
if (contextualTypeMembers && contextualTypeMembers.length > 0) {
|
||||
// Add filtered items to the completion list
|
||||
symbols = filterContextualMembersList(contextualTypeMembers, containingObjectLiteral.properties);
|
||||
@ -2871,9 +2880,9 @@ module ts {
|
||||
|
||||
let exports: Symbol[];
|
||||
if (importDeclaration.moduleSpecifier) {
|
||||
let moduleSpecifierSymbol = typeInfoResolver.getSymbolAtLocation(importDeclaration.moduleSpecifier);
|
||||
let moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(importDeclaration.moduleSpecifier);
|
||||
if (moduleSpecifierSymbol) {
|
||||
exports = typeInfoResolver.getExportsOfModule(moduleSpecifierSymbol);
|
||||
exports = typeChecker.getExportsOfModule(moduleSpecifierSymbol);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2922,7 +2931,7 @@ module ts {
|
||||
|
||||
/// TODO filter meaning based on the current context
|
||||
let symbolMeanings = SymbolFlags.Type | SymbolFlags.Value | SymbolFlags.Namespace | SymbolFlags.Alias;
|
||||
symbols = typeInfoResolver.getSymbolsInScope(scopeNode, symbolMeanings);
|
||||
symbols = typeChecker.getSymbolsInScope(scopeNode, symbolMeanings);
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -3109,6 +3118,7 @@ module ts {
|
||||
|
||||
case SyntaxKind.SemicolonToken:
|
||||
return containingNodeKind === SyntaxKind.PropertySignature &&
|
||||
previousToken.parent && previousToken.parent.parent &&
|
||||
(previousToken.parent.parent.kind === SyntaxKind.InterfaceDeclaration || // interface a { f; |
|
||||
previousToken.parent.parent.kind === SyntaxKind.TypeLiteral); // let x : { a; |
|
||||
|
||||
@ -3124,7 +3134,8 @@ module ts {
|
||||
case SyntaxKind.DotDotDotToken:
|
||||
return containingNodeKind === SyntaxKind.Parameter ||
|
||||
containingNodeKind === SyntaxKind.Constructor ||
|
||||
(previousToken.parent.parent.kind === SyntaxKind.ArrayBindingPattern); // var [ ...z|
|
||||
(previousToken.parent && previousToken.parent.parent &&
|
||||
previousToken.parent.parent.kind === SyntaxKind.ArrayBindingPattern); // var [ ...z|
|
||||
|
||||
case SyntaxKind.PublicKeyword:
|
||||
case SyntaxKind.PrivateKeyword:
|
||||
@ -3283,6 +3294,31 @@ module ts {
|
||||
return entries;
|
||||
}
|
||||
|
||||
function createCompletionEntry(symbol: Symbol, location: Node): CompletionEntry {
|
||||
// Try to get a valid display name for this symbol, if we could not find one, then ignore it.
|
||||
// We would like to only show things that can be added after a dot, so for instance numeric properties can
|
||||
// not be accessed with a dot (a.1 <- invalid)
|
||||
let displayName = getCompletionEntryDisplayNameForSymbol(symbol, program.getCompilerOptions().target, /*performCharacterChecks:*/ true);
|
||||
if (!displayName) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// TODO(drosen): Right now we just permit *all* semantic meanings when calling
|
||||
// 'getSymbolKind' which is permissible given that it is backwards compatible; but
|
||||
// really we should consider passing the meaning for the node so that we don't report
|
||||
// that a suggestion for a value is an interface. We COULD also just do what
|
||||
// 'getSymbolModifiers' does, which is to use the first declaration.
|
||||
|
||||
// Use a 'sortText' of 0' so that all symbol completion entries come before any other
|
||||
// entries (like JavaScript identifier entries).
|
||||
return {
|
||||
name: displayName,
|
||||
kind: getSymbolKind(symbol, location),
|
||||
kindModifiers: getSymbolModifiers(symbol),
|
||||
sortText: "0",
|
||||
};
|
||||
}
|
||||
|
||||
function getCompletionEntriesFromSymbols(symbols: Symbol[]): CompletionEntry[] {
|
||||
let start = new Date().getTime();
|
||||
var entries: CompletionEntry[] = [];
|
||||
@ -3290,7 +3326,7 @@ module ts {
|
||||
if (symbols) {
|
||||
var nameToSymbol: Map<Symbol> = {};
|
||||
for (let symbol of symbols) {
|
||||
let entry = createCompletionEntry(symbol, typeInfoResolver, location);
|
||||
let entry = createCompletionEntry(symbol, location);
|
||||
if (entry) {
|
||||
let id = escapeIdentifier(entry.name);
|
||||
if (!lookUp(nameToSymbol, id)) {
|
||||
@ -3322,7 +3358,7 @@ module ts {
|
||||
let symbol = forEach(symbols, s => getCompletionEntryDisplayNameForSymbol(s, target, /*performCharacterChecks:*/ false) === entryName ? s : undefined);
|
||||
|
||||
if (symbol) {
|
||||
let displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), location, typeInfoResolver, location, SemanticMeaning.All);
|
||||
let displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), location, location, SemanticMeaning.All);
|
||||
return {
|
||||
name: entryName,
|
||||
kind: displayPartsDocumentationsAndSymbolKind.symbolKind,
|
||||
@ -3349,7 +3385,7 @@ module ts {
|
||||
}
|
||||
|
||||
// TODO(drosen): use contextual SemanticMeaning.
|
||||
function getSymbolKind(symbol: Symbol, typeResolver: TypeChecker, location: Node): string {
|
||||
function getSymbolKind(symbol: Symbol, location: Node): string {
|
||||
let flags = symbol.getFlags();
|
||||
|
||||
if (flags & SymbolFlags.Class) return ScriptElementKind.classElement;
|
||||
@ -3358,7 +3394,7 @@ module ts {
|
||||
if (flags & SymbolFlags.Interface) return ScriptElementKind.interfaceElement;
|
||||
if (flags & SymbolFlags.TypeParameter) return ScriptElementKind.typeParameterElement;
|
||||
|
||||
let result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, typeResolver, location);
|
||||
let result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, location);
|
||||
if (result === ScriptElementKind.unknown) {
|
||||
if (flags & SymbolFlags.TypeParameter) return ScriptElementKind.typeParameterElement;
|
||||
if (flags & SymbolFlags.EnumMember) return ScriptElementKind.variableElement;
|
||||
@ -3369,11 +3405,13 @@ module ts {
|
||||
return result;
|
||||
}
|
||||
|
||||
function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol: Symbol, flags: SymbolFlags, typeResolver: TypeChecker, location: Node) {
|
||||
if (typeResolver.isUndefinedSymbol(symbol)) {
|
||||
function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol: Symbol, flags: SymbolFlags, location: Node) {
|
||||
let typeChecker = program.getTypeChecker();
|
||||
|
||||
if (typeChecker.isUndefinedSymbol(symbol)) {
|
||||
return ScriptElementKind.variableElement;
|
||||
}
|
||||
if (typeResolver.isArgumentsSymbol(symbol)) {
|
||||
if (typeChecker.isArgumentsSymbol(symbol)) {
|
||||
return ScriptElementKind.localVariableElement;
|
||||
}
|
||||
if (flags & SymbolFlags.Variable) {
|
||||
@ -3397,7 +3435,7 @@ module ts {
|
||||
if (flags & SymbolFlags.Property) {
|
||||
if (flags & SymbolFlags.UnionProperty) {
|
||||
// If union property is result of union of non method (property/accessors/variables), it is labeled as property
|
||||
let unionPropertyKind = forEach(typeInfoResolver.getRootSymbols(symbol), rootSymbol => {
|
||||
let unionPropertyKind = forEach(typeChecker.getRootSymbols(symbol), rootSymbol => {
|
||||
let rootSymbolFlags = rootSymbol.getFlags();
|
||||
if (rootSymbolFlags & (SymbolFlags.PropertyOrAccessor | SymbolFlags.Variable)) {
|
||||
return ScriptElementKind.memberVariableElement;
|
||||
@ -3407,7 +3445,7 @@ module ts {
|
||||
if (!unionPropertyKind) {
|
||||
// If this was union of all methods,
|
||||
//make sure it has call signatures before we can label it as method
|
||||
let typeOfUnionProperty = typeInfoResolver.getTypeOfSymbolAtLocation(symbol, location);
|
||||
let typeOfUnionProperty = typeChecker.getTypeOfSymbolAtLocation(symbol, location);
|
||||
if (typeOfUnionProperty.getCallSignatures().length) {
|
||||
return ScriptElementKind.memberFunctionElement;
|
||||
}
|
||||
@ -3440,15 +3478,16 @@ module ts {
|
||||
: ScriptElementKindModifier.none;
|
||||
}
|
||||
|
||||
// TODO(drosen): Currently completion entry details passes the SemanticMeaning.All instead of using semanticMeaning of location
|
||||
function getSymbolDisplayPartsDocumentationAndSymbolKind(symbol: Symbol, sourceFile: SourceFile, enclosingDeclaration: Node,
|
||||
typeResolver: TypeChecker, location: Node,
|
||||
// TODO(drosen): Currently completion entry details passes the SemanticMeaning.All instead of using semanticMeaning of location
|
||||
semanticMeaning = getMeaningFromLocation(location)) {
|
||||
location: Node, semanticMeaning = getMeaningFromLocation(location)) {
|
||||
|
||||
let typeChecker = program.getTypeChecker();
|
||||
|
||||
let displayParts: SymbolDisplayPart[] = [];
|
||||
let documentation: SymbolDisplayPart[];
|
||||
let symbolFlags = symbol.flags;
|
||||
let symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, typeResolver, location);
|
||||
let symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, location);
|
||||
let hasAddedSymbolInfo: boolean;
|
||||
let type: Type;
|
||||
|
||||
@ -3460,7 +3499,7 @@ module ts {
|
||||
}
|
||||
|
||||
let signature: Signature;
|
||||
type = typeResolver.getTypeOfSymbolAtLocation(symbol, location);
|
||||
type = typeChecker.getTypeOfSymbolAtLocation(symbol, location);
|
||||
if (type) {
|
||||
if (location.parent && location.parent.kind === SyntaxKind.PropertyAccessExpression) {
|
||||
let right = (<PropertyAccessExpression>location.parent).name;
|
||||
@ -3481,7 +3520,7 @@ module ts {
|
||||
|
||||
if (callExpression) {
|
||||
let candidateSignatures: Signature[] = [];
|
||||
signature = typeResolver.getResolvedSignature(callExpression, candidateSignatures);
|
||||
signature = typeChecker.getResolvedSignature(callExpression, candidateSignatures);
|
||||
if (!signature && candidateSignatures.length) {
|
||||
// Use the first candidate:
|
||||
signature = candidateSignatures[0];
|
||||
@ -3530,7 +3569,7 @@ module ts {
|
||||
displayParts.push(spacePart());
|
||||
}
|
||||
if (!(type.flags & TypeFlags.Anonymous)) {
|
||||
displayParts.push.apply(displayParts, symbolToDisplayParts(typeResolver, type.symbol, enclosingDeclaration, /*meaning*/ undefined, SymbolFormatFlags.WriteTypeParametersOrArguments));
|
||||
displayParts.push.apply(displayParts, symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, /*meaning*/ undefined, SymbolFormatFlags.WriteTypeParametersOrArguments));
|
||||
}
|
||||
addSignatureDisplayParts(signature, allSignatures, TypeFormatFlags.WriteArrowStyleSignature);
|
||||
break;
|
||||
@ -3547,8 +3586,8 @@ module ts {
|
||||
// get the signature from the declaration and write it
|
||||
let functionDeclaration = <FunctionLikeDeclaration>location.parent;
|
||||
let allSignatures = functionDeclaration.kind === SyntaxKind.Constructor ? type.getConstructSignatures() : type.getCallSignatures();
|
||||
if (!typeResolver.isImplementationOfOverload(functionDeclaration)) {
|
||||
signature = typeResolver.getSignatureFromDeclaration(functionDeclaration);
|
||||
if (!typeChecker.isImplementationOfOverload(functionDeclaration)) {
|
||||
signature = typeChecker.getSignatureFromDeclaration(functionDeclaration);
|
||||
}
|
||||
else {
|
||||
signature = allSignatures[0];
|
||||
@ -3591,7 +3630,7 @@ module ts {
|
||||
displayParts.push(spacePart());
|
||||
displayParts.push(operatorPart(SyntaxKind.EqualsToken));
|
||||
displayParts.push(spacePart());
|
||||
displayParts.push.apply(displayParts, typeToDisplayParts(typeResolver, typeResolver.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration));
|
||||
displayParts.push.apply(displayParts, typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration));
|
||||
}
|
||||
if (symbolFlags & SymbolFlags.Enum) {
|
||||
addNewLineIfDisplayPartsExist();
|
||||
@ -3627,7 +3666,7 @@ module ts {
|
||||
else {
|
||||
// Method/function type parameter
|
||||
let signatureDeclaration = <SignatureDeclaration>getDeclarationOfKind(symbol, SyntaxKind.TypeParameter).parent;
|
||||
let signature = typeResolver.getSignatureFromDeclaration(signatureDeclaration);
|
||||
let signature = typeChecker.getSignatureFromDeclaration(signatureDeclaration);
|
||||
if (signatureDeclaration.kind === SyntaxKind.ConstructSignature) {
|
||||
displayParts.push(keywordPart(SyntaxKind.NewKeyword));
|
||||
displayParts.push(spacePart());
|
||||
@ -3635,14 +3674,14 @@ module ts {
|
||||
else if (signatureDeclaration.kind !== SyntaxKind.CallSignature && signatureDeclaration.name) {
|
||||
addFullSymbolName(signatureDeclaration.symbol);
|
||||
}
|
||||
displayParts.push.apply(displayParts, signatureToDisplayParts(typeResolver, signature, sourceFile, TypeFormatFlags.WriteTypeArgumentsOfSignature));
|
||||
displayParts.push.apply(displayParts, signatureToDisplayParts(typeChecker, signature, sourceFile, TypeFormatFlags.WriteTypeArgumentsOfSignature));
|
||||
}
|
||||
}
|
||||
if (symbolFlags & SymbolFlags.EnumMember) {
|
||||
addPrefixForAnyFunctionOrVar(symbol, "enum member");
|
||||
let declaration = symbol.declarations[0];
|
||||
if (declaration.kind === SyntaxKind.EnumMember) {
|
||||
let constantValue = typeResolver.getConstantValue(<EnumMember>declaration);
|
||||
let constantValue = typeChecker.getConstantValue(<EnumMember>declaration);
|
||||
if (constantValue !== undefined) {
|
||||
displayParts.push(spacePart());
|
||||
displayParts.push(operatorPart(SyntaxKind.EqualsToken));
|
||||
@ -3669,7 +3708,7 @@ module ts {
|
||||
displayParts.push(punctuationPart(SyntaxKind.CloseParenToken));
|
||||
}
|
||||
else {
|
||||
let internalAliasSymbol = typeResolver.getSymbolAtLocation(importEqualsDeclaration.moduleReference);
|
||||
let internalAliasSymbol = typeChecker.getSymbolAtLocation(importEqualsDeclaration.moduleReference);
|
||||
if (internalAliasSymbol) {
|
||||
displayParts.push(spacePart());
|
||||
displayParts.push(operatorPart(SyntaxKind.EqualsToken));
|
||||
@ -3694,12 +3733,12 @@ module ts {
|
||||
// If the type is type parameter, format it specially
|
||||
if (type.symbol && type.symbol.flags & SymbolFlags.TypeParameter) {
|
||||
let typeParameterParts = mapToDisplayParts(writer => {
|
||||
typeResolver.getSymbolDisplayBuilder().buildTypeParameterDisplay(<TypeParameter>type, writer, enclosingDeclaration);
|
||||
typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplay(<TypeParameter>type, writer, enclosingDeclaration);
|
||||
});
|
||||
displayParts.push.apply(displayParts, typeParameterParts);
|
||||
}
|
||||
else {
|
||||
displayParts.push.apply(displayParts, typeToDisplayParts(typeResolver, type, enclosingDeclaration));
|
||||
displayParts.push.apply(displayParts, typeToDisplayParts(typeChecker, type, enclosingDeclaration));
|
||||
}
|
||||
}
|
||||
else if (symbolFlags & SymbolFlags.Function ||
|
||||
@ -3714,7 +3753,7 @@ module ts {
|
||||
}
|
||||
}
|
||||
else {
|
||||
symbolKind = getSymbolKind(symbol, typeResolver, location);
|
||||
symbolKind = getSymbolKind(symbol, location);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3731,7 +3770,7 @@ module ts {
|
||||
}
|
||||
|
||||
function addFullSymbolName(symbol: Symbol, enclosingDeclaration?: Node) {
|
||||
let fullSymbolDisplayParts = symbolToDisplayParts(typeResolver, symbol, enclosingDeclaration || sourceFile, /*meaning*/ undefined,
|
||||
let fullSymbolDisplayParts = symbolToDisplayParts(typeChecker, symbol, enclosingDeclaration || sourceFile, /*meaning*/ undefined,
|
||||
SymbolFormatFlags.WriteTypeParametersOrArguments | SymbolFormatFlags.UseOnlyExternalAliasing);
|
||||
displayParts.push.apply(displayParts, fullSymbolDisplayParts);
|
||||
}
|
||||
@ -3763,7 +3802,7 @@ module ts {
|
||||
}
|
||||
|
||||
function addSignatureDisplayParts(signature: Signature, allSignatures: Signature[], flags?: TypeFormatFlags) {
|
||||
displayParts.push.apply(displayParts, signatureToDisplayParts(typeResolver, signature, enclosingDeclaration, flags | TypeFormatFlags.WriteTypeArgumentsOfSignature));
|
||||
displayParts.push.apply(displayParts, signatureToDisplayParts(typeChecker, signature, enclosingDeclaration, flags | TypeFormatFlags.WriteTypeArgumentsOfSignature));
|
||||
if (allSignatures.length > 1) {
|
||||
displayParts.push(spacePart());
|
||||
displayParts.push(punctuationPart(SyntaxKind.OpenParenToken));
|
||||
@ -3778,7 +3817,7 @@ module ts {
|
||||
|
||||
function writeTypeParametersOfSymbol(symbol: Symbol, enclosingDeclaration: Node) {
|
||||
let typeParameterParts = mapToDisplayParts(writer => {
|
||||
typeResolver.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration);
|
||||
typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration);
|
||||
});
|
||||
displayParts.push.apply(displayParts, typeParameterParts);
|
||||
}
|
||||
@ -3793,7 +3832,13 @@ module ts {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
let symbol = typeInfoResolver.getSymbolAtLocation(node);
|
||||
if (isLabelName(node)) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
let typeChecker = program.getTypeChecker();
|
||||
let symbol = typeChecker.getSymbolAtLocation(node);
|
||||
|
||||
if (!symbol) {
|
||||
// Try getting just type at this position and show
|
||||
switch (node.kind) {
|
||||
@ -3803,13 +3848,13 @@ module ts {
|
||||
case SyntaxKind.ThisKeyword:
|
||||
case SyntaxKind.SuperKeyword:
|
||||
// For the identifiers/this/super etc get the type at position
|
||||
let type = typeInfoResolver.getTypeAtLocation(node);
|
||||
let type = typeChecker.getTypeAtLocation(node);
|
||||
if (type) {
|
||||
return {
|
||||
kind: ScriptElementKind.unknown,
|
||||
kindModifiers: ScriptElementKindModifier.none,
|
||||
textSpan: createTextSpan(node.getStart(), node.getWidth()),
|
||||
displayParts: typeToDisplayParts(typeInfoResolver, type, getContainerNode(node)),
|
||||
displayParts: typeToDisplayParts(typeChecker, type, getContainerNode(node)),
|
||||
documentation: type.symbol ? type.symbol.getDocumentationComment() : undefined
|
||||
};
|
||||
}
|
||||
@ -3818,7 +3863,7 @@ module ts {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
let displayPartsDocumentationsAndKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, getContainerNode(node), typeInfoResolver, node);
|
||||
let displayPartsDocumentationsAndKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, getContainerNode(node), node);
|
||||
return {
|
||||
kind: displayPartsDocumentationsAndKind.symbolKind,
|
||||
kindModifiers: getSymbolModifiers(symbol),
|
||||
@ -3874,7 +3919,8 @@ module ts {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
let symbol = typeInfoResolver.getSymbolAtLocation(node);
|
||||
let typeChecker = program.getTypeChecker();
|
||||
let symbol = typeChecker.getSymbolAtLocation(node);
|
||||
|
||||
// Could not find a symbol e.g. node is string or number keyword,
|
||||
// or the symbol was an internal symbol and does not have a declaration e.g. undefined symbol
|
||||
@ -3889,7 +3935,7 @@ module ts {
|
||||
if (symbol.flags & SymbolFlags.Alias) {
|
||||
let declaration = symbol.declarations[0];
|
||||
if (node.kind === SyntaxKind.Identifier && node.parent === declaration) {
|
||||
symbol = typeInfoResolver.getAliasedSymbol(symbol);
|
||||
symbol = typeChecker.getAliasedSymbol(symbol);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3899,25 +3945,25 @@ module ts {
|
||||
// is performed at the location of property access, we would like to go to definition of the property in the short-hand
|
||||
// assignment. This case and others are handled by the following code.
|
||||
if (node.parent.kind === SyntaxKind.ShorthandPropertyAssignment) {
|
||||
let shorthandSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(symbol.valueDeclaration);
|
||||
let shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration);
|
||||
if (!shorthandSymbol) {
|
||||
return [];
|
||||
}
|
||||
|
||||
let shorthandDeclarations = shorthandSymbol.getDeclarations();
|
||||
let shorthandSymbolKind = getSymbolKind(shorthandSymbol, typeInfoResolver, node);
|
||||
let shorthandSymbolName = typeInfoResolver.symbolToString(shorthandSymbol);
|
||||
let shorthandContainerName = typeInfoResolver.symbolToString(symbol.parent, node);
|
||||
let shorthandSymbolKind = getSymbolKind(shorthandSymbol, node);
|
||||
let shorthandSymbolName = typeChecker.symbolToString(shorthandSymbol);
|
||||
let shorthandContainerName = typeChecker.symbolToString(symbol.parent, node);
|
||||
return map(shorthandDeclarations,
|
||||
declaration => createDefinitionInfo(declaration, shorthandSymbolKind, shorthandSymbolName, shorthandContainerName));
|
||||
}
|
||||
|
||||
let result: DefinitionInfo[] = [];
|
||||
let declarations = symbol.getDeclarations();
|
||||
let symbolName = typeInfoResolver.symbolToString(symbol); // Do not get scoped name, just the name of the symbol
|
||||
let symbolKind = getSymbolKind(symbol, typeInfoResolver, node);
|
||||
let symbolName = typeChecker.symbolToString(symbol); // Do not get scoped name, just the name of the symbol
|
||||
let symbolKind = getSymbolKind(symbol, node);
|
||||
let containerSymbol = symbol.parent;
|
||||
let containerName = containerSymbol ? typeInfoResolver.symbolToString(containerSymbol, node) : "";
|
||||
let containerName = containerSymbol ? typeChecker.symbolToString(containerSymbol, node) : "";
|
||||
|
||||
if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) &&
|
||||
!tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) {
|
||||
@ -3983,7 +4029,7 @@ module ts {
|
||||
|
||||
// Get occurrences only supports reporting occurrences for the file queried. So
|
||||
// filter down to that list.
|
||||
results = filter(results, r => r.fileName === fileName);
|
||||
results = filter(results, r => getCanonicalFileName(ts.normalizeSlashes(r.fileName)) === sourceFile);
|
||||
}
|
||||
|
||||
return results;
|
||||
@ -4676,7 +4722,9 @@ module ts {
|
||||
return getReferencedSymbolsForNodes(node, program.getSourceFiles(), findInStrings, findInComments);
|
||||
}
|
||||
|
||||
function getReferencedSymbolsForNodes(node: Node, sourceFiles: SourceFile[], findInStrings: boolean, findInComments: boolean): ReferencedSymbol[]{
|
||||
function getReferencedSymbolsForNodes(node: Node, sourceFiles: SourceFile[], findInStrings: boolean, findInComments: boolean): ReferencedSymbol[] {
|
||||
let typeChecker = program.getTypeChecker();
|
||||
|
||||
// Labels
|
||||
if (isLabelName(node)) {
|
||||
if (isJumpStatementTarget(node)) {
|
||||
@ -4699,7 +4747,7 @@ module ts {
|
||||
return getReferencesForSuperKeyword(node);
|
||||
}
|
||||
|
||||
let symbol = typeInfoResolver.getSymbolAtLocation(node);
|
||||
let symbol = typeChecker.getSymbolAtLocation(node);
|
||||
|
||||
// Could not find a symbol e.g. unknown identifier
|
||||
if (!symbol) {
|
||||
@ -4750,7 +4798,7 @@ module ts {
|
||||
return result;
|
||||
|
||||
function getDefinition(symbol: Symbol): DefinitionInfo {
|
||||
let info = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, node.getSourceFile(), getContainerNode(node), typeInfoResolver, node);
|
||||
let info = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, node.getSourceFile(), getContainerNode(node), node);
|
||||
let name = map(info.displayParts, p => p.text).join("");
|
||||
let declarations = symbol.declarations;
|
||||
if (!declarations || declarations.length === 0) {
|
||||
@ -4800,7 +4848,7 @@ module ts {
|
||||
return location.getText();
|
||||
}
|
||||
|
||||
name = typeInfoResolver.symbolToString(symbol);
|
||||
name = typeChecker.symbolToString(symbol);
|
||||
|
||||
return stripQuotes(name);
|
||||
}
|
||||
@ -5036,10 +5084,10 @@ module ts {
|
||||
return;
|
||||
}
|
||||
|
||||
let referenceSymbol = typeInfoResolver.getSymbolAtLocation(referenceLocation);
|
||||
let referenceSymbol = typeChecker.getSymbolAtLocation(referenceLocation);
|
||||
if (referenceSymbol) {
|
||||
let referenceSymbolDeclaration = referenceSymbol.valueDeclaration;
|
||||
let shorthandValueSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(referenceSymbolDeclaration);
|
||||
let shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(referenceSymbolDeclaration);
|
||||
var relatedSymbol = getRelatedSymbol(searchSymbols, referenceSymbol, referenceLocation);
|
||||
|
||||
if (relatedSymbol) {
|
||||
@ -5264,7 +5312,7 @@ module ts {
|
||||
|
||||
// If the symbol is an alias, add what it alaises to the list
|
||||
if (isImportOrExportSpecifierImportSymbol(symbol)) {
|
||||
result.push(typeInfoResolver.getAliasedSymbol(symbol));
|
||||
result.push(typeChecker.getAliasedSymbol(symbol));
|
||||
}
|
||||
|
||||
// If the location is in a context sensitive location (i.e. in an object literal) try
|
||||
@ -5272,7 +5320,7 @@ module ts {
|
||||
// type to the search set
|
||||
if (isNameOfPropertyAssignment(location)) {
|
||||
forEach(getPropertySymbolsFromContextualType(location), contextualSymbol => {
|
||||
result.push.apply(result, typeInfoResolver.getRootSymbols(contextualSymbol));
|
||||
result.push.apply(result, typeChecker.getRootSymbols(contextualSymbol));
|
||||
});
|
||||
|
||||
/* Because in short-hand property assignment, location has two meaning : property name and as value of the property
|
||||
@ -5286,7 +5334,7 @@ module ts {
|
||||
* so that when matching with potential reference symbol, both symbols from property declaration and variable declaration
|
||||
* will be included correctly.
|
||||
*/
|
||||
let shorthandValueSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(location.parent);
|
||||
let shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(location.parent);
|
||||
if (shorthandValueSymbol) {
|
||||
result.push(shorthandValueSymbol);
|
||||
}
|
||||
@ -5294,7 +5342,7 @@ module ts {
|
||||
|
||||
// If this is a union property, add all the symbols from all its source symbols in all unioned types.
|
||||
// If the symbol is an instantiation from a another symbol (e.g. widened symbol) , add the root the list
|
||||
forEach(typeInfoResolver.getRootSymbols(symbol), rootSymbol => {
|
||||
forEach(typeChecker.getRootSymbols(symbol), rootSymbol => {
|
||||
if (rootSymbol !== symbol) {
|
||||
result.push(rootSymbol);
|
||||
}
|
||||
@ -5324,9 +5372,9 @@ module ts {
|
||||
|
||||
function getPropertySymbolFromTypeReference(typeReference: HeritageClauseElement) {
|
||||
if (typeReference) {
|
||||
let type = typeInfoResolver.getTypeAtLocation(typeReference);
|
||||
let type = typeChecker.getTypeAtLocation(typeReference);
|
||||
if (type) {
|
||||
let propertySymbol = typeInfoResolver.getPropertyOfType(type, propertyName);
|
||||
let propertySymbol = typeChecker.getPropertyOfType(type, propertyName);
|
||||
if (propertySymbol) {
|
||||
result.push(propertySymbol);
|
||||
}
|
||||
@ -5346,7 +5394,7 @@ module ts {
|
||||
// If the reference symbol is an alias, check if what it is aliasing is one of the search
|
||||
// symbols.
|
||||
if (isImportOrExportSpecifierImportSymbol(referenceSymbol)) {
|
||||
var aliasedSymbol = typeInfoResolver.getAliasedSymbol(referenceSymbol);
|
||||
var aliasedSymbol = typeChecker.getAliasedSymbol(referenceSymbol);
|
||||
if (searchSymbols.indexOf(aliasedSymbol) >= 0) {
|
||||
return aliasedSymbol;
|
||||
}
|
||||
@ -5357,13 +5405,13 @@ module ts {
|
||||
// compare to our searchSymbol
|
||||
if (isNameOfPropertyAssignment(referenceLocation)) {
|
||||
return forEach(getPropertySymbolsFromContextualType(referenceLocation), contextualSymbol => {
|
||||
return forEach(typeInfoResolver.getRootSymbols(contextualSymbol), s => searchSymbols.indexOf(s) >= 0 ? s : undefined);
|
||||
return forEach(typeChecker.getRootSymbols(contextualSymbol), s => searchSymbols.indexOf(s) >= 0 ? s : undefined);
|
||||
});
|
||||
}
|
||||
|
||||
// Unwrap symbols to get to the root (e.g. transient symbols as a result of widening)
|
||||
// Or a union property, use its underlying unioned symbols
|
||||
return forEach(typeInfoResolver.getRootSymbols(referenceSymbol), rootSymbol => {
|
||||
return forEach(typeChecker.getRootSymbols(referenceSymbol), rootSymbol => {
|
||||
// if it is in the list, then we are done
|
||||
if (searchSymbols.indexOf(rootSymbol) >= 0) {
|
||||
return rootSymbol;
|
||||
@ -5384,7 +5432,7 @@ module ts {
|
||||
function getPropertySymbolsFromContextualType(node: Node): Symbol[] {
|
||||
if (isNameOfPropertyAssignment(node)) {
|
||||
let objectLiteral = <ObjectLiteralExpression>node.parent.parent;
|
||||
let contextualType = typeInfoResolver.getContextualType(objectLiteral);
|
||||
let contextualType = typeChecker.getContextualType(objectLiteral);
|
||||
let name = (<Identifier>node).text;
|
||||
if (contextualType) {
|
||||
if (contextualType.flags & TypeFlags.Union) {
|
||||
@ -5676,7 +5724,7 @@ module ts {
|
||||
|
||||
let sourceFile = getValidSourceFile(fileName);
|
||||
|
||||
return SignatureHelp.getSignatureHelpItems(sourceFile, position, typeInfoResolver, cancellationToken);
|
||||
return SignatureHelp.getSignatureHelpItems(program, sourceFile, position, cancellationToken);
|
||||
}
|
||||
|
||||
/// Syntactic features
|
||||
@ -5757,6 +5805,7 @@ module ts {
|
||||
synchronizeHostData();
|
||||
|
||||
let sourceFile = getValidSourceFile(fileName);
|
||||
let typeChecker = program.getTypeChecker();
|
||||
|
||||
let result: ClassifiedSpan[] = [];
|
||||
processNode(sourceFile);
|
||||
@ -5809,7 +5858,7 @@ module ts {
|
||||
// Only walk into nodes that intersect the requested span.
|
||||
if (node && textSpanIntersectsWith(span, node.getStart(), node.getWidth())) {
|
||||
if (node.kind === SyntaxKind.Identifier && node.getWidth() > 0) {
|
||||
let symbol = typeInfoResolver.getSymbolAtLocation(node);
|
||||
let symbol = typeChecker.getSymbolAtLocation(node);
|
||||
if (symbol) {
|
||||
let type = classifySymbol(symbol, getMeaningFromLocation(node));
|
||||
if (type) {
|
||||
@ -6291,12 +6340,13 @@ module ts {
|
||||
synchronizeHostData();
|
||||
|
||||
let sourceFile = getValidSourceFile(fileName);
|
||||
let typeChecker = program.getTypeChecker();
|
||||
|
||||
let node = getTouchingWord(sourceFile, position);
|
||||
|
||||
// Can only rename an identifier.
|
||||
if (node && node.kind === SyntaxKind.Identifier) {
|
||||
let symbol = typeInfoResolver.getSymbolAtLocation(node);
|
||||
let symbol = typeChecker.getSymbolAtLocation(node);
|
||||
|
||||
// Only allow a symbol to be renamed if it actually has at least one declaration.
|
||||
if (symbol) {
|
||||
@ -6313,13 +6363,13 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
let kind = getSymbolKind(symbol, typeInfoResolver, node);
|
||||
let kind = getSymbolKind(symbol, node);
|
||||
if (kind) {
|
||||
return {
|
||||
canRename: true,
|
||||
localizedErrorMessage: undefined,
|
||||
displayName: symbol.name,
|
||||
fullDisplayName: typeInfoResolver.getFullyQualifiedName(symbol),
|
||||
fullDisplayName: typeChecker.getFullyQualifiedName(symbol),
|
||||
kind: kind,
|
||||
kindModifiers: getSymbolModifiers(symbol),
|
||||
triggerSpan: createTextSpan(node.getStart(), node.getWidth())
|
||||
|
||||
@ -178,7 +178,9 @@ module ts.SignatureHelp {
|
||||
argumentCount: number;
|
||||
}
|
||||
|
||||
export function getSignatureHelpItems(sourceFile: SourceFile, position: number, typeInfoResolver: TypeChecker, cancellationToken: CancellationTokenObject): SignatureHelpItems {
|
||||
export function getSignatureHelpItems(program: Program, sourceFile: SourceFile, position: number, cancellationToken: CancellationTokenObject): SignatureHelpItems {
|
||||
let typeChecker = program.getTypeChecker();
|
||||
|
||||
// Decide whether to show signature help
|
||||
let startingToken = findTokenOnLeftOfPosition(sourceFile, position);
|
||||
if (!startingToken) {
|
||||
@ -196,15 +198,61 @@ module ts.SignatureHelp {
|
||||
|
||||
let call = argumentInfo.invocation;
|
||||
let candidates = <Signature[]>[];
|
||||
let resolvedSignature = typeInfoResolver.getResolvedSignature(call, candidates);
|
||||
let resolvedSignature = typeChecker.getResolvedSignature(call, candidates);
|
||||
cancellationToken.throwIfCancellationRequested();
|
||||
|
||||
if (!candidates.length) {
|
||||
// We didn't have any sig help items produced by the TS compiler. If this is a JS
|
||||
// file, then see if we can figure out anything better.
|
||||
if (isJavaScript(sourceFile.fileName)) {
|
||||
return createJavaScriptSignatureHelpItems(argumentInfo);
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return createSignatureHelpItems(candidates, resolvedSignature, argumentInfo);
|
||||
|
||||
function createJavaScriptSignatureHelpItems(argumentInfo: ArgumentListInfo): SignatureHelpItems {
|
||||
if (argumentInfo.invocation.kind !== SyntaxKind.CallExpression) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// See if we can find some symbol with the call expression name that has call signatures.
|
||||
let callExpression = <CallExpression>argumentInfo.invocation;
|
||||
let expression = callExpression.expression;
|
||||
let name = expression.kind === SyntaxKind.Identifier
|
||||
? <Identifier> expression
|
||||
: expression.kind === SyntaxKind.PropertyAccessExpression
|
||||
? (<PropertyAccessExpression>expression).name
|
||||
: undefined;
|
||||
|
||||
if (!name || !name.text) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
let typeChecker = program.getTypeChecker();
|
||||
for (let sourceFile of program.getSourceFiles()) {
|
||||
let nameToDeclarations = sourceFile.getNamedDeclarations();
|
||||
let declarations = getProperty(nameToDeclarations, name.text);
|
||||
|
||||
if (declarations) {
|
||||
for (let declaration of declarations) {
|
||||
let symbol = declaration.symbol;
|
||||
if (symbol) {
|
||||
let type = typeChecker.getTypeOfSymbolAtLocation(symbol, declaration);
|
||||
if (type) {
|
||||
let callSignatures = type.getCallSignatures();
|
||||
if (callSignatures && callSignatures.length) {
|
||||
return createSignatureHelpItems(callSignatures, callSignatures[0], argumentInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns relevant information for the argument list and the current argument if we are
|
||||
* in the argument of an invocation; returns undefined otherwise.
|
||||
@ -494,8 +542,8 @@ module ts.SignatureHelp {
|
||||
|
||||
let invocation = argumentListInfo.invocation;
|
||||
let callTarget = getInvokedExpression(invocation)
|
||||
let callTargetSymbol = typeInfoResolver.getSymbolAtLocation(callTarget);
|
||||
let callTargetDisplayParts = callTargetSymbol && symbolToDisplayParts(typeInfoResolver, callTargetSymbol, /*enclosingDeclaration*/ undefined, /*meaning*/ undefined);
|
||||
let callTargetSymbol = typeChecker.getSymbolAtLocation(callTarget);
|
||||
let callTargetDisplayParts = callTargetSymbol && symbolToDisplayParts(typeChecker, callTargetSymbol, /*enclosingDeclaration*/ undefined, /*meaning*/ undefined);
|
||||
let items: SignatureHelpItem[] = map(candidates, candidateSignature => {
|
||||
let signatureHelpParameters: SignatureHelpParameter[];
|
||||
let prefixDisplayParts: SymbolDisplayPart[] = [];
|
||||
@ -511,12 +559,12 @@ module ts.SignatureHelp {
|
||||
signatureHelpParameters = typeParameters && typeParameters.length > 0 ? map(typeParameters, createSignatureHelpParameterForTypeParameter) : emptyArray;
|
||||
suffixDisplayParts.push(punctuationPart(SyntaxKind.GreaterThanToken));
|
||||
let parameterParts = mapToDisplayParts(writer =>
|
||||
typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.parameters, writer, invocation));
|
||||
typeChecker.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.parameters, writer, invocation));
|
||||
suffixDisplayParts.push.apply(suffixDisplayParts, parameterParts);
|
||||
}
|
||||
else {
|
||||
let typeParameterParts = mapToDisplayParts(writer =>
|
||||
typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, invocation));
|
||||
typeChecker.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, invocation));
|
||||
prefixDisplayParts.push.apply(prefixDisplayParts, typeParameterParts);
|
||||
prefixDisplayParts.push(punctuationPart(SyntaxKind.OpenParenToken));
|
||||
|
||||
@ -526,7 +574,7 @@ module ts.SignatureHelp {
|
||||
}
|
||||
|
||||
let returnTypeParts = mapToDisplayParts(writer =>
|
||||
typeInfoResolver.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, invocation));
|
||||
typeChecker.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, invocation));
|
||||
suffixDisplayParts.push.apply(suffixDisplayParts, returnTypeParts);
|
||||
|
||||
return {
|
||||
@ -561,7 +609,7 @@ module ts.SignatureHelp {
|
||||
|
||||
function createSignatureHelpParameterForParameter(parameter: Symbol): SignatureHelpParameter {
|
||||
let displayParts = mapToDisplayParts(writer =>
|
||||
typeInfoResolver.getSymbolDisplayBuilder().buildParameterDisplay(parameter, writer, invocation));
|
||||
typeChecker.getSymbolDisplayBuilder().buildParameterDisplay(parameter, writer, invocation));
|
||||
|
||||
let isOptional = hasQuestionToken(parameter.valueDeclaration);
|
||||
|
||||
@ -575,7 +623,7 @@ module ts.SignatureHelp {
|
||||
|
||||
function createSignatureHelpParameterForTypeParameter(typeParameter: TypeParameter): SignatureHelpParameter {
|
||||
let displayParts = mapToDisplayParts(writer =>
|
||||
typeInfoResolver.getSymbolDisplayBuilder().buildTypeParameterDisplay(typeParameter, writer, invocation));
|
||||
typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplay(typeParameter, writer, invocation));
|
||||
|
||||
return {
|
||||
name: typeParameter.symbol.name,
|
||||
|
||||
@ -652,4 +652,8 @@ module ts {
|
||||
typechecker.getSymbolDisplayBuilder().buildSignatureDisplay(signature, writer, enclosingDeclaration, flags);
|
||||
});
|
||||
}
|
||||
|
||||
export function isJavaScript(fileName: string) {
|
||||
return fileExtensionIs(fileName, ".js");
|
||||
}
|
||||
}
|
||||
@ -1,40 +1,40 @@
|
||||
=== tests/cases/compiler/2dArrays.ts ===
|
||||
class Cell {
|
||||
>Cell : Cell
|
||||
>Cell : Cell, Symbol(Cell, Decl(2dArrays.ts, 0, 0))
|
||||
}
|
||||
|
||||
class Ship {
|
||||
>Ship : Ship
|
||||
>Ship : Ship, Symbol(Ship, Decl(2dArrays.ts, 1, 1))
|
||||
|
||||
isSunk: boolean;
|
||||
>isSunk : boolean
|
||||
>isSunk : boolean, Symbol(isSunk, Decl(2dArrays.ts, 3, 12))
|
||||
}
|
||||
|
||||
class Board {
|
||||
>Board : Board
|
||||
>Board : Board, Symbol(Board, Decl(2dArrays.ts, 5, 1))
|
||||
|
||||
ships: Ship[];
|
||||
>ships : Ship[]
|
||||
>Ship : Ship
|
||||
>ships : Ship[], Symbol(ships, Decl(2dArrays.ts, 7, 13))
|
||||
>Ship : Ship, Symbol(Ship, Decl(2dArrays.ts, 1, 1))
|
||||
|
||||
cells: Cell[];
|
||||
>cells : Cell[]
|
||||
>Cell : Cell
|
||||
>cells : Cell[], Symbol(cells, Decl(2dArrays.ts, 8, 18))
|
||||
>Cell : Cell, Symbol(Cell, Decl(2dArrays.ts, 0, 0))
|
||||
|
||||
private allShipsSunk() {
|
||||
>allShipsSunk : () => boolean
|
||||
>allShipsSunk : () => boolean, Symbol(allShipsSunk, Decl(2dArrays.ts, 9, 18))
|
||||
|
||||
return this.ships.every(function (val) { return val.isSunk; });
|
||||
>this.ships.every(function (val) { return val.isSunk; }) : boolean
|
||||
>this.ships.every : (callbackfn: (value: Ship, index: number, array: Ship[]) => boolean, thisArg?: any) => boolean
|
||||
>this.ships : Ship[]
|
||||
>this : Board
|
||||
>ships : Ship[]
|
||||
>every : (callbackfn: (value: Ship, index: number, array: Ship[]) => boolean, thisArg?: any) => boolean
|
||||
>this.ships.every : (callbackfn: (value: Ship, index: number, array: Ship[]) => boolean, thisArg?: any) => boolean, Symbol(Array.every, Decl(lib.d.ts, 1094, 62))
|
||||
>this.ships : Ship[], Symbol(ships, Decl(2dArrays.ts, 7, 13))
|
||||
>this : Board, Symbol(Board, Decl(2dArrays.ts, 5, 1))
|
||||
>ships : Ship[], Symbol(ships, Decl(2dArrays.ts, 7, 13))
|
||||
>every : (callbackfn: (value: Ship, index: number, array: Ship[]) => boolean, thisArg?: any) => boolean, Symbol(Array.every, Decl(lib.d.ts, 1094, 62))
|
||||
>function (val) { return val.isSunk; } : (val: Ship) => boolean
|
||||
>val : Ship
|
||||
>val.isSunk : boolean
|
||||
>val : Ship
|
||||
>isSunk : boolean
|
||||
>val : Ship, Symbol(val, Decl(2dArrays.ts, 12, 42))
|
||||
>val.isSunk : boolean, Symbol(Ship.isSunk, Decl(2dArrays.ts, 3, 12))
|
||||
>val : Ship, Symbol(val, Decl(2dArrays.ts, 12, 42))
|
||||
>isSunk : boolean, Symbol(Ship.isSunk, Decl(2dArrays.ts, 3, 12))
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,152 +7,162 @@
|
||||
*/
|
||||
|
||||
declare var process: any;
|
||||
>process : any
|
||||
>process : any, Symbol(process, Decl(APISample_compile.ts, 7, 11))
|
||||
|
||||
declare var console: any;
|
||||
>console : any
|
||||
>console : any, Symbol(console, Decl(APISample_compile.ts, 8, 11))
|
||||
|
||||
declare var os: any;
|
||||
>os : any
|
||||
>os : any, Symbol(os, Decl(APISample_compile.ts, 9, 11))
|
||||
|
||||
import ts = require("typescript");
|
||||
>ts : typeof ts
|
||||
>ts : typeof ts, Symbol(ts, Decl(APISample_compile.ts, 9, 20))
|
||||
|
||||
export function compile(fileNames: string[], options: ts.CompilerOptions): void {
|
||||
>compile : (fileNames: string[], options: ts.CompilerOptions) => void
|
||||
>fileNames : string[]
|
||||
>options : ts.CompilerOptions
|
||||
>ts : unknown
|
||||
>CompilerOptions : ts.CompilerOptions
|
||||
>compile : (fileNames: string[], options: ts.CompilerOptions) => void, Symbol(compile, Decl(APISample_compile.ts, 11, 34))
|
||||
>fileNames : string[], Symbol(fileNames, Decl(APISample_compile.ts, 13, 24))
|
||||
>options : ts.CompilerOptions, Symbol(options, Decl(APISample_compile.ts, 13, 44))
|
||||
>ts : any, Symbol(ts, Decl(APISample_compile.ts, 9, 20))
|
||||
>CompilerOptions : ts.CompilerOptions, Symbol(ts.CompilerOptions, Decl(typescript.d.ts, 1074, 5))
|
||||
|
||||
var program = ts.createProgram(fileNames, options);
|
||||
>program : ts.Program
|
||||
>program : ts.Program, Symbol(program, Decl(APISample_compile.ts, 14, 7))
|
||||
>ts.createProgram(fileNames, options) : ts.Program
|
||||
>ts.createProgram : (rootNames: string[], options: ts.CompilerOptions, host?: ts.CompilerHost) => ts.Program
|
||||
>ts : typeof ts
|
||||
>createProgram : (rootNames: string[], options: ts.CompilerOptions, host?: ts.CompilerHost) => ts.Program
|
||||
>fileNames : string[]
|
||||
>options : ts.CompilerOptions
|
||||
>ts.createProgram : (rootNames: string[], options: ts.CompilerOptions, host?: ts.CompilerHost) => ts.Program, Symbol(ts.createProgram, Decl(typescript.d.ts, 1229, 113))
|
||||
>ts : typeof ts, Symbol(ts, Decl(APISample_compile.ts, 9, 20))
|
||||
>createProgram : (rootNames: string[], options: ts.CompilerOptions, host?: ts.CompilerHost) => ts.Program, Symbol(ts.createProgram, Decl(typescript.d.ts, 1229, 113))
|
||||
>fileNames : string[], Symbol(fileNames, Decl(APISample_compile.ts, 13, 24))
|
||||
>options : ts.CompilerOptions, Symbol(options, Decl(APISample_compile.ts, 13, 44))
|
||||
|
||||
var emitResult = program.emit();
|
||||
>emitResult : ts.EmitResult
|
||||
>emitResult : ts.EmitResult, Symbol(emitResult, Decl(APISample_compile.ts, 15, 7))
|
||||
>program.emit() : ts.EmitResult
|
||||
>program.emit : (targetSourceFile?: ts.SourceFile, writeFile?: ts.WriteFileCallback) => ts.EmitResult
|
||||
>program : ts.Program
|
||||
>emit : (targetSourceFile?: ts.SourceFile, writeFile?: ts.WriteFileCallback) => ts.EmitResult
|
||||
>program.emit : (targetSourceFile?: ts.SourceFile, writeFile?: ts.WriteFileCallback) => ts.EmitResult, Symbol(ts.Program.emit, Decl(typescript.d.ts, 767, 39))
|
||||
>program : ts.Program, Symbol(program, Decl(APISample_compile.ts, 14, 7))
|
||||
>emit : (targetSourceFile?: ts.SourceFile, writeFile?: ts.WriteFileCallback) => ts.EmitResult, Symbol(ts.Program.emit, Decl(typescript.d.ts, 767, 39))
|
||||
|
||||
var allDiagnostics = ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics);
|
||||
>allDiagnostics : ts.Diagnostic[]
|
||||
>allDiagnostics : ts.Diagnostic[], Symbol(allDiagnostics, Decl(APISample_compile.ts, 17, 7))
|
||||
>ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics) : ts.Diagnostic[]
|
||||
>ts.getPreEmitDiagnostics(program).concat : { <U extends ts.Diagnostic[]>(...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; }
|
||||
>ts.getPreEmitDiagnostics(program).concat : { <U extends ts.Diagnostic[]>(...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; }, Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46))
|
||||
>ts.getPreEmitDiagnostics(program) : ts.Diagnostic[]
|
||||
>ts.getPreEmitDiagnostics : (program: ts.Program) => ts.Diagnostic[]
|
||||
>ts : typeof ts
|
||||
>getPreEmitDiagnostics : (program: ts.Program) => ts.Diagnostic[]
|
||||
>program : ts.Program
|
||||
>concat : { <U extends ts.Diagnostic[]>(...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; }
|
||||
>emitResult.diagnostics : ts.Diagnostic[]
|
||||
>emitResult : ts.EmitResult
|
||||
>diagnostics : ts.Diagnostic[]
|
||||
>ts.getPreEmitDiagnostics : (program: ts.Program) => ts.Diagnostic[], Symbol(ts.getPreEmitDiagnostics, Decl(typescript.d.ts, 1227, 98))
|
||||
>ts : typeof ts, Symbol(ts, Decl(APISample_compile.ts, 9, 20))
|
||||
>getPreEmitDiagnostics : (program: ts.Program) => ts.Diagnostic[], Symbol(ts.getPreEmitDiagnostics, Decl(typescript.d.ts, 1227, 98))
|
||||
>program : ts.Program, Symbol(program, Decl(APISample_compile.ts, 14, 7))
|
||||
>concat : { <U extends ts.Diagnostic[]>(...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; }, Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46))
|
||||
>emitResult.diagnostics : ts.Diagnostic[], Symbol(ts.EmitResult.diagnostics, Decl(typescript.d.ts, 820, 29))
|
||||
>emitResult : ts.EmitResult, Symbol(emitResult, Decl(APISample_compile.ts, 15, 7))
|
||||
>diagnostics : ts.Diagnostic[], Symbol(ts.EmitResult.diagnostics, Decl(typescript.d.ts, 820, 29))
|
||||
|
||||
allDiagnostics.forEach(diagnostic => {
|
||||
>allDiagnostics.forEach(diagnostic => { var { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); var message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); }) : void
|
||||
>allDiagnostics.forEach : (callbackfn: (value: ts.Diagnostic, index: number, array: ts.Diagnostic[]) => void, thisArg?: any) => void
|
||||
>allDiagnostics : ts.Diagnostic[]
|
||||
>forEach : (callbackfn: (value: ts.Diagnostic, index: number, array: ts.Diagnostic[]) => void, thisArg?: any) => void
|
||||
>allDiagnostics.forEach : (callbackfn: (value: ts.Diagnostic, index: number, array: ts.Diagnostic[]) => void, thisArg?: any) => void, Symbol(Array.forEach, Decl(lib.d.ts, 1108, 95))
|
||||
>allDiagnostics : ts.Diagnostic[], Symbol(allDiagnostics, Decl(APISample_compile.ts, 17, 7))
|
||||
>forEach : (callbackfn: (value: ts.Diagnostic, index: number, array: ts.Diagnostic[]) => void, thisArg?: any) => void, Symbol(Array.forEach, Decl(lib.d.ts, 1108, 95))
|
||||
>diagnostic => { var { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); var message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); } : (diagnostic: ts.Diagnostic) => void
|
||||
>diagnostic : ts.Diagnostic
|
||||
>diagnostic : ts.Diagnostic, Symbol(diagnostic, Decl(APISample_compile.ts, 19, 27))
|
||||
|
||||
var { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);
|
||||
>line : number
|
||||
>character : number
|
||||
>line : number, Symbol(line, Decl(APISample_compile.ts, 20, 13))
|
||||
>character : number, Symbol(character, Decl(APISample_compile.ts, 20, 19))
|
||||
>diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start) : ts.LineAndCharacter
|
||||
>diagnostic.file.getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter
|
||||
>diagnostic.file : ts.SourceFile
|
||||
>diagnostic : ts.Diagnostic
|
||||
>file : ts.SourceFile
|
||||
>getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter
|
||||
>diagnostic.start : number
|
||||
>diagnostic : ts.Diagnostic
|
||||
>start : number
|
||||
>diagnostic.file.getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter, Symbol(ts.SourceFile.getLineAndCharacterOfPosition, Decl(typescript.d.ts, 1290, 26))
|
||||
>diagnostic.file : ts.SourceFile, Symbol(ts.Diagnostic.file, Decl(typescript.d.ts, 1062, 26))
|
||||
>diagnostic : ts.Diagnostic, Symbol(diagnostic, Decl(APISample_compile.ts, 19, 27))
|
||||
>file : ts.SourceFile, Symbol(ts.Diagnostic.file, Decl(typescript.d.ts, 1062, 26))
|
||||
>getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter, Symbol(ts.SourceFile.getLineAndCharacterOfPosition, Decl(typescript.d.ts, 1290, 26))
|
||||
>diagnostic.start : number, Symbol(ts.Diagnostic.start, Decl(typescript.d.ts, 1063, 25))
|
||||
>diagnostic : ts.Diagnostic, Symbol(diagnostic, Decl(APISample_compile.ts, 19, 27))
|
||||
>start : number, Symbol(ts.Diagnostic.start, Decl(typescript.d.ts, 1063, 25))
|
||||
|
||||
var message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n');
|
||||
>message : string
|
||||
>message : string, Symbol(message, Decl(APISample_compile.ts, 21, 11))
|
||||
>ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n') : string
|
||||
>ts.flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string
|
||||
>ts : typeof ts
|
||||
>flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string
|
||||
>diagnostic.messageText : string | ts.DiagnosticMessageChain
|
||||
>diagnostic : ts.Diagnostic
|
||||
>messageText : string | ts.DiagnosticMessageChain
|
||||
>ts.flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string, Symbol(ts.flattenDiagnosticMessageText, Decl(typescript.d.ts, 1228, 67))
|
||||
>ts : typeof ts, Symbol(ts, Decl(APISample_compile.ts, 9, 20))
|
||||
>flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string, Symbol(ts.flattenDiagnosticMessageText, Decl(typescript.d.ts, 1228, 67))
|
||||
>diagnostic.messageText : string | ts.DiagnosticMessageChain, Symbol(ts.Diagnostic.messageText, Decl(typescript.d.ts, 1065, 23))
|
||||
>diagnostic : ts.Diagnostic, Symbol(diagnostic, Decl(APISample_compile.ts, 19, 27))
|
||||
>messageText : string | ts.DiagnosticMessageChain, Symbol(ts.Diagnostic.messageText, Decl(typescript.d.ts, 1065, 23))
|
||||
>'\n' : string
|
||||
|
||||
console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`);
|
||||
>console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`) : any
|
||||
>console.log : any
|
||||
>console : any
|
||||
>console : any, Symbol(console, Decl(APISample_compile.ts, 8, 11))
|
||||
>log : any
|
||||
>diagnostic.file.fileName : string
|
||||
>diagnostic.file : ts.SourceFile
|
||||
>diagnostic : ts.Diagnostic
|
||||
>file : ts.SourceFile
|
||||
>fileName : string
|
||||
>`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}` : string
|
||||
>diagnostic.file.fileName : string, Symbol(ts.SourceFile.fileName, Decl(typescript.d.ts, 743, 29))
|
||||
>diagnostic.file : ts.SourceFile, Symbol(ts.Diagnostic.file, Decl(typescript.d.ts, 1062, 26))
|
||||
>diagnostic : ts.Diagnostic, Symbol(diagnostic, Decl(APISample_compile.ts, 19, 27))
|
||||
>file : ts.SourceFile, Symbol(ts.Diagnostic.file, Decl(typescript.d.ts, 1062, 26))
|
||||
>fileName : string, Symbol(ts.SourceFile.fileName, Decl(typescript.d.ts, 743, 29))
|
||||
>line + 1 : number
|
||||
>line : number
|
||||
>line : number, Symbol(line, Decl(APISample_compile.ts, 20, 13))
|
||||
>1 : number
|
||||
>character + 1 : number
|
||||
>character : number
|
||||
>message : string
|
||||
>character : number, Symbol(character, Decl(APISample_compile.ts, 20, 19))
|
||||
>1 : number
|
||||
>message : string, Symbol(message, Decl(APISample_compile.ts, 21, 11))
|
||||
|
||||
});
|
||||
|
||||
var exitCode = emitResult.emitSkipped ? 1 : 0;
|
||||
>exitCode : number
|
||||
>exitCode : number, Symbol(exitCode, Decl(APISample_compile.ts, 25, 7))
|
||||
>emitResult.emitSkipped ? 1 : 0 : number
|
||||
>emitResult.emitSkipped : boolean
|
||||
>emitResult : ts.EmitResult
|
||||
>emitSkipped : boolean
|
||||
>emitResult.emitSkipped : boolean, Symbol(ts.EmitResult.emitSkipped, Decl(typescript.d.ts, 819, 26))
|
||||
>emitResult : ts.EmitResult, Symbol(emitResult, Decl(APISample_compile.ts, 15, 7))
|
||||
>emitSkipped : boolean, Symbol(ts.EmitResult.emitSkipped, Decl(typescript.d.ts, 819, 26))
|
||||
>1 : number
|
||||
>0 : number
|
||||
|
||||
console.log(`Process exiting with code '${exitCode}'.`);
|
||||
>console.log(`Process exiting with code '${exitCode}'.`) : any
|
||||
>console.log : any
|
||||
>console : any
|
||||
>console : any, Symbol(console, Decl(APISample_compile.ts, 8, 11))
|
||||
>log : any
|
||||
>exitCode : number
|
||||
>`Process exiting with code '${exitCode}'.` : string
|
||||
>exitCode : number, Symbol(exitCode, Decl(APISample_compile.ts, 25, 7))
|
||||
|
||||
process.exit(exitCode);
|
||||
>process.exit(exitCode) : any
|
||||
>process.exit : any
|
||||
>process : any
|
||||
>process : any, Symbol(process, Decl(APISample_compile.ts, 7, 11))
|
||||
>exit : any
|
||||
>exitCode : number
|
||||
>exitCode : number, Symbol(exitCode, Decl(APISample_compile.ts, 25, 7))
|
||||
}
|
||||
|
||||
compile(process.argv.slice(2), {
|
||||
>compile(process.argv.slice(2), { noEmitOnError: true, noImplicitAny: true, target: ts.ScriptTarget.ES5, module: ts.ModuleKind.CommonJS}) : void
|
||||
>compile : (fileNames: string[], options: ts.CompilerOptions) => void
|
||||
>compile : (fileNames: string[], options: ts.CompilerOptions) => void, Symbol(compile, Decl(APISample_compile.ts, 11, 34))
|
||||
>process.argv.slice(2) : any
|
||||
>process.argv.slice : any
|
||||
>process.argv : any
|
||||
>process : any
|
||||
>process : any, Symbol(process, Decl(APISample_compile.ts, 7, 11))
|
||||
>argv : any
|
||||
>slice : any
|
||||
>2 : number
|
||||
>{ noEmitOnError: true, noImplicitAny: true, target: ts.ScriptTarget.ES5, module: ts.ModuleKind.CommonJS} : { [x: string]: boolean | ts.ScriptTarget | ts.ModuleKind; noEmitOnError: boolean; noImplicitAny: boolean; target: ts.ScriptTarget; module: ts.ModuleKind; }
|
||||
|
||||
noEmitOnError: true, noImplicitAny: true,
|
||||
>noEmitOnError : boolean
|
||||
>noImplicitAny : boolean
|
||||
>noEmitOnError : boolean, Symbol(noEmitOnError, Decl(APISample_compile.ts, 30, 32))
|
||||
>true : boolean
|
||||
>noImplicitAny : boolean, Symbol(noImplicitAny, Decl(APISample_compile.ts, 31, 24))
|
||||
>true : boolean
|
||||
|
||||
target: ts.ScriptTarget.ES5, module: ts.ModuleKind.CommonJS
|
||||
>target : ts.ScriptTarget
|
||||
>ts.ScriptTarget.ES5 : ts.ScriptTarget
|
||||
>ts.ScriptTarget : typeof ts.ScriptTarget
|
||||
>ts : typeof ts
|
||||
>ScriptTarget : typeof ts.ScriptTarget
|
||||
>ES5 : ts.ScriptTarget
|
||||
>module : ts.ModuleKind
|
||||
>ts.ModuleKind.CommonJS : ts.ModuleKind
|
||||
>ts.ModuleKind : typeof ts.ModuleKind
|
||||
>ts : typeof ts
|
||||
>ModuleKind : typeof ts.ModuleKind
|
||||
>CommonJS : ts.ModuleKind
|
||||
>target : ts.ScriptTarget, Symbol(target, Decl(APISample_compile.ts, 31, 45))
|
||||
>ts.ScriptTarget.ES5 : ts.ScriptTarget, Symbol(ts.ScriptTarget.ES5, Decl(typescript.d.ts, 1117, 16))
|
||||
>ts.ScriptTarget : typeof ts.ScriptTarget, Symbol(ts.ScriptTarget, Decl(typescript.d.ts, 1115, 5))
|
||||
>ts : typeof ts, Symbol(ts, Decl(APISample_compile.ts, 9, 20))
|
||||
>ScriptTarget : typeof ts.ScriptTarget, Symbol(ts.ScriptTarget, Decl(typescript.d.ts, 1115, 5))
|
||||
>ES5 : ts.ScriptTarget, Symbol(ts.ScriptTarget.ES5, Decl(typescript.d.ts, 1117, 16))
|
||||
>module : ts.ModuleKind, Symbol(module, Decl(APISample_compile.ts, 32, 32))
|
||||
>ts.ModuleKind.CommonJS : ts.ModuleKind, Symbol(ts.ModuleKind.CommonJS, Decl(typescript.d.ts, 1108, 17))
|
||||
>ts.ModuleKind : typeof ts.ModuleKind, Symbol(ts.ModuleKind, Decl(typescript.d.ts, 1106, 5))
|
||||
>ts : typeof ts, Symbol(ts, Decl(APISample_compile.ts, 9, 20))
|
||||
>ModuleKind : typeof ts.ModuleKind, Symbol(ts.ModuleKind, Decl(typescript.d.ts, 1106, 5))
|
||||
>CommonJS : ts.ModuleKind, Symbol(ts.ModuleKind.CommonJS, Decl(typescript.d.ts, 1108, 17))
|
||||
|
||||
});
|
||||
|
||||
@ -7,297 +7,306 @@
|
||||
*/
|
||||
|
||||
declare var process: any;
|
||||
>process : any
|
||||
>process : any, Symbol(process, Decl(APISample_linter.ts, 7, 11))
|
||||
|
||||
declare var console: any;
|
||||
>console : any
|
||||
>console : any, Symbol(console, Decl(APISample_linter.ts, 8, 11))
|
||||
|
||||
declare var readFileSync: any;
|
||||
>readFileSync : any
|
||||
>readFileSync : any, Symbol(readFileSync, Decl(APISample_linter.ts, 9, 11))
|
||||
|
||||
import * as ts from "typescript";
|
||||
>ts : typeof ts
|
||||
>ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
|
||||
|
||||
export function delint(sourceFile: ts.SourceFile) {
|
||||
>delint : (sourceFile: ts.SourceFile) => void
|
||||
>sourceFile : ts.SourceFile
|
||||
>ts : unknown
|
||||
>SourceFile : ts.SourceFile
|
||||
>delint : (sourceFile: ts.SourceFile) => void, Symbol(delint, Decl(APISample_linter.ts, 11, 33))
|
||||
>sourceFile : ts.SourceFile, Symbol(sourceFile, Decl(APISample_linter.ts, 13, 23))
|
||||
>ts : any, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
|
||||
>SourceFile : ts.SourceFile, Symbol(ts.SourceFile, Decl(typescript.d.ts, 740, 5), Decl(typescript.d.ts, 1289, 5))
|
||||
|
||||
delintNode(sourceFile);
|
||||
>delintNode(sourceFile) : void
|
||||
>delintNode : (node: ts.Node) => void
|
||||
>sourceFile : ts.SourceFile
|
||||
>delintNode : (node: ts.Node) => void, Symbol(delintNode, Decl(APISample_linter.ts, 14, 27))
|
||||
>sourceFile : ts.SourceFile, Symbol(sourceFile, Decl(APISample_linter.ts, 13, 23))
|
||||
|
||||
function delintNode(node: ts.Node) {
|
||||
>delintNode : (node: ts.Node) => void
|
||||
>node : ts.Node
|
||||
>ts : unknown
|
||||
>Node : ts.Node
|
||||
>delintNode : (node: ts.Node) => void, Symbol(delintNode, Decl(APISample_linter.ts, 14, 27))
|
||||
>node : ts.Node, Symbol(node, Decl(APISample_linter.ts, 16, 24))
|
||||
>ts : any, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
|
||||
>Node : ts.Node, Symbol(ts.Node, Decl(typescript.d.ts, 296, 5), Decl(typescript.d.ts, 1249, 32))
|
||||
|
||||
switch (node.kind) {
|
||||
>node.kind : ts.SyntaxKind
|
||||
>node : ts.Node
|
||||
>kind : ts.SyntaxKind
|
||||
>node.kind : ts.SyntaxKind, Symbol(ts.Node.kind, Decl(typescript.d.ts, 297, 38))
|
||||
>node : ts.Node, Symbol(node, Decl(APISample_linter.ts, 16, 24))
|
||||
>kind : ts.SyntaxKind, Symbol(ts.Node.kind, Decl(typescript.d.ts, 297, 38))
|
||||
|
||||
case ts.SyntaxKind.ForStatement:
|
||||
>ts.SyntaxKind.ForStatement : ts.SyntaxKind
|
||||
>ts.SyntaxKind : typeof ts.SyntaxKind
|
||||
>ts : typeof ts
|
||||
>SyntaxKind : typeof ts.SyntaxKind
|
||||
>ForStatement : ts.SyntaxKind
|
||||
>ts.SyntaxKind.ForStatement : ts.SyntaxKind, Symbol(ts.SyntaxKind.ForStatement, Decl(typescript.d.ts, 209, 29))
|
||||
>ts.SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
|
||||
>ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
|
||||
>SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
|
||||
>ForStatement : ts.SyntaxKind, Symbol(ts.SyntaxKind.ForStatement, Decl(typescript.d.ts, 209, 29))
|
||||
|
||||
case ts.SyntaxKind.ForInStatement:
|
||||
>ts.SyntaxKind.ForInStatement : ts.SyntaxKind
|
||||
>ts.SyntaxKind : typeof ts.SyntaxKind
|
||||
>ts : typeof ts
|
||||
>SyntaxKind : typeof ts.SyntaxKind
|
||||
>ForInStatement : ts.SyntaxKind
|
||||
>ts.SyntaxKind.ForInStatement : ts.SyntaxKind, Symbol(ts.SyntaxKind.ForInStatement, Decl(typescript.d.ts, 210, 27))
|
||||
>ts.SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
|
||||
>ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
|
||||
>SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
|
||||
>ForInStatement : ts.SyntaxKind, Symbol(ts.SyntaxKind.ForInStatement, Decl(typescript.d.ts, 210, 27))
|
||||
|
||||
case ts.SyntaxKind.WhileStatement:
|
||||
>ts.SyntaxKind.WhileStatement : ts.SyntaxKind
|
||||
>ts.SyntaxKind : typeof ts.SyntaxKind
|
||||
>ts : typeof ts
|
||||
>SyntaxKind : typeof ts.SyntaxKind
|
||||
>WhileStatement : ts.SyntaxKind
|
||||
>ts.SyntaxKind.WhileStatement : ts.SyntaxKind, Symbol(ts.SyntaxKind.WhileStatement, Decl(typescript.d.ts, 208, 26))
|
||||
>ts.SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
|
||||
>ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
|
||||
>SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
|
||||
>WhileStatement : ts.SyntaxKind, Symbol(ts.SyntaxKind.WhileStatement, Decl(typescript.d.ts, 208, 26))
|
||||
|
||||
case ts.SyntaxKind.DoStatement:
|
||||
>ts.SyntaxKind.DoStatement : ts.SyntaxKind
|
||||
>ts.SyntaxKind : typeof ts.SyntaxKind
|
||||
>ts : typeof ts
|
||||
>SyntaxKind : typeof ts.SyntaxKind
|
||||
>DoStatement : ts.SyntaxKind
|
||||
>ts.SyntaxKind.DoStatement : ts.SyntaxKind, Symbol(ts.SyntaxKind.DoStatement, Decl(typescript.d.ts, 207, 26))
|
||||
>ts.SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
|
||||
>ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
|
||||
>SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
|
||||
>DoStatement : ts.SyntaxKind, Symbol(ts.SyntaxKind.DoStatement, Decl(typescript.d.ts, 207, 26))
|
||||
|
||||
if ((<ts.IterationStatement>node).statement.kind !== ts.SyntaxKind.Block) {
|
||||
>(<ts.IterationStatement>node).statement.kind !== ts.SyntaxKind.Block : boolean
|
||||
>(<ts.IterationStatement>node).statement.kind : ts.SyntaxKind
|
||||
>(<ts.IterationStatement>node).statement : ts.Statement
|
||||
>(<ts.IterationStatement>node).statement.kind : ts.SyntaxKind, Symbol(ts.Node.kind, Decl(typescript.d.ts, 297, 38))
|
||||
>(<ts.IterationStatement>node).statement : ts.Statement, Symbol(ts.IterationStatement.statement, Decl(typescript.d.ts, 589, 52))
|
||||
>(<ts.IterationStatement>node) : ts.IterationStatement
|
||||
><ts.IterationStatement>node : ts.IterationStatement
|
||||
>ts : unknown
|
||||
>IterationStatement : ts.IterationStatement
|
||||
>node : ts.Node
|
||||
>statement : ts.Statement
|
||||
>kind : ts.SyntaxKind
|
||||
>ts.SyntaxKind.Block : ts.SyntaxKind
|
||||
>ts.SyntaxKind : typeof ts.SyntaxKind
|
||||
>ts : typeof ts
|
||||
>SyntaxKind : typeof ts.SyntaxKind
|
||||
>Block : ts.SyntaxKind
|
||||
>ts : any, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
|
||||
>IterationStatement : ts.IterationStatement, Symbol(ts.IterationStatement, Decl(typescript.d.ts, 588, 5))
|
||||
>node : ts.Node, Symbol(node, Decl(APISample_linter.ts, 16, 24))
|
||||
>statement : ts.Statement, Symbol(ts.IterationStatement.statement, Decl(typescript.d.ts, 589, 52))
|
||||
>kind : ts.SyntaxKind, Symbol(ts.Node.kind, Decl(typescript.d.ts, 297, 38))
|
||||
>ts.SyntaxKind.Block : ts.SyntaxKind, Symbol(ts.SyntaxKind.Block, Decl(typescript.d.ts, 202, 36))
|
||||
>ts.SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
|
||||
>ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
|
||||
>SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
|
||||
>Block : ts.SyntaxKind, Symbol(ts.SyntaxKind.Block, Decl(typescript.d.ts, 202, 36))
|
||||
|
||||
report(node, "A looping statement's contents should be wrapped in a block body.");
|
||||
>report(node, "A looping statement's contents should be wrapped in a block body.") : void
|
||||
>report : (node: ts.Node, message: string) => void
|
||||
>node : ts.Node
|
||||
>report : (node: ts.Node, message: string) => void, Symbol(report, Decl(APISample_linter.ts, 48, 5))
|
||||
>node : ts.Node, Symbol(node, Decl(APISample_linter.ts, 16, 24))
|
||||
>"A looping statement's contents should be wrapped in a block body." : string
|
||||
}
|
||||
break;
|
||||
|
||||
case ts.SyntaxKind.IfStatement:
|
||||
>ts.SyntaxKind.IfStatement : ts.SyntaxKind
|
||||
>ts.SyntaxKind : typeof ts.SyntaxKind
|
||||
>ts : typeof ts
|
||||
>SyntaxKind : typeof ts.SyntaxKind
|
||||
>IfStatement : ts.SyntaxKind
|
||||
>ts.SyntaxKind.IfStatement : ts.SyntaxKind, Symbol(ts.SyntaxKind.IfStatement, Decl(typescript.d.ts, 206, 34))
|
||||
>ts.SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
|
||||
>ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
|
||||
>SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
|
||||
>IfStatement : ts.SyntaxKind, Symbol(ts.SyntaxKind.IfStatement, Decl(typescript.d.ts, 206, 34))
|
||||
|
||||
let ifStatement = (<ts.IfStatement>node);
|
||||
>ifStatement : ts.IfStatement
|
||||
>ifStatement : ts.IfStatement, Symbol(ifStatement, Decl(APISample_linter.ts, 28, 19))
|
||||
>(<ts.IfStatement>node) : ts.IfStatement
|
||||
><ts.IfStatement>node : ts.IfStatement
|
||||
>ts : unknown
|
||||
>IfStatement : ts.IfStatement
|
||||
>node : ts.Node
|
||||
>ts : any, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
|
||||
>IfStatement : ts.IfStatement, Symbol(ts.IfStatement, Decl(typescript.d.ts, 583, 5))
|
||||
>node : ts.Node, Symbol(node, Decl(APISample_linter.ts, 16, 24))
|
||||
|
||||
if (ifStatement.thenStatement.kind !== ts.SyntaxKind.Block) {
|
||||
>ifStatement.thenStatement.kind !== ts.SyntaxKind.Block : boolean
|
||||
>ifStatement.thenStatement.kind : ts.SyntaxKind
|
||||
>ifStatement.thenStatement : ts.Statement
|
||||
>ifStatement : ts.IfStatement
|
||||
>thenStatement : ts.Statement
|
||||
>kind : ts.SyntaxKind
|
||||
>ts.SyntaxKind.Block : ts.SyntaxKind
|
||||
>ts.SyntaxKind : typeof ts.SyntaxKind
|
||||
>ts : typeof ts
|
||||
>SyntaxKind : typeof ts.SyntaxKind
|
||||
>Block : ts.SyntaxKind
|
||||
>ifStatement.thenStatement.kind : ts.SyntaxKind, Symbol(ts.Node.kind, Decl(typescript.d.ts, 297, 38))
|
||||
>ifStatement.thenStatement : ts.Statement, Symbol(ts.IfStatement.thenStatement, Decl(typescript.d.ts, 585, 31))
|
||||
>ifStatement : ts.IfStatement, Symbol(ifStatement, Decl(APISample_linter.ts, 28, 19))
|
||||
>thenStatement : ts.Statement, Symbol(ts.IfStatement.thenStatement, Decl(typescript.d.ts, 585, 31))
|
||||
>kind : ts.SyntaxKind, Symbol(ts.Node.kind, Decl(typescript.d.ts, 297, 38))
|
||||
>ts.SyntaxKind.Block : ts.SyntaxKind, Symbol(ts.SyntaxKind.Block, Decl(typescript.d.ts, 202, 36))
|
||||
>ts.SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
|
||||
>ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
|
||||
>SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
|
||||
>Block : ts.SyntaxKind, Symbol(ts.SyntaxKind.Block, Decl(typescript.d.ts, 202, 36))
|
||||
|
||||
report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body.");
|
||||
>report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body.") : void
|
||||
>report : (node: ts.Node, message: string) => void
|
||||
>ifStatement.thenStatement : ts.Statement
|
||||
>ifStatement : ts.IfStatement
|
||||
>thenStatement : ts.Statement
|
||||
>report : (node: ts.Node, message: string) => void, Symbol(report, Decl(APISample_linter.ts, 48, 5))
|
||||
>ifStatement.thenStatement : ts.Statement, Symbol(ts.IfStatement.thenStatement, Decl(typescript.d.ts, 585, 31))
|
||||
>ifStatement : ts.IfStatement, Symbol(ifStatement, Decl(APISample_linter.ts, 28, 19))
|
||||
>thenStatement : ts.Statement, Symbol(ts.IfStatement.thenStatement, Decl(typescript.d.ts, 585, 31))
|
||||
>"An if statement's contents should be wrapped in a block body." : string
|
||||
}
|
||||
if (ifStatement.elseStatement &&
|
||||
>ifStatement.elseStatement && ifStatement.elseStatement.kind !== ts.SyntaxKind.Block && ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement : boolean
|
||||
>ifStatement.elseStatement && ifStatement.elseStatement.kind !== ts.SyntaxKind.Block : boolean
|
||||
>ifStatement.elseStatement : ts.Statement
|
||||
>ifStatement : ts.IfStatement
|
||||
>elseStatement : ts.Statement
|
||||
>ifStatement.elseStatement : ts.Statement, Symbol(ts.IfStatement.elseStatement, Decl(typescript.d.ts, 586, 33))
|
||||
>ifStatement : ts.IfStatement, Symbol(ifStatement, Decl(APISample_linter.ts, 28, 19))
|
||||
>elseStatement : ts.Statement, Symbol(ts.IfStatement.elseStatement, Decl(typescript.d.ts, 586, 33))
|
||||
|
||||
ifStatement.elseStatement.kind !== ts.SyntaxKind.Block &&
|
||||
>ifStatement.elseStatement.kind !== ts.SyntaxKind.Block : boolean
|
||||
>ifStatement.elseStatement.kind : ts.SyntaxKind
|
||||
>ifStatement.elseStatement : ts.Statement
|
||||
>ifStatement : ts.IfStatement
|
||||
>elseStatement : ts.Statement
|
||||
>kind : ts.SyntaxKind
|
||||
>ts.SyntaxKind.Block : ts.SyntaxKind
|
||||
>ts.SyntaxKind : typeof ts.SyntaxKind
|
||||
>ts : typeof ts
|
||||
>SyntaxKind : typeof ts.SyntaxKind
|
||||
>Block : ts.SyntaxKind
|
||||
>ifStatement.elseStatement.kind : ts.SyntaxKind, Symbol(ts.Node.kind, Decl(typescript.d.ts, 297, 38))
|
||||
>ifStatement.elseStatement : ts.Statement, Symbol(ts.IfStatement.elseStatement, Decl(typescript.d.ts, 586, 33))
|
||||
>ifStatement : ts.IfStatement, Symbol(ifStatement, Decl(APISample_linter.ts, 28, 19))
|
||||
>elseStatement : ts.Statement, Symbol(ts.IfStatement.elseStatement, Decl(typescript.d.ts, 586, 33))
|
||||
>kind : ts.SyntaxKind, Symbol(ts.Node.kind, Decl(typescript.d.ts, 297, 38))
|
||||
>ts.SyntaxKind.Block : ts.SyntaxKind, Symbol(ts.SyntaxKind.Block, Decl(typescript.d.ts, 202, 36))
|
||||
>ts.SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
|
||||
>ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
|
||||
>SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
|
||||
>Block : ts.SyntaxKind, Symbol(ts.SyntaxKind.Block, Decl(typescript.d.ts, 202, 36))
|
||||
|
||||
ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement) {
|
||||
>ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement : boolean
|
||||
>ifStatement.elseStatement.kind : ts.SyntaxKind
|
||||
>ifStatement.elseStatement : ts.Statement
|
||||
>ifStatement : ts.IfStatement
|
||||
>elseStatement : ts.Statement
|
||||
>kind : ts.SyntaxKind
|
||||
>ts.SyntaxKind.IfStatement : ts.SyntaxKind
|
||||
>ts.SyntaxKind : typeof ts.SyntaxKind
|
||||
>ts : typeof ts
|
||||
>SyntaxKind : typeof ts.SyntaxKind
|
||||
>IfStatement : ts.SyntaxKind
|
||||
>ifStatement.elseStatement.kind : ts.SyntaxKind, Symbol(ts.Node.kind, Decl(typescript.d.ts, 297, 38))
|
||||
>ifStatement.elseStatement : ts.Statement, Symbol(ts.IfStatement.elseStatement, Decl(typescript.d.ts, 586, 33))
|
||||
>ifStatement : ts.IfStatement, Symbol(ifStatement, Decl(APISample_linter.ts, 28, 19))
|
||||
>elseStatement : ts.Statement, Symbol(ts.IfStatement.elseStatement, Decl(typescript.d.ts, 586, 33))
|
||||
>kind : ts.SyntaxKind, Symbol(ts.Node.kind, Decl(typescript.d.ts, 297, 38))
|
||||
>ts.SyntaxKind.IfStatement : ts.SyntaxKind, Symbol(ts.SyntaxKind.IfStatement, Decl(typescript.d.ts, 206, 34))
|
||||
>ts.SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
|
||||
>ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
|
||||
>SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
|
||||
>IfStatement : ts.SyntaxKind, Symbol(ts.SyntaxKind.IfStatement, Decl(typescript.d.ts, 206, 34))
|
||||
|
||||
report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body.");
|
||||
>report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body.") : void
|
||||
>report : (node: ts.Node, message: string) => void
|
||||
>ifStatement.elseStatement : ts.Statement
|
||||
>ifStatement : ts.IfStatement
|
||||
>elseStatement : ts.Statement
|
||||
>report : (node: ts.Node, message: string) => void, Symbol(report, Decl(APISample_linter.ts, 48, 5))
|
||||
>ifStatement.elseStatement : ts.Statement, Symbol(ts.IfStatement.elseStatement, Decl(typescript.d.ts, 586, 33))
|
||||
>ifStatement : ts.IfStatement, Symbol(ifStatement, Decl(APISample_linter.ts, 28, 19))
|
||||
>elseStatement : ts.Statement, Symbol(ts.IfStatement.elseStatement, Decl(typescript.d.ts, 586, 33))
|
||||
>"An else statement's contents should be wrapped in a block body." : string
|
||||
}
|
||||
break;
|
||||
|
||||
case ts.SyntaxKind.BinaryExpression:
|
||||
>ts.SyntaxKind.BinaryExpression : ts.SyntaxKind
|
||||
>ts.SyntaxKind : typeof ts.SyntaxKind
|
||||
>ts : typeof ts
|
||||
>SyntaxKind : typeof ts.SyntaxKind
|
||||
>BinaryExpression : ts.SyntaxKind
|
||||
>ts.SyntaxKind.BinaryExpression : ts.SyntaxKind, Symbol(ts.SyntaxKind.BinaryExpression, Decl(typescript.d.ts, 192, 37))
|
||||
>ts.SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
|
||||
>ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
|
||||
>SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
|
||||
>BinaryExpression : ts.SyntaxKind, Symbol(ts.SyntaxKind.BinaryExpression, Decl(typescript.d.ts, 192, 37))
|
||||
|
||||
let op = (<ts.BinaryExpression>node).operatorToken.kind;
|
||||
>op : ts.SyntaxKind
|
||||
>(<ts.BinaryExpression>node).operatorToken.kind : ts.SyntaxKind
|
||||
>(<ts.BinaryExpression>node).operatorToken : ts.Node
|
||||
>op : ts.SyntaxKind, Symbol(op, Decl(APISample_linter.ts, 40, 19))
|
||||
>(<ts.BinaryExpression>node).operatorToken.kind : ts.SyntaxKind, Symbol(ts.Node.kind, Decl(typescript.d.ts, 297, 38))
|
||||
>(<ts.BinaryExpression>node).operatorToken : ts.Node, Symbol(ts.BinaryExpression.operatorToken, Decl(typescript.d.ts, 497, 25))
|
||||
>(<ts.BinaryExpression>node) : ts.BinaryExpression
|
||||
><ts.BinaryExpression>node : ts.BinaryExpression
|
||||
>ts : unknown
|
||||
>BinaryExpression : ts.BinaryExpression
|
||||
>node : ts.Node
|
||||
>operatorToken : ts.Node
|
||||
>kind : ts.SyntaxKind
|
||||
>ts : any, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
|
||||
>BinaryExpression : ts.BinaryExpression, Symbol(ts.BinaryExpression, Decl(typescript.d.ts, 495, 5))
|
||||
>node : ts.Node, Symbol(node, Decl(APISample_linter.ts, 16, 24))
|
||||
>operatorToken : ts.Node, Symbol(ts.BinaryExpression.operatorToken, Decl(typescript.d.ts, 497, 25))
|
||||
>kind : ts.SyntaxKind, Symbol(ts.Node.kind, Decl(typescript.d.ts, 297, 38))
|
||||
|
||||
if (op === ts.SyntaxKind.EqualsEqualsToken || op == ts.SyntaxKind.ExclamationEqualsToken) {
|
||||
>op === ts.SyntaxKind.EqualsEqualsToken || op == ts.SyntaxKind.ExclamationEqualsToken : boolean
|
||||
>op === ts.SyntaxKind.EqualsEqualsToken : boolean
|
||||
>op : ts.SyntaxKind
|
||||
>ts.SyntaxKind.EqualsEqualsToken : ts.SyntaxKind
|
||||
>ts.SyntaxKind : typeof ts.SyntaxKind
|
||||
>ts : typeof ts
|
||||
>SyntaxKind : typeof ts.SyntaxKind
|
||||
>EqualsEqualsToken : ts.SyntaxKind
|
||||
>op : ts.SyntaxKind, Symbol(op, Decl(APISample_linter.ts, 40, 19))
|
||||
>ts.SyntaxKind.EqualsEqualsToken : ts.SyntaxKind, Symbol(ts.SyntaxKind.EqualsEqualsToken, Decl(typescript.d.ts, 51, 36))
|
||||
>ts.SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
|
||||
>ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
|
||||
>SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
|
||||
>EqualsEqualsToken : ts.SyntaxKind, Symbol(ts.SyntaxKind.EqualsEqualsToken, Decl(typescript.d.ts, 51, 36))
|
||||
>op == ts.SyntaxKind.ExclamationEqualsToken : boolean
|
||||
>op : ts.SyntaxKind
|
||||
>ts.SyntaxKind.ExclamationEqualsToken : ts.SyntaxKind
|
||||
>ts.SyntaxKind : typeof ts.SyntaxKind
|
||||
>ts : typeof ts
|
||||
>SyntaxKind : typeof ts.SyntaxKind
|
||||
>ExclamationEqualsToken : ts.SyntaxKind
|
||||
>op : ts.SyntaxKind, Symbol(op, Decl(APISample_linter.ts, 40, 19))
|
||||
>ts.SyntaxKind.ExclamationEqualsToken : ts.SyntaxKind, Symbol(ts.SyntaxKind.ExclamationEqualsToken, Decl(typescript.d.ts, 52, 31))
|
||||
>ts.SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
|
||||
>ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
|
||||
>SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
|
||||
>ExclamationEqualsToken : ts.SyntaxKind, Symbol(ts.SyntaxKind.ExclamationEqualsToken, Decl(typescript.d.ts, 52, 31))
|
||||
|
||||
report(node, "Use '===' and '!=='.")
|
||||
>report(node, "Use '===' and '!=='.") : void
|
||||
>report : (node: ts.Node, message: string) => void
|
||||
>node : ts.Node
|
||||
>report : (node: ts.Node, message: string) => void, Symbol(report, Decl(APISample_linter.ts, 48, 5))
|
||||
>node : ts.Node, Symbol(node, Decl(APISample_linter.ts, 16, 24))
|
||||
>"Use '===' and '!=='." : string
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
ts.forEachChild(node, delintNode);
|
||||
>ts.forEachChild(node, delintNode) : void
|
||||
>ts.forEachChild : <T>(node: ts.Node, cbNode: (node: ts.Node) => T, cbNodeArray?: (nodes: ts.Node[]) => T) => T
|
||||
>ts : typeof ts
|
||||
>forEachChild : <T>(node: ts.Node, cbNode: (node: ts.Node) => T, cbNodeArray?: (nodes: ts.Node[]) => T) => T
|
||||
>node : ts.Node
|
||||
>delintNode : (node: ts.Node) => void
|
||||
>ts.forEachChild : <T>(node: ts.Node, cbNode: (node: ts.Node) => T, cbNodeArray?: (nodes: ts.Node[]) => T) => T, Symbol(ts.forEachChild, Decl(typescript.d.ts, 1214, 48))
|
||||
>ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
|
||||
>forEachChild : <T>(node: ts.Node, cbNode: (node: ts.Node) => T, cbNodeArray?: (nodes: ts.Node[]) => T) => T, Symbol(ts.forEachChild, Decl(typescript.d.ts, 1214, 48))
|
||||
>node : ts.Node, Symbol(node, Decl(APISample_linter.ts, 16, 24))
|
||||
>delintNode : (node: ts.Node) => void, Symbol(delintNode, Decl(APISample_linter.ts, 14, 27))
|
||||
}
|
||||
|
||||
function report(node: ts.Node, message: string) {
|
||||
>report : (node: ts.Node, message: string) => void
|
||||
>node : ts.Node
|
||||
>ts : unknown
|
||||
>Node : ts.Node
|
||||
>message : string
|
||||
>report : (node: ts.Node, message: string) => void, Symbol(report, Decl(APISample_linter.ts, 48, 5))
|
||||
>node : ts.Node, Symbol(node, Decl(APISample_linter.ts, 50, 20))
|
||||
>ts : any, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
|
||||
>Node : ts.Node, Symbol(ts.Node, Decl(typescript.d.ts, 296, 5), Decl(typescript.d.ts, 1249, 32))
|
||||
>message : string, Symbol(message, Decl(APISample_linter.ts, 50, 34))
|
||||
|
||||
let { line, character } = sourceFile.getLineAndCharacterOfPosition(node.getStart());
|
||||
>line : number
|
||||
>character : number
|
||||
>line : number, Symbol(line, Decl(APISample_linter.ts, 51, 13))
|
||||
>character : number, Symbol(character, Decl(APISample_linter.ts, 51, 19))
|
||||
>sourceFile.getLineAndCharacterOfPosition(node.getStart()) : ts.LineAndCharacter
|
||||
>sourceFile.getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter
|
||||
>sourceFile : ts.SourceFile
|
||||
>getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter
|
||||
>sourceFile.getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter, Symbol(ts.SourceFile.getLineAndCharacterOfPosition, Decl(typescript.d.ts, 1290, 26))
|
||||
>sourceFile : ts.SourceFile, Symbol(sourceFile, Decl(APISample_linter.ts, 13, 23))
|
||||
>getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter, Symbol(ts.SourceFile.getLineAndCharacterOfPosition, Decl(typescript.d.ts, 1290, 26))
|
||||
>node.getStart() : number
|
||||
>node.getStart : (sourceFile?: ts.SourceFile) => number
|
||||
>node : ts.Node
|
||||
>getStart : (sourceFile?: ts.SourceFile) => number
|
||||
>node.getStart : (sourceFile?: ts.SourceFile) => number, Symbol(ts.Node.getStart, Decl(typescript.d.ts, 1254, 53))
|
||||
>node : ts.Node, Symbol(node, Decl(APISample_linter.ts, 50, 20))
|
||||
>getStart : (sourceFile?: ts.SourceFile) => number, Symbol(ts.Node.getStart, Decl(typescript.d.ts, 1254, 53))
|
||||
|
||||
console.log(`${sourceFile.fileName} (${line + 1},${character + 1}): ${message}`);
|
||||
>console.log(`${sourceFile.fileName} (${line + 1},${character + 1}): ${message}`) : any
|
||||
>console.log : any
|
||||
>console : any
|
||||
>console : any, Symbol(console, Decl(APISample_linter.ts, 8, 11))
|
||||
>log : any
|
||||
>sourceFile.fileName : string
|
||||
>sourceFile : ts.SourceFile
|
||||
>fileName : string
|
||||
>`${sourceFile.fileName} (${line + 1},${character + 1}): ${message}` : string
|
||||
>sourceFile.fileName : string, Symbol(ts.SourceFile.fileName, Decl(typescript.d.ts, 743, 29))
|
||||
>sourceFile : ts.SourceFile, Symbol(sourceFile, Decl(APISample_linter.ts, 13, 23))
|
||||
>fileName : string, Symbol(ts.SourceFile.fileName, Decl(typescript.d.ts, 743, 29))
|
||||
>line + 1 : number
|
||||
>line : number
|
||||
>line : number, Symbol(line, Decl(APISample_linter.ts, 51, 13))
|
||||
>1 : number
|
||||
>character + 1 : number
|
||||
>character : number
|
||||
>message : string
|
||||
>character : number, Symbol(character, Decl(APISample_linter.ts, 51, 19))
|
||||
>1 : number
|
||||
>message : string, Symbol(message, Decl(APISample_linter.ts, 50, 34))
|
||||
}
|
||||
}
|
||||
|
||||
const fileNames = process.argv.slice(2);
|
||||
>fileNames : any
|
||||
>fileNames : any, Symbol(fileNames, Decl(APISample_linter.ts, 56, 5))
|
||||
>process.argv.slice(2) : any
|
||||
>process.argv.slice : any
|
||||
>process.argv : any
|
||||
>process : any
|
||||
>process : any, Symbol(process, Decl(APISample_linter.ts, 7, 11))
|
||||
>argv : any
|
||||
>slice : any
|
||||
>2 : number
|
||||
|
||||
fileNames.forEach(fileName => {
|
||||
>fileNames.forEach(fileName => { // Parse a file let sourceFile = ts.createSourceFile(fileName, readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); // delint it delint(sourceFile);}) : any
|
||||
>fileNames.forEach : any
|
||||
>fileNames : any
|
||||
>fileNames : any, Symbol(fileNames, Decl(APISample_linter.ts, 56, 5))
|
||||
>forEach : any
|
||||
>fileName => { // Parse a file let sourceFile = ts.createSourceFile(fileName, readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); // delint it delint(sourceFile);} : (fileName: any) => void
|
||||
>fileName : any
|
||||
>fileName : any, Symbol(fileName, Decl(APISample_linter.ts, 57, 18))
|
||||
|
||||
// Parse a file
|
||||
let sourceFile = ts.createSourceFile(fileName, readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true);
|
||||
>sourceFile : ts.SourceFile
|
||||
>sourceFile : ts.SourceFile, Symbol(sourceFile, Decl(APISample_linter.ts, 59, 7))
|
||||
>ts.createSourceFile(fileName, readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true) : ts.SourceFile
|
||||
>ts.createSourceFile : (fileName: string, sourceText: string, languageVersion: ts.ScriptTarget, setParentNodes?: boolean) => ts.SourceFile
|
||||
>ts : typeof ts
|
||||
>createSourceFile : (fileName: string, sourceText: string, languageVersion: ts.ScriptTarget, setParentNodes?: boolean) => ts.SourceFile
|
||||
>fileName : any
|
||||
>ts.createSourceFile : (fileName: string, sourceText: string, languageVersion: ts.ScriptTarget, setParentNodes?: boolean) => ts.SourceFile, Symbol(ts.createSourceFile, Decl(typescript.d.ts, 1218, 62))
|
||||
>ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
|
||||
>createSourceFile : (fileName: string, sourceText: string, languageVersion: ts.ScriptTarget, setParentNodes?: boolean) => ts.SourceFile, Symbol(ts.createSourceFile, Decl(typescript.d.ts, 1218, 62))
|
||||
>fileName : any, Symbol(fileName, Decl(APISample_linter.ts, 57, 18))
|
||||
>readFileSync(fileName).toString() : any
|
||||
>readFileSync(fileName).toString : any
|
||||
>readFileSync(fileName) : any
|
||||
>readFileSync : any
|
||||
>fileName : any
|
||||
>readFileSync : any, Symbol(readFileSync, Decl(APISample_linter.ts, 9, 11))
|
||||
>fileName : any, Symbol(fileName, Decl(APISample_linter.ts, 57, 18))
|
||||
>toString : any
|
||||
>ts.ScriptTarget.ES6 : ts.ScriptTarget
|
||||
>ts.ScriptTarget : typeof ts.ScriptTarget
|
||||
>ts : typeof ts
|
||||
>ScriptTarget : typeof ts.ScriptTarget
|
||||
>ES6 : ts.ScriptTarget
|
||||
>ts.ScriptTarget.ES6 : ts.ScriptTarget, Symbol(ts.ScriptTarget.ES6, Decl(typescript.d.ts, 1118, 16))
|
||||
>ts.ScriptTarget : typeof ts.ScriptTarget, Symbol(ts.ScriptTarget, Decl(typescript.d.ts, 1115, 5))
|
||||
>ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
|
||||
>ScriptTarget : typeof ts.ScriptTarget, Symbol(ts.ScriptTarget, Decl(typescript.d.ts, 1115, 5))
|
||||
>ES6 : ts.ScriptTarget, Symbol(ts.ScriptTarget.ES6, Decl(typescript.d.ts, 1118, 16))
|
||||
>true : boolean
|
||||
|
||||
// delint it
|
||||
delint(sourceFile);
|
||||
>delint(sourceFile) : void
|
||||
>delint : (sourceFile: ts.SourceFile) => void
|
||||
>sourceFile : ts.SourceFile
|
||||
>delint : (sourceFile: ts.SourceFile) => void, Symbol(delint, Decl(APISample_linter.ts, 11, 33))
|
||||
>sourceFile : ts.SourceFile, Symbol(sourceFile, Decl(APISample_linter.ts, 59, 7))
|
||||
|
||||
});
|
||||
|
||||
@ -7,37 +7,38 @@
|
||||
*/
|
||||
|
||||
declare var console: any;
|
||||
>console : any
|
||||
>console : any, Symbol(console, Decl(APISample_transform.ts, 7, 11))
|
||||
|
||||
import * as ts from "typescript";
|
||||
>ts : typeof ts
|
||||
>ts : typeof ts, Symbol(ts, Decl(APISample_transform.ts, 9, 6))
|
||||
|
||||
const source = "let x: string = 'string'";
|
||||
>source : string
|
||||
>source : string, Symbol(source, Decl(APISample_transform.ts, 11, 5))
|
||||
>"let x: string = 'string'" : string
|
||||
|
||||
let result = ts.transpile(source, { module: ts.ModuleKind.CommonJS });
|
||||
>result : string
|
||||
>result : string, Symbol(result, Decl(APISample_transform.ts, 13, 3))
|
||||
>ts.transpile(source, { module: ts.ModuleKind.CommonJS }) : string
|
||||
>ts.transpile : (input: string, compilerOptions?: ts.CompilerOptions, fileName?: string, diagnostics?: ts.Diagnostic[]) => string
|
||||
>ts : typeof ts
|
||||
>transpile : (input: string, compilerOptions?: ts.CompilerOptions, fileName?: string, diagnostics?: ts.Diagnostic[]) => string
|
||||
>source : string
|
||||
>ts.transpile : (input: string, compilerOptions?: ts.CompilerOptions, fileName?: string, diagnostics?: ts.Diagnostic[]) => string, Symbol(ts.transpile, Decl(typescript.d.ts, 1756, 5))
|
||||
>ts : typeof ts, Symbol(ts, Decl(APISample_transform.ts, 9, 6))
|
||||
>transpile : (input: string, compilerOptions?: ts.CompilerOptions, fileName?: string, diagnostics?: ts.Diagnostic[]) => string, Symbol(ts.transpile, Decl(typescript.d.ts, 1756, 5))
|
||||
>source : string, Symbol(source, Decl(APISample_transform.ts, 11, 5))
|
||||
>{ module: ts.ModuleKind.CommonJS } : { [x: string]: ts.ModuleKind; module: ts.ModuleKind; }
|
||||
>module : ts.ModuleKind
|
||||
>ts.ModuleKind.CommonJS : ts.ModuleKind
|
||||
>ts.ModuleKind : typeof ts.ModuleKind
|
||||
>ts : typeof ts
|
||||
>ModuleKind : typeof ts.ModuleKind
|
||||
>CommonJS : ts.ModuleKind
|
||||
>module : ts.ModuleKind, Symbol(module, Decl(APISample_transform.ts, 13, 35))
|
||||
>ts.ModuleKind.CommonJS : ts.ModuleKind, Symbol(ts.ModuleKind.CommonJS, Decl(typescript.d.ts, 1108, 17))
|
||||
>ts.ModuleKind : typeof ts.ModuleKind, Symbol(ts.ModuleKind, Decl(typescript.d.ts, 1106, 5))
|
||||
>ts : typeof ts, Symbol(ts, Decl(APISample_transform.ts, 9, 6))
|
||||
>ModuleKind : typeof ts.ModuleKind, Symbol(ts.ModuleKind, Decl(typescript.d.ts, 1106, 5))
|
||||
>CommonJS : ts.ModuleKind, Symbol(ts.ModuleKind.CommonJS, Decl(typescript.d.ts, 1108, 17))
|
||||
|
||||
console.log(JSON.stringify(result));
|
||||
>console.log(JSON.stringify(result)) : any
|
||||
>console.log : any
|
||||
>console : any
|
||||
>console : any, Symbol(console, Decl(APISample_transform.ts, 7, 11))
|
||||
>log : any
|
||||
>JSON.stringify(result) : string
|
||||
>JSON.stringify : { (value: any): string; (value: any, replacer: (key: string, value: any) => any): string; (value: any, replacer: any[]): string; (value: any, replacer: (key: string, value: any) => any, space: any): string; (value: any, replacer: any[], space: any): string; }
|
||||
>JSON : JSON
|
||||
>stringify : { (value: any): string; (value: any, replacer: (key: string, value: any) => any): string; (value: any, replacer: any[]): string; (value: any, replacer: (key: string, value: any) => any, space: any): string; (value: any, replacer: any[], space: any): string; }
|
||||
>result : string
|
||||
>JSON.stringify : { (value: any): string; (value: any, replacer: (key: string, value: any) => any): string; (value: any, replacer: any[]): string; (value: any, replacer: (key: string, value: any) => any, space: any): string; (value: any, replacer: any[], space: any): string; }, Symbol(JSON.stringify, Decl(lib.d.ts, 964, 70), Decl(lib.d.ts, 969, 34), Decl(lib.d.ts, 975, 78), Decl(lib.d.ts, 981, 51), Decl(lib.d.ts, 988, 90))
|
||||
>JSON : JSON, Symbol(JSON, Decl(lib.d.ts, 955, 42), Decl(lib.d.ts, 1000, 11))
|
||||
>stringify : { (value: any): string; (value: any, replacer: (key: string, value: any) => any): string; (value: any, replacer: any[]): string; (value: any, replacer: (key: string, value: any) => any, space: any): string; (value: any, replacer: any[], space: any): string; }, Symbol(JSON.stringify, Decl(lib.d.ts, 964, 70), Decl(lib.d.ts, 969, 34), Decl(lib.d.ts, 975, 78), Decl(lib.d.ts, 981, 51), Decl(lib.d.ts, 988, 90))
|
||||
>result : string, Symbol(result, Decl(APISample_transform.ts, 13, 3))
|
||||
|
||||
|
||||
@ -7,197 +7,200 @@
|
||||
*/
|
||||
|
||||
declare var process: any;
|
||||
>process : any
|
||||
>process : any, Symbol(process, Decl(APISample_watcher.ts, 7, 11))
|
||||
|
||||
declare var console: any;
|
||||
>console : any
|
||||
>console : any, Symbol(console, Decl(APISample_watcher.ts, 8, 11))
|
||||
|
||||
declare var fs: any;
|
||||
>fs : any
|
||||
>fs : any, Symbol(fs, Decl(APISample_watcher.ts, 9, 11))
|
||||
|
||||
declare var path: any;
|
||||
>path : any
|
||||
>path : any, Symbol(path, Decl(APISample_watcher.ts, 10, 11))
|
||||
|
||||
import * as ts from "typescript";
|
||||
>ts : typeof ts
|
||||
>ts : typeof ts, Symbol(ts, Decl(APISample_watcher.ts, 12, 6))
|
||||
|
||||
function watch(rootFileNames: string[], options: ts.CompilerOptions) {
|
||||
>watch : (rootFileNames: string[], options: ts.CompilerOptions) => void
|
||||
>rootFileNames : string[]
|
||||
>options : ts.CompilerOptions
|
||||
>ts : unknown
|
||||
>CompilerOptions : ts.CompilerOptions
|
||||
>watch : (rootFileNames: string[], options: ts.CompilerOptions) => void, Symbol(watch, Decl(APISample_watcher.ts, 12, 33))
|
||||
>rootFileNames : string[], Symbol(rootFileNames, Decl(APISample_watcher.ts, 14, 15))
|
||||
>options : ts.CompilerOptions, Symbol(options, Decl(APISample_watcher.ts, 14, 39))
|
||||
>ts : any, Symbol(ts, Decl(APISample_watcher.ts, 12, 6))
|
||||
>CompilerOptions : ts.CompilerOptions, Symbol(ts.CompilerOptions, Decl(typescript.d.ts, 1074, 5))
|
||||
|
||||
const files: ts.Map<{ version: number }> = {};
|
||||
>files : ts.Map<{ version: number; }>
|
||||
>ts : unknown
|
||||
>Map : ts.Map<T>
|
||||
>version : number
|
||||
>files : ts.Map<{ version: number; }>, Symbol(files, Decl(APISample_watcher.ts, 15, 9))
|
||||
>ts : any, Symbol(ts, Decl(APISample_watcher.ts, 12, 6))
|
||||
>Map : ts.Map<T>, Symbol(ts.Map, Decl(typescript.d.ts, 15, 29))
|
||||
>version : number, Symbol(version, Decl(APISample_watcher.ts, 15, 25))
|
||||
>{} : { [x: string]: undefined; }
|
||||
|
||||
// initialize the list of files
|
||||
rootFileNames.forEach(fileName => {
|
||||
>rootFileNames.forEach(fileName => { files[fileName] = { version: 0 }; }) : void
|
||||
>rootFileNames.forEach : (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void
|
||||
>rootFileNames : string[]
|
||||
>forEach : (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void
|
||||
>rootFileNames.forEach : (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void, Symbol(Array.forEach, Decl(lib.d.ts, 1108, 95))
|
||||
>rootFileNames : string[], Symbol(rootFileNames, Decl(APISample_watcher.ts, 14, 15))
|
||||
>forEach : (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void, Symbol(Array.forEach, Decl(lib.d.ts, 1108, 95))
|
||||
>fileName => { files[fileName] = { version: 0 }; } : (fileName: string) => void
|
||||
>fileName : string
|
||||
>fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 18, 26))
|
||||
|
||||
files[fileName] = { version: 0 };
|
||||
>files[fileName] = { version: 0 } : { version: number; }
|
||||
>files[fileName] : { version: number; }
|
||||
>files : ts.Map<{ version: number; }>
|
||||
>fileName : string
|
||||
>files : ts.Map<{ version: number; }>, Symbol(files, Decl(APISample_watcher.ts, 15, 9))
|
||||
>fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 18, 26))
|
||||
>{ version: 0 } : { version: number; }
|
||||
>version : number
|
||||
>version : number, Symbol(version, Decl(APISample_watcher.ts, 19, 27))
|
||||
>0 : number
|
||||
|
||||
});
|
||||
|
||||
// Create the language service host to allow the LS to communicate with the host
|
||||
const servicesHost: ts.LanguageServiceHost = {
|
||||
>servicesHost : ts.LanguageServiceHost
|
||||
>ts : unknown
|
||||
>LanguageServiceHost : ts.LanguageServiceHost
|
||||
>servicesHost : ts.LanguageServiceHost, Symbol(servicesHost, Decl(APISample_watcher.ts, 23, 9))
|
||||
>ts : any, Symbol(ts, Decl(APISample_watcher.ts, 12, 6))
|
||||
>LanguageServiceHost : ts.LanguageServiceHost, Symbol(ts.LanguageServiceHost, Decl(typescript.d.ts, 1322, 5))
|
||||
>{ getScriptFileNames: () => rootFileNames, getScriptVersion: (fileName) => files[fileName] && files[fileName].version.toString(), getScriptSnapshot: (fileName) => { if (!fs.existsSync(fileName)) { return undefined; } return ts.ScriptSnapshot.fromString(fs.readFileSync(fileName).toString()); }, getCurrentDirectory: () => process.cwd(), getCompilationSettings: () => options, getDefaultLibFileName: (options) => ts.getDefaultLibFilePath(options), } : { getScriptFileNames: () => string[]; getScriptVersion: (fileName: string) => string; getScriptSnapshot: (fileName: string) => ts.IScriptSnapshot; getCurrentDirectory: () => any; getCompilationSettings: () => ts.CompilerOptions; getDefaultLibFileName: (options: ts.CompilerOptions) => string; }
|
||||
|
||||
getScriptFileNames: () => rootFileNames,
|
||||
>getScriptFileNames : () => string[]
|
||||
>getScriptFileNames : () => string[], Symbol(getScriptFileNames, Decl(APISample_watcher.ts, 23, 50))
|
||||
>() => rootFileNames : () => string[]
|
||||
>rootFileNames : string[]
|
||||
>rootFileNames : string[], Symbol(rootFileNames, Decl(APISample_watcher.ts, 14, 15))
|
||||
|
||||
getScriptVersion: (fileName) => files[fileName] && files[fileName].version.toString(),
|
||||
>getScriptVersion : (fileName: string) => string
|
||||
>getScriptVersion : (fileName: string) => string, Symbol(getScriptVersion, Decl(APISample_watcher.ts, 24, 48))
|
||||
>(fileName) => files[fileName] && files[fileName].version.toString() : (fileName: string) => string
|
||||
>fileName : string
|
||||
>fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 25, 27))
|
||||
>files[fileName] && files[fileName].version.toString() : string
|
||||
>files[fileName] : { version: number; }
|
||||
>files : ts.Map<{ version: number; }>
|
||||
>fileName : string
|
||||
>files : ts.Map<{ version: number; }>, Symbol(files, Decl(APISample_watcher.ts, 15, 9))
|
||||
>fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 25, 27))
|
||||
>files[fileName].version.toString() : string
|
||||
>files[fileName].version.toString : (radix?: number) => string
|
||||
>files[fileName].version : number
|
||||
>files[fileName].version.toString : (radix?: number) => string, Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
>files[fileName].version : number, Symbol(version, Decl(APISample_watcher.ts, 15, 25))
|
||||
>files[fileName] : { version: number; }
|
||||
>files : ts.Map<{ version: number; }>
|
||||
>fileName : string
|
||||
>version : number
|
||||
>toString : (radix?: number) => string
|
||||
>files : ts.Map<{ version: number; }>, Symbol(files, Decl(APISample_watcher.ts, 15, 9))
|
||||
>fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 25, 27))
|
||||
>version : number, Symbol(version, Decl(APISample_watcher.ts, 15, 25))
|
||||
>toString : (radix?: number) => string, Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
|
||||
getScriptSnapshot: (fileName) => {
|
||||
>getScriptSnapshot : (fileName: string) => ts.IScriptSnapshot
|
||||
>getScriptSnapshot : (fileName: string) => ts.IScriptSnapshot, Symbol(getScriptSnapshot, Decl(APISample_watcher.ts, 25, 94))
|
||||
>(fileName) => { if (!fs.existsSync(fileName)) { return undefined; } return ts.ScriptSnapshot.fromString(fs.readFileSync(fileName).toString()); } : (fileName: string) => ts.IScriptSnapshot
|
||||
>fileName : string
|
||||
>fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 26, 28))
|
||||
|
||||
if (!fs.existsSync(fileName)) {
|
||||
>!fs.existsSync(fileName) : boolean
|
||||
>fs.existsSync(fileName) : any
|
||||
>fs.existsSync : any
|
||||
>fs : any
|
||||
>fs : any, Symbol(fs, Decl(APISample_watcher.ts, 9, 11))
|
||||
>existsSync : any
|
||||
>fileName : string
|
||||
>fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 26, 28))
|
||||
|
||||
return undefined;
|
||||
>undefined : undefined
|
||||
>undefined : undefined, Symbol(undefined)
|
||||
}
|
||||
|
||||
return ts.ScriptSnapshot.fromString(fs.readFileSync(fileName).toString());
|
||||
>ts.ScriptSnapshot.fromString(fs.readFileSync(fileName).toString()) : ts.IScriptSnapshot
|
||||
>ts.ScriptSnapshot.fromString : (text: string) => ts.IScriptSnapshot
|
||||
>ts.ScriptSnapshot : typeof ts.ScriptSnapshot
|
||||
>ts : typeof ts
|
||||
>ScriptSnapshot : typeof ts.ScriptSnapshot
|
||||
>fromString : (text: string) => ts.IScriptSnapshot
|
||||
>ts.ScriptSnapshot.fromString : (text: string) => ts.IScriptSnapshot, Symbol(ts.ScriptSnapshot.fromString, Decl(typescript.d.ts, 1315, 27))
|
||||
>ts.ScriptSnapshot : typeof ts.ScriptSnapshot, Symbol(ts.ScriptSnapshot, Decl(typescript.d.ts, 1314, 5))
|
||||
>ts : typeof ts, Symbol(ts, Decl(APISample_watcher.ts, 12, 6))
|
||||
>ScriptSnapshot : typeof ts.ScriptSnapshot, Symbol(ts.ScriptSnapshot, Decl(typescript.d.ts, 1314, 5))
|
||||
>fromString : (text: string) => ts.IScriptSnapshot, Symbol(ts.ScriptSnapshot.fromString, Decl(typescript.d.ts, 1315, 27))
|
||||
>fs.readFileSync(fileName).toString() : any
|
||||
>fs.readFileSync(fileName).toString : any
|
||||
>fs.readFileSync(fileName) : any
|
||||
>fs.readFileSync : any
|
||||
>fs : any
|
||||
>fs : any, Symbol(fs, Decl(APISample_watcher.ts, 9, 11))
|
||||
>readFileSync : any
|
||||
>fileName : string
|
||||
>fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 26, 28))
|
||||
>toString : any
|
||||
|
||||
},
|
||||
getCurrentDirectory: () => process.cwd(),
|
||||
>getCurrentDirectory : () => any
|
||||
>getCurrentDirectory : () => any, Symbol(getCurrentDirectory, Decl(APISample_watcher.ts, 32, 10))
|
||||
>() => process.cwd() : () => any
|
||||
>process.cwd() : any
|
||||
>process.cwd : any
|
||||
>process : any
|
||||
>process : any, Symbol(process, Decl(APISample_watcher.ts, 7, 11))
|
||||
>cwd : any
|
||||
|
||||
getCompilationSettings: () => options,
|
||||
>getCompilationSettings : () => ts.CompilerOptions
|
||||
>getCompilationSettings : () => ts.CompilerOptions, Symbol(getCompilationSettings, Decl(APISample_watcher.ts, 33, 49))
|
||||
>() => options : () => ts.CompilerOptions
|
||||
>options : ts.CompilerOptions
|
||||
>options : ts.CompilerOptions, Symbol(options, Decl(APISample_watcher.ts, 14, 39))
|
||||
|
||||
getDefaultLibFileName: (options) => ts.getDefaultLibFilePath(options),
|
||||
>getDefaultLibFileName : (options: ts.CompilerOptions) => string
|
||||
>getDefaultLibFileName : (options: ts.CompilerOptions) => string, Symbol(getDefaultLibFileName, Decl(APISample_watcher.ts, 34, 46))
|
||||
>(options) => ts.getDefaultLibFilePath(options) : (options: ts.CompilerOptions) => string
|
||||
>options : ts.CompilerOptions
|
||||
>options : ts.CompilerOptions, Symbol(options, Decl(APISample_watcher.ts, 35, 32))
|
||||
>ts.getDefaultLibFilePath(options) : string
|
||||
>ts.getDefaultLibFilePath : (options: ts.CompilerOptions) => string
|
||||
>ts : typeof ts
|
||||
>getDefaultLibFilePath : (options: ts.CompilerOptions) => string
|
||||
>options : ts.CompilerOptions
|
||||
>ts.getDefaultLibFilePath : (options: ts.CompilerOptions) => string, Symbol(ts.getDefaultLibFilePath, Decl(typescript.d.ts, 1764, 44))
|
||||
>ts : typeof ts, Symbol(ts, Decl(APISample_watcher.ts, 12, 6))
|
||||
>getDefaultLibFilePath : (options: ts.CompilerOptions) => string, Symbol(ts.getDefaultLibFilePath, Decl(typescript.d.ts, 1764, 44))
|
||||
>options : ts.CompilerOptions, Symbol(options, Decl(APISample_watcher.ts, 35, 32))
|
||||
|
||||
};
|
||||
|
||||
// Create the language service files
|
||||
const services = ts.createLanguageService(servicesHost, ts.createDocumentRegistry())
|
||||
>services : ts.LanguageService
|
||||
>services : ts.LanguageService, Symbol(services, Decl(APISample_watcher.ts, 39, 9))
|
||||
>ts.createLanguageService(servicesHost, ts.createDocumentRegistry()) : ts.LanguageService
|
||||
>ts.createLanguageService : (host: ts.LanguageServiceHost, documentRegistry?: ts.DocumentRegistry) => ts.LanguageService
|
||||
>ts : typeof ts
|
||||
>createLanguageService : (host: ts.LanguageServiceHost, documentRegistry?: ts.DocumentRegistry) => ts.LanguageService
|
||||
>servicesHost : ts.LanguageServiceHost
|
||||
>ts.createLanguageService : (host: ts.LanguageServiceHost, documentRegistry?: ts.DocumentRegistry) => ts.LanguageService, Symbol(ts.createLanguageService, Decl(typescript.d.ts, 1762, 97))
|
||||
>ts : typeof ts, Symbol(ts, Decl(APISample_watcher.ts, 12, 6))
|
||||
>createLanguageService : (host: ts.LanguageServiceHost, documentRegistry?: ts.DocumentRegistry) => ts.LanguageService, Symbol(ts.createLanguageService, Decl(typescript.d.ts, 1762, 97))
|
||||
>servicesHost : ts.LanguageServiceHost, Symbol(servicesHost, Decl(APISample_watcher.ts, 23, 9))
|
||||
>ts.createDocumentRegistry() : ts.DocumentRegistry
|
||||
>ts.createDocumentRegistry : () => ts.DocumentRegistry
|
||||
>ts : typeof ts
|
||||
>createDocumentRegistry : () => ts.DocumentRegistry
|
||||
>ts.createDocumentRegistry : () => ts.DocumentRegistry, Symbol(ts.createDocumentRegistry, Decl(typescript.d.ts, 1760, 193))
|
||||
>ts : typeof ts, Symbol(ts, Decl(APISample_watcher.ts, 12, 6))
|
||||
>createDocumentRegistry : () => ts.DocumentRegistry, Symbol(ts.createDocumentRegistry, Decl(typescript.d.ts, 1760, 193))
|
||||
|
||||
// Now let's watch the files
|
||||
rootFileNames.forEach(fileName => {
|
||||
>rootFileNames.forEach(fileName => { // First time around, emit all files emitFile(fileName); // Add a watch on the file to handle next change fs.watchFile(fileName, { persistent: true, interval: 250 }, (curr, prev) => { // Check timestamp if (+curr.mtime <= +prev.mtime) { return; } // Update the version to signal a change in the file files[fileName].version++; // write the changes to disk emitFile(fileName); }); }) : void
|
||||
>rootFileNames.forEach : (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void
|
||||
>rootFileNames : string[]
|
||||
>forEach : (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void
|
||||
>rootFileNames.forEach : (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void, Symbol(Array.forEach, Decl(lib.d.ts, 1108, 95))
|
||||
>rootFileNames : string[], Symbol(rootFileNames, Decl(APISample_watcher.ts, 14, 15))
|
||||
>forEach : (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void, Symbol(Array.forEach, Decl(lib.d.ts, 1108, 95))
|
||||
>fileName => { // First time around, emit all files emitFile(fileName); // Add a watch on the file to handle next change fs.watchFile(fileName, { persistent: true, interval: 250 }, (curr, prev) => { // Check timestamp if (+curr.mtime <= +prev.mtime) { return; } // Update the version to signal a change in the file files[fileName].version++; // write the changes to disk emitFile(fileName); }); } : (fileName: string) => void
|
||||
>fileName : string
|
||||
>fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 42, 26))
|
||||
|
||||
// First time around, emit all files
|
||||
emitFile(fileName);
|
||||
>emitFile(fileName) : void
|
||||
>emitFile : (fileName: string) => void
|
||||
>fileName : string
|
||||
>emitFile : (fileName: string) => void, Symbol(emitFile, Decl(APISample_watcher.ts, 61, 7))
|
||||
>fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 42, 26))
|
||||
|
||||
// Add a watch on the file to handle next change
|
||||
fs.watchFile(fileName,
|
||||
>fs.watchFile(fileName, { persistent: true, interval: 250 }, (curr, prev) => { // Check timestamp if (+curr.mtime <= +prev.mtime) { return; } // Update the version to signal a change in the file files[fileName].version++; // write the changes to disk emitFile(fileName); }) : any
|
||||
>fs.watchFile : any
|
||||
>fs : any
|
||||
>fs : any, Symbol(fs, Decl(APISample_watcher.ts, 9, 11))
|
||||
>watchFile : any
|
||||
>fileName : string
|
||||
>fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 42, 26))
|
||||
|
||||
{ persistent: true, interval: 250 },
|
||||
>{ persistent: true, interval: 250 } : { persistent: boolean; interval: number; }
|
||||
>persistent : boolean
|
||||
>interval : number
|
||||
>persistent : boolean, Symbol(persistent, Decl(APISample_watcher.ts, 48, 13))
|
||||
>true : boolean
|
||||
>interval : number, Symbol(interval, Decl(APISample_watcher.ts, 48, 31))
|
||||
>250 : number
|
||||
|
||||
(curr, prev) => {
|
||||
>(curr, prev) => { // Check timestamp if (+curr.mtime <= +prev.mtime) { return; } // Update the version to signal a change in the file files[fileName].version++; // write the changes to disk emitFile(fileName); } : (curr: any, prev: any) => void
|
||||
>curr : any
|
||||
>prev : any
|
||||
>curr : any, Symbol(curr, Decl(APISample_watcher.ts, 49, 13))
|
||||
>prev : any, Symbol(prev, Decl(APISample_watcher.ts, 49, 18))
|
||||
|
||||
// Check timestamp
|
||||
if (+curr.mtime <= +prev.mtime) {
|
||||
>+curr.mtime <= +prev.mtime : boolean
|
||||
>+curr.mtime : number
|
||||
>curr.mtime : any
|
||||
>curr : any
|
||||
>curr : any, Symbol(curr, Decl(APISample_watcher.ts, 49, 13))
|
||||
>mtime : any
|
||||
>+prev.mtime : number
|
||||
>prev.mtime : any
|
||||
>prev : any
|
||||
>prev : any, Symbol(prev, Decl(APISample_watcher.ts, 49, 18))
|
||||
>mtime : any
|
||||
|
||||
return;
|
||||
@ -206,175 +209,183 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) {
|
||||
// Update the version to signal a change in the file
|
||||
files[fileName].version++;
|
||||
>files[fileName].version++ : number
|
||||
>files[fileName].version : number
|
||||
>files[fileName].version : number, Symbol(version, Decl(APISample_watcher.ts, 15, 25))
|
||||
>files[fileName] : { version: number; }
|
||||
>files : ts.Map<{ version: number; }>
|
||||
>fileName : string
|
||||
>version : number
|
||||
>files : ts.Map<{ version: number; }>, Symbol(files, Decl(APISample_watcher.ts, 15, 9))
|
||||
>fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 42, 26))
|
||||
>version : number, Symbol(version, Decl(APISample_watcher.ts, 15, 25))
|
||||
|
||||
// write the changes to disk
|
||||
emitFile(fileName);
|
||||
>emitFile(fileName) : void
|
||||
>emitFile : (fileName: string) => void
|
||||
>fileName : string
|
||||
>emitFile : (fileName: string) => void, Symbol(emitFile, Decl(APISample_watcher.ts, 61, 7))
|
||||
>fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 42, 26))
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
function emitFile(fileName: string) {
|
||||
>emitFile : (fileName: string) => void
|
||||
>fileName : string
|
||||
>emitFile : (fileName: string) => void, Symbol(emitFile, Decl(APISample_watcher.ts, 61, 7))
|
||||
>fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 63, 22))
|
||||
|
||||
let output = services.getEmitOutput(fileName);
|
||||
>output : ts.EmitOutput
|
||||
>output : ts.EmitOutput, Symbol(output, Decl(APISample_watcher.ts, 64, 11))
|
||||
>services.getEmitOutput(fileName) : ts.EmitOutput
|
||||
>services.getEmitOutput : (fileName: string) => ts.EmitOutput
|
||||
>services : ts.LanguageService
|
||||
>getEmitOutput : (fileName: string) => ts.EmitOutput
|
||||
>fileName : string
|
||||
>services.getEmitOutput : (fileName: string) => ts.EmitOutput, Symbol(ts.LanguageService.getEmitOutput, Decl(typescript.d.ts, 1366, 132))
|
||||
>services : ts.LanguageService, Symbol(services, Decl(APISample_watcher.ts, 39, 9))
|
||||
>getEmitOutput : (fileName: string) => ts.EmitOutput, Symbol(ts.LanguageService.getEmitOutput, Decl(typescript.d.ts, 1366, 132))
|
||||
>fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 63, 22))
|
||||
|
||||
if (!output.emitSkipped) {
|
||||
>!output.emitSkipped : boolean
|
||||
>output.emitSkipped : boolean
|
||||
>output : ts.EmitOutput
|
||||
>emitSkipped : boolean
|
||||
>output.emitSkipped : boolean, Symbol(ts.EmitOutput.emitSkipped, Decl(typescript.d.ts, 1569, 34))
|
||||
>output : ts.EmitOutput, Symbol(output, Decl(APISample_watcher.ts, 64, 11))
|
||||
>emitSkipped : boolean, Symbol(ts.EmitOutput.emitSkipped, Decl(typescript.d.ts, 1569, 34))
|
||||
|
||||
console.log(`Emitting ${fileName}`);
|
||||
>console.log(`Emitting ${fileName}`) : any
|
||||
>console.log : any
|
||||
>console : any
|
||||
>console : any, Symbol(console, Decl(APISample_watcher.ts, 8, 11))
|
||||
>log : any
|
||||
>fileName : string
|
||||
>`Emitting ${fileName}` : string
|
||||
>fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 63, 22))
|
||||
}
|
||||
else {
|
||||
console.log(`Emitting ${fileName} failed`);
|
||||
>console.log(`Emitting ${fileName} failed`) : any
|
||||
>console.log : any
|
||||
>console : any
|
||||
>console : any, Symbol(console, Decl(APISample_watcher.ts, 8, 11))
|
||||
>log : any
|
||||
>fileName : string
|
||||
>`Emitting ${fileName} failed` : string
|
||||
>fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 63, 22))
|
||||
|
||||
logErrors(fileName);
|
||||
>logErrors(fileName) : void
|
||||
>logErrors : (fileName: string) => void
|
||||
>fileName : string
|
||||
>logErrors : (fileName: string) => void, Symbol(logErrors, Decl(APISample_watcher.ts, 77, 5))
|
||||
>fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 63, 22))
|
||||
}
|
||||
|
||||
output.outputFiles.forEach(o => {
|
||||
>output.outputFiles.forEach(o => { fs.writeFileSync(o.name, o.text, "utf8"); }) : void
|
||||
>output.outputFiles.forEach : (callbackfn: (value: ts.OutputFile, index: number, array: ts.OutputFile[]) => void, thisArg?: any) => void
|
||||
>output.outputFiles : ts.OutputFile[]
|
||||
>output : ts.EmitOutput
|
||||
>outputFiles : ts.OutputFile[]
|
||||
>forEach : (callbackfn: (value: ts.OutputFile, index: number, array: ts.OutputFile[]) => void, thisArg?: any) => void
|
||||
>output.outputFiles.forEach : (callbackfn: (value: ts.OutputFile, index: number, array: ts.OutputFile[]) => void, thisArg?: any) => void, Symbol(Array.forEach, Decl(lib.d.ts, 1108, 95))
|
||||
>output.outputFiles : ts.OutputFile[], Symbol(ts.EmitOutput.outputFiles, Decl(typescript.d.ts, 1568, 26))
|
||||
>output : ts.EmitOutput, Symbol(output, Decl(APISample_watcher.ts, 64, 11))
|
||||
>outputFiles : ts.OutputFile[], Symbol(ts.EmitOutput.outputFiles, Decl(typescript.d.ts, 1568, 26))
|
||||
>forEach : (callbackfn: (value: ts.OutputFile, index: number, array: ts.OutputFile[]) => void, thisArg?: any) => void, Symbol(Array.forEach, Decl(lib.d.ts, 1108, 95))
|
||||
>o => { fs.writeFileSync(o.name, o.text, "utf8"); } : (o: ts.OutputFile) => void
|
||||
>o : ts.OutputFile
|
||||
>o : ts.OutputFile, Symbol(o, Decl(APISample_watcher.ts, 74, 35))
|
||||
|
||||
fs.writeFileSync(o.name, o.text, "utf8");
|
||||
>fs.writeFileSync(o.name, o.text, "utf8") : any
|
||||
>fs.writeFileSync : any
|
||||
>fs : any
|
||||
>fs : any, Symbol(fs, Decl(APISample_watcher.ts, 9, 11))
|
||||
>writeFileSync : any
|
||||
>o.name : string
|
||||
>o : ts.OutputFile
|
||||
>name : string
|
||||
>o.text : string
|
||||
>o : ts.OutputFile
|
||||
>text : string
|
||||
>o.name : string, Symbol(ts.OutputFile.name, Decl(typescript.d.ts, 1577, 26))
|
||||
>o : ts.OutputFile, Symbol(o, Decl(APISample_watcher.ts, 74, 35))
|
||||
>name : string, Symbol(ts.OutputFile.name, Decl(typescript.d.ts, 1577, 26))
|
||||
>o.text : string, Symbol(ts.OutputFile.text, Decl(typescript.d.ts, 1579, 36))
|
||||
>o : ts.OutputFile, Symbol(o, Decl(APISample_watcher.ts, 74, 35))
|
||||
>text : string, Symbol(ts.OutputFile.text, Decl(typescript.d.ts, 1579, 36))
|
||||
>"utf8" : string
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function logErrors(fileName: string) {
|
||||
>logErrors : (fileName: string) => void
|
||||
>fileName : string
|
||||
>logErrors : (fileName: string) => void, Symbol(logErrors, Decl(APISample_watcher.ts, 77, 5))
|
||||
>fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 79, 23))
|
||||
|
||||
let allDiagnostics = services.getCompilerOptionsDiagnostics()
|
||||
>allDiagnostics : ts.Diagnostic[]
|
||||
>allDiagnostics : ts.Diagnostic[], Symbol(allDiagnostics, Decl(APISample_watcher.ts, 80, 11))
|
||||
>services.getCompilerOptionsDiagnostics() .concat(services.getSyntacticDiagnostics(fileName)) .concat(services.getSemanticDiagnostics(fileName)) : ts.Diagnostic[]
|
||||
>services.getCompilerOptionsDiagnostics() .concat(services.getSyntacticDiagnostics(fileName)) .concat : { <U extends ts.Diagnostic[]>(...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; }
|
||||
>services.getCompilerOptionsDiagnostics() .concat(services.getSyntacticDiagnostics(fileName)) .concat : { <U extends ts.Diagnostic[]>(...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; }, Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46))
|
||||
>services.getCompilerOptionsDiagnostics() .concat(services.getSyntacticDiagnostics(fileName)) : ts.Diagnostic[]
|
||||
>services.getCompilerOptionsDiagnostics() .concat : { <U extends ts.Diagnostic[]>(...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; }
|
||||
>services.getCompilerOptionsDiagnostics() .concat : { <U extends ts.Diagnostic[]>(...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; }, Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46))
|
||||
>services.getCompilerOptionsDiagnostics() : ts.Diagnostic[]
|
||||
>services.getCompilerOptionsDiagnostics : () => ts.Diagnostic[]
|
||||
>services : ts.LanguageService
|
||||
>getCompilerOptionsDiagnostics : () => ts.Diagnostic[]
|
||||
>services.getCompilerOptionsDiagnostics : () => ts.Diagnostic[], Symbol(ts.LanguageService.getCompilerOptionsDiagnostics, Decl(typescript.d.ts, 1340, 63))
|
||||
>services : ts.LanguageService, Symbol(services, Decl(APISample_watcher.ts, 39, 9))
|
||||
>getCompilerOptionsDiagnostics : () => ts.Diagnostic[], Symbol(ts.LanguageService.getCompilerOptionsDiagnostics, Decl(typescript.d.ts, 1340, 63))
|
||||
|
||||
.concat(services.getSyntacticDiagnostics(fileName))
|
||||
>concat : { <U extends ts.Diagnostic[]>(...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; }
|
||||
>concat : { <U extends ts.Diagnostic[]>(...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; }, Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46))
|
||||
>services.getSyntacticDiagnostics(fileName) : ts.Diagnostic[]
|
||||
>services.getSyntacticDiagnostics : (fileName: string) => ts.Diagnostic[]
|
||||
>services : ts.LanguageService
|
||||
>getSyntacticDiagnostics : (fileName: string) => ts.Diagnostic[]
|
||||
>fileName : string
|
||||
>services.getSyntacticDiagnostics : (fileName: string) => ts.Diagnostic[], Symbol(ts.LanguageService.getSyntacticDiagnostics, Decl(typescript.d.ts, 1338, 37))
|
||||
>services : ts.LanguageService, Symbol(services, Decl(APISample_watcher.ts, 39, 9))
|
||||
>getSyntacticDiagnostics : (fileName: string) => ts.Diagnostic[], Symbol(ts.LanguageService.getSyntacticDiagnostics, Decl(typescript.d.ts, 1338, 37))
|
||||
>fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 79, 23))
|
||||
|
||||
.concat(services.getSemanticDiagnostics(fileName));
|
||||
>concat : { <U extends ts.Diagnostic[]>(...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; }
|
||||
>concat : { <U extends ts.Diagnostic[]>(...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; }, Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46))
|
||||
>services.getSemanticDiagnostics(fileName) : ts.Diagnostic[]
|
||||
>services.getSemanticDiagnostics : (fileName: string) => ts.Diagnostic[]
|
||||
>services : ts.LanguageService
|
||||
>getSemanticDiagnostics : (fileName: string) => ts.Diagnostic[]
|
||||
>fileName : string
|
||||
>services.getSemanticDiagnostics : (fileName: string) => ts.Diagnostic[], Symbol(ts.LanguageService.getSemanticDiagnostics, Decl(typescript.d.ts, 1339, 64))
|
||||
>services : ts.LanguageService, Symbol(services, Decl(APISample_watcher.ts, 39, 9))
|
||||
>getSemanticDiagnostics : (fileName: string) => ts.Diagnostic[], Symbol(ts.LanguageService.getSemanticDiagnostics, Decl(typescript.d.ts, 1339, 64))
|
||||
>fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 79, 23))
|
||||
|
||||
allDiagnostics.forEach(diagnostic => {
|
||||
>allDiagnostics.forEach(diagnostic => { let message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n"); if (diagnostic.file) { let { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); console.log(` Error ${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); } else { console.log(` Error: ${message}`); } }) : void
|
||||
>allDiagnostics.forEach : (callbackfn: (value: ts.Diagnostic, index: number, array: ts.Diagnostic[]) => void, thisArg?: any) => void
|
||||
>allDiagnostics : ts.Diagnostic[]
|
||||
>forEach : (callbackfn: (value: ts.Diagnostic, index: number, array: ts.Diagnostic[]) => void, thisArg?: any) => void
|
||||
>allDiagnostics.forEach : (callbackfn: (value: ts.Diagnostic, index: number, array: ts.Diagnostic[]) => void, thisArg?: any) => void, Symbol(Array.forEach, Decl(lib.d.ts, 1108, 95))
|
||||
>allDiagnostics : ts.Diagnostic[], Symbol(allDiagnostics, Decl(APISample_watcher.ts, 80, 11))
|
||||
>forEach : (callbackfn: (value: ts.Diagnostic, index: number, array: ts.Diagnostic[]) => void, thisArg?: any) => void, Symbol(Array.forEach, Decl(lib.d.ts, 1108, 95))
|
||||
>diagnostic => { let message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n"); if (diagnostic.file) { let { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); console.log(` Error ${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); } else { console.log(` Error: ${message}`); } } : (diagnostic: ts.Diagnostic) => void
|
||||
>diagnostic : ts.Diagnostic
|
||||
>diagnostic : ts.Diagnostic, Symbol(diagnostic, Decl(APISample_watcher.ts, 84, 31))
|
||||
|
||||
let message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n");
|
||||
>message : string
|
||||
>message : string, Symbol(message, Decl(APISample_watcher.ts, 85, 15))
|
||||
>ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n") : string
|
||||
>ts.flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string
|
||||
>ts : typeof ts
|
||||
>flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string
|
||||
>diagnostic.messageText : string | ts.DiagnosticMessageChain
|
||||
>diagnostic : ts.Diagnostic
|
||||
>messageText : string | ts.DiagnosticMessageChain
|
||||
>ts.flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string, Symbol(ts.flattenDiagnosticMessageText, Decl(typescript.d.ts, 1228, 67))
|
||||
>ts : typeof ts, Symbol(ts, Decl(APISample_watcher.ts, 12, 6))
|
||||
>flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string, Symbol(ts.flattenDiagnosticMessageText, Decl(typescript.d.ts, 1228, 67))
|
||||
>diagnostic.messageText : string | ts.DiagnosticMessageChain, Symbol(ts.Diagnostic.messageText, Decl(typescript.d.ts, 1065, 23))
|
||||
>diagnostic : ts.Diagnostic, Symbol(diagnostic, Decl(APISample_watcher.ts, 84, 31))
|
||||
>messageText : string | ts.DiagnosticMessageChain, Symbol(ts.Diagnostic.messageText, Decl(typescript.d.ts, 1065, 23))
|
||||
>"\n" : string
|
||||
|
||||
if (diagnostic.file) {
|
||||
>diagnostic.file : ts.SourceFile
|
||||
>diagnostic : ts.Diagnostic
|
||||
>file : ts.SourceFile
|
||||
>diagnostic.file : ts.SourceFile, Symbol(ts.Diagnostic.file, Decl(typescript.d.ts, 1062, 26))
|
||||
>diagnostic : ts.Diagnostic, Symbol(diagnostic, Decl(APISample_watcher.ts, 84, 31))
|
||||
>file : ts.SourceFile, Symbol(ts.Diagnostic.file, Decl(typescript.d.ts, 1062, 26))
|
||||
|
||||
let { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);
|
||||
>line : number
|
||||
>character : number
|
||||
>line : number, Symbol(line, Decl(APISample_watcher.ts, 87, 21))
|
||||
>character : number, Symbol(character, Decl(APISample_watcher.ts, 87, 27))
|
||||
>diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start) : ts.LineAndCharacter
|
||||
>diagnostic.file.getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter
|
||||
>diagnostic.file : ts.SourceFile
|
||||
>diagnostic : ts.Diagnostic
|
||||
>file : ts.SourceFile
|
||||
>getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter
|
||||
>diagnostic.start : number
|
||||
>diagnostic : ts.Diagnostic
|
||||
>start : number
|
||||
>diagnostic.file.getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter, Symbol(ts.SourceFile.getLineAndCharacterOfPosition, Decl(typescript.d.ts, 1290, 26))
|
||||
>diagnostic.file : ts.SourceFile, Symbol(ts.Diagnostic.file, Decl(typescript.d.ts, 1062, 26))
|
||||
>diagnostic : ts.Diagnostic, Symbol(diagnostic, Decl(APISample_watcher.ts, 84, 31))
|
||||
>file : ts.SourceFile, Symbol(ts.Diagnostic.file, Decl(typescript.d.ts, 1062, 26))
|
||||
>getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter, Symbol(ts.SourceFile.getLineAndCharacterOfPosition, Decl(typescript.d.ts, 1290, 26))
|
||||
>diagnostic.start : number, Symbol(ts.Diagnostic.start, Decl(typescript.d.ts, 1063, 25))
|
||||
>diagnostic : ts.Diagnostic, Symbol(diagnostic, Decl(APISample_watcher.ts, 84, 31))
|
||||
>start : number, Symbol(ts.Diagnostic.start, Decl(typescript.d.ts, 1063, 25))
|
||||
|
||||
console.log(` Error ${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`);
|
||||
>console.log(` Error ${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`) : any
|
||||
>console.log : any
|
||||
>console : any
|
||||
>console : any, Symbol(console, Decl(APISample_watcher.ts, 8, 11))
|
||||
>log : any
|
||||
>diagnostic.file.fileName : string
|
||||
>diagnostic.file : ts.SourceFile
|
||||
>diagnostic : ts.Diagnostic
|
||||
>file : ts.SourceFile
|
||||
>fileName : string
|
||||
>` Error ${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}` : string
|
||||
>diagnostic.file.fileName : string, Symbol(ts.SourceFile.fileName, Decl(typescript.d.ts, 743, 29))
|
||||
>diagnostic.file : ts.SourceFile, Symbol(ts.Diagnostic.file, Decl(typescript.d.ts, 1062, 26))
|
||||
>diagnostic : ts.Diagnostic, Symbol(diagnostic, Decl(APISample_watcher.ts, 84, 31))
|
||||
>file : ts.SourceFile, Symbol(ts.Diagnostic.file, Decl(typescript.d.ts, 1062, 26))
|
||||
>fileName : string, Symbol(ts.SourceFile.fileName, Decl(typescript.d.ts, 743, 29))
|
||||
>line + 1 : number
|
||||
>line : number
|
||||
>line : number, Symbol(line, Decl(APISample_watcher.ts, 87, 21))
|
||||
>1 : number
|
||||
>character + 1 : number
|
||||
>character : number
|
||||
>message : string
|
||||
>character : number, Symbol(character, Decl(APISample_watcher.ts, 87, 27))
|
||||
>1 : number
|
||||
>message : string, Symbol(message, Decl(APISample_watcher.ts, 85, 15))
|
||||
}
|
||||
else {
|
||||
console.log(` Error: ${message}`);
|
||||
>console.log(` Error: ${message}`) : any
|
||||
>console.log : any
|
||||
>console : any
|
||||
>console : any, Symbol(console, Decl(APISample_watcher.ts, 8, 11))
|
||||
>log : any
|
||||
>message : string
|
||||
>` Error: ${message}` : string
|
||||
>message : string, Symbol(message, Decl(APISample_watcher.ts, 85, 15))
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -382,47 +393,51 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) {
|
||||
|
||||
// Initialize files constituting the program as all .ts files in the current directory
|
||||
const currentDirectoryFiles = fs.readdirSync(process.cwd()).
|
||||
>currentDirectoryFiles : any
|
||||
>currentDirectoryFiles : any, Symbol(currentDirectoryFiles, Decl(APISample_watcher.ts, 98, 5))
|
||||
>fs.readdirSync(process.cwd()). filter(fileName=> fileName.length >= 3 && fileName.substr(fileName.length - 3, 3) === ".ts") : any
|
||||
>fs.readdirSync(process.cwd()). filter : any
|
||||
>fs.readdirSync(process.cwd()) : any
|
||||
>fs.readdirSync : any
|
||||
>fs : any
|
||||
>fs : any, Symbol(fs, Decl(APISample_watcher.ts, 9, 11))
|
||||
>readdirSync : any
|
||||
>process.cwd() : any
|
||||
>process.cwd : any
|
||||
>process : any
|
||||
>process : any, Symbol(process, Decl(APISample_watcher.ts, 7, 11))
|
||||
>cwd : any
|
||||
|
||||
filter(fileName=> fileName.length >= 3 && fileName.substr(fileName.length - 3, 3) === ".ts");
|
||||
>filter : any
|
||||
>fileName=> fileName.length >= 3 && fileName.substr(fileName.length - 3, 3) === ".ts" : (fileName: any) => boolean
|
||||
>fileName : any
|
||||
>fileName : any, Symbol(fileName, Decl(APISample_watcher.ts, 99, 11))
|
||||
>fileName.length >= 3 && fileName.substr(fileName.length - 3, 3) === ".ts" : boolean
|
||||
>fileName.length >= 3 : boolean
|
||||
>fileName.length : any
|
||||
>fileName : any
|
||||
>fileName : any, Symbol(fileName, Decl(APISample_watcher.ts, 99, 11))
|
||||
>length : any
|
||||
>3 : number
|
||||
>fileName.substr(fileName.length - 3, 3) === ".ts" : boolean
|
||||
>fileName.substr(fileName.length - 3, 3) : any
|
||||
>fileName.substr : any
|
||||
>fileName : any
|
||||
>fileName : any, Symbol(fileName, Decl(APISample_watcher.ts, 99, 11))
|
||||
>substr : any
|
||||
>fileName.length - 3 : number
|
||||
>fileName.length : any
|
||||
>fileName : any
|
||||
>fileName : any, Symbol(fileName, Decl(APISample_watcher.ts, 99, 11))
|
||||
>length : any
|
||||
>3 : number
|
||||
>3 : number
|
||||
>".ts" : string
|
||||
|
||||
// Start the watcher
|
||||
watch(currentDirectoryFiles, { module: ts.ModuleKind.CommonJS });
|
||||
>watch(currentDirectoryFiles, { module: ts.ModuleKind.CommonJS }) : void
|
||||
>watch : (rootFileNames: string[], options: ts.CompilerOptions) => void
|
||||
>currentDirectoryFiles : any
|
||||
>watch : (rootFileNames: string[], options: ts.CompilerOptions) => void, Symbol(watch, Decl(APISample_watcher.ts, 12, 33))
|
||||
>currentDirectoryFiles : any, Symbol(currentDirectoryFiles, Decl(APISample_watcher.ts, 98, 5))
|
||||
>{ module: ts.ModuleKind.CommonJS } : { [x: string]: ts.ModuleKind; module: ts.ModuleKind; }
|
||||
>module : ts.ModuleKind
|
||||
>ts.ModuleKind.CommonJS : ts.ModuleKind
|
||||
>ts.ModuleKind : typeof ts.ModuleKind
|
||||
>ts : typeof ts
|
||||
>ModuleKind : typeof ts.ModuleKind
|
||||
>CommonJS : ts.ModuleKind
|
||||
>module : ts.ModuleKind, Symbol(module, Decl(APISample_watcher.ts, 102, 30))
|
||||
>ts.ModuleKind.CommonJS : ts.ModuleKind, Symbol(ts.ModuleKind.CommonJS, Decl(typescript.d.ts, 1108, 17))
|
||||
>ts.ModuleKind : typeof ts.ModuleKind, Symbol(ts.ModuleKind, Decl(typescript.d.ts, 1106, 5))
|
||||
>ts : typeof ts, Symbol(ts, Decl(APISample_watcher.ts, 12, 6))
|
||||
>ModuleKind : typeof ts.ModuleKind, Symbol(ts.ModuleKind, Decl(typescript.d.ts, 1106, 5))
|
||||
>CommonJS : ts.ModuleKind, Symbol(ts.ModuleKind.CommonJS, Decl(typescript.d.ts, 1108, 17))
|
||||
|
||||
|
||||
@ -1,33 +1,33 @@
|
||||
=== tests/cases/conformance/internalModules/DeclarationMerging/module.d.ts ===
|
||||
declare module Point {
|
||||
>Point : typeof Point
|
||||
>Point : typeof Point, Symbol(Point, Decl(module.d.ts, 0, 0), Decl(function.d.ts, 0, 0))
|
||||
|
||||
export var Origin: { x: number; y: number; }
|
||||
>Origin : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>Origin : { x: number; y: number; }, Symbol(Origin, Decl(module.d.ts, 1, 14))
|
||||
>x : number, Symbol(x, Decl(module.d.ts, 1, 24))
|
||||
>y : number, Symbol(y, Decl(module.d.ts, 1, 35))
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/internalModules/DeclarationMerging/function.d.ts ===
|
||||
declare function Point(): { x: number; y: number; }
|
||||
>Point : typeof Point
|
||||
>x : number
|
||||
>y : number
|
||||
>Point : typeof Point, Symbol(Point, Decl(module.d.ts, 0, 0), Decl(function.d.ts, 0, 0))
|
||||
>x : number, Symbol(x, Decl(function.d.ts, 0, 27))
|
||||
>y : number, Symbol(y, Decl(function.d.ts, 0, 38))
|
||||
|
||||
=== tests/cases/conformance/internalModules/DeclarationMerging/test.ts ===
|
||||
var cl: { x: number; y: number; }
|
||||
>cl : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>cl : { x: number; y: number; }, Symbol(cl, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
|
||||
>x : number, Symbol(x, Decl(test.ts, 0, 9))
|
||||
>y : number, Symbol(y, Decl(test.ts, 0, 20))
|
||||
|
||||
var cl = Point();
|
||||
>cl : { x: number; y: number; }
|
||||
>cl : { x: number; y: number; }, Symbol(cl, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
|
||||
>Point() : { x: number; y: number; }
|
||||
>Point : typeof Point
|
||||
>Point : typeof Point, Symbol(Point, Decl(module.d.ts, 0, 0), Decl(function.d.ts, 0, 0))
|
||||
|
||||
var cl = Point.Origin;
|
||||
>cl : { x: number; y: number; }
|
||||
>Point.Origin : { x: number; y: number; }
|
||||
>Point : typeof Point
|
||||
>Origin : { x: number; y: number; }
|
||||
>cl : { x: number; y: number; }, Symbol(cl, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
|
||||
>Point.Origin : { x: number; y: number; }, Symbol(Point.Origin, Decl(module.d.ts, 1, 14))
|
||||
>Point : typeof Point, Symbol(Point, Decl(module.d.ts, 0, 0), Decl(function.d.ts, 0, 0))
|
||||
>Origin : { x: number; y: number; }, Symbol(Point.Origin, Decl(module.d.ts, 1, 14))
|
||||
|
||||
|
||||
@ -1,59 +1,61 @@
|
||||
=== tests/cases/conformance/internalModules/DeclarationMerging/module.d.ts ===
|
||||
declare module A {
|
||||
>A : typeof A
|
||||
>A : typeof A, Symbol(A, Decl(module.d.ts, 0, 0), Decl(class.d.ts, 0, 0))
|
||||
|
||||
export module Point {
|
||||
>Point : typeof Point
|
||||
>Point : typeof Point, Symbol(Point, Decl(module.d.ts, 0, 18), Decl(class.d.ts, 0, 18))
|
||||
|
||||
export var Origin: {
|
||||
>Origin : { x: number; y: number; }
|
||||
>Origin : { x: number; y: number; }, Symbol(Origin, Decl(module.d.ts, 2, 18))
|
||||
|
||||
x: number;
|
||||
>x : number
|
||||
>x : number, Symbol(x, Decl(module.d.ts, 2, 28))
|
||||
|
||||
y: number;
|
||||
>y : number
|
||||
>y : number, Symbol(y, Decl(module.d.ts, 3, 22))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/internalModules/DeclarationMerging/class.d.ts ===
|
||||
declare module A {
|
||||
>A : typeof A
|
||||
>A : typeof A, Symbol(A, Decl(module.d.ts, 0, 0), Decl(class.d.ts, 0, 0))
|
||||
|
||||
export class Point {
|
||||
>Point : Point
|
||||
>Point : Point, Symbol(Point, Decl(module.d.ts, 0, 18), Decl(class.d.ts, 0, 18))
|
||||
|
||||
constructor(x: number, y: number);
|
||||
>x : number
|
||||
>y : number
|
||||
>x : number, Symbol(x, Decl(class.d.ts, 2, 20))
|
||||
>y : number, Symbol(y, Decl(class.d.ts, 2, 30))
|
||||
|
||||
x: number;
|
||||
>x : number
|
||||
>x : number, Symbol(x, Decl(class.d.ts, 2, 42))
|
||||
|
||||
y: number;
|
||||
>y : number
|
||||
>y : number, Symbol(y, Decl(class.d.ts, 3, 18))
|
||||
}
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/internalModules/DeclarationMerging/test.ts ===
|
||||
var p: { x: number; y: number; }
|
||||
>p : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>p : { x: number; y: number; }, Symbol(p, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
|
||||
>x : number, Symbol(x, Decl(test.ts, 0, 8))
|
||||
>y : number, Symbol(y, Decl(test.ts, 0, 19))
|
||||
|
||||
var p = A.Point.Origin;
|
||||
>p : { x: number; y: number; }
|
||||
>A.Point.Origin : { x: number; y: number; }
|
||||
>A.Point : typeof A.Point
|
||||
>A : typeof A
|
||||
>Point : typeof A.Point
|
||||
>Origin : { x: number; y: number; }
|
||||
>p : { x: number; y: number; }, Symbol(p, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
|
||||
>A.Point.Origin : { x: number; y: number; }, Symbol(A.Point.Origin, Decl(module.d.ts, 2, 18))
|
||||
>A.Point : typeof A.Point, Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(class.d.ts, 0, 18))
|
||||
>A : typeof A, Symbol(A, Decl(module.d.ts, 0, 0), Decl(class.d.ts, 0, 0))
|
||||
>Point : typeof A.Point, Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(class.d.ts, 0, 18))
|
||||
>Origin : { x: number; y: number; }, Symbol(A.Point.Origin, Decl(module.d.ts, 2, 18))
|
||||
|
||||
var p = new A.Point(0, 0); // unexpected error here, bug 840000
|
||||
>p : { x: number; y: number; }
|
||||
>p : { x: number; y: number; }, Symbol(p, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
|
||||
>new A.Point(0, 0) : A.Point
|
||||
>A.Point : typeof A.Point
|
||||
>A : typeof A
|
||||
>Point : typeof A.Point
|
||||
>A.Point : typeof A.Point, Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(class.d.ts, 0, 18))
|
||||
>A : typeof A, Symbol(A, Decl(module.d.ts, 0, 0), Decl(class.d.ts, 0, 0))
|
||||
>Point : typeof A.Point, Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(class.d.ts, 0, 18))
|
||||
>0 : number
|
||||
>0 : number
|
||||
|
||||
|
||||
@ -1,53 +1,55 @@
|
||||
=== tests/cases/conformance/internalModules/DeclarationMerging/module.d.ts ===
|
||||
declare module A {
|
||||
>A : typeof A
|
||||
>A : typeof A, Symbol(A, Decl(module.d.ts, 0, 0), Decl(classPoint.ts, 0, 0))
|
||||
|
||||
export module Point {
|
||||
>Point : typeof Point
|
||||
>Point : typeof Point, Symbol(Point, Decl(module.d.ts, 0, 18), Decl(classPoint.ts, 0, 10))
|
||||
|
||||
export var Origin: {
|
||||
>Origin : { x: number; y: number; }
|
||||
>Origin : { x: number; y: number; }, Symbol(Origin, Decl(module.d.ts, 2, 18))
|
||||
|
||||
x: number;
|
||||
>x : number
|
||||
>x : number, Symbol(x, Decl(module.d.ts, 2, 28))
|
||||
|
||||
y: number;
|
||||
>y : number
|
||||
>y : number, Symbol(y, Decl(module.d.ts, 3, 22))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/internalModules/DeclarationMerging/classPoint.ts ===
|
||||
module A {
|
||||
>A : typeof A
|
||||
>A : typeof A, Symbol(A, Decl(module.d.ts, 0, 0), Decl(classPoint.ts, 0, 0))
|
||||
|
||||
export class Point {
|
||||
>Point : Point
|
||||
>Point : Point, Symbol(Point, Decl(module.d.ts, 0, 18), Decl(classPoint.ts, 0, 10))
|
||||
|
||||
constructor(public x: number, public y: number) { }
|
||||
>x : number
|
||||
>y : number
|
||||
>x : number, Symbol(x, Decl(classPoint.ts, 2, 20))
|
||||
>y : number, Symbol(y, Decl(classPoint.ts, 2, 37))
|
||||
}
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/internalModules/DeclarationMerging/test.ts ===
|
||||
var p: { x: number; y: number; }
|
||||
>p : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>p : { x: number; y: number; }, Symbol(p, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
|
||||
>x : number, Symbol(x, Decl(test.ts, 0, 8))
|
||||
>y : number, Symbol(y, Decl(test.ts, 0, 19))
|
||||
|
||||
var p = A.Point.Origin;
|
||||
>p : { x: number; y: number; }
|
||||
>A.Point.Origin : { x: number; y: number; }
|
||||
>A.Point : typeof A.Point
|
||||
>A : typeof A
|
||||
>Point : typeof A.Point
|
||||
>Origin : { x: number; y: number; }
|
||||
>p : { x: number; y: number; }, Symbol(p, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
|
||||
>A.Point.Origin : { x: number; y: number; }, Symbol(A.Point.Origin, Decl(module.d.ts, 2, 18))
|
||||
>A.Point : typeof A.Point, Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(classPoint.ts, 0, 10))
|
||||
>A : typeof A, Symbol(A, Decl(module.d.ts, 0, 0), Decl(classPoint.ts, 0, 0))
|
||||
>Point : typeof A.Point, Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(classPoint.ts, 0, 10))
|
||||
>Origin : { x: number; y: number; }, Symbol(A.Point.Origin, Decl(module.d.ts, 2, 18))
|
||||
|
||||
var p = new A.Point(0, 0); // unexpected error here, bug 840000
|
||||
>p : { x: number; y: number; }
|
||||
>p : { x: number; y: number; }, Symbol(p, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
|
||||
>new A.Point(0, 0) : A.Point
|
||||
>A.Point : typeof A.Point
|
||||
>A : typeof A
|
||||
>Point : typeof A.Point
|
||||
>A.Point : typeof A.Point, Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(classPoint.ts, 0, 10))
|
||||
>A : typeof A, Symbol(A, Decl(module.d.ts, 0, 0), Decl(classPoint.ts, 0, 0))
|
||||
>Point : typeof A.Point, Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(classPoint.ts, 0, 10))
|
||||
>0 : number
|
||||
>0 : number
|
||||
|
||||
|
||||
@ -1,37 +1,39 @@
|
||||
=== tests/cases/conformance/internalModules/DeclarationMerging/module.d.ts ===
|
||||
declare module Point {
|
||||
>Point : typeof Point
|
||||
>Point : typeof Point, Symbol(Point, Decl(module.d.ts, 0, 0), Decl(function.ts, 0, 0))
|
||||
|
||||
export var Origin: { x: number; y: number; }
|
||||
>Origin : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>Origin : { x: number; y: number; }, Symbol(Origin, Decl(module.d.ts, 1, 14))
|
||||
>x : number, Symbol(x, Decl(module.d.ts, 1, 24))
|
||||
>y : number, Symbol(y, Decl(module.d.ts, 1, 35))
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/internalModules/DeclarationMerging/function.ts ===
|
||||
function Point() {
|
||||
>Point : typeof Point
|
||||
>Point : typeof Point, Symbol(Point, Decl(module.d.ts, 0, 0), Decl(function.ts, 0, 0))
|
||||
|
||||
return { x: 0, y: 0 };
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>x : number, Symbol(x, Decl(function.ts, 1, 12))
|
||||
>0 : number
|
||||
>y : number, Symbol(y, Decl(function.ts, 1, 18))
|
||||
>0 : number
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/internalModules/DeclarationMerging/test.ts ===
|
||||
var cl: { x: number; y: number; }
|
||||
>cl : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>cl : { x: number; y: number; }, Symbol(cl, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
|
||||
>x : number, Symbol(x, Decl(test.ts, 0, 9))
|
||||
>y : number, Symbol(y, Decl(test.ts, 0, 20))
|
||||
|
||||
var cl = Point();
|
||||
>cl : { x: number; y: number; }
|
||||
>cl : { x: number; y: number; }, Symbol(cl, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
|
||||
>Point() : { x: number; y: number; }
|
||||
>Point : typeof Point
|
||||
>Point : typeof Point, Symbol(Point, Decl(module.d.ts, 0, 0), Decl(function.ts, 0, 0))
|
||||
|
||||
var cl = Point.Origin;
|
||||
>cl : { x: number; y: number; }
|
||||
>Point.Origin : { x: number; y: number; }
|
||||
>Point : typeof Point
|
||||
>Origin : { x: number; y: number; }
|
||||
>cl : { x: number; y: number; }, Symbol(cl, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
|
||||
>Point.Origin : { x: number; y: number; }, Symbol(Point.Origin, Decl(module.d.ts, 1, 14))
|
||||
>Point : typeof Point, Symbol(Point, Decl(module.d.ts, 0, 0), Decl(function.ts, 0, 0))
|
||||
>Origin : { x: number; y: number; }, Symbol(Point.Origin, Decl(module.d.ts, 1, 14))
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
=== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction4.ts ===
|
||||
var v = (a, b) => {
|
||||
>v : (a: any, b: any) => void
|
||||
>v : (a: any, b: any) => void, Symbol(v, Decl(ArrowFunction4.ts, 0, 3))
|
||||
>(a, b) => { } : (a: any, b: any) => void
|
||||
>a : any
|
||||
>b : any
|
||||
>a : any, Symbol(a, Decl(ArrowFunction4.ts, 0, 9))
|
||||
>b : any, Symbol(b, Decl(ArrowFunction4.ts, 0, 11))
|
||||
|
||||
};
|
||||
|
||||
@ -1,49 +1,55 @@
|
||||
=== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts ===
|
||||
class Point {
|
||||
>Point : Point
|
||||
>Point : Point, Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 4, 1))
|
||||
|
||||
constructor(public x: number, public y: number) { }
|
||||
>x : number
|
||||
>y : number
|
||||
>x : number, Symbol(x, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 1, 16))
|
||||
>y : number, Symbol(y, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 1, 33))
|
||||
|
||||
static Origin(): Point { return { x: 0, y: 0 }; }
|
||||
>Origin : () => Point
|
||||
>Point : Point
|
||||
>Origin : () => Point, Symbol(Point.Origin, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 1, 55))
|
||||
>Point : Point, Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 4, 1))
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>x : number, Symbol(x, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 3, 37))
|
||||
>0 : number
|
||||
>y : number, Symbol(y, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 3, 43))
|
||||
>0 : number
|
||||
}
|
||||
|
||||
module Point {
|
||||
>Point : typeof Point
|
||||
>Point : typeof Point, Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 4, 1))
|
||||
|
||||
function Origin() { return ""; }// not an error, since not exported
|
||||
>Origin : () => string
|
||||
>Origin : () => string, Symbol(Origin, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 6, 14))
|
||||
>"" : string
|
||||
}
|
||||
|
||||
|
||||
module A {
|
||||
>A : typeof A
|
||||
>A : typeof A, Symbol(A, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 8, 1))
|
||||
|
||||
export class Point {
|
||||
>Point : Point
|
||||
>Point : Point, Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 16, 5))
|
||||
|
||||
constructor(public x: number, public y: number) { }
|
||||
>x : number
|
||||
>y : number
|
||||
>x : number, Symbol(x, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 13, 20))
|
||||
>y : number, Symbol(y, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 13, 37))
|
||||
|
||||
static Origin(): Point { return { x: 0, y: 0 }; }
|
||||
>Origin : () => Point
|
||||
>Point : Point
|
||||
>Origin : () => Point, Symbol(Point.Origin, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 13, 59))
|
||||
>Point : Point, Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 16, 5))
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>x : number, Symbol(x, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 15, 41))
|
||||
>0 : number
|
||||
>y : number, Symbol(y, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 15, 47))
|
||||
>0 : number
|
||||
}
|
||||
|
||||
export module Point {
|
||||
>Point : typeof Point
|
||||
>Point : typeof Point, Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 16, 5))
|
||||
|
||||
function Origin() { return ""; }// not an error since not exported
|
||||
>Origin : () => string
|
||||
>Origin : () => string, Symbol(Origin, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 18, 25))
|
||||
>"" : string
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,49 +1,55 @@
|
||||
=== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts ===
|
||||
class Point {
|
||||
>Point : Point
|
||||
>Point : Point, Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 4, 1))
|
||||
|
||||
constructor(public x: number, public y: number) { }
|
||||
>x : number
|
||||
>y : number
|
||||
>x : number, Symbol(x, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 1, 16))
|
||||
>y : number, Symbol(y, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 1, 33))
|
||||
|
||||
static Origin: Point = { x: 0, y: 0 };
|
||||
>Origin : Point
|
||||
>Point : Point
|
||||
>Origin : Point, Symbol(Point.Origin, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 1, 55))
|
||||
>Point : Point, Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 4, 1))
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>x : number, Symbol(x, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 3, 28))
|
||||
>0 : number
|
||||
>y : number, Symbol(y, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 3, 34))
|
||||
>0 : number
|
||||
}
|
||||
|
||||
module Point {
|
||||
>Point : typeof Point
|
||||
>Point : typeof Point, Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 4, 1))
|
||||
|
||||
var Origin = ""; // not an error, since not exported
|
||||
>Origin : string
|
||||
>Origin : string, Symbol(Origin, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 7, 7))
|
||||
>"" : string
|
||||
}
|
||||
|
||||
|
||||
module A {
|
||||
>A : typeof A
|
||||
>A : typeof A, Symbol(A, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 8, 1))
|
||||
|
||||
export class Point {
|
||||
>Point : Point
|
||||
>Point : Point, Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 16, 5))
|
||||
|
||||
constructor(public x: number, public y: number) { }
|
||||
>x : number
|
||||
>y : number
|
||||
>x : number, Symbol(x, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 13, 20))
|
||||
>y : number, Symbol(y, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 13, 37))
|
||||
|
||||
static Origin: Point = { x: 0, y: 0 };
|
||||
>Origin : Point
|
||||
>Point : Point
|
||||
>Origin : Point, Symbol(Point.Origin, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 13, 59))
|
||||
>Point : Point, Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 16, 5))
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>x : number, Symbol(x, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 15, 32))
|
||||
>0 : number
|
||||
>y : number, Symbol(y, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 15, 38))
|
||||
>0 : number
|
||||
}
|
||||
|
||||
export module Point {
|
||||
>Point : typeof Point
|
||||
>Point : typeof Point, Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 16, 5))
|
||||
|
||||
var Origin = ""; // not an error since not exported
|
||||
>Origin : string
|
||||
>Origin : string, Symbol(Origin, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 19, 11))
|
||||
>"" : string
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
=== tests/cases/conformance/statements/for-ofStatements/ES3For-ofTypeCheck2.ts ===
|
||||
for (var v of [true]) { }
|
||||
>v : boolean
|
||||
>v : boolean, Symbol(v, Decl(ES3For-ofTypeCheck2.ts, 0, 8))
|
||||
>[true] : boolean[]
|
||||
>true : boolean
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
=== tests/cases/conformance/statements/for-ofStatements/ES3For-ofTypeCheck6.ts ===
|
||||
var union: string[] | number[];
|
||||
>union : string[] | number[]
|
||||
>union : string[] | number[], Symbol(union, Decl(ES3For-ofTypeCheck6.ts, 0, 3))
|
||||
|
||||
for (var v of union) { }
|
||||
>v : string | number
|
||||
>union : string[] | number[]
|
||||
>v : string | number, Symbol(v, Decl(ES3For-ofTypeCheck6.ts, 1, 8))
|
||||
>union : string[] | number[], Symbol(union, Decl(ES3For-ofTypeCheck6.ts, 0, 3))
|
||||
|
||||
|
||||
@ -1,29 +1,30 @@
|
||||
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of10.ts ===
|
||||
function foo() {
|
||||
>foo : () => { x: number; }
|
||||
>foo : () => { x: number; }, Symbol(foo, Decl(ES5For-of10.ts, 0, 0))
|
||||
|
||||
return { x: 0 };
|
||||
>{ x: 0 } : { x: number; }
|
||||
>x : number
|
||||
>x : number, Symbol(x, Decl(ES5For-of10.ts, 1, 12))
|
||||
>0 : number
|
||||
}
|
||||
for (foo().x of []) {
|
||||
>foo().x : number
|
||||
>foo().x : number, Symbol(x, Decl(ES5For-of10.ts, 1, 12))
|
||||
>foo() : { x: number; }
|
||||
>foo : () => { x: number; }
|
||||
>x : number
|
||||
>foo : () => { x: number; }, Symbol(foo, Decl(ES5For-of10.ts, 0, 0))
|
||||
>x : number, Symbol(x, Decl(ES5For-of10.ts, 1, 12))
|
||||
>[] : undefined[]
|
||||
|
||||
for (foo().x of [])
|
||||
>foo().x : number
|
||||
>foo().x : number, Symbol(x, Decl(ES5For-of10.ts, 1, 12))
|
||||
>foo() : { x: number; }
|
||||
>foo : () => { x: number; }
|
||||
>x : number
|
||||
>foo : () => { x: number; }, Symbol(foo, Decl(ES5For-of10.ts, 0, 0))
|
||||
>x : number, Symbol(x, Decl(ES5For-of10.ts, 1, 12))
|
||||
>[] : undefined[]
|
||||
|
||||
var p = foo().x;
|
||||
>p : number
|
||||
>foo().x : number
|
||||
>p : number, Symbol(p, Decl(ES5For-of10.ts, 5, 11))
|
||||
>foo().x : number, Symbol(x, Decl(ES5For-of10.ts, 1, 12))
|
||||
>foo() : { x: number; }
|
||||
>foo : () => { x: number; }
|
||||
>x : number
|
||||
>foo : () => { x: number; }, Symbol(foo, Decl(ES5For-of10.ts, 0, 0))
|
||||
>x : number, Symbol(x, Decl(ES5For-of10.ts, 1, 12))
|
||||
}
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of11.ts ===
|
||||
var v;
|
||||
>v : any
|
||||
>v : any, Symbol(v, Decl(ES5For-of11.ts, 0, 3))
|
||||
|
||||
for (v of []) { }
|
||||
>v : any
|
||||
>v : any, Symbol(v, Decl(ES5For-of11.ts, 0, 3))
|
||||
>[] : undefined[]
|
||||
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of13.ts ===
|
||||
for (let v of ['a', 'b', 'c']) {
|
||||
>v : string
|
||||
>v : string, Symbol(v, Decl(ES5For-of13.ts, 0, 8))
|
||||
>['a', 'b', 'c'] : string[]
|
||||
>'a' : string
|
||||
>'b' : string
|
||||
>'c' : string
|
||||
|
||||
var x = v;
|
||||
>x : string
|
||||
>v : string
|
||||
>x : string, Symbol(x, Decl(ES5For-of13.ts, 1, 7))
|
||||
>v : string, Symbol(v, Decl(ES5For-of13.ts, 0, 8))
|
||||
}
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of14.ts ===
|
||||
for (const v of []) {
|
||||
>v : any
|
||||
>v : any, Symbol(v, Decl(ES5For-of14.ts, 0, 10))
|
||||
>[] : undefined[]
|
||||
|
||||
var x = v;
|
||||
>x : any
|
||||
>v : any
|
||||
>x : any, Symbol(x, Decl(ES5For-of14.ts, 1, 7))
|
||||
>v : any, Symbol(v, Decl(ES5For-of14.ts, 0, 10))
|
||||
}
|
||||
|
||||
@ -1,17 +1,17 @@
|
||||
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of15.ts ===
|
||||
for (let v of []) {
|
||||
>v : any
|
||||
>v : any, Symbol(v, Decl(ES5For-of15.ts, 0, 8))
|
||||
>[] : undefined[]
|
||||
|
||||
v;
|
||||
>v : any
|
||||
>v : any, Symbol(v, Decl(ES5For-of15.ts, 0, 8))
|
||||
|
||||
for (const v of []) {
|
||||
>v : any
|
||||
>v : any, Symbol(v, Decl(ES5For-of15.ts, 2, 14))
|
||||
>[] : undefined[]
|
||||
|
||||
var x = v;
|
||||
>x : any
|
||||
>v : any
|
||||
>x : any, Symbol(x, Decl(ES5For-of15.ts, 3, 11))
|
||||
>v : any, Symbol(v, Decl(ES5For-of15.ts, 2, 14))
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,21 +1,21 @@
|
||||
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of16.ts ===
|
||||
for (let v of []) {
|
||||
>v : any
|
||||
>v : any, Symbol(v, Decl(ES5For-of16.ts, 0, 8))
|
||||
>[] : undefined[]
|
||||
|
||||
v;
|
||||
>v : any
|
||||
>v : any, Symbol(v, Decl(ES5For-of16.ts, 0, 8))
|
||||
|
||||
for (let v of []) {
|
||||
>v : any
|
||||
>v : any, Symbol(v, Decl(ES5For-of16.ts, 2, 12))
|
||||
>[] : undefined[]
|
||||
|
||||
var x = v;
|
||||
>x : any
|
||||
>v : any
|
||||
>x : any, Symbol(x, Decl(ES5For-of16.ts, 3, 11))
|
||||
>v : any, Symbol(v, Decl(ES5For-of16.ts, 2, 12))
|
||||
|
||||
v++;
|
||||
>v++ : number
|
||||
>v : any
|
||||
>v : any, Symbol(v, Decl(ES5For-of16.ts, 2, 12))
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,16 +1,16 @@
|
||||
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of18.ts ===
|
||||
for (let v of []) {
|
||||
>v : any
|
||||
>v : any, Symbol(v, Decl(ES5For-of18.ts, 0, 8))
|
||||
>[] : undefined[]
|
||||
|
||||
v;
|
||||
>v : any
|
||||
>v : any, Symbol(v, Decl(ES5For-of18.ts, 0, 8))
|
||||
}
|
||||
for (let v of []) {
|
||||
>v : any
|
||||
>v : any, Symbol(v, Decl(ES5For-of18.ts, 3, 8))
|
||||
>[] : undefined[]
|
||||
|
||||
v;
|
||||
>v : any
|
||||
>v : any, Symbol(v, Decl(ES5For-of18.ts, 3, 8))
|
||||
}
|
||||
|
||||
|
||||
@ -1,20 +1,20 @@
|
||||
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of19.ts ===
|
||||
for (let v of []) {
|
||||
>v : any
|
||||
>v : any, Symbol(v, Decl(ES5For-of19.ts, 0, 8))
|
||||
>[] : undefined[]
|
||||
|
||||
v;
|
||||
>v : any
|
||||
>v : any, Symbol(v, Decl(ES5For-of19.ts, 0, 8))
|
||||
|
||||
function foo() {
|
||||
>foo : () => void
|
||||
>foo : () => void, Symbol(foo, Decl(ES5For-of19.ts, 1, 6))
|
||||
|
||||
for (const v of []) {
|
||||
>v : any
|
||||
>v : any, Symbol(v, Decl(ES5For-of19.ts, 3, 18))
|
||||
>[] : undefined[]
|
||||
|
||||
v;
|
||||
>v : any
|
||||
>v : any, Symbol(v, Decl(ES5For-of19.ts, 3, 18))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of2.ts ===
|
||||
for (var v of []) {
|
||||
>v : any
|
||||
>v : any, Symbol(v, Decl(ES5For-of2.ts, 0, 8))
|
||||
>[] : undefined[]
|
||||
|
||||
var x = v;
|
||||
>x : any
|
||||
>v : any
|
||||
>x : any, Symbol(x, Decl(ES5For-of2.ts, 1, 7))
|
||||
>v : any, Symbol(v, Decl(ES5For-of2.ts, 0, 8))
|
||||
}
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of21.ts ===
|
||||
for (let v of []) {
|
||||
>v : any
|
||||
>v : any, Symbol(v, Decl(ES5For-of21.ts, 0, 8))
|
||||
>[] : undefined[]
|
||||
|
||||
for (let _i of []) { }
|
||||
>_i : any
|
||||
>_i : any, Symbol(_i, Decl(ES5For-of21.ts, 1, 12))
|
||||
>[] : undefined[]
|
||||
}
|
||||
|
||||
@ -1,12 +1,16 @@
|
||||
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of24.ts ===
|
||||
var a = [1, 2, 3];
|
||||
>a : number[]
|
||||
>a : number[], Symbol(a, Decl(ES5For-of24.ts, 0, 3))
|
||||
>[1, 2, 3] : number[]
|
||||
>1 : number
|
||||
>2 : number
|
||||
>3 : number
|
||||
|
||||
for (var v of a) {
|
||||
>v : number
|
||||
>a : number[]
|
||||
>v : number, Symbol(v, Decl(ES5For-of24.ts, 1, 8))
|
||||
>a : number[], Symbol(a, Decl(ES5For-of24.ts, 0, 3))
|
||||
|
||||
let a = 0;
|
||||
>a : number
|
||||
>a : number, Symbol(a, Decl(ES5For-of24.ts, 2, 7))
|
||||
>0 : number
|
||||
}
|
||||
|
||||
@ -1,15 +1,18 @@
|
||||
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of25.ts ===
|
||||
var a = [1, 2, 3];
|
||||
>a : number[]
|
||||
>a : number[], Symbol(a, Decl(ES5For-of25.ts, 0, 3))
|
||||
>[1, 2, 3] : number[]
|
||||
>1 : number
|
||||
>2 : number
|
||||
>3 : number
|
||||
|
||||
for (var v of a) {
|
||||
>v : number
|
||||
>a : number[]
|
||||
>v : number, Symbol(v, Decl(ES5For-of25.ts, 1, 8))
|
||||
>a : number[], Symbol(a, Decl(ES5For-of25.ts, 0, 3))
|
||||
|
||||
v;
|
||||
>v : number
|
||||
>v : number, Symbol(v, Decl(ES5For-of25.ts, 1, 8))
|
||||
|
||||
a;
|
||||
>a : number[]
|
||||
>a : number[], Symbol(a, Decl(ES5For-of25.ts, 0, 3))
|
||||
}
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of3.ts ===
|
||||
for (var v of ['a', 'b', 'c'])
|
||||
>v : string
|
||||
>v : string, Symbol(v, Decl(ES5For-of3.ts, 0, 8))
|
||||
>['a', 'b', 'c'] : string[]
|
||||
>'a' : string
|
||||
>'b' : string
|
||||
>'c' : string
|
||||
|
||||
var x = v;
|
||||
>x : string
|
||||
>v : string
|
||||
>x : string, Symbol(x, Decl(ES5For-of3.ts, 1, 7))
|
||||
>v : string, Symbol(v, Decl(ES5For-of3.ts, 0, 8))
|
||||
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of4.ts ===
|
||||
for (var v of [])
|
||||
>v : any
|
||||
>v : any, Symbol(v, Decl(ES5For-of4.ts, 0, 8))
|
||||
>[] : undefined[]
|
||||
|
||||
var x = v;
|
||||
>x : any
|
||||
>v : any
|
||||
>x : any, Symbol(x, Decl(ES5For-of4.ts, 1, 7))
|
||||
>v : any, Symbol(v, Decl(ES5For-of4.ts, 0, 8))
|
||||
|
||||
var y = v;
|
||||
>y : any
|
||||
>v : any
|
||||
>y : any, Symbol(y, Decl(ES5For-of4.ts, 2, 3))
|
||||
>v : any, Symbol(v, Decl(ES5For-of4.ts, 0, 8))
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of5.ts ===
|
||||
for (var _a of []) {
|
||||
>_a : any
|
||||
>_a : any, Symbol(_a, Decl(ES5For-of5.ts, 0, 8))
|
||||
>[] : undefined[]
|
||||
|
||||
var x = _a;
|
||||
>x : any
|
||||
>_a : any
|
||||
>x : any, Symbol(x, Decl(ES5For-of5.ts, 1, 7))
|
||||
>_a : any, Symbol(_a, Decl(ES5For-of5.ts, 0, 8))
|
||||
}
|
||||
|
||||
@ -1,16 +1,16 @@
|
||||
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of6.ts ===
|
||||
for (var w of []) {
|
||||
>w : any
|
||||
>w : any, Symbol(w, Decl(ES5For-of6.ts, 0, 8))
|
||||
>[] : undefined[]
|
||||
|
||||
for (var v of []) {
|
||||
>v : any
|
||||
>v : any, Symbol(v, Decl(ES5For-of6.ts, 1, 12))
|
||||
>[] : undefined[]
|
||||
|
||||
var x = [w, v];
|
||||
>x : any[]
|
||||
>x : any[], Symbol(x, Decl(ES5For-of6.ts, 2, 11))
|
||||
>[w, v] : any[]
|
||||
>w : any
|
||||
>v : any
|
||||
>w : any, Symbol(w, Decl(ES5For-of6.ts, 0, 8))
|
||||
>v : any, Symbol(v, Decl(ES5For-of6.ts, 1, 12))
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,30 +1,31 @@
|
||||
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of9.ts ===
|
||||
function foo() {
|
||||
>foo : () => { x: number; }
|
||||
>foo : () => { x: number; }, Symbol(foo, Decl(ES5For-of9.ts, 0, 0))
|
||||
|
||||
return { x: 0 };
|
||||
>{ x: 0 } : { x: number; }
|
||||
>x : number
|
||||
>x : number, Symbol(x, Decl(ES5For-of9.ts, 1, 12))
|
||||
>0 : number
|
||||
}
|
||||
for (foo().x of []) {
|
||||
>foo().x : number
|
||||
>foo().x : number, Symbol(x, Decl(ES5For-of9.ts, 1, 12))
|
||||
>foo() : { x: number; }
|
||||
>foo : () => { x: number; }
|
||||
>x : number
|
||||
>foo : () => { x: number; }, Symbol(foo, Decl(ES5For-of9.ts, 0, 0))
|
||||
>x : number, Symbol(x, Decl(ES5For-of9.ts, 1, 12))
|
||||
>[] : undefined[]
|
||||
|
||||
for (foo().x of []) {
|
||||
>foo().x : number
|
||||
>foo().x : number, Symbol(x, Decl(ES5For-of9.ts, 1, 12))
|
||||
>foo() : { x: number; }
|
||||
>foo : () => { x: number; }
|
||||
>x : number
|
||||
>foo : () => { x: number; }, Symbol(foo, Decl(ES5For-of9.ts, 0, 0))
|
||||
>x : number, Symbol(x, Decl(ES5For-of9.ts, 1, 12))
|
||||
>[] : undefined[]
|
||||
|
||||
var p = foo().x;
|
||||
>p : number
|
||||
>foo().x : number
|
||||
>p : number, Symbol(p, Decl(ES5For-of9.ts, 5, 11))
|
||||
>foo().x : number, Symbol(x, Decl(ES5For-of9.ts, 1, 12))
|
||||
>foo() : { x: number; }
|
||||
>foo : () => { x: number; }
|
||||
>x : number
|
||||
>foo : () => { x: number; }, Symbol(foo, Decl(ES5For-of9.ts, 0, 0))
|
||||
>x : number, Symbol(x, Decl(ES5For-of9.ts, 1, 12))
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
=== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck1.ts ===
|
||||
for (var v of "") { }
|
||||
>v : string
|
||||
>v : string, Symbol(v, Decl(ES5For-ofTypeCheck1.ts, 0, 8))
|
||||
>"" : string
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
=== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck2.ts ===
|
||||
for (var v of [true]) { }
|
||||
>v : boolean
|
||||
>v : boolean, Symbol(v, Decl(ES5For-ofTypeCheck2.ts, 0, 8))
|
||||
>[true] : boolean[]
|
||||
>true : boolean
|
||||
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
=== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck3.ts ===
|
||||
var tuple: [string, number] = ["", 0];
|
||||
>tuple : [string, number]
|
||||
>tuple : [string, number], Symbol(tuple, Decl(ES5For-ofTypeCheck3.ts, 0, 3))
|
||||
>["", 0] : [string, number]
|
||||
>"" : string
|
||||
>0 : number
|
||||
|
||||
for (var v of tuple) { }
|
||||
>v : string | number
|
||||
>tuple : [string, number]
|
||||
>v : string | number, Symbol(v, Decl(ES5For-ofTypeCheck3.ts, 1, 8))
|
||||
>tuple : [string, number], Symbol(tuple, Decl(ES5For-ofTypeCheck3.ts, 0, 3))
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
=== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck4.ts ===
|
||||
var union: string | string[];
|
||||
>union : string | string[]
|
||||
>union : string | string[], Symbol(union, Decl(ES5For-ofTypeCheck4.ts, 0, 3))
|
||||
|
||||
for (const v of union) { }
|
||||
>v : string
|
||||
>union : string | string[]
|
||||
>v : string, Symbol(v, Decl(ES5For-ofTypeCheck4.ts, 1, 10))
|
||||
>union : string | string[], Symbol(union, Decl(ES5For-ofTypeCheck4.ts, 0, 3))
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
=== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck5.ts ===
|
||||
var union: string | number[];
|
||||
>union : string | number[]
|
||||
>union : string | number[], Symbol(union, Decl(ES5For-ofTypeCheck5.ts, 0, 3))
|
||||
|
||||
for (var v of union) { }
|
||||
>v : string | number
|
||||
>union : string | number[]
|
||||
>v : string | number, Symbol(v, Decl(ES5For-ofTypeCheck5.ts, 1, 8))
|
||||
>union : string | number[], Symbol(union, Decl(ES5For-ofTypeCheck5.ts, 0, 3))
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
=== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck6.ts ===
|
||||
var union: string[] | number[];
|
||||
>union : string[] | number[]
|
||||
>union : string[] | number[], Symbol(union, Decl(ES5For-ofTypeCheck6.ts, 0, 3))
|
||||
|
||||
for (var v of union) { }
|
||||
>v : string | number
|
||||
>union : string[] | number[]
|
||||
>v : string | number, Symbol(v, Decl(ES5For-ofTypeCheck6.ts, 1, 8))
|
||||
>union : string[] | number[], Symbol(union, Decl(ES5For-ofTypeCheck6.ts, 0, 3))
|
||||
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
=== tests/cases/conformance/Symbols/ES5SymbolType1.ts ===
|
||||
var s: symbol;
|
||||
>s : symbol
|
||||
>s : symbol, Symbol(s, Decl(ES5SymbolType1.ts, 0, 3))
|
||||
|
||||
s.toString();
|
||||
>s.toString() : string
|
||||
>s.toString : () => string
|
||||
>s : symbol
|
||||
>toString : () => string
|
||||
>s.toString : () => string, Symbol(Object.toString, Decl(lib.d.ts, 96, 26))
|
||||
>s : symbol, Symbol(s, Decl(ES5SymbolType1.ts, 0, 3))
|
||||
>toString : () => string, Symbol(Object.toString, Decl(lib.d.ts, 96, 26))
|
||||
|
||||
|
||||
@ -1,43 +1,45 @@
|
||||
=== tests/cases/conformance/internalModules/DeclarationMerging/EnumAndModuleWithSameNameAndCommonRoot.ts ===
|
||||
enum enumdule {
|
||||
>enumdule : enumdule
|
||||
>enumdule : enumdule, Symbol(enumdule, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 0, 0), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 2, 1))
|
||||
|
||||
Red, Blue
|
||||
>Red : enumdule
|
||||
>Blue : enumdule
|
||||
>Red : enumdule, Symbol(enumdule.Red, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 0, 15))
|
||||
>Blue : enumdule, Symbol(enumdule.Blue, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 1, 8))
|
||||
}
|
||||
|
||||
module enumdule {
|
||||
>enumdule : typeof enumdule
|
||||
>enumdule : typeof enumdule, Symbol(enumdule, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 0, 0), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 2, 1))
|
||||
|
||||
export class Point {
|
||||
>Point : Point
|
||||
>Point : Point, Symbol(Point, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 4, 17))
|
||||
|
||||
constructor(public x: number, public y: number) { }
|
||||
>x : number
|
||||
>y : number
|
||||
>x : number, Symbol(x, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 7, 20))
|
||||
>y : number, Symbol(y, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 7, 37))
|
||||
}
|
||||
}
|
||||
|
||||
var x: enumdule;
|
||||
>x : enumdule
|
||||
>enumdule : enumdule
|
||||
>x : enumdule, Symbol(x, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 11, 3), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 12, 3))
|
||||
>enumdule : enumdule, Symbol(enumdule, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 0, 0), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 2, 1))
|
||||
|
||||
var x = enumdule.Red;
|
||||
>x : enumdule
|
||||
>enumdule.Red : enumdule
|
||||
>enumdule : typeof enumdule
|
||||
>Red : enumdule
|
||||
>x : enumdule, Symbol(x, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 11, 3), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 12, 3))
|
||||
>enumdule.Red : enumdule, Symbol(enumdule.Red, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 0, 15))
|
||||
>enumdule : typeof enumdule, Symbol(enumdule, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 0, 0), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 2, 1))
|
||||
>Red : enumdule, Symbol(enumdule.Red, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 0, 15))
|
||||
|
||||
var y: { x: number; y: number };
|
||||
>y : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>y : { x: number; y: number; }, Symbol(y, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 14, 3), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 15, 3))
|
||||
>x : number, Symbol(x, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 14, 8))
|
||||
>y : number, Symbol(y, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 14, 19))
|
||||
|
||||
var y = new enumdule.Point(0, 0);
|
||||
>y : { x: number; y: number; }
|
||||
>y : { x: number; y: number; }, Symbol(y, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 14, 3), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 15, 3))
|
||||
>new enumdule.Point(0, 0) : enumdule.Point
|
||||
>enumdule.Point : typeof enumdule.Point
|
||||
>enumdule : typeof enumdule
|
||||
>Point : typeof enumdule.Point
|
||||
>enumdule.Point : typeof enumdule.Point, Symbol(enumdule.Point, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 4, 17))
|
||||
>enumdule : typeof enumdule, Symbol(enumdule, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 0, 0), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 2, 1))
|
||||
>Point : typeof enumdule.Point, Symbol(enumdule.Point, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 4, 17))
|
||||
>0 : number
|
||||
>0 : number
|
||||
|
||||
|
||||
@ -1,36 +1,37 @@
|
||||
=== tests/cases/conformance/internalModules/exportDeclarations/ExportClassWhichExtendsInterfaceWithInaccessibleType.ts ===
|
||||
module A {
|
||||
>A : typeof A
|
||||
>A : typeof A, Symbol(A, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 0, 0))
|
||||
|
||||
interface Point {
|
||||
>Point : Point
|
||||
>Point : Point, Symbol(Point, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 0, 10))
|
||||
|
||||
x: number;
|
||||
>x : number
|
||||
>x : number, Symbol(x, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 2, 21))
|
||||
|
||||
y: number;
|
||||
>y : number
|
||||
>y : number, Symbol(y, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 3, 18))
|
||||
|
||||
fromOrigin(p: Point): number;
|
||||
>fromOrigin : (p: Point) => number
|
||||
>p : Point
|
||||
>Point : Point
|
||||
>fromOrigin : (p: Point) => number, Symbol(fromOrigin, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 4, 18))
|
||||
>p : Point, Symbol(p, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 6, 19))
|
||||
>Point : Point, Symbol(Point, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 0, 10))
|
||||
}
|
||||
|
||||
export class Point2d implements Point {
|
||||
>Point2d : Point2d
|
||||
>Point : Point
|
||||
>Point2d : Point2d, Symbol(Point2d, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 7, 5))
|
||||
>Point : Point, Symbol(Point, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 0, 10))
|
||||
|
||||
constructor(public x: number, public y: number) { }
|
||||
>x : number
|
||||
>y : number
|
||||
>x : number, Symbol(x, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 10, 20))
|
||||
>y : number, Symbol(y, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 10, 37))
|
||||
|
||||
fromOrigin(p: Point) {
|
||||
>fromOrigin : (p: Point) => number
|
||||
>p : Point
|
||||
>Point : Point
|
||||
>fromOrigin : (p: Point) => number, Symbol(fromOrigin, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 10, 59))
|
||||
>p : Point, Symbol(p, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 12, 19))
|
||||
>Point : Point, Symbol(Point, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 0, 10))
|
||||
|
||||
return 1;
|
||||
>1 : number
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,50 +1,55 @@
|
||||
=== tests/cases/conformance/internalModules/exportDeclarations/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts ===
|
||||
module A {
|
||||
>A : typeof A
|
||||
>A : typeof A, Symbol(A, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 0))
|
||||
|
||||
export class Point {
|
||||
>Point : Point
|
||||
>Point : Point, Symbol(Point, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 10))
|
||||
|
||||
x: number;
|
||||
>x : number
|
||||
>x : number, Symbol(x, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 2, 24))
|
||||
|
||||
y: number;
|
||||
>y : number
|
||||
>y : number, Symbol(y, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 3, 18))
|
||||
}
|
||||
|
||||
export var Origin: Point = { x: 0, y: 0 };
|
||||
>Origin : Point
|
||||
>Point : Point
|
||||
>Origin : Point, Symbol(Origin, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 14))
|
||||
>Point : Point, Symbol(Point, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 10))
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>x : number, Symbol(x, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 32))
|
||||
>0 : number
|
||||
>y : number, Symbol(y, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 38))
|
||||
>0 : number
|
||||
|
||||
export class Point3d extends Point {
|
||||
>Point3d : Point3d
|
||||
>Point : Point
|
||||
>Point3d : Point3d, Symbol(Point3d, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 46))
|
||||
>Point : Point, Symbol(Point, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 10))
|
||||
|
||||
z: number;
|
||||
>z : number
|
||||
>z : number, Symbol(z, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 9, 40))
|
||||
}
|
||||
|
||||
export var Origin3d: Point3d = { x: 0, y: 0, z: 0 };
|
||||
>Origin3d : Point3d
|
||||
>Point3d : Point3d
|
||||
>Origin3d : Point3d, Symbol(Origin3d, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 14))
|
||||
>Point3d : Point3d, Symbol(Point3d, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 46))
|
||||
>{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>z : number
|
||||
>x : number, Symbol(x, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 36))
|
||||
>0 : number
|
||||
>y : number, Symbol(y, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 42))
|
||||
>0 : number
|
||||
>z : number, Symbol(z, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 48))
|
||||
>0 : number
|
||||
|
||||
export class Line<TPoint extends Point>{
|
||||
>Line : Line<TPoint>
|
||||
>TPoint : TPoint
|
||||
>Point : Point
|
||||
>Line : Line<TPoint>, Symbol(Line, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 56))
|
||||
>TPoint : TPoint, Symbol(TPoint, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 15, 22))
|
||||
>Point : Point, Symbol(Point, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 10))
|
||||
|
||||
constructor(public start: TPoint, public end: TPoint) { }
|
||||
>start : TPoint
|
||||
>TPoint : TPoint
|
||||
>end : TPoint
|
||||
>TPoint : TPoint
|
||||
>start : TPoint, Symbol(start, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 16, 20))
|
||||
>TPoint : TPoint, Symbol(TPoint, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 15, 22))
|
||||
>end : TPoint, Symbol(end, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 16, 41))
|
||||
>TPoint : TPoint, Symbol(TPoint, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 15, 22))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,27 +1,27 @@
|
||||
=== tests/cases/conformance/internalModules/exportDeclarations/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts ===
|
||||
module A {
|
||||
>A : typeof A
|
||||
>A : typeof A, Symbol(A, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 0, 0))
|
||||
|
||||
class Point {
|
||||
>Point : Point
|
||||
>Point : Point, Symbol(Point, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 0, 10))
|
||||
|
||||
x: number;
|
||||
>x : number
|
||||
>x : number, Symbol(x, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 2, 17))
|
||||
|
||||
y: number;
|
||||
>y : number
|
||||
>y : number, Symbol(y, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 3, 18))
|
||||
}
|
||||
|
||||
export class points {
|
||||
>points : points
|
||||
>points : points, Symbol(points, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 5, 5))
|
||||
|
||||
[idx: number]: Point;
|
||||
>idx : number
|
||||
>Point : Point
|
||||
>idx : number, Symbol(idx, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 9, 9))
|
||||
>Point : Point, Symbol(Point, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 0, 10))
|
||||
|
||||
[idx: string]: Point;
|
||||
>idx : string
|
||||
>Point : Point
|
||||
>idx : string, Symbol(idx, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 10, 9))
|
||||
>Point : Point, Symbol(Point, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 0, 10))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,59 +1,65 @@
|
||||
=== tests/cases/conformance/internalModules/exportDeclarations/ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts ===
|
||||
module A {
|
||||
>A : typeof A
|
||||
>A : typeof A, Symbol(A, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 0))
|
||||
|
||||
class Point {
|
||||
>Point : Point
|
||||
>Point : Point, Symbol(Point, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10))
|
||||
|
||||
x: number;
|
||||
>x : number
|
||||
>x : number, Symbol(x, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 2, 17))
|
||||
|
||||
y: number;
|
||||
>y : number
|
||||
>y : number, Symbol(y, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 3, 18))
|
||||
}
|
||||
|
||||
export var Origin: Point = { x: 0, y: 0 };
|
||||
>Origin : Point
|
||||
>Point : Point
|
||||
>Origin : Point, Symbol(Origin, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 14))
|
||||
>Point : Point, Symbol(Point, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10))
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>x : number, Symbol(x, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 32))
|
||||
>0 : number
|
||||
>y : number, Symbol(y, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 38))
|
||||
>0 : number
|
||||
|
||||
export class Point3d extends Point {
|
||||
>Point3d : Point3d
|
||||
>Point : Point
|
||||
>Point3d : Point3d, Symbol(Point3d, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 46))
|
||||
>Point : Point, Symbol(Point, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10))
|
||||
|
||||
z: number;
|
||||
>z : number
|
||||
>z : number, Symbol(z, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 9, 40))
|
||||
}
|
||||
|
||||
export var Origin3d: Point3d = { x: 0, y: 0, z: 0 };
|
||||
>Origin3d : Point3d
|
||||
>Point3d : Point3d
|
||||
>Origin3d : Point3d, Symbol(Origin3d, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 14))
|
||||
>Point3d : Point3d, Symbol(Point3d, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 46))
|
||||
>{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>z : number
|
||||
>x : number, Symbol(x, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 36))
|
||||
>0 : number
|
||||
>y : number, Symbol(y, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 42))
|
||||
>0 : number
|
||||
>z : number, Symbol(z, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 48))
|
||||
>0 : number
|
||||
|
||||
export class Line<TPoint extends Point>{
|
||||
>Line : Line<TPoint>
|
||||
>TPoint : TPoint
|
||||
>Point : Point
|
||||
>Line : Line<TPoint>, Symbol(Line, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 56))
|
||||
>TPoint : TPoint, Symbol(TPoint, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 15, 22))
|
||||
>Point : Point, Symbol(Point, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10))
|
||||
|
||||
constructor(public start: TPoint, public end: TPoint) { }
|
||||
>start : TPoint
|
||||
>TPoint : TPoint
|
||||
>end : TPoint
|
||||
>TPoint : TPoint
|
||||
>start : TPoint, Symbol(start, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 16, 20))
|
||||
>TPoint : TPoint, Symbol(TPoint, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 15, 22))
|
||||
>end : TPoint, Symbol(end, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 16, 41))
|
||||
>TPoint : TPoint, Symbol(TPoint, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 15, 22))
|
||||
|
||||
static fromorigin2d(p: Point): Line<Point>{
|
||||
>fromorigin2d : (p: Point) => Line<Point>
|
||||
>p : Point
|
||||
>Point : Point
|
||||
>Line : Line<TPoint>
|
||||
>Point : Point
|
||||
>fromorigin2d : (p: Point) => Line<Point>, Symbol(Line.fromorigin2d, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 16, 65))
|
||||
>p : Point, Symbol(p, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 18, 28))
|
||||
>Point : Point, Symbol(Point, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10))
|
||||
>Line : Line<TPoint>, Symbol(Line, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 56))
|
||||
>Point : Point, Symbol(Point, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10))
|
||||
|
||||
return null;
|
||||
>null : null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,39 +1,41 @@
|
||||
=== tests/cases/conformance/internalModules/exportDeclarations/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts ===
|
||||
module A {
|
||||
>A : typeof A
|
||||
>A : typeof A, Symbol(A, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 0, 0))
|
||||
|
||||
export class Point {
|
||||
>Point : Point
|
||||
>Point : Point, Symbol(Point, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 0, 10))
|
||||
|
||||
x: number;
|
||||
>x : number
|
||||
>x : number, Symbol(x, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 2, 24))
|
||||
|
||||
y: number;
|
||||
>y : number
|
||||
>y : number, Symbol(y, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 3, 18))
|
||||
}
|
||||
|
||||
export class Line {
|
||||
>Line : Line
|
||||
>Line : Line, Symbol(Line, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 5, 5))
|
||||
|
||||
constructor(public start: Point, public end: Point) { }
|
||||
>start : Point
|
||||
>Point : Point
|
||||
>end : Point
|
||||
>Point : Point
|
||||
>start : Point, Symbol(start, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 8, 20))
|
||||
>Point : Point, Symbol(Point, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 0, 10))
|
||||
>end : Point, Symbol(end, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 8, 40))
|
||||
>Point : Point, Symbol(Point, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 0, 10))
|
||||
}
|
||||
|
||||
export function fromOrigin(p: Point): Line {
|
||||
>fromOrigin : (p: Point) => Line
|
||||
>p : Point
|
||||
>Point : Point
|
||||
>Line : Line
|
||||
>fromOrigin : (p: Point) => Line, Symbol(fromOrigin, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 9, 5))
|
||||
>p : Point, Symbol(p, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 11, 31))
|
||||
>Point : Point, Symbol(Point, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 0, 10))
|
||||
>Line : Line, Symbol(Line, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 5, 5))
|
||||
|
||||
return new Line({ x: 0, y: 0 }, p);
|
||||
>new Line({ x: 0, y: 0 }, p) : Line
|
||||
>Line : typeof Line
|
||||
>Line : typeof Line, Symbol(Line, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 5, 5))
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>p : Point
|
||||
>x : number, Symbol(x, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 12, 25))
|
||||
>0 : number
|
||||
>y : number, Symbol(y, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 12, 31))
|
||||
>0 : number
|
||||
>p : Point, Symbol(p, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 11, 31))
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,39 +1,41 @@
|
||||
=== tests/cases/conformance/internalModules/exportDeclarations/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts ===
|
||||
module A {
|
||||
>A : typeof A
|
||||
>A : typeof A, Symbol(A, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 0, 0))
|
||||
|
||||
class Point {
|
||||
>Point : Point
|
||||
>Point : Point, Symbol(Point, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 0, 10))
|
||||
|
||||
x: number;
|
||||
>x : number
|
||||
>x : number, Symbol(x, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 2, 17))
|
||||
|
||||
y: number;
|
||||
>y : number
|
||||
>y : number, Symbol(y, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 3, 18))
|
||||
}
|
||||
|
||||
export class Line {
|
||||
>Line : Line
|
||||
>Line : Line, Symbol(Line, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 5, 5))
|
||||
|
||||
constructor(public start: Point, public end: Point) { }
|
||||
>start : Point
|
||||
>Point : Point
|
||||
>end : Point
|
||||
>Point : Point
|
||||
>start : Point, Symbol(start, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 8, 20))
|
||||
>Point : Point, Symbol(Point, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 0, 10))
|
||||
>end : Point, Symbol(end, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 8, 40))
|
||||
>Point : Point, Symbol(Point, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 0, 10))
|
||||
}
|
||||
|
||||
export function fromOrigin(p: Point): Line {
|
||||
>fromOrigin : (p: Point) => Line
|
||||
>p : Point
|
||||
>Point : Point
|
||||
>Line : Line
|
||||
>fromOrigin : (p: Point) => Line, Symbol(fromOrigin, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 9, 5))
|
||||
>p : Point, Symbol(p, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 11, 31))
|
||||
>Point : Point, Symbol(Point, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 0, 10))
|
||||
>Line : Line, Symbol(Line, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 5, 5))
|
||||
|
||||
return new Line({ x: 0, y: 0 }, p);
|
||||
>new Line({ x: 0, y: 0 }, p) : Line
|
||||
>Line : typeof Line
|
||||
>Line : typeof Line, Symbol(Line, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 5, 5))
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>p : Point
|
||||
>x : number, Symbol(x, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 12, 25))
|
||||
>0 : number
|
||||
>y : number, Symbol(y, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 12, 31))
|
||||
>0 : number
|
||||
>p : Point, Symbol(p, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 11, 31))
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,39 +1,41 @@
|
||||
=== tests/cases/conformance/internalModules/exportDeclarations/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts ===
|
||||
module A {
|
||||
>A : typeof A
|
||||
>A : typeof A, Symbol(A, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 0, 0))
|
||||
|
||||
export class Point {
|
||||
>Point : Point
|
||||
>Point : Point, Symbol(Point, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 0, 10))
|
||||
|
||||
x: number;
|
||||
>x : number
|
||||
>x : number, Symbol(x, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 2, 24))
|
||||
|
||||
y: number;
|
||||
>y : number
|
||||
>y : number, Symbol(y, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 3, 18))
|
||||
}
|
||||
|
||||
class Line {
|
||||
>Line : Line
|
||||
>Line : Line, Symbol(Line, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 5, 5))
|
||||
|
||||
constructor(public start: Point, public end: Point) { }
|
||||
>start : Point
|
||||
>Point : Point
|
||||
>end : Point
|
||||
>Point : Point
|
||||
>start : Point, Symbol(start, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 8, 20))
|
||||
>Point : Point, Symbol(Point, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 0, 10))
|
||||
>end : Point, Symbol(end, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 8, 40))
|
||||
>Point : Point, Symbol(Point, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 0, 10))
|
||||
}
|
||||
|
||||
export function fromOrigin(p: Point): Line {
|
||||
>fromOrigin : (p: Point) => Line
|
||||
>p : Point
|
||||
>Point : Point
|
||||
>Line : Line
|
||||
>fromOrigin : (p: Point) => Line, Symbol(fromOrigin, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 9, 5))
|
||||
>p : Point, Symbol(p, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 11, 31))
|
||||
>Point : Point, Symbol(Point, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 0, 10))
|
||||
>Line : Line, Symbol(Line, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 5, 5))
|
||||
|
||||
return new Line({ x: 0, y: 0 }, p);
|
||||
>new Line({ x: 0, y: 0 }, p) : Line
|
||||
>Line : typeof Line
|
||||
>Line : typeof Line, Symbol(Line, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 5, 5))
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>p : Point
|
||||
>x : number, Symbol(x, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 12, 25))
|
||||
>0 : number
|
||||
>y : number, Symbol(y, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 12, 31))
|
||||
>0 : number
|
||||
>p : Point, Symbol(p, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 11, 31))
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,58 +1,63 @@
|
||||
=== tests/cases/conformance/internalModules/exportDeclarations/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts ===
|
||||
module A {
|
||||
>A : typeof A
|
||||
>A : typeof A, Symbol(A, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 0))
|
||||
|
||||
export interface Point {
|
||||
>Point : Point
|
||||
>Point : Point, Symbol(Point, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 10))
|
||||
|
||||
x: number;
|
||||
>x : number
|
||||
>x : number, Symbol(x, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 2, 28))
|
||||
|
||||
y: number;
|
||||
>y : number
|
||||
>y : number, Symbol(y, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 3, 18))
|
||||
}
|
||||
|
||||
export var Origin: Point = { x: 0, y: 0 };
|
||||
>Origin : Point
|
||||
>Point : Point
|
||||
>Origin : Point, Symbol(Origin, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 14))
|
||||
>Point : Point, Symbol(Point, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 10))
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>x : number, Symbol(x, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 32))
|
||||
>0 : number
|
||||
>y : number, Symbol(y, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 38))
|
||||
>0 : number
|
||||
|
||||
export interface Point3d extends Point {
|
||||
>Point3d : Point3d
|
||||
>Point : Point
|
||||
>Point3d : Point3d, Symbol(Point3d, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 46))
|
||||
>Point : Point, Symbol(Point, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 10))
|
||||
|
||||
z: number;
|
||||
>z : number
|
||||
>z : number, Symbol(z, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 9, 44))
|
||||
}
|
||||
|
||||
export var Origin3d: Point3d = { x: 0, y: 0, z: 0 };
|
||||
>Origin3d : Point3d
|
||||
>Point3d : Point3d
|
||||
>Origin3d : Point3d, Symbol(Origin3d, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 14))
|
||||
>Point3d : Point3d, Symbol(Point3d, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 46))
|
||||
>{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>z : number
|
||||
>x : number, Symbol(x, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 36))
|
||||
>0 : number
|
||||
>y : number, Symbol(y, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 42))
|
||||
>0 : number
|
||||
>z : number, Symbol(z, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 48))
|
||||
>0 : number
|
||||
|
||||
export interface Line<TPoint extends Point>{
|
||||
>Line : Line<TPoint>
|
||||
>TPoint : TPoint
|
||||
>Point : Point
|
||||
>Line : Line<TPoint>, Symbol(Line, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 56))
|
||||
>TPoint : TPoint, Symbol(TPoint, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 15, 26))
|
||||
>Point : Point, Symbol(Point, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 10))
|
||||
|
||||
new (start: TPoint, end: TPoint);
|
||||
>start : TPoint
|
||||
>TPoint : TPoint
|
||||
>end : TPoint
|
||||
>TPoint : TPoint
|
||||
>start : TPoint, Symbol(start, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 16, 13))
|
||||
>TPoint : TPoint, Symbol(TPoint, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 15, 26))
|
||||
>end : TPoint, Symbol(end, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 16, 27))
|
||||
>TPoint : TPoint, Symbol(TPoint, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 15, 26))
|
||||
|
||||
start: TPoint;
|
||||
>start : TPoint
|
||||
>TPoint : TPoint
|
||||
>start : TPoint, Symbol(start, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 16, 41))
|
||||
>TPoint : TPoint, Symbol(TPoint, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 15, 26))
|
||||
|
||||
end: TPoint;
|
||||
>end : TPoint
|
||||
>TPoint : TPoint
|
||||
>end : TPoint, Symbol(end, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 17, 22))
|
||||
>TPoint : TPoint, Symbol(TPoint, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 15, 26))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,27 +1,27 @@
|
||||
=== tests/cases/conformance/internalModules/exportDeclarations/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts ===
|
||||
module A {
|
||||
>A : unknown
|
||||
>A : any, Symbol(A, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 0, 0))
|
||||
|
||||
interface Point {
|
||||
>Point : Point
|
||||
>Point : Point, Symbol(Point, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 0, 10))
|
||||
|
||||
x: number;
|
||||
>x : number
|
||||
>x : number, Symbol(x, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 2, 21))
|
||||
|
||||
y: number;
|
||||
>y : number
|
||||
>y : number, Symbol(y, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 3, 18))
|
||||
}
|
||||
|
||||
export interface points {
|
||||
>points : points
|
||||
>points : points, Symbol(points, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 5, 5))
|
||||
|
||||
[idx: number]: Point;
|
||||
>idx : number
|
||||
>Point : Point
|
||||
>idx : number, Symbol(idx, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 9, 9))
|
||||
>Point : Point, Symbol(Point, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 0, 10))
|
||||
|
||||
[idx: string]: Point;
|
||||
>idx : string
|
||||
>Point : Point
|
||||
>idx : string, Symbol(idx, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 10, 9))
|
||||
>Point : Point, Symbol(Point, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 0, 10))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,58 +1,63 @@
|
||||
=== tests/cases/conformance/internalModules/exportDeclarations/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts ===
|
||||
module A {
|
||||
>A : typeof A
|
||||
>A : typeof A, Symbol(A, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 0))
|
||||
|
||||
interface Point {
|
||||
>Point : Point
|
||||
>Point : Point, Symbol(Point, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10))
|
||||
|
||||
x: number;
|
||||
>x : number
|
||||
>x : number, Symbol(x, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 2, 21))
|
||||
|
||||
y: number;
|
||||
>y : number
|
||||
>y : number, Symbol(y, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 3, 18))
|
||||
}
|
||||
|
||||
export var Origin: Point = { x: 0, y: 0 };
|
||||
>Origin : Point
|
||||
>Point : Point
|
||||
>Origin : Point, Symbol(Origin, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 14))
|
||||
>Point : Point, Symbol(Point, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10))
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>x : number, Symbol(x, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 32))
|
||||
>0 : number
|
||||
>y : number, Symbol(y, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 38))
|
||||
>0 : number
|
||||
|
||||
export interface Point3d extends Point {
|
||||
>Point3d : Point3d
|
||||
>Point : Point
|
||||
>Point3d : Point3d, Symbol(Point3d, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 46))
|
||||
>Point : Point, Symbol(Point, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10))
|
||||
|
||||
z: number;
|
||||
>z : number
|
||||
>z : number, Symbol(z, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 9, 44))
|
||||
}
|
||||
|
||||
export var Origin3d: Point3d = { x: 0, y: 0, z: 0 };
|
||||
>Origin3d : Point3d
|
||||
>Point3d : Point3d
|
||||
>Origin3d : Point3d, Symbol(Origin3d, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 14))
|
||||
>Point3d : Point3d, Symbol(Point3d, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 46))
|
||||
>{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>z : number
|
||||
>x : number, Symbol(x, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 36))
|
||||
>0 : number
|
||||
>y : number, Symbol(y, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 42))
|
||||
>0 : number
|
||||
>z : number, Symbol(z, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 48))
|
||||
>0 : number
|
||||
|
||||
export interface Line<TPoint extends Point>{
|
||||
>Line : Line<TPoint>
|
||||
>TPoint : TPoint
|
||||
>Point : Point
|
||||
>Line : Line<TPoint>, Symbol(Line, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 56))
|
||||
>TPoint : TPoint, Symbol(TPoint, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 15, 26))
|
||||
>Point : Point, Symbol(Point, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10))
|
||||
|
||||
new (start: TPoint, end: TPoint);
|
||||
>start : TPoint
|
||||
>TPoint : TPoint
|
||||
>end : TPoint
|
||||
>TPoint : TPoint
|
||||
>start : TPoint, Symbol(start, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 16, 13))
|
||||
>TPoint : TPoint, Symbol(TPoint, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 15, 26))
|
||||
>end : TPoint, Symbol(end, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 16, 27))
|
||||
>TPoint : TPoint, Symbol(TPoint, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 15, 26))
|
||||
|
||||
start: TPoint;
|
||||
>start : TPoint
|
||||
>TPoint : TPoint
|
||||
>start : TPoint, Symbol(start, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 16, 41))
|
||||
>TPoint : TPoint, Symbol(TPoint, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 15, 26))
|
||||
|
||||
end: TPoint;
|
||||
>end : TPoint
|
||||
>TPoint : TPoint
|
||||
>end : TPoint, Symbol(end, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 18, 22))
|
||||
>TPoint : TPoint, Symbol(TPoint, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 15, 26))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,47 +1,51 @@
|
||||
=== tests/cases/conformance/internalModules/exportDeclarations/ExportModuleWithAccessibleTypesOnItsExportedMembers.ts ===
|
||||
module A {
|
||||
>A : typeof A
|
||||
>A : typeof A, Symbol(A, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 0, 0))
|
||||
|
||||
export class Point {
|
||||
>Point : Point
|
||||
>Point : Point, Symbol(Point, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 0, 10))
|
||||
|
||||
constructor(public x: number, public y: number) { }
|
||||
>x : number
|
||||
>y : number
|
||||
>x : number, Symbol(x, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 3, 20))
|
||||
>y : number, Symbol(y, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 3, 37))
|
||||
}
|
||||
|
||||
export module B {
|
||||
>B : typeof B
|
||||
>B : typeof B, Symbol(B, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 4, 5))
|
||||
|
||||
export var Origin: Point = new Point(0, 0);
|
||||
>Origin : Point
|
||||
>Point : Point
|
||||
>Origin : Point, Symbol(Origin, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 7, 18))
|
||||
>Point : Point, Symbol(Point, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 0, 10))
|
||||
>new Point(0, 0) : Point
|
||||
>Point : typeof Point
|
||||
>Point : typeof Point, Symbol(Point, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 0, 10))
|
||||
>0 : number
|
||||
>0 : number
|
||||
|
||||
export class Line {
|
||||
>Line : Line
|
||||
>Line : Line, Symbol(Line, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 7, 51))
|
||||
|
||||
constructor(start: Point, end: Point) {
|
||||
>start : Point
|
||||
>Point : Point
|
||||
>end : Point
|
||||
>Point : Point
|
||||
>start : Point, Symbol(start, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 10, 24))
|
||||
>Point : Point, Symbol(Point, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 0, 10))
|
||||
>end : Point, Symbol(end, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 10, 37))
|
||||
>Point : Point, Symbol(Point, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 0, 10))
|
||||
|
||||
}
|
||||
|
||||
static fromOrigin(p: Point) {
|
||||
>fromOrigin : (p: Point) => Line
|
||||
>p : Point
|
||||
>Point : Point
|
||||
>fromOrigin : (p: Point) => Line, Symbol(Line.fromOrigin, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 12, 13))
|
||||
>p : Point, Symbol(p, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 14, 30))
|
||||
>Point : Point, Symbol(Point, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 0, 10))
|
||||
|
||||
return new Line({ x: 0, y: 0 }, p);
|
||||
>new Line({ x: 0, y: 0 }, p) : Line
|
||||
>Line : typeof Line
|
||||
>Line : typeof Line, Symbol(Line, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 7, 51))
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>p : Point
|
||||
>x : number, Symbol(x, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 15, 33))
|
||||
>0 : number
|
||||
>y : number, Symbol(y, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 15, 39))
|
||||
>0 : number
|
||||
>p : Point, Symbol(p, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 14, 30))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,30 +1,36 @@
|
||||
=== tests/cases/conformance/internalModules/exportDeclarations/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts ===
|
||||
module A {
|
||||
>A : typeof A
|
||||
>A : typeof A, Symbol(A, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 0, 0))
|
||||
|
||||
class Point {
|
||||
>Point : Point
|
||||
>Point : Point, Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 0, 10))
|
||||
|
||||
constructor(public x: number, public y: number) { }
|
||||
>x : number
|
||||
>y : number
|
||||
>x : number, Symbol(x, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 3, 20))
|
||||
>y : number, Symbol(y, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 3, 37))
|
||||
}
|
||||
|
||||
export var Origin: Point = { x: 0, y: 0 };
|
||||
>Origin : Point
|
||||
>Point : Point
|
||||
>Origin : Point, Symbol(Origin, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 6, 14))
|
||||
>Point : Point, Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 0, 10))
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>x : number, Symbol(x, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 6, 32))
|
||||
>0 : number
|
||||
>y : number, Symbol(y, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 6, 38))
|
||||
>0 : number
|
||||
|
||||
export var Unity = { start: new Point(0, 0), end: new Point(1, 0) };
|
||||
>Unity : { start: Point; end: Point; }
|
||||
>Unity : { start: Point; end: Point; }, Symbol(Unity, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 8, 14))
|
||||
>{ start: new Point(0, 0), end: new Point(1, 0) } : { start: Point; end: Point; }
|
||||
>start : Point
|
||||
>start : Point, Symbol(start, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 8, 24))
|
||||
>new Point(0, 0) : Point
|
||||
>Point : typeof Point
|
||||
>end : Point
|
||||
>Point : typeof Point, Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 0, 10))
|
||||
>0 : number
|
||||
>0 : number
|
||||
>end : Point, Symbol(end, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 8, 48))
|
||||
>new Point(1, 0) : Point
|
||||
>Point : typeof Point
|
||||
>Point : typeof Point, Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 0, 10))
|
||||
>1 : number
|
||||
>0 : number
|
||||
}
|
||||
|
||||
|
||||
@ -1,31 +1,32 @@
|
||||
=== tests/cases/conformance/internalModules/exportDeclarations/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts ===
|
||||
module A {
|
||||
>A : typeof A
|
||||
>A : typeof A, Symbol(A, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 0, 0))
|
||||
|
||||
class Point {
|
||||
>Point : Point
|
||||
>Point : Point, Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 0, 10))
|
||||
|
||||
constructor(public x: number, public y: number) { }
|
||||
>x : number
|
||||
>y : number
|
||||
>x : number, Symbol(x, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 3, 20))
|
||||
>y : number, Symbol(y, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 3, 37))
|
||||
}
|
||||
|
||||
export var UnitSquare : {
|
||||
>UnitSquare : { top: { left: Point; right: Point; }; bottom: { left: Point; right: Point; }; }
|
||||
>UnitSquare : { top: { left: Point; right: Point; }; bottom: { left: Point; right: Point; }; }, Symbol(UnitSquare, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 6, 14))
|
||||
|
||||
top: { left: Point, right: Point },
|
||||
>top : { left: Point; right: Point; }
|
||||
>left : Point
|
||||
>Point : Point
|
||||
>right : Point
|
||||
>Point : Point
|
||||
>top : { left: Point; right: Point; }, Symbol(top, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 6, 29))
|
||||
>left : Point, Symbol(left, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 7, 14))
|
||||
>Point : Point, Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 0, 10))
|
||||
>right : Point, Symbol(right, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 7, 27))
|
||||
>Point : Point, Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 0, 10))
|
||||
|
||||
bottom: { left: Point, right: Point }
|
||||
>bottom : { left: Point; right: Point; }
|
||||
>left : Point
|
||||
>Point : Point
|
||||
>right : Point
|
||||
>Point : Point
|
||||
>bottom : { left: Point; right: Point; }, Symbol(bottom, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 7, 43))
|
||||
>left : Point, Symbol(left, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 8, 17))
|
||||
>Point : Point, Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 0, 10))
|
||||
>right : Point, Symbol(right, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 8, 30))
|
||||
>Point : Point, Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 0, 10))
|
||||
|
||||
} = null;
|
||||
>null : null
|
||||
}
|
||||
|
||||
@ -1,22 +1,22 @@
|
||||
=== tests/cases/conformance/internalModules/exportDeclarations/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts ===
|
||||
module A {
|
||||
>A : typeof A
|
||||
>A : typeof A, Symbol(A, Decl(ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts, 0, 0))
|
||||
|
||||
class B {
|
||||
>B : B
|
||||
>B : B, Symbol(B, Decl(ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts, 0, 10))
|
||||
|
||||
id: number;
|
||||
>id : number
|
||||
>id : number, Symbol(id, Decl(ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts, 1, 13))
|
||||
}
|
||||
|
||||
export var beez: Array<B>;
|
||||
>beez : B[]
|
||||
>Array : T[]
|
||||
>B : B
|
||||
>beez : B[], Symbol(beez, Decl(ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts, 5, 14))
|
||||
>Array : T[], Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11))
|
||||
>B : B, Symbol(B, Decl(ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts, 0, 10))
|
||||
|
||||
export var beez2 = new Array<B>();
|
||||
>beez2 : B[]
|
||||
>beez2 : B[], Symbol(beez2, Decl(ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts, 6, 14))
|
||||
>new Array<B>() : B[]
|
||||
>Array : ArrayConstructor
|
||||
>B : B
|
||||
>Array : ArrayConstructor, Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11))
|
||||
>B : B, Symbol(B, Decl(ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts, 0, 10))
|
||||
}
|
||||
|
||||
@ -1,23 +1,25 @@
|
||||
=== tests/cases/conformance/internalModules/exportDeclarations/ExportVariableWithAccessibleTypeInTypeAnnotation.ts ===
|
||||
module A {
|
||||
>A : typeof A
|
||||
>A : typeof A, Symbol(A, Decl(ExportVariableWithAccessibleTypeInTypeAnnotation.ts, 0, 0))
|
||||
|
||||
export interface Point {
|
||||
>Point : Point
|
||||
>Point : Point, Symbol(Point, Decl(ExportVariableWithAccessibleTypeInTypeAnnotation.ts, 0, 10))
|
||||
|
||||
x: number;
|
||||
>x : number
|
||||
>x : number, Symbol(x, Decl(ExportVariableWithAccessibleTypeInTypeAnnotation.ts, 2, 28))
|
||||
|
||||
y: number;
|
||||
>y : number
|
||||
>y : number, Symbol(y, Decl(ExportVariableWithAccessibleTypeInTypeAnnotation.ts, 3, 18))
|
||||
}
|
||||
|
||||
// valid since Point is exported
|
||||
export var Origin: Point = { x: 0, y: 0 };
|
||||
>Origin : Point
|
||||
>Point : Point
|
||||
>Origin : Point, Symbol(Origin, Decl(ExportVariableWithAccessibleTypeInTypeAnnotation.ts, 8, 14))
|
||||
>Point : Point, Symbol(Point, Decl(ExportVariableWithAccessibleTypeInTypeAnnotation.ts, 0, 10))
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>x : number, Symbol(x, Decl(ExportVariableWithAccessibleTypeInTypeAnnotation.ts, 8, 32))
|
||||
>0 : number
|
||||
>y : number, Symbol(y, Decl(ExportVariableWithAccessibleTypeInTypeAnnotation.ts, 8, 38))
|
||||
>0 : number
|
||||
}
|
||||
|
||||
|
||||
@ -1,40 +1,45 @@
|
||||
=== tests/cases/conformance/internalModules/exportDeclarations/ExportVariableWithInaccessibleTypeInTypeAnnotation.ts ===
|
||||
module A {
|
||||
>A : typeof A
|
||||
>A : typeof A, Symbol(A, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 0, 0))
|
||||
|
||||
export interface Point {
|
||||
>Point : Point
|
||||
>Point : Point, Symbol(Point, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 0, 10))
|
||||
|
||||
x: number;
|
||||
>x : number
|
||||
>x : number, Symbol(x, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 2, 28))
|
||||
|
||||
y: number;
|
||||
>y : number
|
||||
>y : number, Symbol(y, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 3, 18))
|
||||
}
|
||||
|
||||
// valid since Point is exported
|
||||
export var Origin: Point = { x: 0, y: 0 };
|
||||
>Origin : Point
|
||||
>Point : Point
|
||||
>Origin : Point, Symbol(Origin, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 8, 14))
|
||||
>Point : Point, Symbol(Point, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 0, 10))
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>x : number, Symbol(x, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 8, 32))
|
||||
>0 : number
|
||||
>y : number, Symbol(y, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 8, 38))
|
||||
>0 : number
|
||||
|
||||
interface Point3d extends Point {
|
||||
>Point3d : Point3d
|
||||
>Point : Point
|
||||
>Point3d : Point3d, Symbol(Point3d, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 8, 46))
|
||||
>Point : Point, Symbol(Point, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 0, 10))
|
||||
|
||||
z: number;
|
||||
>z : number
|
||||
>z : number, Symbol(z, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 10, 37))
|
||||
}
|
||||
|
||||
// invalid Point3d is not exported
|
||||
export var Origin3d: Point3d = { x: 0, y: 0, z: 0 };
|
||||
>Origin3d : Point3d
|
||||
>Point3d : Point3d
|
||||
>Origin3d : Point3d, Symbol(Origin3d, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 15, 14))
|
||||
>Point3d : Point3d, Symbol(Point3d, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 8, 46))
|
||||
>{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>z : number
|
||||
>x : number, Symbol(x, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 15, 36))
|
||||
>0 : number
|
||||
>y : number, Symbol(y, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 15, 42))
|
||||
>0 : number
|
||||
>z : number, Symbol(z, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 15, 48))
|
||||
>0 : number
|
||||
}
|
||||
|
||||
|
||||
@ -1,54 +1,58 @@
|
||||
=== tests/cases/conformance/internalModules/DeclarationMerging/function.ts ===
|
||||
module A {
|
||||
>A : typeof A
|
||||
>A : typeof A, Symbol(A, Decl(function.ts, 0, 0))
|
||||
|
||||
export function Point() {
|
||||
>Point : () => { x: number; y: number; }
|
||||
>Point : () => { x: number; y: number; }, Symbol(Point, Decl(function.ts, 0, 10))
|
||||
|
||||
return { x: 0, y: 0 };
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>x : number, Symbol(x, Decl(function.ts, 2, 16))
|
||||
>0 : number
|
||||
>y : number, Symbol(y, Decl(function.ts, 2, 22))
|
||||
>0 : number
|
||||
}
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/internalModules/DeclarationMerging/module.ts ===
|
||||
module B {
|
||||
>B : typeof B
|
||||
>B : typeof B, Symbol(B, Decl(module.ts, 0, 0))
|
||||
|
||||
export module Point {
|
||||
>Point : typeof Point
|
||||
>Point : typeof Point, Symbol(Point, Decl(module.ts, 0, 10))
|
||||
|
||||
export var Origin = { x: 0, y: 0 };
|
||||
>Origin : { x: number; y: number; }
|
||||
>Origin : { x: number; y: number; }, Symbol(Origin, Decl(module.ts, 2, 18))
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>x : number, Symbol(x, Decl(module.ts, 2, 29))
|
||||
>0 : number
|
||||
>y : number, Symbol(y, Decl(module.ts, 2, 35))
|
||||
>0 : number
|
||||
}
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/internalModules/DeclarationMerging/test.ts ===
|
||||
var fn: () => { x: number; y: number };
|
||||
>fn : () => { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>fn : () => { x: number; y: number; }, Symbol(fn, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3))
|
||||
>x : number, Symbol(x, Decl(test.ts, 0, 15))
|
||||
>y : number, Symbol(y, Decl(test.ts, 0, 26))
|
||||
|
||||
var fn = A.Point;
|
||||
>fn : () => { x: number; y: number; }
|
||||
>A.Point : () => { x: number; y: number; }
|
||||
>A : typeof A
|
||||
>Point : () => { x: number; y: number; }
|
||||
>fn : () => { x: number; y: number; }, Symbol(fn, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3))
|
||||
>A.Point : () => { x: number; y: number; }, Symbol(A.Point, Decl(function.ts, 0, 10))
|
||||
>A : typeof A, Symbol(A, Decl(function.ts, 0, 0))
|
||||
>Point : () => { x: number; y: number; }, Symbol(A.Point, Decl(function.ts, 0, 10))
|
||||
|
||||
var cl: { x: number; y: number; }
|
||||
>cl : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>cl : { x: number; y: number; }, Symbol(cl, Decl(test.ts, 3, 3), Decl(test.ts, 4, 3))
|
||||
>x : number, Symbol(x, Decl(test.ts, 3, 9))
|
||||
>y : number, Symbol(y, Decl(test.ts, 3, 20))
|
||||
|
||||
var cl = B.Point.Origin;
|
||||
>cl : { x: number; y: number; }
|
||||
>B.Point.Origin : { x: number; y: number; }
|
||||
>B.Point : typeof B.Point
|
||||
>B : typeof B
|
||||
>Point : typeof B.Point
|
||||
>Origin : { x: number; y: number; }
|
||||
>cl : { x: number; y: number; }, Symbol(cl, Decl(test.ts, 3, 3), Decl(test.ts, 4, 3))
|
||||
>B.Point.Origin : { x: number; y: number; }, Symbol(B.Point.Origin, Decl(module.ts, 2, 18))
|
||||
>B.Point : typeof B.Point, Symbol(B.Point, Decl(module.ts, 0, 10))
|
||||
>B : typeof B, Symbol(B, Decl(module.ts, 0, 0))
|
||||
>Point : typeof B.Point, Symbol(B.Point, Decl(module.ts, 0, 10))
|
||||
>Origin : { x: number; y: number; }, Symbol(B.Point.Origin, Decl(module.ts, 2, 18))
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration2_es6.ts ===
|
||||
function f(yield) {
|
||||
>f : (yield: any) => void
|
||||
>yield : any
|
||||
>f : (yield: any) => void, Symbol(f, Decl(FunctionDeclaration2_es6.ts, 0, 0))
|
||||
>yield : any, Symbol(yield, Decl(FunctionDeclaration2_es6.ts, 0, 11))
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration4_es6.ts ===
|
||||
function yield() {
|
||||
>yield : () => void
|
||||
>yield : () => void, Symbol(yield, Decl(FunctionDeclaration4_es6.ts, 0, 0))
|
||||
}
|
||||
|
||||
@ -1,43 +1,45 @@
|
||||
=== tests/cases/conformance/internalModules/DeclarationMerging/ModuleAndEnumWithSameNameAndCommonRoot.ts ===
|
||||
module enumdule {
|
||||
>enumdule : typeof enumdule
|
||||
>enumdule : typeof enumdule, Symbol(enumdule, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 0, 0), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 5, 1))
|
||||
|
||||
export class Point {
|
||||
>Point : Point
|
||||
>Point : Point, Symbol(Point, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 0, 17))
|
||||
|
||||
constructor(public x: number, public y: number) { }
|
||||
>x : number
|
||||
>y : number
|
||||
>x : number, Symbol(x, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 3, 20))
|
||||
>y : number, Symbol(y, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 3, 37))
|
||||
}
|
||||
}
|
||||
|
||||
enum enumdule {
|
||||
>enumdule : enumdule
|
||||
>enumdule : enumdule, Symbol(enumdule, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 0, 0), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 5, 1))
|
||||
|
||||
Red, Blue
|
||||
>Red : enumdule
|
||||
>Blue : enumdule
|
||||
>Red : enumdule, Symbol(enumdule.Red, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 7, 15))
|
||||
>Blue : enumdule, Symbol(enumdule.Blue, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 8, 8))
|
||||
}
|
||||
|
||||
var x: enumdule;
|
||||
>x : enumdule
|
||||
>enumdule : enumdule
|
||||
>x : enumdule, Symbol(x, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 11, 3), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 12, 3))
|
||||
>enumdule : enumdule, Symbol(enumdule, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 0, 0), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 5, 1))
|
||||
|
||||
var x = enumdule.Red;
|
||||
>x : enumdule
|
||||
>enumdule.Red : enumdule
|
||||
>enumdule : typeof enumdule
|
||||
>Red : enumdule
|
||||
>x : enumdule, Symbol(x, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 11, 3), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 12, 3))
|
||||
>enumdule.Red : enumdule, Symbol(enumdule.Red, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 7, 15))
|
||||
>enumdule : typeof enumdule, Symbol(enumdule, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 0, 0), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 5, 1))
|
||||
>Red : enumdule, Symbol(enumdule.Red, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 7, 15))
|
||||
|
||||
var y: { x: number; y: number };
|
||||
>y : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>y : { x: number; y: number; }, Symbol(y, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 14, 3), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 15, 3))
|
||||
>x : number, Symbol(x, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 14, 8))
|
||||
>y : number, Symbol(y, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 14, 19))
|
||||
|
||||
var y = new enumdule.Point(0, 0);
|
||||
>y : { x: number; y: number; }
|
||||
>y : { x: number; y: number; }, Symbol(y, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 14, 3), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 15, 3))
|
||||
>new enumdule.Point(0, 0) : enumdule.Point
|
||||
>enumdule.Point : typeof enumdule.Point
|
||||
>enumdule : typeof enumdule
|
||||
>Point : typeof enumdule.Point
|
||||
>enumdule.Point : typeof enumdule.Point, Symbol(enumdule.Point, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 0, 17))
|
||||
>enumdule : typeof enumdule, Symbol(enumdule, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 0, 0), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 5, 1))
|
||||
>Point : typeof enumdule.Point, Symbol(enumdule.Point, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 0, 17))
|
||||
>0 : number
|
||||
>0 : number
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
=== tests/cases/conformance/parser/ecmascript5/Protected/Protected5.ts ===
|
||||
class C {
|
||||
>C : C
|
||||
>C : C, Symbol(C, Decl(Protected5.ts, 0, 0))
|
||||
|
||||
protected static m() { }
|
||||
>m : () => void
|
||||
>m : () => void, Symbol(C.m, Decl(Protected5.ts, 0, 9))
|
||||
}
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
=== tests/cases/conformance/parser/ecmascript5/Protected/Protected8.ts ===
|
||||
interface I {
|
||||
>I : I
|
||||
>I : I, Symbol(I, Decl(Protected8.ts, 0, 0))
|
||||
|
||||
protected
|
||||
>protected : any
|
||||
>protected : any, Symbol(protected, Decl(Protected8.ts, 0, 13))
|
||||
|
||||
p
|
||||
>p : any
|
||||
>p : any, Symbol(p, Decl(Protected8.ts, 1, 12))
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
=== tests/cases/conformance/parser/ecmascript5/Protected/Protected9.ts ===
|
||||
class C {
|
||||
>C : C
|
||||
>C : C, Symbol(C, Decl(Protected9.ts, 0, 0))
|
||||
|
||||
constructor(protected p) { }
|
||||
>p : any
|
||||
>p : any, Symbol(p, Decl(Protected9.ts, 1, 15))
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
=== tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType1.ts ===
|
||||
var v: [number]
|
||||
>v : [number]
|
||||
>v : [number], Symbol(v, Decl(TupleType1.ts, 0, 3))
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
=== tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType2.ts ===
|
||||
var v: [number, string]
|
||||
>v : [number, string]
|
||||
>v : [number, string], Symbol(v, Decl(TupleType2.ts, 0, 3))
|
||||
|
||||
|
||||
@ -1,82 +1,82 @@
|
||||
=== tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts ===
|
||||
module A {
|
||||
>A : typeof A
|
||||
>A : typeof A, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 5, 1))
|
||||
|
||||
export class Point {
|
||||
>Point : Point
|
||||
>Point : Point, Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 0, 10))
|
||||
|
||||
x: number;
|
||||
>x : number
|
||||
>x : number, Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 1, 24))
|
||||
|
||||
y: number;
|
||||
>y : number
|
||||
>y : number, Symbol(y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 2, 18))
|
||||
}
|
||||
}
|
||||
|
||||
module A {
|
||||
>A : typeof A
|
||||
>A : typeof A, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 5, 1))
|
||||
|
||||
class Point {
|
||||
>Point : Point
|
||||
>Point : Point, Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 7, 10))
|
||||
|
||||
fromCarthesian(p: A.Point) {
|
||||
>fromCarthesian : (p: A.Point) => { x: number; y: number; }
|
||||
>p : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>fromCarthesian : (p: A.Point) => { x: number; y: number; }, Symbol(fromCarthesian, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 8, 17))
|
||||
>p : A.Point, Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 9, 23))
|
||||
>A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 5, 1))
|
||||
>Point : A.Point, Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 0, 10))
|
||||
|
||||
return { x: p.x, y: p.y };
|
||||
>{ x: p.x, y: p.y } : { x: number; y: number; }
|
||||
>x : number
|
||||
>p.x : number
|
||||
>p : A.Point
|
||||
>x : number
|
||||
>y : number
|
||||
>p.y : number
|
||||
>p : A.Point
|
||||
>y : number
|
||||
>x : number, Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 10, 20))
|
||||
>p.x : number, Symbol(Point.x, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 1, 24))
|
||||
>p : A.Point, Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 9, 23))
|
||||
>x : number, Symbol(Point.x, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 1, 24))
|
||||
>y : number, Symbol(y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 10, 28))
|
||||
>p.y : number, Symbol(Point.y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 2, 18))
|
||||
>p : A.Point, Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 9, 23))
|
||||
>y : number, Symbol(Point.y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 2, 18))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ensure merges as expected
|
||||
var p: { x: number; y: number; };
|
||||
>p : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>p : { x: number; y: number; }, Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 16, 3), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 17, 3))
|
||||
>x : number, Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 16, 8))
|
||||
>y : number, Symbol(y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 16, 19))
|
||||
|
||||
var p: A.Point;
|
||||
>p : { x: number; y: number; }
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>p : { x: number; y: number; }, Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 16, 3), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 17, 3))
|
||||
>A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 5, 1))
|
||||
>Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 0, 10))
|
||||
|
||||
module X.Y.Z {
|
||||
>X : typeof X
|
||||
>Y : typeof Y
|
||||
>Z : typeof Z
|
||||
>X : typeof X, Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 17, 15), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 23, 1))
|
||||
>Y : typeof Y, Symbol(Y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 19, 9), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 25, 10))
|
||||
>Z : typeof Z, Symbol(Z, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 19, 11), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 26, 21))
|
||||
|
||||
export class Line {
|
||||
>Line : Line
|
||||
>Line : Line, Symbol(Line, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 19, 14))
|
||||
|
||||
length: number;
|
||||
>length : number
|
||||
>length : number, Symbol(length, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 20, 23))
|
||||
}
|
||||
}
|
||||
|
||||
module X {
|
||||
>X : typeof X
|
||||
>X : typeof X, Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 17, 15), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 23, 1))
|
||||
|
||||
export module Y {
|
||||
>Y : typeof Y
|
||||
>Y : typeof Y, Symbol(Y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 19, 9), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 25, 10))
|
||||
|
||||
export module Z {
|
||||
>Z : typeof Z
|
||||
>Z : typeof Z, Symbol(Z, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 19, 11), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 26, 21))
|
||||
|
||||
class Line {
|
||||
>Line : Line
|
||||
>Line : Line, Symbol(Line, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 27, 25))
|
||||
|
||||
name: string;
|
||||
>name : string
|
||||
>name : string, Symbol(name, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 28, 24))
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -84,14 +84,14 @@ module X {
|
||||
|
||||
// ensure merges as expected
|
||||
var l: { length: number; }
|
||||
>l : { length: number; }
|
||||
>length : number
|
||||
>l : { length: number; }, Symbol(l, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 36, 3), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 37, 3))
|
||||
>length : number, Symbol(length, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 36, 8))
|
||||
|
||||
var l: X.Y.Z.Line;
|
||||
>l : { length: number; }
|
||||
>X : unknown
|
||||
>Y : unknown
|
||||
>Z : unknown
|
||||
>Line : X.Y.Z.Line
|
||||
>l : { length: number; }, Symbol(l, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 36, 3), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 37, 3))
|
||||
>X : any, Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 17, 15), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 23, 1))
|
||||
>Y : any, Symbol(X.Y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 19, 9), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 25, 10))
|
||||
>Z : any, Symbol(X.Y.Z, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 19, 11), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 26, 21))
|
||||
>Line : X.Y.Z.Line, Symbol(X.Y.Z.Line, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 19, 14))
|
||||
|
||||
|
||||
|
||||
@ -1,103 +1,103 @@
|
||||
=== tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts ===
|
||||
module A {
|
||||
>A : unknown
|
||||
>A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1))
|
||||
|
||||
export interface Point {
|
||||
>Point : Point
|
||||
>Point : Point, Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10))
|
||||
|
||||
x: number;
|
||||
>x : number
|
||||
>x : number, Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 1, 28))
|
||||
|
||||
y: number;
|
||||
>y : number
|
||||
>y : number, Symbol(y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 2, 18))
|
||||
|
||||
toCarth(): Point;
|
||||
>toCarth : () => Point
|
||||
>Point : Point
|
||||
>toCarth : () => Point, Symbol(toCarth, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 3, 18))
|
||||
>Point : Point, Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10))
|
||||
}
|
||||
}
|
||||
|
||||
module A {
|
||||
>A : unknown
|
||||
>A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1))
|
||||
|
||||
interface Point {
|
||||
>Point : Point
|
||||
>Point : Point, Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 8, 10))
|
||||
|
||||
fromCarth(): Point;
|
||||
>fromCarth : () => Point
|
||||
>Point : Point
|
||||
>fromCarth : () => Point, Symbol(fromCarth, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 9, 21))
|
||||
>Point : Point, Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 8, 10))
|
||||
}
|
||||
}
|
||||
|
||||
// ensure merges as expected
|
||||
var p: { x: number; y: number; toCarth(): A.Point; };
|
||||
>p : { x: number; y: number; toCarth(): A.Point; }
|
||||
>x : number
|
||||
>y : number
|
||||
>toCarth : () => A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>p : { x: number; y: number; toCarth(): A.Point; }, Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 15, 3), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 16, 3))
|
||||
>x : number, Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 15, 8))
|
||||
>y : number, Symbol(y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 15, 19))
|
||||
>toCarth : () => A.Point, Symbol(toCarth, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 15, 30))
|
||||
>A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1))
|
||||
>Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10))
|
||||
|
||||
var p: A.Point;
|
||||
>p : { x: number; y: number; toCarth(): A.Point; }
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>p : { x: number; y: number; toCarth(): A.Point; }, Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 15, 3), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 16, 3))
|
||||
>A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1))
|
||||
>Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10))
|
||||
|
||||
module X.Y.Z {
|
||||
>X : unknown
|
||||
>Y : unknown
|
||||
>Z : unknown
|
||||
>X : any, Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 16, 15), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 22, 1))
|
||||
>Y : any, Symbol(Y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 18, 9), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 24, 10))
|
||||
>Z : any, Symbol(Z, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 18, 11), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 25, 20))
|
||||
|
||||
export interface Line {
|
||||
>Line : Line
|
||||
>Line : Line, Symbol(Line, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 18, 14))
|
||||
|
||||
new (start: A.Point, end: A.Point);
|
||||
>start : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>end : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>start : A.Point, Symbol(start, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 20, 13))
|
||||
>A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1))
|
||||
>Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10))
|
||||
>end : A.Point, Symbol(end, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 20, 28))
|
||||
>A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1))
|
||||
>Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10))
|
||||
}
|
||||
}
|
||||
|
||||
module X {
|
||||
>X : unknown
|
||||
>X : any, Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 16, 15), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 22, 1))
|
||||
|
||||
export module Y.Z {
|
||||
>Y : unknown
|
||||
>Z : unknown
|
||||
>Y : any, Symbol(Y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 18, 9), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 24, 10))
|
||||
>Z : any, Symbol(Z, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 18, 11), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 25, 20))
|
||||
|
||||
interface Line {
|
||||
>Line : Line
|
||||
>Line : Line, Symbol(Line, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 25, 23))
|
||||
|
||||
start: A.Point;
|
||||
>start : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>start : A.Point, Symbol(start, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 26, 24))
|
||||
>A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1))
|
||||
>Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10))
|
||||
|
||||
end: A.Point;
|
||||
>end : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>end : A.Point, Symbol(end, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 27, 27))
|
||||
>A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1))
|
||||
>Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ensure merges as expected
|
||||
var l: { new (s: A.Point, e: A.Point); }
|
||||
>l : new (s: A.Point, e: A.Point) => any
|
||||
>s : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>e : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>l : new (s: A.Point, e: A.Point) => any, Symbol(l, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 34, 3), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 35, 3))
|
||||
>s : A.Point, Symbol(s, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 34, 14))
|
||||
>A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1))
|
||||
>Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10))
|
||||
>e : A.Point, Symbol(e, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 34, 25))
|
||||
>A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1))
|
||||
>Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10))
|
||||
|
||||
var l: X.Y.Z.Line;
|
||||
>l : new (s: A.Point, e: A.Point) => any
|
||||
>X : unknown
|
||||
>Y : unknown
|
||||
>Z : unknown
|
||||
>Line : X.Y.Z.Line
|
||||
>l : new (s: A.Point, e: A.Point) => any, Symbol(l, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 34, 3), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 35, 3))
|
||||
>X : any, Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 16, 15), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 22, 1))
|
||||
>Y : any, Symbol(X.Y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 18, 9), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 24, 10))
|
||||
>Z : any, Symbol(X.Y.Z, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 18, 11), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 25, 20))
|
||||
>Line : X.Y.Z.Line, Symbol(X.Y.Z.Line, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 18, 14))
|
||||
|
||||
|
||||
@ -1,66 +1,69 @@
|
||||
=== tests/cases/conformance/internalModules/DeclarationMerging/part1.ts ===
|
||||
module A {
|
||||
>A : typeof A
|
||||
>A : typeof A, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
|
||||
|
||||
export interface Point {
|
||||
>Point : Point
|
||||
>Point : Point, Symbol(Point, Decl(part1.ts, 0, 10))
|
||||
|
||||
x: number;
|
||||
>x : number
|
||||
>x : number, Symbol(x, Decl(part1.ts, 1, 28))
|
||||
|
||||
y: number;
|
||||
>y : number
|
||||
>y : number, Symbol(y, Decl(part1.ts, 2, 18))
|
||||
}
|
||||
|
||||
export module Utils {
|
||||
>Utils : typeof Utils
|
||||
>Utils : typeof Utils, Symbol(Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 2, 31))
|
||||
|
||||
export function mirror<T extends Point>(p: T) {
|
||||
>mirror : <T extends Point>(p: T) => { x: number; y: number; }
|
||||
>T : T
|
||||
>Point : Point
|
||||
>p : T
|
||||
>T : T
|
||||
>mirror : <T extends Point>(p: T) => { x: number; y: number; }, Symbol(mirror, Decl(part1.ts, 6, 25))
|
||||
>T : T, Symbol(T, Decl(part1.ts, 7, 31))
|
||||
>Point : Point, Symbol(Point, Decl(part1.ts, 0, 10))
|
||||
>p : T, Symbol(p, Decl(part1.ts, 7, 48))
|
||||
>T : T, Symbol(T, Decl(part1.ts, 7, 31))
|
||||
|
||||
return { x: p.y, y: p.x };
|
||||
>{ x: p.y, y: p.x } : { x: number; y: number; }
|
||||
>x : number
|
||||
>p.y : number
|
||||
>p : T
|
||||
>y : number
|
||||
>y : number
|
||||
>p.x : number
|
||||
>p : T
|
||||
>x : number
|
||||
>x : number, Symbol(x, Decl(part1.ts, 8, 20))
|
||||
>p.y : number, Symbol(Point.y, Decl(part1.ts, 2, 18))
|
||||
>p : T, Symbol(p, Decl(part1.ts, 7, 48))
|
||||
>y : number, Symbol(Point.y, Decl(part1.ts, 2, 18))
|
||||
>y : number, Symbol(y, Decl(part1.ts, 8, 28))
|
||||
>p.x : number, Symbol(Point.x, Decl(part1.ts, 1, 28))
|
||||
>p : T, Symbol(p, Decl(part1.ts, 7, 48))
|
||||
>x : number, Symbol(Point.x, Decl(part1.ts, 1, 28))
|
||||
}
|
||||
}
|
||||
export var Origin: Point = { x: 0, y: 0 };
|
||||
>Origin : Point
|
||||
>Point : Point
|
||||
>Origin : Point, Symbol(Origin, Decl(part1.ts, 11, 14))
|
||||
>Point : Point, Symbol(Point, Decl(part1.ts, 0, 10))
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>x : number, Symbol(x, Decl(part1.ts, 11, 32))
|
||||
>0 : number
|
||||
>y : number, Symbol(y, Decl(part1.ts, 11, 38))
|
||||
>0 : number
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/internalModules/DeclarationMerging/part2.ts ===
|
||||
module A {
|
||||
>A : typeof A
|
||||
>A : typeof A, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
|
||||
|
||||
// not a collision, since we don't export
|
||||
var Origin: string = "0,0";
|
||||
>Origin : string
|
||||
>Origin : string, Symbol(Origin, Decl(part2.ts, 2, 7))
|
||||
>"0,0" : string
|
||||
|
||||
export module Utils {
|
||||
>Utils : typeof Utils
|
||||
>Utils : typeof Utils, Symbol(Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 2, 31))
|
||||
|
||||
export class Plane {
|
||||
>Plane : Plane
|
||||
>Plane : Plane, Symbol(Plane, Decl(part2.ts, 4, 25))
|
||||
|
||||
constructor(public tl: Point, public br: Point) { }
|
||||
>tl : Point
|
||||
>Point : Point
|
||||
>br : Point
|
||||
>Point : Point
|
||||
>tl : Point, Symbol(tl, Decl(part2.ts, 6, 24))
|
||||
>Point : Point, Symbol(Point, Decl(part1.ts, 0, 10))
|
||||
>br : Point, Symbol(br, Decl(part2.ts, 6, 41))
|
||||
>Point : Point, Symbol(Point, Decl(part1.ts, 0, 10))
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -69,57 +72,59 @@ module A {
|
||||
// test the merging actually worked
|
||||
|
||||
var o: { x: number; y: number };
|
||||
>o : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>o : { x: number; y: number; }, Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
|
||||
>x : number, Symbol(x, Decl(part3.ts, 2, 8))
|
||||
>y : number, Symbol(y, Decl(part3.ts, 2, 19))
|
||||
|
||||
var o: A.Point;
|
||||
>o : { x: number; y: number; }
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>o : { x: number; y: number; }, Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
|
||||
>A : any, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
|
||||
>Point : A.Point, Symbol(A.Point, Decl(part1.ts, 0, 10))
|
||||
|
||||
var o = A.Origin;
|
||||
>o : { x: number; y: number; }
|
||||
>A.Origin : A.Point
|
||||
>A : typeof A
|
||||
>Origin : A.Point
|
||||
>o : { x: number; y: number; }, Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
|
||||
>A.Origin : A.Point, Symbol(A.Origin, Decl(part1.ts, 11, 14))
|
||||
>A : typeof A, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
|
||||
>Origin : A.Point, Symbol(A.Origin, Decl(part1.ts, 11, 14))
|
||||
|
||||
var o = A.Utils.mirror(o);
|
||||
>o : { x: number; y: number; }
|
||||
>o : { x: number; y: number; }, Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
|
||||
>A.Utils.mirror(o) : { x: number; y: number; }
|
||||
>A.Utils.mirror : <T extends A.Point>(p: T) => { x: number; y: number; }
|
||||
>A.Utils : typeof A.Utils
|
||||
>A : typeof A
|
||||
>Utils : typeof A.Utils
|
||||
>mirror : <T extends A.Point>(p: T) => { x: number; y: number; }
|
||||
>o : { x: number; y: number; }
|
||||
>A.Utils.mirror : <T extends A.Point>(p: T) => { x: number; y: number; }, Symbol(A.Utils.mirror, Decl(part1.ts, 6, 25))
|
||||
>A.Utils : typeof A.Utils, Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 2, 31))
|
||||
>A : typeof A, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
|
||||
>Utils : typeof A.Utils, Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 2, 31))
|
||||
>mirror : <T extends A.Point>(p: T) => { x: number; y: number; }, Symbol(A.Utils.mirror, Decl(part1.ts, 6, 25))
|
||||
>o : { x: number; y: number; }, Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
|
||||
|
||||
var p: { tl: A.Point; br: A.Point };
|
||||
>p : { tl: A.Point; br: A.Point; }
|
||||
>tl : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>br : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>p : { tl: A.Point; br: A.Point; }, Symbol(p, Decl(part3.ts, 7, 3), Decl(part3.ts, 8, 3), Decl(part3.ts, 9, 3))
|
||||
>tl : A.Point, Symbol(tl, Decl(part3.ts, 7, 8))
|
||||
>A : any, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
|
||||
>Point : A.Point, Symbol(A.Point, Decl(part1.ts, 0, 10))
|
||||
>br : A.Point, Symbol(br, Decl(part3.ts, 7, 21))
|
||||
>A : any, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
|
||||
>Point : A.Point, Symbol(A.Point, Decl(part1.ts, 0, 10))
|
||||
|
||||
var p: A.Utils.Plane;
|
||||
>p : { tl: A.Point; br: A.Point; }
|
||||
>A : unknown
|
||||
>Utils : unknown
|
||||
>Plane : A.Utils.Plane
|
||||
>p : { tl: A.Point; br: A.Point; }, Symbol(p, Decl(part3.ts, 7, 3), Decl(part3.ts, 8, 3), Decl(part3.ts, 9, 3))
|
||||
>A : any, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
|
||||
>Utils : any, Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 2, 31))
|
||||
>Plane : A.Utils.Plane, Symbol(A.Utils.Plane, Decl(part2.ts, 4, 25))
|
||||
|
||||
var p = new A.Utils.Plane(o, { x: 1, y: 1 });
|
||||
>p : { tl: A.Point; br: A.Point; }
|
||||
>p : { tl: A.Point; br: A.Point; }, Symbol(p, Decl(part3.ts, 7, 3), Decl(part3.ts, 8, 3), Decl(part3.ts, 9, 3))
|
||||
>new A.Utils.Plane(o, { x: 1, y: 1 }) : A.Utils.Plane
|
||||
>A.Utils.Plane : typeof A.Utils.Plane
|
||||
>A.Utils : typeof A.Utils
|
||||
>A : typeof A
|
||||
>Utils : typeof A.Utils
|
||||
>Plane : typeof A.Utils.Plane
|
||||
>o : { x: number; y: number; }
|
||||
>A.Utils.Plane : typeof A.Utils.Plane, Symbol(A.Utils.Plane, Decl(part2.ts, 4, 25))
|
||||
>A.Utils : typeof A.Utils, Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 2, 31))
|
||||
>A : typeof A, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
|
||||
>Utils : typeof A.Utils, Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 2, 31))
|
||||
>Plane : typeof A.Utils.Plane, Symbol(A.Utils.Plane, Decl(part2.ts, 4, 25))
|
||||
>o : { x: number; y: number; }, Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
|
||||
>{ x: 1, y: 1 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>x : number, Symbol(x, Decl(part3.ts, 9, 30))
|
||||
>1 : number
|
||||
>y : number, Symbol(y, Decl(part3.ts, 9, 36))
|
||||
>1 : number
|
||||
|
||||
|
||||
|
||||
@ -1,112 +1,112 @@
|
||||
=== tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts ===
|
||||
module A {
|
||||
>A : unknown
|
||||
>A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
|
||||
|
||||
export interface Point {
|
||||
>Point : Point
|
||||
>Point : Point, Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
|
||||
|
||||
x: number;
|
||||
>x : number
|
||||
>x : number, Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 1, 28))
|
||||
|
||||
y: number;
|
||||
>y : number
|
||||
>y : number, Symbol(y, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 2, 18))
|
||||
|
||||
toCarth(): Point;
|
||||
>toCarth : () => Point
|
||||
>Point : Point
|
||||
>toCarth : () => Point, Symbol(toCarth, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 3, 18))
|
||||
>Point : Point, Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
|
||||
}
|
||||
}
|
||||
|
||||
module A {
|
||||
>A : unknown
|
||||
>A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
|
||||
|
||||
export interface Point {
|
||||
>Point : Point
|
||||
>Point : Point, Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
|
||||
|
||||
fromCarth(): Point;
|
||||
>fromCarth : () => Point
|
||||
>Point : Point
|
||||
>fromCarth : () => Point, Symbol(fromCarth, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 9, 28))
|
||||
>Point : Point, Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
|
||||
}
|
||||
}
|
||||
|
||||
// ensure merges as expected
|
||||
var p: { x: number; y: number; toCarth(): A.Point; fromCarth(): A.Point; };
|
||||
>p : { x: number; y: number; toCarth(): A.Point; fromCarth(): A.Point; }
|
||||
>x : number
|
||||
>y : number
|
||||
>toCarth : () => A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>fromCarth : () => A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>p : { x: number; y: number; toCarth(): A.Point; fromCarth(): A.Point; }, Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 15, 3), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 16, 3))
|
||||
>x : number, Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 15, 8))
|
||||
>y : number, Symbol(y, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 15, 19))
|
||||
>toCarth : () => A.Point, Symbol(toCarth, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 15, 30))
|
||||
>A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
|
||||
>Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
|
||||
>fromCarth : () => A.Point, Symbol(fromCarth, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 15, 50))
|
||||
>A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
|
||||
>Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
|
||||
|
||||
var p: A.Point;
|
||||
>p : { x: number; y: number; toCarth(): A.Point; fromCarth(): A.Point; }
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>p : { x: number; y: number; toCarth(): A.Point; fromCarth(): A.Point; }, Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 15, 3), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 16, 3))
|
||||
>A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
|
||||
>Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
|
||||
|
||||
module X.Y.Z {
|
||||
>X : unknown
|
||||
>Y : unknown
|
||||
>Z : unknown
|
||||
>X : any, Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 16, 15), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 22, 1))
|
||||
>Y : any, Symbol(Y, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 9), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 24, 10))
|
||||
>Z : any, Symbol(Z, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 11), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 25, 20))
|
||||
|
||||
export interface Line {
|
||||
>Line : Line
|
||||
>Line : Line, Symbol(Line, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 14), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 25, 23))
|
||||
|
||||
new (start: A.Point, end: A.Point);
|
||||
>start : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>end : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>start : A.Point, Symbol(start, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 20, 13))
|
||||
>A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
|
||||
>Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
|
||||
>end : A.Point, Symbol(end, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 20, 28))
|
||||
>A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
|
||||
>Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
|
||||
}
|
||||
}
|
||||
|
||||
module X {
|
||||
>X : unknown
|
||||
>X : any, Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 16, 15), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 22, 1))
|
||||
|
||||
export module Y.Z {
|
||||
>Y : unknown
|
||||
>Z : unknown
|
||||
>Y : any, Symbol(Y, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 9), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 24, 10))
|
||||
>Z : any, Symbol(Z, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 11), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 25, 20))
|
||||
|
||||
export interface Line {
|
||||
>Line : Line
|
||||
>Line : Line, Symbol(Line, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 14), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 25, 23))
|
||||
|
||||
start: A.Point;
|
||||
>start : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>start : A.Point, Symbol(start, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 26, 31))
|
||||
>A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
|
||||
>Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
|
||||
|
||||
end: A.Point;
|
||||
>end : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>end : A.Point, Symbol(end, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 27, 27))
|
||||
>A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
|
||||
>Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ensure merges as expected
|
||||
var l: { start: A.Point; end: A.Point; new (s: A.Point, e: A.Point); }
|
||||
>l : { new (s: A.Point, e: A.Point): any; start: A.Point; end: A.Point; }
|
||||
>start : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>end : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>s : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>e : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>l : { new (s: A.Point, e: A.Point): any; start: A.Point; end: A.Point; }, Symbol(l, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 34, 3), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 35, 3))
|
||||
>start : A.Point, Symbol(start, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 34, 8))
|
||||
>A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
|
||||
>Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
|
||||
>end : A.Point, Symbol(end, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 34, 24))
|
||||
>A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
|
||||
>Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
|
||||
>s : A.Point, Symbol(s, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 34, 44))
|
||||
>A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
|
||||
>Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
|
||||
>e : A.Point, Symbol(e, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 34, 55))
|
||||
>A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
|
||||
>Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
|
||||
|
||||
var l: X.Y.Z.Line;
|
||||
>l : { new (s: A.Point, e: A.Point): any; start: A.Point; end: A.Point; }
|
||||
>X : unknown
|
||||
>Y : unknown
|
||||
>Z : unknown
|
||||
>Line : X.Y.Z.Line
|
||||
>l : { new (s: A.Point, e: A.Point): any; start: A.Point; end: A.Point; }, Symbol(l, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 34, 3), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 35, 3))
|
||||
>X : any, Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 16, 15), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 22, 1))
|
||||
>Y : any, Symbol(X.Y, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 9), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 24, 10))
|
||||
>Z : any, Symbol(X.Y.Z, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 11), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 25, 20))
|
||||
>Line : X.Y.Z.Line, Symbol(X.Y.Z.Line, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 14), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 25, 23))
|
||||
|
||||
|
||||
@ -1,62 +1,62 @@
|
||||
=== tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts ===
|
||||
module A.B {
|
||||
>A : typeof A
|
||||
>B : typeof B
|
||||
>A : typeof A, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 2, 1))
|
||||
>B : typeof B, Symbol(B, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 0, 9))
|
||||
|
||||
export var x: number;
|
||||
>x : number
|
||||
>x : number, Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 1, 14))
|
||||
}
|
||||
|
||||
module A{
|
||||
>A : typeof A
|
||||
>A : typeof A, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 2, 1))
|
||||
|
||||
module B {
|
||||
>B : typeof B
|
||||
>B : typeof B, Symbol(B, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 4, 9))
|
||||
|
||||
export var x: string;
|
||||
>x : string
|
||||
>x : string, Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 6, 18))
|
||||
}
|
||||
}
|
||||
|
||||
// ensure the right var decl is exported
|
||||
var x: number;
|
||||
>x : number
|
||||
>x : number, Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 11, 3), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 12, 3))
|
||||
|
||||
var x = A.B.x;
|
||||
>x : number
|
||||
>A.B.x : number
|
||||
>A.B : typeof A.B
|
||||
>A : typeof A
|
||||
>B : typeof A.B
|
||||
>x : number
|
||||
>x : number, Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 11, 3), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 12, 3))
|
||||
>A.B.x : number, Symbol(A.B.x, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 1, 14))
|
||||
>A.B : typeof A.B, Symbol(A.B, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 0, 9))
|
||||
>A : typeof A, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 2, 1))
|
||||
>B : typeof A.B, Symbol(A.B, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 0, 9))
|
||||
>x : number, Symbol(A.B.x, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 1, 14))
|
||||
|
||||
module X.Y.Z {
|
||||
>X : typeof X
|
||||
>Y : typeof Y
|
||||
>Z : typeof Z
|
||||
>X : typeof X, Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 12, 14), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 18, 1))
|
||||
>Y : typeof Y, Symbol(Y, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 14, 9), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 20, 10))
|
||||
>Z : typeof Z, Symbol(Z, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 14, 11))
|
||||
|
||||
export class Line {
|
||||
>Line : Line
|
||||
>Line : Line, Symbol(Line, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 14, 14))
|
||||
|
||||
length: number;
|
||||
>length : number
|
||||
>length : number, Symbol(length, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 15, 23))
|
||||
}
|
||||
}
|
||||
|
||||
module X {
|
||||
>X : typeof X
|
||||
>X : typeof X, Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 12, 14), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 18, 1))
|
||||
|
||||
export module Y {
|
||||
>Y : typeof Y
|
||||
>Y : typeof Y, Symbol(Y, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 14, 9), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 20, 10))
|
||||
|
||||
module Z {
|
||||
>Z : typeof Z
|
||||
>Z : typeof Z, Symbol(Z, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 21, 21))
|
||||
|
||||
export class Line {
|
||||
>Line : Line
|
||||
>Line : Line, Symbol(Line, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 22, 18))
|
||||
|
||||
name: string;
|
||||
>name : string
|
||||
>name : string, Symbol(name, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 23, 31))
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -64,13 +64,13 @@ module X {
|
||||
|
||||
// make sure merging works as expected
|
||||
var l: { length: number };
|
||||
>l : { length: number; }
|
||||
>length : number
|
||||
>l : { length: number; }, Symbol(l, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 31, 3), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 32, 3))
|
||||
>length : number, Symbol(length, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 31, 8))
|
||||
|
||||
var l: X.Y.Z.Line;
|
||||
>l : { length: number; }
|
||||
>X : unknown
|
||||
>Y : unknown
|
||||
>Z : unknown
|
||||
>Line : X.Y.Z.Line
|
||||
>l : { length: number; }, Symbol(l, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 31, 3), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 32, 3))
|
||||
>X : any, Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 12, 14), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 18, 1))
|
||||
>Y : any, Symbol(X.Y, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 14, 9), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 20, 10))
|
||||
>Z : any, Symbol(X.Y.Z, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 14, 11))
|
||||
>Line : X.Y.Z.Line, Symbol(X.Y.Z.Line, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 14, 14))
|
||||
|
||||
|
||||
@ -1,40 +1,40 @@
|
||||
=== tests/cases/conformance/internalModules/DeclarationMerging/part1.ts ===
|
||||
module Root {
|
||||
>Root : typeof Root
|
||||
>Root : typeof Root, Symbol(Root, Decl(part1.ts, 0, 0))
|
||||
|
||||
export module A {
|
||||
>A : typeof A
|
||||
>A : typeof A, Symbol(A, Decl(part1.ts, 0, 13))
|
||||
|
||||
export interface Point {
|
||||
>Point : Point
|
||||
>Point : Point, Symbol(Point, Decl(part1.ts, 1, 21))
|
||||
|
||||
x: number;
|
||||
>x : number
|
||||
>x : number, Symbol(x, Decl(part1.ts, 2, 32))
|
||||
|
||||
y: number;
|
||||
>y : number
|
||||
>y : number, Symbol(y, Decl(part1.ts, 3, 22))
|
||||
}
|
||||
|
||||
export module Utils {
|
||||
>Utils : typeof Utils
|
||||
>Utils : typeof Utils, Symbol(Utils, Decl(part1.ts, 5, 9))
|
||||
|
||||
export function mirror<T extends Point>(p: T) {
|
||||
>mirror : <T extends Point>(p: T) => { x: number; y: number; }
|
||||
>T : T
|
||||
>Point : Point
|
||||
>p : T
|
||||
>T : T
|
||||
>mirror : <T extends Point>(p: T) => { x: number; y: number; }, Symbol(mirror, Decl(part1.ts, 7, 29))
|
||||
>T : T, Symbol(T, Decl(part1.ts, 8, 35))
|
||||
>Point : Point, Symbol(Point, Decl(part1.ts, 1, 21))
|
||||
>p : T, Symbol(p, Decl(part1.ts, 8, 52))
|
||||
>T : T, Symbol(T, Decl(part1.ts, 8, 35))
|
||||
|
||||
return { x: p.y, y: p.x };
|
||||
>{ x: p.y, y: p.x } : { x: number; y: number; }
|
||||
>x : number
|
||||
>p.y : number
|
||||
>p : T
|
||||
>y : number
|
||||
>y : number
|
||||
>p.x : number
|
||||
>p : T
|
||||
>x : number
|
||||
>x : number, Symbol(x, Decl(part1.ts, 9, 24))
|
||||
>p.y : number, Symbol(Point.y, Decl(part1.ts, 3, 22))
|
||||
>p : T, Symbol(p, Decl(part1.ts, 8, 52))
|
||||
>y : number, Symbol(Point.y, Decl(part1.ts, 3, 22))
|
||||
>y : number, Symbol(y, Decl(part1.ts, 9, 32))
|
||||
>p.x : number, Symbol(Point.x, Decl(part1.ts, 2, 32))
|
||||
>p : T, Symbol(p, Decl(part1.ts, 8, 52))
|
||||
>x : number, Symbol(Point.x, Decl(part1.ts, 2, 32))
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -42,36 +42,38 @@ module Root {
|
||||
|
||||
=== tests/cases/conformance/internalModules/DeclarationMerging/part2.ts ===
|
||||
module otherRoot {
|
||||
>otherRoot : typeof otherRoot
|
||||
>otherRoot : typeof otherRoot, Symbol(otherRoot, Decl(part2.ts, 0, 0))
|
||||
|
||||
export module A {
|
||||
>A : typeof A
|
||||
>A : typeof A, Symbol(A, Decl(part2.ts, 0, 18))
|
||||
|
||||
// have to be fully qualified since in different root
|
||||
export var Origin: Root.A.Point = { x: 0, y: 0 };
|
||||
>Origin : Root.A.Point
|
||||
>Root : unknown
|
||||
>A : unknown
|
||||
>Point : Root.A.Point
|
||||
>Origin : Root.A.Point, Symbol(Origin, Decl(part2.ts, 3, 18))
|
||||
>Root : any, Symbol(Root, Decl(part1.ts, 0, 0))
|
||||
>A : any, Symbol(Root.A, Decl(part1.ts, 0, 13))
|
||||
>Point : Root.A.Point, Symbol(Root.A.Point, Decl(part1.ts, 1, 21))
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>x : number, Symbol(x, Decl(part2.ts, 3, 43))
|
||||
>0 : number
|
||||
>y : number, Symbol(y, Decl(part2.ts, 3, 49))
|
||||
>0 : number
|
||||
|
||||
export module Utils {
|
||||
>Utils : typeof Utils
|
||||
>Utils : typeof Utils, Symbol(Utils, Decl(part2.ts, 3, 57))
|
||||
|
||||
export class Plane {
|
||||
>Plane : Plane
|
||||
>Plane : Plane, Symbol(Plane, Decl(part2.ts, 5, 29))
|
||||
|
||||
constructor(public tl: Root.A.Point, public br: Root.A.Point) { }
|
||||
>tl : Root.A.Point
|
||||
>Root : unknown
|
||||
>A : unknown
|
||||
>Point : Root.A.Point
|
||||
>br : Root.A.Point
|
||||
>Root : unknown
|
||||
>A : unknown
|
||||
>Point : Root.A.Point
|
||||
>tl : Root.A.Point, Symbol(tl, Decl(part2.ts, 7, 28))
|
||||
>Root : any, Symbol(Root, Decl(part1.ts, 0, 0))
|
||||
>A : any, Symbol(Root.A, Decl(part1.ts, 0, 13))
|
||||
>Point : Root.A.Point, Symbol(Root.A.Point, Decl(part1.ts, 1, 21))
|
||||
>br : Root.A.Point, Symbol(br, Decl(part2.ts, 7, 52))
|
||||
>Root : any, Symbol(Root, Decl(part1.ts, 0, 0))
|
||||
>A : any, Symbol(Root.A, Decl(part1.ts, 0, 13))
|
||||
>Point : Root.A.Point, Symbol(Root.A.Point, Decl(part1.ts, 1, 21))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,63 +1,65 @@
|
||||
=== tests/cases/conformance/internalModules/DeclarationMerging/part1.ts ===
|
||||
module A {
|
||||
>A : typeof A
|
||||
>A : typeof A, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
|
||||
|
||||
export interface Point {
|
||||
>Point : Point
|
||||
>Point : Point, Symbol(Point, Decl(part1.ts, 0, 10))
|
||||
|
||||
x: number;
|
||||
>x : number
|
||||
>x : number, Symbol(x, Decl(part1.ts, 1, 28))
|
||||
|
||||
y: number;
|
||||
>y : number
|
||||
>y : number, Symbol(y, Decl(part1.ts, 2, 18))
|
||||
}
|
||||
|
||||
export module Utils {
|
||||
>Utils : typeof Utils
|
||||
>Utils : typeof Utils, Symbol(Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 1, 46))
|
||||
|
||||
export function mirror<T extends Point>(p: T) {
|
||||
>mirror : <T extends Point>(p: T) => { x: number; y: number; }
|
||||
>T : T
|
||||
>Point : Point
|
||||
>p : T
|
||||
>T : T
|
||||
>mirror : <T extends Point>(p: T) => { x: number; y: number; }, Symbol(mirror, Decl(part1.ts, 6, 25))
|
||||
>T : T, Symbol(T, Decl(part1.ts, 7, 31))
|
||||
>Point : Point, Symbol(Point, Decl(part1.ts, 0, 10))
|
||||
>p : T, Symbol(p, Decl(part1.ts, 7, 48))
|
||||
>T : T, Symbol(T, Decl(part1.ts, 7, 31))
|
||||
|
||||
return { x: p.y, y: p.x };
|
||||
>{ x: p.y, y: p.x } : { x: number; y: number; }
|
||||
>x : number
|
||||
>p.y : number
|
||||
>p : T
|
||||
>y : number
|
||||
>y : number
|
||||
>p.x : number
|
||||
>p : T
|
||||
>x : number
|
||||
>x : number, Symbol(x, Decl(part1.ts, 8, 20))
|
||||
>p.y : number, Symbol(Point.y, Decl(part1.ts, 2, 18))
|
||||
>p : T, Symbol(p, Decl(part1.ts, 7, 48))
|
||||
>y : number, Symbol(Point.y, Decl(part1.ts, 2, 18))
|
||||
>y : number, Symbol(y, Decl(part1.ts, 8, 28))
|
||||
>p.x : number, Symbol(Point.x, Decl(part1.ts, 1, 28))
|
||||
>p : T, Symbol(p, Decl(part1.ts, 7, 48))
|
||||
>x : number, Symbol(Point.x, Decl(part1.ts, 1, 28))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/internalModules/DeclarationMerging/part2.ts ===
|
||||
module A {
|
||||
>A : typeof A
|
||||
>A : typeof A, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
|
||||
|
||||
export var Origin: Point = { x: 0, y: 0 };
|
||||
>Origin : Point
|
||||
>Point : Point
|
||||
>Origin : Point, Symbol(Origin, Decl(part2.ts, 1, 14))
|
||||
>Point : Point, Symbol(Point, Decl(part1.ts, 0, 10))
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>x : number, Symbol(x, Decl(part2.ts, 1, 32))
|
||||
>0 : number
|
||||
>y : number, Symbol(y, Decl(part2.ts, 1, 38))
|
||||
>0 : number
|
||||
|
||||
export module Utils {
|
||||
>Utils : typeof Utils
|
||||
>Utils : typeof Utils, Symbol(Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 1, 46))
|
||||
|
||||
export class Plane {
|
||||
>Plane : Plane
|
||||
>Plane : Plane, Symbol(Plane, Decl(part2.ts, 3, 25))
|
||||
|
||||
constructor(public tl: Point, public br: Point) { }
|
||||
>tl : Point
|
||||
>Point : Point
|
||||
>br : Point
|
||||
>Point : Point
|
||||
>tl : Point, Symbol(tl, Decl(part2.ts, 5, 24))
|
||||
>Point : Point, Symbol(Point, Decl(part1.ts, 0, 10))
|
||||
>br : Point, Symbol(br, Decl(part2.ts, 5, 41))
|
||||
>Point : Point, Symbol(Point, Decl(part1.ts, 0, 10))
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -66,57 +68,59 @@ module A {
|
||||
// test the merging actually worked
|
||||
|
||||
var o: { x: number; y: number };
|
||||
>o : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>o : { x: number; y: number; }, Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
|
||||
>x : number, Symbol(x, Decl(part3.ts, 2, 8))
|
||||
>y : number, Symbol(y, Decl(part3.ts, 2, 19))
|
||||
|
||||
var o: A.Point;
|
||||
>o : { x: number; y: number; }
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>o : { x: number; y: number; }, Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
|
||||
>A : any, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
|
||||
>Point : A.Point, Symbol(A.Point, Decl(part1.ts, 0, 10))
|
||||
|
||||
var o = A.Origin;
|
||||
>o : { x: number; y: number; }
|
||||
>A.Origin : A.Point
|
||||
>A : typeof A
|
||||
>Origin : A.Point
|
||||
>o : { x: number; y: number; }, Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
|
||||
>A.Origin : A.Point, Symbol(A.Origin, Decl(part2.ts, 1, 14))
|
||||
>A : typeof A, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
|
||||
>Origin : A.Point, Symbol(A.Origin, Decl(part2.ts, 1, 14))
|
||||
|
||||
var o = A.Utils.mirror(o);
|
||||
>o : { x: number; y: number; }
|
||||
>o : { x: number; y: number; }, Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
|
||||
>A.Utils.mirror(o) : { x: number; y: number; }
|
||||
>A.Utils.mirror : <T extends A.Point>(p: T) => { x: number; y: number; }
|
||||
>A.Utils : typeof A.Utils
|
||||
>A : typeof A
|
||||
>Utils : typeof A.Utils
|
||||
>mirror : <T extends A.Point>(p: T) => { x: number; y: number; }
|
||||
>o : { x: number; y: number; }
|
||||
>A.Utils.mirror : <T extends A.Point>(p: T) => { x: number; y: number; }, Symbol(A.Utils.mirror, Decl(part1.ts, 6, 25))
|
||||
>A.Utils : typeof A.Utils, Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 1, 46))
|
||||
>A : typeof A, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
|
||||
>Utils : typeof A.Utils, Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 1, 46))
|
||||
>mirror : <T extends A.Point>(p: T) => { x: number; y: number; }, Symbol(A.Utils.mirror, Decl(part1.ts, 6, 25))
|
||||
>o : { x: number; y: number; }, Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
|
||||
|
||||
var p: { tl: A.Point; br: A.Point };
|
||||
>p : { tl: A.Point; br: A.Point; }
|
||||
>tl : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>br : A.Point
|
||||
>A : unknown
|
||||
>Point : A.Point
|
||||
>p : { tl: A.Point; br: A.Point; }, Symbol(p, Decl(part3.ts, 7, 3), Decl(part3.ts, 8, 3), Decl(part3.ts, 9, 3))
|
||||
>tl : A.Point, Symbol(tl, Decl(part3.ts, 7, 8))
|
||||
>A : any, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
|
||||
>Point : A.Point, Symbol(A.Point, Decl(part1.ts, 0, 10))
|
||||
>br : A.Point, Symbol(br, Decl(part3.ts, 7, 21))
|
||||
>A : any, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
|
||||
>Point : A.Point, Symbol(A.Point, Decl(part1.ts, 0, 10))
|
||||
|
||||
var p: A.Utils.Plane;
|
||||
>p : { tl: A.Point; br: A.Point; }
|
||||
>A : unknown
|
||||
>Utils : unknown
|
||||
>Plane : A.Utils.Plane
|
||||
>p : { tl: A.Point; br: A.Point; }, Symbol(p, Decl(part3.ts, 7, 3), Decl(part3.ts, 8, 3), Decl(part3.ts, 9, 3))
|
||||
>A : any, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
|
||||
>Utils : any, Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 1, 46))
|
||||
>Plane : A.Utils.Plane, Symbol(A.Utils.Plane, Decl(part2.ts, 3, 25))
|
||||
|
||||
var p = new A.Utils.Plane(o, { x: 1, y: 1 });
|
||||
>p : { tl: A.Point; br: A.Point; }
|
||||
>p : { tl: A.Point; br: A.Point; }, Symbol(p, Decl(part3.ts, 7, 3), Decl(part3.ts, 8, 3), Decl(part3.ts, 9, 3))
|
||||
>new A.Utils.Plane(o, { x: 1, y: 1 }) : A.Utils.Plane
|
||||
>A.Utils.Plane : typeof A.Utils.Plane
|
||||
>A.Utils : typeof A.Utils
|
||||
>A : typeof A
|
||||
>Utils : typeof A.Utils
|
||||
>Plane : typeof A.Utils.Plane
|
||||
>o : { x: number; y: number; }
|
||||
>A.Utils.Plane : typeof A.Utils.Plane, Symbol(A.Utils.Plane, Decl(part2.ts, 3, 25))
|
||||
>A.Utils : typeof A.Utils, Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 1, 46))
|
||||
>A : typeof A, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
|
||||
>Utils : typeof A.Utils, Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 1, 46))
|
||||
>Plane : typeof A.Utils.Plane, Symbol(A.Utils.Plane, Decl(part2.ts, 3, 25))
|
||||
>o : { x: number; y: number; }, Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
|
||||
>{ x: 1, y: 1 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>y : number
|
||||
>x : number, Symbol(x, Decl(part3.ts, 9, 30))
|
||||
>1 : number
|
||||
>y : number, Symbol(y, Decl(part3.ts, 9, 36))
|
||||
>1 : number
|
||||
|
||||
|
||||
|
||||
@ -1,26 +1,26 @@
|
||||
=== tests/cases/conformance/expressions/typeGuards/TypeGuardWithArrayUnion.ts ===
|
||||
class Message {
|
||||
>Message : Message
|
||||
>Message : Message, Symbol(Message, Decl(TypeGuardWithArrayUnion.ts, 0, 0))
|
||||
|
||||
value: string;
|
||||
>value : string
|
||||
>value : string, Symbol(value, Decl(TypeGuardWithArrayUnion.ts, 0, 15))
|
||||
}
|
||||
|
||||
function saySize(message: Message | Message[]) {
|
||||
>saySize : (message: Message | Message[]) => number
|
||||
>message : Message | Message[]
|
||||
>Message : Message
|
||||
>Message : Message
|
||||
>saySize : (message: Message | Message[]) => number, Symbol(saySize, Decl(TypeGuardWithArrayUnion.ts, 2, 1))
|
||||
>message : Message | Message[], Symbol(message, Decl(TypeGuardWithArrayUnion.ts, 4, 17))
|
||||
>Message : Message, Symbol(Message, Decl(TypeGuardWithArrayUnion.ts, 0, 0))
|
||||
>Message : Message, Symbol(Message, Decl(TypeGuardWithArrayUnion.ts, 0, 0))
|
||||
|
||||
if (message instanceof Array) {
|
||||
>message instanceof Array : boolean
|
||||
>message : Message | Message[]
|
||||
>Array : ArrayConstructor
|
||||
>message : Message | Message[], Symbol(message, Decl(TypeGuardWithArrayUnion.ts, 4, 17))
|
||||
>Array : ArrayConstructor, Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11))
|
||||
|
||||
return message.length; // Should have type Message[] here
|
||||
>message.length : number
|
||||
>message : Message[]
|
||||
>length : number
|
||||
>message.length : number, Symbol(Array.length, Decl(lib.d.ts, 1007, 20))
|
||||
>message : Message[], Symbol(message, Decl(TypeGuardWithArrayUnion.ts, 4, 17))
|
||||
>length : number, Symbol(Array.length, Decl(lib.d.ts, 1007, 20))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,96 +1,100 @@
|
||||
=== tests/cases/conformance/expressions/typeGuards/TypeGuardWithEnumUnion.ts ===
|
||||
enum Color { R, G, B }
|
||||
>Color : Color
|
||||
>R : Color
|
||||
>G : Color
|
||||
>B : Color
|
||||
>Color : Color, Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
|
||||
>R : Color, Symbol(Color.R, Decl(TypeGuardWithEnumUnion.ts, 0, 12))
|
||||
>G : Color, Symbol(Color.G, Decl(TypeGuardWithEnumUnion.ts, 0, 15))
|
||||
>B : Color, Symbol(Color.B, Decl(TypeGuardWithEnumUnion.ts, 0, 18))
|
||||
|
||||
function f1(x: Color | string) {
|
||||
>f1 : (x: string | Color) => void
|
||||
>x : string | Color
|
||||
>Color : Color
|
||||
>f1 : (x: string | Color) => void, Symbol(f1, Decl(TypeGuardWithEnumUnion.ts, 0, 22))
|
||||
>x : string | Color, Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 2, 12))
|
||||
>Color : Color, Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
|
||||
|
||||
if (typeof x === "number") {
|
||||
>typeof x === "number" : boolean
|
||||
>typeof x : string
|
||||
>x : string | Color
|
||||
>x : string | Color, Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 2, 12))
|
||||
>"number" : string
|
||||
|
||||
var y = x;
|
||||
>y : Color
|
||||
>x : Color
|
||||
>y : Color, Symbol(y, Decl(TypeGuardWithEnumUnion.ts, 4, 11), Decl(TypeGuardWithEnumUnion.ts, 5, 11))
|
||||
>x : Color, Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 2, 12))
|
||||
|
||||
var y: Color;
|
||||
>y : Color
|
||||
>Color : Color
|
||||
>y : Color, Symbol(y, Decl(TypeGuardWithEnumUnion.ts, 4, 11), Decl(TypeGuardWithEnumUnion.ts, 5, 11))
|
||||
>Color : Color, Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
|
||||
}
|
||||
else {
|
||||
var z = x;
|
||||
>z : string
|
||||
>x : string
|
||||
>z : string, Symbol(z, Decl(TypeGuardWithEnumUnion.ts, 8, 11), Decl(TypeGuardWithEnumUnion.ts, 9, 11))
|
||||
>x : string, Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 2, 12))
|
||||
|
||||
var z: string;
|
||||
>z : string
|
||||
>z : string, Symbol(z, Decl(TypeGuardWithEnumUnion.ts, 8, 11), Decl(TypeGuardWithEnumUnion.ts, 9, 11))
|
||||
}
|
||||
}
|
||||
|
||||
function f2(x: Color | string | string[]) {
|
||||
>f2 : (x: string | string[] | Color) => void
|
||||
>x : string | string[] | Color
|
||||
>Color : Color
|
||||
>f2 : (x: string | string[] | Color) => void, Symbol(f2, Decl(TypeGuardWithEnumUnion.ts, 11, 1))
|
||||
>x : string | string[] | Color, Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
|
||||
>Color : Color, Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
|
||||
|
||||
if (typeof x === "object") {
|
||||
>typeof x === "object" : boolean
|
||||
>typeof x : string
|
||||
>x : string | string[] | Color
|
||||
>x : string | string[] | Color, Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
|
||||
>"object" : string
|
||||
|
||||
var y = x;
|
||||
>y : string[]
|
||||
>x : string[]
|
||||
>y : string[], Symbol(y, Decl(TypeGuardWithEnumUnion.ts, 15, 11), Decl(TypeGuardWithEnumUnion.ts, 16, 11))
|
||||
>x : string[], Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
|
||||
|
||||
var y: string[];
|
||||
>y : string[]
|
||||
>y : string[], Symbol(y, Decl(TypeGuardWithEnumUnion.ts, 15, 11), Decl(TypeGuardWithEnumUnion.ts, 16, 11))
|
||||
}
|
||||
if (typeof x === "number") {
|
||||
>typeof x === "number" : boolean
|
||||
>typeof x : string
|
||||
>x : string | string[] | Color
|
||||
>x : string | string[] | Color, Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
|
||||
>"number" : string
|
||||
|
||||
var z = x;
|
||||
>z : Color
|
||||
>x : Color
|
||||
>z : Color, Symbol(z, Decl(TypeGuardWithEnumUnion.ts, 19, 11), Decl(TypeGuardWithEnumUnion.ts, 20, 11))
|
||||
>x : Color, Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
|
||||
|
||||
var z: Color;
|
||||
>z : Color
|
||||
>Color : Color
|
||||
>z : Color, Symbol(z, Decl(TypeGuardWithEnumUnion.ts, 19, 11), Decl(TypeGuardWithEnumUnion.ts, 20, 11))
|
||||
>Color : Color, Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
|
||||
}
|
||||
else {
|
||||
var w = x;
|
||||
>w : string | string[]
|
||||
>x : string | string[]
|
||||
>w : string | string[], Symbol(w, Decl(TypeGuardWithEnumUnion.ts, 23, 11), Decl(TypeGuardWithEnumUnion.ts, 24, 11))
|
||||
>x : string | string[], Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
|
||||
|
||||
var w: string | string[];
|
||||
>w : string | string[]
|
||||
>w : string | string[], Symbol(w, Decl(TypeGuardWithEnumUnion.ts, 23, 11), Decl(TypeGuardWithEnumUnion.ts, 24, 11))
|
||||
}
|
||||
if (typeof x === "string") {
|
||||
>typeof x === "string" : boolean
|
||||
>typeof x : string
|
||||
>x : string | string[] | Color
|
||||
>x : string | string[] | Color, Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
|
||||
>"string" : string
|
||||
|
||||
var a = x;
|
||||
>a : string
|
||||
>x : string
|
||||
>a : string, Symbol(a, Decl(TypeGuardWithEnumUnion.ts, 27, 11), Decl(TypeGuardWithEnumUnion.ts, 28, 11))
|
||||
>x : string, Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
|
||||
|
||||
var a: string;
|
||||
>a : string
|
||||
>a : string, Symbol(a, Decl(TypeGuardWithEnumUnion.ts, 27, 11), Decl(TypeGuardWithEnumUnion.ts, 28, 11))
|
||||
}
|
||||
else {
|
||||
var b = x;
|
||||
>b : string[] | Color
|
||||
>x : string[] | Color
|
||||
>b : string[] | Color, Symbol(b, Decl(TypeGuardWithEnumUnion.ts, 31, 11), Decl(TypeGuardWithEnumUnion.ts, 32, 11))
|
||||
>x : string[] | Color, Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
|
||||
|
||||
var b: Color | string[];
|
||||
>b : string[] | Color
|
||||
>Color : Color
|
||||
>b : string[] | Color, Symbol(b, Decl(TypeGuardWithEnumUnion.ts, 31, 11), Decl(TypeGuardWithEnumUnion.ts, 32, 11))
|
||||
>Color : Color, Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,96 +1,100 @@
|
||||
=== tests/cases/conformance/expressions/typeGuards/TypeGuardWithEnumUnion.ts ===
|
||||
enum Color { R, G, B }
|
||||
>Color : Color
|
||||
>R : Color
|
||||
>G : Color
|
||||
>B : Color
|
||||
>Color : Color, Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
|
||||
>R : Color, Symbol(Color.R, Decl(TypeGuardWithEnumUnion.ts, 0, 12))
|
||||
>G : Color, Symbol(Color.G, Decl(TypeGuardWithEnumUnion.ts, 0, 15))
|
||||
>B : Color, Symbol(Color.B, Decl(TypeGuardWithEnumUnion.ts, 0, 18))
|
||||
|
||||
function f1(x: Color | string) {
|
||||
>f1 : (x: string | Color) => void
|
||||
>x : string | Color
|
||||
>Color : Color
|
||||
>f1 : (x: string | Color) => void, Symbol(f1, Decl(TypeGuardWithEnumUnion.ts, 0, 22))
|
||||
>x : string | Color, Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 2, 12))
|
||||
>Color : Color, Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
|
||||
|
||||
if (typeof x === "number") {
|
||||
>typeof x === "number" : boolean
|
||||
>typeof x : string
|
||||
>x : string | Color
|
||||
>x : string | Color, Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 2, 12))
|
||||
>"number" : string
|
||||
|
||||
var y = x;
|
||||
>y : Color
|
||||
>x : Color
|
||||
>y : Color, Symbol(y, Decl(TypeGuardWithEnumUnion.ts, 4, 11), Decl(TypeGuardWithEnumUnion.ts, 5, 11))
|
||||
>x : Color, Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 2, 12))
|
||||
|
||||
var y: Color;
|
||||
>y : Color
|
||||
>Color : Color
|
||||
>y : Color, Symbol(y, Decl(TypeGuardWithEnumUnion.ts, 4, 11), Decl(TypeGuardWithEnumUnion.ts, 5, 11))
|
||||
>Color : Color, Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
|
||||
}
|
||||
else {
|
||||
var z = x;
|
||||
>z : string
|
||||
>x : string
|
||||
>z : string, Symbol(z, Decl(TypeGuardWithEnumUnion.ts, 8, 11), Decl(TypeGuardWithEnumUnion.ts, 9, 11))
|
||||
>x : string, Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 2, 12))
|
||||
|
||||
var z: string;
|
||||
>z : string
|
||||
>z : string, Symbol(z, Decl(TypeGuardWithEnumUnion.ts, 8, 11), Decl(TypeGuardWithEnumUnion.ts, 9, 11))
|
||||
}
|
||||
}
|
||||
|
||||
function f2(x: Color | string | string[]) {
|
||||
>f2 : (x: string | Color | string[]) => void
|
||||
>x : string | Color | string[]
|
||||
>Color : Color
|
||||
>f2 : (x: string | Color | string[]) => void, Symbol(f2, Decl(TypeGuardWithEnumUnion.ts, 11, 1))
|
||||
>x : string | Color | string[], Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
|
||||
>Color : Color, Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
|
||||
|
||||
if (typeof x === "object") {
|
||||
>typeof x === "object" : boolean
|
||||
>typeof x : string
|
||||
>x : string | Color | string[]
|
||||
>x : string | Color | string[], Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
|
||||
>"object" : string
|
||||
|
||||
var y = x;
|
||||
>y : string[]
|
||||
>x : string[]
|
||||
>y : string[], Symbol(y, Decl(TypeGuardWithEnumUnion.ts, 15, 11), Decl(TypeGuardWithEnumUnion.ts, 16, 11))
|
||||
>x : string[], Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
|
||||
|
||||
var y: string[];
|
||||
>y : string[]
|
||||
>y : string[], Symbol(y, Decl(TypeGuardWithEnumUnion.ts, 15, 11), Decl(TypeGuardWithEnumUnion.ts, 16, 11))
|
||||
}
|
||||
if (typeof x === "number") {
|
||||
>typeof x === "number" : boolean
|
||||
>typeof x : string
|
||||
>x : string | Color | string[]
|
||||
>x : string | Color | string[], Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
|
||||
>"number" : string
|
||||
|
||||
var z = x;
|
||||
>z : Color
|
||||
>x : Color
|
||||
>z : Color, Symbol(z, Decl(TypeGuardWithEnumUnion.ts, 19, 11), Decl(TypeGuardWithEnumUnion.ts, 20, 11))
|
||||
>x : Color, Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
|
||||
|
||||
var z: Color;
|
||||
>z : Color
|
||||
>Color : Color
|
||||
>z : Color, Symbol(z, Decl(TypeGuardWithEnumUnion.ts, 19, 11), Decl(TypeGuardWithEnumUnion.ts, 20, 11))
|
||||
>Color : Color, Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
|
||||
}
|
||||
else {
|
||||
var w = x;
|
||||
>w : string | string[]
|
||||
>x : string | string[]
|
||||
>w : string | string[], Symbol(w, Decl(TypeGuardWithEnumUnion.ts, 23, 11), Decl(TypeGuardWithEnumUnion.ts, 24, 11))
|
||||
>x : string | string[], Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
|
||||
|
||||
var w: string | string[];
|
||||
>w : string | string[]
|
||||
>w : string | string[], Symbol(w, Decl(TypeGuardWithEnumUnion.ts, 23, 11), Decl(TypeGuardWithEnumUnion.ts, 24, 11))
|
||||
}
|
||||
if (typeof x === "string") {
|
||||
>typeof x === "string" : boolean
|
||||
>typeof x : string
|
||||
>x : string | Color | string[]
|
||||
>x : string | Color | string[], Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
|
||||
>"string" : string
|
||||
|
||||
var a = x;
|
||||
>a : string
|
||||
>x : string
|
||||
>a : string, Symbol(a, Decl(TypeGuardWithEnumUnion.ts, 27, 11), Decl(TypeGuardWithEnumUnion.ts, 28, 11))
|
||||
>x : string, Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
|
||||
|
||||
var a: string;
|
||||
>a : string
|
||||
>a : string, Symbol(a, Decl(TypeGuardWithEnumUnion.ts, 27, 11), Decl(TypeGuardWithEnumUnion.ts, 28, 11))
|
||||
}
|
||||
else {
|
||||
var b = x;
|
||||
>b : Color | string[]
|
||||
>x : Color | string[]
|
||||
>b : Color | string[], Symbol(b, Decl(TypeGuardWithEnumUnion.ts, 31, 11), Decl(TypeGuardWithEnumUnion.ts, 32, 11))
|
||||
>x : Color | string[], Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
|
||||
|
||||
var b: Color | string[];
|
||||
>b : Color | string[]
|
||||
>Color : Color
|
||||
>b : Color | string[], Symbol(b, Decl(TypeGuardWithEnumUnion.ts, 31, 11), Decl(TypeGuardWithEnumUnion.ts, 32, 11))
|
||||
>Color : Color, Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration10_es6.ts ===
|
||||
let a: number = 1
|
||||
>a : number
|
||||
>a : number, Symbol(a, Decl(VariableDeclaration10_es6.ts, 0, 3))
|
||||
>1 : number
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration3_es6.ts ===
|
||||
const a = 1
|
||||
>a : number
|
||||
>a : number, Symbol(a, Decl(VariableDeclaration3_es6.ts, 0, 5))
|
||||
>1 : number
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration5_es6.ts ===
|
||||
const a: number = 1
|
||||
>a : number
|
||||
>a : number, Symbol(a, Decl(VariableDeclaration5_es6.ts, 0, 5))
|
||||
>1 : number
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration7_es6.ts ===
|
||||
let a
|
||||
>a : any
|
||||
>a : any, Symbol(a, Decl(VariableDeclaration7_es6.ts, 0, 3))
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration8_es6.ts ===
|
||||
let a = 1
|
||||
>a : number
|
||||
>a : number, Symbol(a, Decl(VariableDeclaration8_es6.ts, 0, 3))
|
||||
>1 : number
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration9_es6.ts ===
|
||||
let a: number
|
||||
>a : number
|
||||
>a : number, Symbol(a, Decl(VariableDeclaration9_es6.ts, 0, 3))
|
||||
|
||||
|
||||
@ -1,17 +1,17 @@
|
||||
=== tests/cases/compiler/acceptableAlias1.ts ===
|
||||
module M {
|
||||
>M : typeof M
|
||||
>M : typeof M, Symbol(M, Decl(acceptableAlias1.ts, 0, 0))
|
||||
|
||||
export module N {
|
||||
>N : unknown
|
||||
>N : any, Symbol(N, Decl(acceptableAlias1.ts, 0, 10))
|
||||
}
|
||||
export import X = N;
|
||||
>X : unknown
|
||||
>N : unknown
|
||||
>X : any, Symbol(X, Decl(acceptableAlias1.ts, 2, 5))
|
||||
>N : any, Symbol(N, Decl(acceptableAlias1.ts, 0, 10))
|
||||
}
|
||||
|
||||
import r = M.X;
|
||||
>r : unknown
|
||||
>M : typeof M
|
||||
>X : unknown
|
||||
>r : any, Symbol(r, Decl(acceptableAlias1.ts, 4, 1))
|
||||
>M : typeof M, Symbol(M, Decl(acceptableAlias1.ts, 0, 0))
|
||||
>X : any, Symbol(r, Decl(acceptableAlias1.ts, 0, 10))
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user