diff --git a/src/abstractions/api-callable-base.ts b/src/abstractions/api-callable-base.ts index 845d9a62..139941a4 100644 --- a/src/abstractions/api-callable-base.ts +++ b/src/abstractions/api-callable-base.ts @@ -6,6 +6,7 @@ import { ApiItemReference } from "../contracts/api-item-reference"; import { ApiType } from "../contracts/api-type"; import { ApiCallableDto } from "../contracts/api-callable-dto"; import { ApiTypeHelpers } from "../api-type-helpers"; +import { ApiItemLocationDto } from "../contracts"; /** * A callable api item base. @@ -20,8 +21,12 @@ export abstract class ApiCallableBase< protected Parameters: ApiItemReference[] = []; protected TypeParameters: ApiItemReference[] = []; protected ReturnType: ApiType | undefined; + protected Location: ApiItemLocationDto; protected OnGatherData(): void { + // ApiItemLocation + this.Location = ApiHelpers.GetApiItemLocationDtoFromNode(this.Declaration, this.Options); + // Overload this.IsOverloadBase = this.TypeChecker.isImplementationOfOverload(this.Declaration as ts.FunctionLike) || false; @@ -38,7 +43,7 @@ export abstract class ApiCallableBase< if (signature != null) { const type = this.TypeChecker.getReturnTypeOfSignature(signature); - this.ReturnType = ApiTypeHelpers.ResolveApiType(this.Options, type, this.Declaration.type); + this.ReturnType = ApiTypeHelpers.ResolveApiType(this.Options, this.Location, type, this.Declaration.type); } } } diff --git a/src/api-helpers.ts b/src/api-helpers.ts index b494d1c6..2858939d 100644 --- a/src/api-helpers.ts +++ b/src/api-helpers.ts @@ -277,6 +277,11 @@ export namespace ApiHelpers { Logger.Log(logLevel, `${linePrefix}: ${message}`); } + export function LogWithLocation(logLevel: LogLevel, location: ApiItemLocationDto, message: string): void { + const linePrefix = `${location.FileName}(${location.Line + 1},${location.Character + 1})`; + Logger.Log(logLevel, `${linePrefix}: ${message}`); + } + export function StandardizeRelativePath(location: string, options: ApiItemOptions): string { const workingSep = options.ExtractorOptions.OutputPathSeparator; const fixedLocation = location.split(path.sep).join(workingSep); diff --git a/src/api-type-helpers.ts b/src/api-type-helpers.ts index fb8a3112..210699b1 100644 --- a/src/api-type-helpers.ts +++ b/src/api-type-helpers.ts @@ -1,4 +1,6 @@ import * as ts from "typescript"; +import { LogLevel } from "simplr-logger"; + import { ApiItemOptions } from "./abstractions/api-item"; import { ApiHelpers } from "./api-helpers"; import { TSHelpers } from "./index"; @@ -24,9 +26,24 @@ import { TypeQueryType, TypeKeywords } from "./contracts/api-type"; +import { ApiItemLocationDto } from "./contracts/api-item-location-dto"; export namespace ApiTypeHelpers { - export function ResolveApiType(options: ApiItemOptions, type: ts.Type, typeNode?: ts.TypeNode, self?: boolean): ApiType { + /** + * Resolves ApiType from TypeScript type system. + * @param options ApiItem otpions + * @param location ApiItem location for fallback if typeNode is synthesized. + * @param type Type from TypeScript type system. + * @param typeNode Type node. + * @param self For ApiTypeAlias only. Not to have reference to itself. + */ + export function ResolveApiType( + options: ApiItemOptions, + location: ApiItemLocationDto, + type: ts.Type, + typeNode?: ts.TypeNode, + self?: boolean + ): ApiType { const typeChecker = options.Program.getTypeChecker(); if (typeNode == null) { @@ -34,47 +51,60 @@ export namespace ApiTypeHelpers { } if (ts.isTypeReferenceNode(typeNode) || ts.isExpressionWithTypeArguments(typeNode)) { - return TypeReferenceNodeToApiType(options, type, typeNode, self); + return TypeReferenceNodeToApiType(options, location, type, typeNode, self); } else if (ts.isUnionTypeNode(typeNode) || ts.isIntersectionTypeNode(typeNode)) { - return TypeNodeUnionOrIntersectionToApiType(options, type as ts.UnionOrIntersectionType, typeNode); + return TypeNodeUnionOrIntersectionToApiType(options, location, type as ts.UnionOrIntersectionType, typeNode); } else if (ts.isArrayTypeNode(typeNode)) { - return ArrayTypeNodeToApiType(options, type, typeNode); + return ArrayTypeNodeToApiType(options, location, type, typeNode); } else if (ts.isTupleTypeNode(typeNode)) { - return TupleTypeNodeToApiType(options, type, typeNode); + return TupleTypeNodeToApiType(options, location, type, typeNode); } else if (ts.isTypeLiteralNode(typeNode)) { - return ReferenceBaseTypeToTypeDto(options, type, typeNode, ApiTypeKind.TypeLiteral) as TypeLiteralType; + return ReferenceBaseTypeToTypeDto(options, location, type, typeNode, ApiTypeKind.TypeLiteral) as TypeLiteralType; } else if (ts.isMappedTypeNode(typeNode)) { - return ReferenceBaseTypeToTypeDto(options, type, typeNode, ApiTypeKind.Mapped) as MappedType; + return ReferenceBaseTypeToTypeDto(options, location, type, typeNode, ApiTypeKind.Mapped) as MappedType; } else if (ts.isFunctionTypeNode(typeNode)) { - return ReferenceBaseTypeToTypeDto(options, type, typeNode, ApiTypeKind.FunctionType) as FunctionTypeType; + return ReferenceBaseTypeToTypeDto(options, location, type, typeNode, ApiTypeKind.FunctionType) as FunctionTypeType; } else if (ts.isThisTypeNode(typeNode)) { - return ReferenceBaseTypeToTypeDto(options, type, typeNode, ApiTypeKind.This) as ThisType; + return ReferenceBaseTypeToTypeDto(options, location, type, typeNode, ApiTypeKind.This) as ThisType; } else if (ts.isConstructorTypeNode(typeNode)) { - return ReferenceBaseTypeToTypeDto(options, type, typeNode, ApiTypeKind.Constructor) as ConstructorType; + return ReferenceBaseTypeToTypeDto(options, location, type, typeNode, ApiTypeKind.Constructor) as ConstructorType; } else if (ts.isTypePredicateNode(typeNode)) { - return TypePredicateNodeToApiType(options, type, typeNode); + return TypePredicateNodeToApiType(options, location, type, typeNode); } else if (ts.isTypeOperatorNode(typeNode)) { - return TypeOperatorNodeToApiType(options, type, typeNode); + return TypeOperatorNodeToApiType(options, location, type, typeNode); } else if (ts.isIndexedAccessTypeNode(typeNode)) { - return IndexedAccessTypeNodeToApiType(options, type, typeNode); + return IndexedAccessTypeNodeToApiType(options, location, type, typeNode); } else if (ts.isParenthesizedTypeNode(typeNode)) { - return ParenthesizedTypeNodeToApiType(options, type, typeNode); + return ParenthesizedTypeNodeToApiType(options, location, type, typeNode); } else if (ts.isTypeQueryNode(typeNode)) { - return TypeQueryToApiType(options, type, typeNode); + return TypeQueryToApiType(options, location, type, typeNode); } - return ResolveApiBasicType(options, type, typeNode); + return ResolveApiBasicType(options, location, type, typeNode); } /** * @internal */ - export function typeNodeToBaseType(options: ApiItemOptions, type: ts.Type, typeNode: ts.TypeNode): ApiBaseType { + export function typeNodeToBaseType( + options: ApiItemOptions, + apiItemlocation: ApiItemLocationDto, + type: ts.Type, + typeNode: ts.TypeNode + ): ApiBaseType { const typeChecker = options.Program.getTypeChecker(); const text = typeChecker.typeToString(type); + let location: ApiItemLocationDto; + if (TSHelpers.IsNodeSynthesized(typeNode)) { + location = apiItemlocation; + } else { + location = ApiHelpers.GetApiItemLocationDtoFromNode(typeNode, options); + } + const result: ApiBaseType = { ApiTypeKind: ApiTypeKind.Basic, + Location: location, Text: text }; @@ -114,9 +144,14 @@ export namespace ApiTypeHelpers { }; } - export function ResolveApiBasicType(options: ApiItemOptions, type: ts.Type, typeNode: ts.TypeNode): ApiBasicType { + export function ResolveApiBasicType( + options: ApiItemOptions, + location: ApiItemLocationDto, + type: ts.Type, + typeNode: ts.TypeNode + ): ApiBasicType { return { - ...typeNodeToBaseType(options, type, typeNode), + ...typeNodeToBaseType(options, location, type, typeNode), ApiTypeKind: ApiTypeKind.Basic }; } @@ -127,6 +162,7 @@ export namespace ApiTypeHelpers { */ export function ReferenceBaseTypeToTypeDto( options: ApiItemOptions, + location: ApiItemLocationDto, type: ts.Type, typeNode: ts.TypeNode, kind?: ApiTypeKind @@ -139,7 +175,7 @@ export namespace ApiTypeHelpers { } return { - ...typeNodeToBaseType(options, type, typeNode), + ...typeNodeToBaseType(options, location, type, typeNode), ApiTypeKind: kind || ApiTypeKind.Basic, ReferenceId: referenceId }; @@ -150,6 +186,7 @@ export namespace ApiTypeHelpers { */ export function TypeReferenceNodeToApiType( options: ApiItemOptions, + location: ApiItemLocationDto, type: ts.Type, typeNode: ts.TypeReferenceType, self?: boolean @@ -162,10 +199,10 @@ export namespace ApiTypeHelpers { if (!TSHelpers.IsNodeSynthesized(typeNode) && typeNode.typeArguments != null) { typeParameters = typeNode.typeArguments - .map(x => ResolveApiType(options, typeChecker.getTypeFromTypeNode(x), x)); + .map(x => ResolveApiType(options, location, typeChecker.getTypeFromTypeNode(x), x)); } else if (TSHelpers.IsTypeWithTypeArguments(type)) { typeParameters = type.typeArguments - .map(x => ResolveApiType(options, x, typeChecker.typeToTypeNode(x))); + .map(x => ResolveApiType(options, location, x, typeChecker.typeToTypeNode(x))); } const symbol = self ? type.getSymbol() : type.aliasSymbol || type.getSymbol(); @@ -176,7 +213,7 @@ export namespace ApiTypeHelpers { } return { - ...typeNodeToBaseType(options, type, typeNode), + ...typeNodeToBaseType(options, location, type, typeNode), ApiTypeKind: ApiTypeKind.Reference, ReferenceId: refenceId, TypeParameters: typeParameters, @@ -189,6 +226,7 @@ export namespace ApiTypeHelpers { */ export function TypeNodeUnionOrIntersectionToApiType( options: ApiItemOptions, + location: ApiItemLocationDto, type: ts.UnionOrIntersectionType, typeNode: ts.UnionTypeNode | ts.IntersectionTypeNode ): ApiUnionOrIntersectionType { @@ -204,14 +242,14 @@ export namespace ApiTypeHelpers { let members: ApiType[]; if (!TSHelpers.IsNodeSynthesized(typeNode)) { members = typeNode.types - .map(x => ResolveApiType(options, typeChecker.getTypeFromTypeNode(x), x)); + .map(x => ResolveApiType(options, location, typeChecker.getTypeFromTypeNode(x), x)); } else { members = type.types - .map(x => ResolveApiType(options, x, typeChecker.typeToTypeNode(x))); + .map(x => ResolveApiType(options, location, x, typeChecker.typeToTypeNode(x))); } return { - ...typeNodeToBaseType(options, type, typeNode), + ...typeNodeToBaseType(options, location, type, typeNode), ApiTypeKind: apiTypeKind, Members: members }; @@ -222,6 +260,7 @@ export namespace ApiTypeHelpers { */ export function ArrayTypeNodeToApiType( options: ApiItemOptions, + location: ApiItemLocationDto, type: ts.Type, typeNode: ts.ArrayTypeNode ): ArrayType { @@ -229,17 +268,17 @@ export namespace ApiTypeHelpers { let apiType: ApiType; if (!TSHelpers.IsNodeSynthesized(typeNode)) { - apiType = ResolveApiType(options, typeChecker.getTypeFromTypeNode(typeNode.elementType), typeNode.elementType); + apiType = ResolveApiType(options, location, typeChecker.getTypeFromTypeNode(typeNode.elementType), typeNode.elementType); } else if (TSHelpers.IsTypeWithTypeArguments(type)) { const arrayType = type.typeArguments[0]; - apiType = ResolveApiType(options, arrayType, typeChecker.typeToTypeNode(arrayType)); + apiType = ResolveApiType(options, location, arrayType, typeChecker.typeToTypeNode(arrayType)); } else { - // TODO: Log Error. - apiType = ResolveApiType(options, typeChecker.getTypeFromTypeNode(typeNode.elementType), typeNode.elementType); + ApiHelpers.LogWithLocation(LogLevel.Error, location, "Couldn't resolve ArrayTypeNode element type."); + apiType = ResolveApiType(options, location, typeChecker.getTypeFromTypeNode(typeNode.elementType), typeNode.elementType); } return { - ...typeNodeToBaseType(options, type, typeNode), + ...typeNodeToBaseType(options, location, type, typeNode), ApiTypeKind: ApiTypeKind.Array, Type: apiType }; @@ -250,6 +289,7 @@ export namespace ApiTypeHelpers { */ export function TupleTypeNodeToApiType( options: ApiItemOptions, + location: ApiItemLocationDto, type: ts.Type, typeNode: ts.TupleTypeNode ): TupleType { @@ -258,16 +298,16 @@ export namespace ApiTypeHelpers { let members: ApiType[]; if (!TSHelpers.IsNodeSynthesized(typeNode)) { members = typeNode.elementTypes - .map(x => ResolveApiType(options, typeChecker.getTypeFromTypeNode(x), x)); + .map(x => ResolveApiType(options, location, typeChecker.getTypeFromTypeNode(x), x)); } else if (TSHelpers.IsTypeWithTypeArguments(type)) { - members = type.typeArguments.map(x => ResolveApiType(options, x, typeChecker.typeToTypeNode(x))); + members = type.typeArguments.map(x => ResolveApiType(options, location, x, typeChecker.typeToTypeNode(x))); } else { - // TODO: Log Error. + ApiHelpers.LogWithLocation(LogLevel.Error, location, "Couldn't resolve TupleType members."); members = []; } return { - ...typeNodeToBaseType(options, type, typeNode), + ...typeNodeToBaseType(options, location, type, typeNode), ApiTypeKind: ApiTypeKind.Tuple, Members: members }; @@ -278,18 +318,19 @@ export namespace ApiTypeHelpers { */ export function TypePredicateNodeToApiType( options: ApiItemOptions, + location: ApiItemLocationDto, type: ts.Type, typeNode: ts.TypePredicateNode ): TypePredicateType { const typeChecker = options.Program.getTypeChecker(); const parameterName: string = typeNode.parameterName.getText(); - const apiType = ResolveApiType(options, typeChecker.getTypeFromTypeNode(typeNode.type), typeNode.type); + const apiType = ResolveApiType(options, location, typeChecker.getTypeFromTypeNode(typeNode.type), typeNode.type); // Otherwise text will be "boolean". const text = `${parameterName} is ${apiType.Text}`; return { - ...typeNodeToBaseType(options, type, typeNode), + ...typeNodeToBaseType(options, location, type, typeNode), ApiTypeKind: ApiTypeKind.TypePredicate, ParameterName: parameterName, Type: apiType, @@ -302,11 +343,12 @@ export namespace ApiTypeHelpers { */ export function TypeOperatorNodeToApiType( options: ApiItemOptions, + location: ApiItemLocationDto, type: ts.Type, typeNode: ts.TypeOperatorNode ): TypeOperatorType { const typeChecker = options.Program.getTypeChecker(); - const apiType = ResolveApiType(options, typeChecker.getTypeFromTypeNode(typeNode.type), typeNode.type); + const apiType = ResolveApiType(options, location, typeChecker.getTypeFromTypeNode(typeNode.type), typeNode.type); let operator: TypeKeywords; switch (typeNode.operator) { @@ -323,7 +365,7 @@ export namespace ApiTypeHelpers { const text = `${operator} ${apiType.Text}`; return { - ...typeNodeToBaseType(options, type, typeNode), + ...typeNodeToBaseType(options, location, type, typeNode), ApiTypeKind: ApiTypeKind.TypeOperator, Keyword: operator, Type: apiType, @@ -336,15 +378,16 @@ export namespace ApiTypeHelpers { */ export function IndexedAccessTypeNodeToApiType( options: ApiItemOptions, + location: ApiItemLocationDto, type: ts.Type, typeNode: ts.IndexedAccessTypeNode ): IndexedAccessType { const typeChecker = options.Program.getTypeChecker(); - const objectApiType = ResolveApiType(options, typeChecker.getTypeFromTypeNode(typeNode.objectType), typeNode.objectType); - const indexApiType = ResolveApiType(options, typeChecker.getTypeFromTypeNode(typeNode.indexType), typeNode.indexType); + const objectApiType = ResolveApiType(options, location, typeChecker.getTypeFromTypeNode(typeNode.objectType), typeNode.objectType); + const indexApiType = ResolveApiType(options, location, typeChecker.getTypeFromTypeNode(typeNode.indexType), typeNode.indexType); return { - ...typeNodeToBaseType(options, type, typeNode), + ...typeNodeToBaseType(options, location, type, typeNode), ApiTypeKind: ApiTypeKind.IndexedAccess, ObjectType: objectApiType, IndexType: indexApiType @@ -356,14 +399,15 @@ export namespace ApiTypeHelpers { */ export function ParenthesizedTypeNodeToApiType( options: ApiItemOptions, + location: ApiItemLocationDto, type: ts.Type, typeNode: ts.ParenthesizedTypeNode ): ParenthesizedType { const typeChecker = options.Program.getTypeChecker(); - const apiType = ResolveApiType(options, typeChecker.getTypeFromTypeNode(typeNode.type), typeNode.type); + const apiType = ResolveApiType(options, location, typeChecker.getTypeFromTypeNode(typeNode.type), typeNode.type); return { - ...typeNodeToBaseType(options, type, typeNode), + ...typeNodeToBaseType(options, location, type, typeNode), ApiTypeKind: ApiTypeKind.Parenthesized, Type: apiType }; @@ -372,9 +416,14 @@ export namespace ApiTypeHelpers { /** * Example: `typeof Foo`. */ - export function TypeQueryToApiType(options: ApiItemOptions, type: ts.Type, typeNode: ts.TypeQueryNode): TypeQueryType { + export function TypeQueryToApiType( + options: ApiItemOptions, + location: ApiItemLocationDto, + type: ts.Type, + typeNode: ts.TypeQueryNode + ): TypeQueryType { return { - ...ReferenceBaseTypeToTypeDto(options, type, typeNode), + ...ReferenceBaseTypeToTypeDto(options, location, type, typeNode), ApiTypeKind: ApiTypeKind.TypeQuery, Keyword: TypeKeywords.Typeof }; @@ -382,10 +431,18 @@ export namespace ApiTypeHelpers { export type HeritageKinds = ts.SyntaxKind.ImplementsKeyword | ts.SyntaxKind.ExtendsKeyword; + /** + * Gets heritage list by kind. + * @param options Api item options. + * @param location ApiItem location. + * @param heritageClauses Array of heritage clauses. + * @param kind Implements or Extends keyword. + */ export function GetHeritageList( + options: ApiItemOptions, + location: ApiItemLocationDto, heritageClauses: ts.NodeArray, - kind: HeritageKinds, - options: ApiItemOptions + kind: HeritageKinds ): ApiType[] { const typeChecker = options.Program.getTypeChecker(); const list: ApiType[] = []; @@ -398,7 +455,7 @@ export namespace ApiTypeHelpers { heritage.types.forEach(expressionType => { const type = typeChecker.getTypeFromTypeNode(expressionType); - list.push(ResolveApiType(options, type, expressionType)); + list.push(ResolveApiType(options, location, type, expressionType)); }); }); diff --git a/src/contracts/api-type.ts b/src/contracts/api-type.ts index b8478549..c5134aab 100644 --- a/src/contracts/api-type.ts +++ b/src/contracts/api-type.ts @@ -1,4 +1,5 @@ import * as ts from "typescript"; +import { ApiItemLocationDto } from "./api-item-location-dto"; export type ApiType = ApiBasicType | ApiReferenceType | @@ -48,6 +49,7 @@ export interface TypeScriptTypeNodeDebug { export interface ApiBaseType { ApiTypeKind: ApiTypeKind; + Location: ApiItemLocationDto; Text: string; _ts?: TypeScriptTypeNodeDebug; } diff --git a/src/definitions/api-call.ts b/src/definitions/api-call.ts index ac25b2f6..a37165cf 100644 --- a/src/definitions/api-call.ts +++ b/src/definitions/api-call.ts @@ -5,20 +5,18 @@ import { ApiCallDto } from "../contracts/definitions/api-call-dto"; import { ApiItemKinds } from "../contracts/api-item-kinds"; import { ApiMetadataDto } from "../contracts/api-metadata-dto"; import { ApiCallableBase } from "../abstractions/api-callable-base"; -import { ApiItemLocationDto } from "../contracts/api-item-location-dto"; export class ApiCall extends ApiCallableBase { public OnExtract(): ApiCallDto { const parentId: string | undefined = ApiHelpers.GetParentIdFromDeclaration(this.Declaration, this.Options); const metadata: ApiMetadataDto = this.GetItemMetadata(); - const location: ApiItemLocationDto = ApiHelpers.GetApiItemLocationDtoFromNode(this.Declaration, this.Options); return { ApiKind: ApiItemKinds.Call, Name: this.Symbol.name, ParentId: parentId, Metadata: metadata, - Location: location, + Location: this.Location, IsOverloadBase: this.IsOverloadBase, Parameters: this.Parameters, ReturnType: this.ReturnType, diff --git a/src/definitions/api-class-constructor.ts b/src/definitions/api-class-constructor.ts index fc4fa9d2..830f29b1 100644 --- a/src/definitions/api-class-constructor.ts +++ b/src/definitions/api-class-constructor.ts @@ -7,7 +7,6 @@ import { ApiItemKinds } from "../contracts/api-item-kinds"; import { AccessModifier } from "../contracts/access-modifier"; import { ApiMetadataDto } from "../contracts/api-metadata-dto"; -import { ApiItemLocationDto } from "../contracts/api-item-location-dto"; export class ApiClassConstructor extends ApiCallableBase { private accessModifier: AccessModifier; @@ -22,14 +21,13 @@ export class ApiClassConstructor extends ApiCallableBase { private accessModifier: AccessModifier; @@ -32,14 +31,13 @@ export class ApiClassMethod extends ApiCallableBase { + private location: ApiItemLocationDto; private accessModifier: AccessModifier; private isAbstract: boolean; private isStatic: boolean; @@ -19,6 +20,9 @@ export class ApiClassProperty extends ApiItem { + private location: ApiItemLocationDto; /** * Interfaces can extend multiple interfaces. */ @@ -21,13 +22,20 @@ export class ApiClass extends ApiItem { private isAbstract: boolean = false; protected OnGatherData(): void { + // ApiItemLocation + this.location = ApiHelpers.GetApiItemLocationDtoFromNode(this.Declaration, this.Options); + // Members this.members = ApiHelpers.GetItemsIdsFromDeclarations(this.Declaration.members, this.Options); // Extends if (this.Declaration.heritageClauses != null) { - const extendingList = ApiTypeHelpers - .GetHeritageList(this.Declaration.heritageClauses, ts.SyntaxKind.ExtendsKeyword, this.Options); + const extendingList = ApiTypeHelpers.GetHeritageList( + this.Options, + this.location, + this.Declaration.heritageClauses, + ts.SyntaxKind.ExtendsKeyword + ); if (extendingList.length > 0) { this.extends = extendingList[0]; @@ -36,8 +44,12 @@ export class ApiClass extends ApiItem { // Implements if (this.Declaration.heritageClauses != null) { - this.implements = ApiTypeHelpers - .GetHeritageList(this.Declaration.heritageClauses, ts.SyntaxKind.ImplementsKeyword, this.Options); + this.implements = ApiTypeHelpers.GetHeritageList( + this.Options, + this.location, + this.Declaration.heritageClauses, + ts.SyntaxKind.ImplementsKeyword + ); } // IsAbstract @@ -52,14 +64,13 @@ export class ApiClass extends ApiItem { public OnExtract(): ApiClassDto { const parentId: string | undefined = ApiHelpers.GetParentIdFromDeclaration(this.Declaration, this.Options); const metadata: ApiMetadataDto = this.GetItemMetadata(); - const location: ApiItemLocationDto = ApiHelpers.GetApiItemLocationDtoFromNode(this.Declaration, this.Options); return { ApiKind: ApiItemKinds.Class, Name: this.Symbol.name, ParentId: parentId, Metadata: metadata, - Location: location, + Location: this.location, IsAbstract: this.isAbstract, Members: this.members, Extends: this.extends, diff --git a/src/definitions/api-construct.ts b/src/definitions/api-construct.ts index 9c5816fb..3ec16b3b 100644 --- a/src/definitions/api-construct.ts +++ b/src/definitions/api-construct.ts @@ -6,20 +6,18 @@ import { ApiItemKinds } from "../contracts/api-item-kinds"; import { ApiMetadataDto } from "../contracts/api-metadata-dto"; import { ApiCallableBase } from "../abstractions/api-callable-base"; -import { ApiItemLocationDto } from "../contracts/api-item-location-dto"; export class ApiConstruct extends ApiCallableBase { public OnExtract(): ApiConstructDto { const parentId: string | undefined = ApiHelpers.GetParentIdFromDeclaration(this.Declaration, this.Options); const metadata: ApiMetadataDto = this.GetItemMetadata(); - const location: ApiItemLocationDto = ApiHelpers.GetApiItemLocationDtoFromNode(this.Declaration, this.Options); return { ApiKind: ApiItemKinds.Construct, Name: this.Symbol.name, ParentId: parentId, Metadata: metadata, - Location: location, + Location: this.Location, IsOverloadBase: this.IsOverloadBase, Parameters: this.Parameters, ReturnType: this.ReturnType, diff --git a/src/definitions/api-enum-member.ts b/src/definitions/api-enum-member.ts index b2f3c137..3136aace 100644 --- a/src/definitions/api-enum-member.ts +++ b/src/definitions/api-enum-member.ts @@ -8,6 +8,8 @@ import { ApiMetadataDto } from "../contracts/api-metadata-dto"; import { ApiItemLocationDto } from "../contracts/api-item-location-dto"; export class ApiEnumMember extends ApiItem { + private location: ApiItemLocationDto; + public GetValue(): string { for (const item of this.Declaration.getChildren()) { if (ts.isNumericLiteral(item) || @@ -32,13 +34,13 @@ export class ApiEnumMember extends ApiItem { } protected OnGatherData(): void { - // No gathering is needed + // ApiItemLocation + this.location = ApiHelpers.GetApiItemLocationDtoFromNode(this.Declaration, this.Options); } public OnExtract(): ApiEnumMemberDto { const parentId: string | undefined = ApiHelpers.GetParentIdFromDeclaration(this.Declaration, this.Options); const metadata: ApiMetadataDto = this.GetItemMetadata(); - const location: ApiItemLocationDto = ApiHelpers.GetApiItemLocationDtoFromNode(this.Declaration, this.Options); const value: string = this.GetValue(); return { @@ -46,7 +48,7 @@ export class ApiEnumMember extends ApiItem { Name: this.Symbol.name, ParentId: parentId, Metadata: metadata, - Location: location, + Location: this.location, Value: value, _ts: this.GetTsDebugInfo() }; diff --git a/src/definitions/api-enum.ts b/src/definitions/api-enum.ts index 69caefa8..cb561794 100644 --- a/src/definitions/api-enum.ts +++ b/src/definitions/api-enum.ts @@ -9,10 +9,14 @@ import { ApiMetadataDto } from "../contracts/api-metadata-dto"; import { ApiItemLocationDto } from "../contracts/api-item-location-dto"; export class ApiEnum extends ApiItem { + private location: ApiItemLocationDto; private members: ApiItemReference[] = []; private isConst: boolean; protected OnGatherData(): void { + // ApiItemLocation + this.location = ApiHelpers.GetApiItemLocationDtoFromNode(this.Declaration, this.Options); + // IsConst this.isConst = ApiHelpers.ModifierKindExistsInModifiers(this.Declaration.modifiers, ts.SyntaxKind.ConstKeyword); @@ -24,14 +28,13 @@ export class ApiEnum extends ApiItem { public OnExtract(): ApiEnumDto { const parentId: string | undefined = ApiHelpers.GetParentIdFromDeclaration(this.Declaration, this.Options); const metadata: ApiMetadataDto = this.GetItemMetadata(); - const location: ApiItemLocationDto = ApiHelpers.GetApiItemLocationDtoFromNode(this.Declaration, this.Options); return { ApiKind: ApiItemKinds.Enum, Name: this.Symbol.name, ParentId: parentId, Metadata: metadata, - Location: location, + Location: this.location, IsConst: this.isConst, Members: this.members, _ts: this.GetTsDebugInfo() diff --git a/src/definitions/api-export-specifier.ts b/src/definitions/api-export-specifier.ts index d927827b..4b8bfc47 100644 --- a/src/definitions/api-export-specifier.ts +++ b/src/definitions/api-export-specifier.ts @@ -9,9 +9,13 @@ import { ApiMetadataDto } from "../contracts/api-metadata-dto"; import { ApiItemLocationDto } from "../contracts/api-item-location-dto"; export class ApiExportSpecifier extends ApiItem { + private location: ApiItemLocationDto; private apiItems: ApiExportSpecifierApiItems; protected OnGatherData(): void { + // ApiItemLocation + this.location = ApiHelpers.GetApiItemLocationDtoFromNode(this.Declaration, this.Options); + const targetSymbol = this.TypeChecker.getExportSpecifierLocalTargetSymbol(this.Declaration); const symbolReferences = ApiHelpers.GetItemIdsFromSymbol(targetSymbol, this.Options); @@ -25,14 +29,13 @@ export class ApiExportSpecifier extends ApiItem { + private location: ApiItemLocationDto; private getExportPath(): string | undefined { if (this.apiSourceFile == null) { ApiHelpers.LogWithNodePosition(LogLevel.Warning, this.Declaration, "Exported source file is not found!"); @@ -29,6 +30,9 @@ export class ApiExport extends ApiItem { private apiSourceFile: ApiSourceFile | undefined; protected OnGatherData(): void { + // ApiItemLocation + this.location = ApiHelpers.GetApiItemLocationDtoFromNode(this.Declaration, this.Options); + // Extract members from Source file. const sourceFileDeclaration = TSHelpers.ResolveSourceFile(this.Declaration, this.Options.Program); @@ -46,14 +50,13 @@ export class ApiExport extends ApiItem { const parentId: string | undefined = ApiHelpers.GetParentIdFromDeclaration(this.Declaration, this.Options); const metadata: ApiMetadataDto = this.GetItemMetadata(); const exportPath: string | undefined = this.getExportPath(); - const location: ApiItemLocationDto = ApiHelpers.GetApiItemLocationDtoFromNode(this.Declaration, this.Options); return { ApiKind: ApiItemKinds.Export, Name: this.Symbol.name, ParentId: parentId, Metadata: metadata, - Location: location, + Location: this.location, SourceFileId: this.sourceFileId, ExportPath: exportPath, _ts: this.GetTsDebugInfo() diff --git a/src/definitions/api-function-type.ts b/src/definitions/api-function-type.ts index 4c73ec17..0e95ed5a 100644 --- a/src/definitions/api-function-type.ts +++ b/src/definitions/api-function-type.ts @@ -5,7 +5,6 @@ import { ApiFunctionTypeDto } from "../contracts/definitions/api-function-type-d import { ApiItemKinds } from "../contracts/api-item-kinds"; import { ApiMetadataDto } from "../contracts/api-metadata-dto"; import { ApiCallableBase } from "../abstractions/api-callable-base"; -import { ApiItemLocationDto } from "../contracts/api-item-location-dto"; export type FunctionTypes = ts.FunctionTypeNode | ts.ArrowFunction | ts.FunctionExpression; @@ -24,7 +23,6 @@ export class ApiFunctionType extends ApiCallableBase { private isAsync: boolean; @@ -20,14 +19,13 @@ export class ApiFunction extends ApiCallableBase { + private location: ApiItemLocationDto; private accessModifier: AccessModifier; private isAbstract: boolean; private isStatic: boolean; private type: ApiType; protected OnGatherData(): void { + // ApiItemLocation + this.location = ApiHelpers.GetApiItemLocationDtoFromNode(this.Declaration, this.Options); + // Modifiers this.accessModifier = ApiHelpers.ResolveAccessModifierFromModifiers(this.Declaration.modifiers); this.isAbstract = ApiHelpers.ModifierKindExistsInModifiers(this.Declaration.modifiers, ts.SyntaxKind.AbstractKeyword); @@ -24,20 +28,19 @@ export class ApiGetAccessor extends ApiItem { + private location: ApiItemLocationDto; private apiItems: ApiImportSpecifierApiItems; protected OnGatherData(): void { + // ApiItemLocation + this.location = ApiHelpers.GetApiItemLocationDtoFromNode(this.Declaration, this.Options); + const targetSymbol = TSHelpers.GetImportSpecifierLocalTargetSymbol(this.Declaration, this.Options.Program); const symbolReferences = ApiHelpers.GetItemIdsFromSymbol(targetSymbol, this.Options); @@ -26,14 +30,13 @@ export class ApiImportSpecifier extends ApiItem { + private location: ApiItemLocationDto; private parameter: string; private type: ApiType; private isReadonly: boolean; protected OnGatherData(): void { + // ApiItemLocation + this.location = ApiHelpers.GetApiItemLocationDtoFromNode(this.Declaration, this.Options); + // Parameter const parameters = ApiHelpers.GetItemsIdsFromDeclarations(this.Declaration.parameters, this.Options); @@ -37,7 +41,7 @@ export class ApiIndex extends ApiItem * getTypeFromTypeNode method handles undefined and returns `any` type. */ const type = this.TypeChecker.getTypeFromTypeNode(this.Declaration.type!); - this.type = ApiTypeHelpers.ResolveApiType(this.Options, type, this.Declaration.type); + this.type = ApiTypeHelpers.ResolveApiType(this.Options, this.location, type, this.Declaration.type); // Modifiers this.isReadonly = ApiHelpers.ModifierKindExistsInModifiers(this.Declaration.modifiers, ts.SyntaxKind.ReadonlyKeyword); @@ -46,14 +50,13 @@ export class ApiIndex extends ApiItem public OnExtract(): ApiIndexDto { const parentId: string | undefined = ApiHelpers.GetParentIdFromDeclaration(this.Declaration, this.Options); const metadata: ApiMetadataDto = this.GetItemMetadata(); - const location: ApiItemLocationDto = ApiHelpers.GetApiItemLocationDtoFromNode(this.Declaration, this.Options); return { ApiKind: ApiItemKinds.Index, Name: this.Symbol.name, ParentId: parentId, Metadata: metadata, - Location: location, + Location: this.location, Parameter: this.parameter, IsReadonly: this.isReadonly, Type: this.type, diff --git a/src/definitions/api-interface.ts b/src/definitions/api-interface.ts index 0e66f1f8..6dfd1b9b 100644 --- a/src/definitions/api-interface.ts +++ b/src/definitions/api-interface.ts @@ -11,6 +11,7 @@ import { ApiItemLocationDto } from "../contracts/api-item-location-dto"; import { ApiTypeHelpers } from "../api-type-helpers"; export class ApiInterface extends ApiItem { + private location: ApiItemLocationDto; /** * Interfaces can extend multiple interfaces. */ @@ -19,12 +20,20 @@ export class ApiInterface extends ApiItem { + private location: ApiItemLocationDto; private typeParameter: string | undefined; private type: ApiType; private isReadonly: boolean; private isOptional: boolean; protected OnGatherData(): void { + // ApiItemLocation + this.location = ApiHelpers.GetApiItemLocationDtoFromNode(this.Declaration, this.Options); + // TypeParameter const typeParameterSymbol = TSHelpers.GetSymbolFromDeclaration(this.Declaration.typeParameter, this.TypeChecker); if (typeParameterSymbol != null) { @@ -29,7 +33,7 @@ export class ApiMapped extends ApiItem { * getTypeFromTypeNode method handles undefined and returns `any` type. */ const type = this.TypeChecker.getTypeFromTypeNode(this.Declaration.type!); - this.type = ApiTypeHelpers.ResolveApiType(this.Options, type, this.Declaration.type); + this.type = ApiTypeHelpers.ResolveApiType(this.Options, this.location, type, this.Declaration.type); // Readonly this.isReadonly = Boolean(this.Declaration.readonlyToken); @@ -41,14 +45,13 @@ export class ApiMapped extends ApiItem { public OnExtract(): ApiMappedDto { const parentId: string | undefined = ApiHelpers.GetParentIdFromDeclaration(this.Declaration, this.Options); const metadata: ApiMetadataDto = this.GetItemMetadata(); - const location: ApiItemLocationDto = ApiHelpers.GetApiItemLocationDtoFromNode(this.Declaration, this.Options); return { ApiKind: ApiItemKinds.Mapped, Name: this.Symbol.name, ParentId: parentId, Metadata: metadata, - Location: location, + Location: this.location, TypeParameter: this.typeParameter, IsOptional: this.isOptional, IsReadonly: this.isReadonly, diff --git a/src/definitions/api-method.ts b/src/definitions/api-method.ts index 89f408fd..f1711dd1 100644 --- a/src/definitions/api-method.ts +++ b/src/definitions/api-method.ts @@ -6,7 +6,6 @@ import { ApiItemKinds } from "../contracts/api-item-kinds"; import { ApiMetadataDto } from "../contracts/api-metadata-dto"; import { ApiCallableBase } from "../abstractions/api-callable-base"; -import { ApiItemLocationDto } from "../contracts/api-item-location-dto"; export class ApiMethod extends ApiCallableBase { private isOptional: boolean; @@ -21,14 +20,13 @@ export class ApiMethod extends ApiCallableBase public OnExtract(): ApiMethodDto { const parentId: string | undefined = ApiHelpers.GetParentIdFromDeclaration(this.Declaration, this.Options); const metadata: ApiMetadataDto = this.GetItemMetadata(); - const location: ApiItemLocationDto = ApiHelpers.GetApiItemLocationDtoFromNode(this.Declaration, this.Options); return { ApiKind: ApiItemKinds.Method, Name: this.Symbol.name, ParentId: parentId, Metadata: metadata, - Location: location, + Location: this.Location, IsOverloadBase: this.IsOverloadBase, Parameters: this.Parameters, ReturnType: this.ReturnType, diff --git a/src/definitions/api-namespace.ts b/src/definitions/api-namespace.ts index f370ef5d..251a7a2b 100644 --- a/src/definitions/api-namespace.ts +++ b/src/definitions/api-namespace.ts @@ -9,6 +9,7 @@ import { ApiMetadataDto } from "../contracts/api-metadata-dto"; import { ApiItemLocationDto } from "../contracts/api-item-location-dto"; export class ApiNamespace extends ApiItem { + private location: ApiItemLocationDto; private members: ApiItemReference[] = []; protected ResolveApiKind(): ApiItemKinds.Namespace | ApiItemKinds.ImportNamespace { @@ -20,6 +21,9 @@ export class ApiNamespace extends ApiItem { + private location: ApiItemLocationDto; private type: ApiType; private isOptional: boolean; private isSpread: boolean; private initializer: string | undefined; protected OnGatherData(): void { + // ApiItemLocation + this.location = ApiHelpers.GetApiItemLocationDtoFromNode(this.Declaration, this.Options); + // Type const type = this.TypeChecker.getTypeOfSymbolAtLocation(this.Symbol, this.Declaration); - this.type = ApiTypeHelpers.ResolveApiType(this.Options, type, this.Declaration.type); + this.type = ApiTypeHelpers.ResolveApiType(this.Options, this.location, type, this.Declaration.type); // IsOptional this.isOptional = Boolean(this.Declaration.questionToken); @@ -33,14 +37,13 @@ export class ApiParameter extends ApiItem { + private location: ApiItemLocationDto; private type: ApiType; private isOptional: boolean; private isReadonly: boolean; protected OnGatherData(): void { + // ApiItemLocation + this.location = ApiHelpers.GetApiItemLocationDtoFromNode(this.Declaration, this.Options); + // Type const typeNode: ts.TypeNode | undefined = ts.isPropertySignature(this.Declaration) ? this.Declaration.type : undefined; const type = this.TypeChecker.getTypeOfSymbolAtLocation(this.Symbol, this.Declaration); - this.type = ApiTypeHelpers.ResolveApiType(this.Options, type, typeNode); + this.type = ApiTypeHelpers.ResolveApiType(this.Options, this.location, type, typeNode); // IsOptional this.isOptional = Boolean(this.Declaration.questionToken); @@ -30,14 +34,13 @@ export class ApiProperty extends ApiItem { + private location: ApiItemLocationDto; private accessModifier: AccessModifier; private isAbstract: boolean; private isStatic: boolean; private parameter: ApiItemReference | undefined; protected OnGatherData(): void { + // ApiItemLocation + this.location = ApiHelpers.GetApiItemLocationDtoFromNode(this.Declaration, this.Options); + // Modifiers this.accessModifier = ApiHelpers.ResolveAccessModifierFromModifiers(this.Declaration.modifiers); this.isAbstract = ApiHelpers.ModifierKindExistsInModifiers(this.Declaration.modifiers, ts.SyntaxKind.AbstractKeyword); @@ -40,14 +44,13 @@ export class ApiSetAccessor extends ApiItem { + private location: ApiItemLocationDto; private members: ApiItemReference[]; private getFileName(): string { @@ -18,13 +19,16 @@ export class ApiSourceFile extends ApiItem { } protected OnGatherData(): void { + // ApiItemLocation + this.location = ApiHelpers.GetApiItemLocationDtoFromNode(this.Declaration, this.Options); + + // Members this.members = ApiHelpers.GetItemsIdsFromSymbolsMap(this.Symbol.exports, this.Options); } public OnExtract(): ApiSourceFileDto { const parentId: string | undefined = ApiHelpers.GetParentIdFromDeclaration(this.Declaration, this.Options); const metadata: ApiMetadataDto = this.GetItemMetadata(); - const location: ApiItemLocationDto = ApiHelpers.GetApiItemLocationDtoFromNode(this.Declaration, this.Options); const name: string = this.getFileName(); return { @@ -32,7 +36,7 @@ export class ApiSourceFile extends ApiItem { Name: name, ParentId: parentId, Metadata: metadata, - Location: location, + Location: this.location, Members: this.members, _ts: this.GetTsDebugInfo() }; diff --git a/src/definitions/api-type-alias.ts b/src/definitions/api-type-alias.ts index e3940c52..a316d3e6 100644 --- a/src/definitions/api-type-alias.ts +++ b/src/definitions/api-type-alias.ts @@ -12,10 +12,14 @@ import { ApiType } from "../contracts"; import { ApiTypeHelpers } from "../api-type-helpers"; export class ApiTypeAlias extends ApiItem { + private location: ApiItemLocationDto; private typeParameters: ApiItemReference[] = []; private type: ApiType; protected OnGatherData(): void { + // ApiItemLocation + this.location = ApiHelpers.GetApiItemLocationDtoFromNode(this.Declaration, this.Options); + // TypeParameters if (this.Declaration.typeParameters != null) { this.typeParameters = ApiHelpers.GetItemsIdsFromDeclarations(this.Declaration.typeParameters, this.Options); @@ -24,20 +28,19 @@ export class ApiTypeAlias extends ApiItem { + private location: ApiItemLocationDto; private members: ApiItemReference[] = []; protected ResolveApiKind(): ApiItemKinds.TypeLiteral | ApiItemKinds.ObjectLiteral { @@ -21,6 +22,9 @@ export class ApiTypeLiteral extends ApiItem { + private location: ApiItemLocationDto; private constraintType: ApiType | undefined; private defaultType: ApiType | undefined; protected OnGatherData(): void { + // ApiItemLocation + this.location = ApiHelpers.GetApiItemLocationDtoFromNode(this.Declaration, this.Options); + // Constraint type if (this.Declaration.constraint != null) { const type = this.TypeChecker.getTypeFromTypeNode(this.Declaration.constraint); - this.constraintType = ApiTypeHelpers.ResolveApiType(this.Options, type, this.Declaration.constraint); + this.constraintType = ApiTypeHelpers.ResolveApiType(this.Options, this.location, type, this.Declaration.constraint); } // Default type if (this.Declaration.default != null) { const type = this.TypeChecker.getTypeFromTypeNode(this.Declaration.default); - this.defaultType = ApiTypeHelpers.ResolveApiType(this.Options, type, this.Declaration.default); + this.defaultType = ApiTypeHelpers.ResolveApiType(this.Options, this.location, type, this.Declaration.default); } } public OnExtract(): ApiTypeParameterDto { const parentId: string | undefined = ApiHelpers.GetParentIdFromDeclaration(this.Declaration, this.Options); const metadata: ApiMetadataDto = this.GetItemMetadata(); - const location: ApiItemLocationDto = ApiHelpers.GetApiItemLocationDtoFromNode(this.Declaration, this.Options); return { ApiKind: ApiItemKinds.TypeParameter, Name: this.Symbol.name, ParentId: parentId, Metadata: metadata, - Location: location, + Location: this.location, ConstraintType: this.constraintType, DefaultType: this.defaultType, _ts: this.GetTsDebugInfo() diff --git a/src/definitions/api-variable.ts b/src/definitions/api-variable.ts index 7f630f72..e20d74c6 100644 --- a/src/definitions/api-variable.ts +++ b/src/definitions/api-variable.ts @@ -10,13 +10,17 @@ import { ApiItemLocationDto } from "../contracts/api-item-location-dto"; import { ApiTypeHelpers } from "../api-type-helpers"; export class ApiVariable extends ApiItem { + private location: ApiItemLocationDto; private type: ApiType; private variableDeclarationType: ApiVariableDeclarationType; protected OnGatherData(): void { + // ApiItemLocation + this.location = ApiHelpers.GetApiItemLocationDtoFromNode(this.Declaration, this.Options); + // Type const type = this.TypeChecker.getTypeOfSymbolAtLocation(this.Symbol, this.Declaration); - this.type = ApiTypeHelpers.ResolveApiType(this.Options, type, this.Declaration.type); + this.type = ApiTypeHelpers.ResolveApiType(this.Options, this.location, type, this.Declaration.type); // VariableDeclarationType if (this.Declaration.parent != null) { @@ -39,14 +43,13 @@ export class ApiVariable extends ApiItem public OnExtract(): ApiVariableDto { const parentId: string | undefined = ApiHelpers.GetParentIdFromDeclaration(this.Declaration, this.Options); const metadata: ApiMetadataDto = this.GetItemMetadata(); - const location: ApiItemLocationDto = ApiHelpers.GetApiItemLocationDtoFromNode(this.Declaration, this.Options); return { ApiKind: ApiItemKinds.Variable, Name: this.Symbol.name, ParentId: parentId, Metadata: metadata, - Location: location, + Location: this.location, VariableDeclarationType: this.variableDeclarationType, Type: this.type, _ts: this.GetTsDebugInfo() diff --git a/src/index.ts b/src/index.ts index 79da9b20..212c932a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,6 @@ export * from "./extractor"; export * from "./api-helpers"; +export * from "./api-type-helpers"; export * from "./ts-helpers"; export * from "./utils/tsconfig-json"; export * from "./api-registry"; diff --git a/tests/cases/__tests__/__snapshots__/ClassDeclaration1.test.ts.snap b/tests/cases/__tests__/__snapshots__/ClassDeclaration1.test.ts.snap index f2b62c15..c73033c6 100644 --- a/tests/cases/__tests__/__snapshots__/ClassDeclaration1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ClassDeclaration1.test.ts.snap @@ -98,6 +98,12 @@ Object { "ParentId": "ClassDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 37, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 11, + }, "Text": "void", "_ts": Object { "Kind": 105, @@ -142,6 +148,12 @@ GetFoo without A parameter comment line.", "ParentId": "ClassDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 33, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 17, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -186,6 +198,12 @@ GetFoo without A parameter comment line.", "ParentId": "ClassDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 34, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 22, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -230,6 +248,12 @@ GetFoo without A parameter comment line.", "ParentId": "ClassDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 42, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 26, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -265,12 +289,24 @@ GetFoo without A parameter comment line.", "ParentId": "ClassDeclaration-0", "ReturnType": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 33, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 30, + }, "ReferenceId": undefined, "SymbolName": "Promise", "Text": "Promise", "TypeParameters": Array [ Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 41, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 30, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -308,6 +344,12 @@ GetFoo without A parameter comment line.", "ParentId": "MethodDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 28, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 11, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -338,6 +380,12 @@ GetFoo without A parameter comment line.", "ParentId": "MethodDeclaration-1", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 24, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 17, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -368,6 +416,12 @@ GetFoo without A parameter comment line.", "ParentId": "MethodDeclaration-2", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 24, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 22, + }, "Text": "boolean", "_ts": Object { "Kind": 122, @@ -398,9 +452,21 @@ GetFoo without A parameter comment line.", "ParentId": "MethodDeclaration-3", "Type": Object { "ApiTypeKind": "union", + "Location": Object { + "Character": 23, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 26, + }, "Members": Array [ Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 23, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 26, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -409,6 +475,12 @@ GetFoo without A parameter comment line.", }, Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 32, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 26, + }, "Text": "boolean", "_ts": Object { "Kind": 122, @@ -453,6 +525,12 @@ GetFoo without A parameter comment line.", "ParentId": "ClassDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 32, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 36, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -485,6 +563,12 @@ GetFoo without A parameter comment line.", "ParentId": "ClassDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 31, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 37, + }, "Text": "string", "_ts": Object { "Kind": 136, diff --git a/tests/cases/__tests__/__snapshots__/ClassDeclaration10.test.ts.snap b/tests/cases/__tests__/__snapshots__/ClassDeclaration10.test.ts.snap index f77acfa5..596cf757 100644 --- a/tests/cases/__tests__/__snapshots__/ClassDeclaration10.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ClassDeclaration10.test.ts.snap @@ -151,6 +151,12 @@ Creating foo with boolean.", "ParentId": "Constructor-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 22, + "FileName": "./cases/ClassDeclaration10.ts", + "IsExternalPackage": false, + "Line": 7, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -181,6 +187,12 @@ Creating foo with boolean.", "ParentId": "Constructor-1", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 24, + "FileName": "./cases/ClassDeclaration10.ts", + "IsExternalPackage": false, + "Line": 12, + }, "Text": "boolean", "_ts": Object { "Kind": 122, @@ -211,9 +223,21 @@ Creating foo with boolean.", "ParentId": "Constructor-2", "Type": Object { "ApiTypeKind": "union", + "Location": Object { + "Character": 21, + "FileName": "./cases/ClassDeclaration10.ts", + "IsExternalPackage": false, + "Line": 14, + }, "Members": Array [ Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 21, + "FileName": "./cases/ClassDeclaration10.ts", + "IsExternalPackage": false, + "Line": 14, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -222,6 +246,12 @@ Creating foo with boolean.", }, Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 30, + "FileName": "./cases/ClassDeclaration10.ts", + "IsExternalPackage": false, + "Line": 14, + }, "Text": "boolean", "_ts": Object { "Kind": 122, diff --git a/tests/cases/__tests__/__snapshots__/ClassDeclaration11.test.ts.snap b/tests/cases/__tests__/__snapshots__/ClassDeclaration11.test.ts.snap index 0c01fae2..e0f7c995 100644 --- a/tests/cases/__tests__/__snapshots__/ClassDeclaration11.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ClassDeclaration11.test.ts.snap @@ -60,6 +60,12 @@ Object { "ParentId": "ClassDeclaration-0", "ReturnType": Object { "ApiTypeKind": "this", + "Location": Object { + "Character": 21, + "FileName": "./cases/ClassDeclaration11.ts", + "IsExternalPackage": false, + "Line": 1, + }, "ReferenceId": "ClassDeclaration-0", "Text": "this", "_ts": Object { diff --git a/tests/cases/__tests__/__snapshots__/ClassDeclaration2.test.ts.snap b/tests/cases/__tests__/__snapshots__/ClassDeclaration2.test.ts.snap index 9bb558e4..7837256c 100644 --- a/tests/cases/__tests__/__snapshots__/ClassDeclaration2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ClassDeclaration2.test.ts.snap @@ -91,6 +91,12 @@ Object { "ParentId": "ClassDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 44, + "FileName": "./cases/ClassDeclaration2.ts", + "IsExternalPackage": false, + "Line": 3, + }, "Text": "void", "_ts": Object { "Kind": 105, @@ -126,6 +132,12 @@ Object { "ParentId": "ClassDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 21, + "FileName": "./cases/ClassDeclaration2.ts", + "IsExternalPackage": false, + "Line": 7, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -157,6 +169,12 @@ Object { "ParentId": "MethodDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 35, + "FileName": "./cases/ClassDeclaration2.ts", + "IsExternalPackage": false, + "Line": 3, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -189,6 +207,12 @@ Object { "ParentId": "ClassDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 22, + "FileName": "./cases/ClassDeclaration2.ts", + "IsExternalPackage": false, + "Line": 5, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -221,6 +245,12 @@ Object { "ParentId": "ClassDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 33, + "FileName": "./cases/ClassDeclaration2.ts", + "IsExternalPackage": false, + "Line": 11, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -253,6 +283,12 @@ Object { "ParentId": "ClassDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 23, + "FileName": "./cases/ClassDeclaration2.ts", + "IsExternalPackage": false, + "Line": 12, + }, "Text": "string", "_ts": Object { "Kind": 136, diff --git a/tests/cases/__tests__/__snapshots__/ClassDeclaration3.test.ts.snap b/tests/cases/__tests__/__snapshots__/ClassDeclaration3.test.ts.snap index e0cbb48d..ab78085c 100644 --- a/tests/cases/__tests__/__snapshots__/ClassDeclaration3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ClassDeclaration3.test.ts.snap @@ -12,6 +12,12 @@ Object { "Implements": Array [ Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 33, + "FileName": "./cases/ClassDeclaration3.ts", + "IsExternalPackage": false, + "Line": 6, + }, "ReferenceId": "InterfaceDeclaration-0", "SymbolName": "Foo", "Text": "Foo", @@ -99,6 +105,12 @@ Object { "ParentId": "ClassDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 16, + "FileName": "./cases/ClassDeclaration3.ts", + "IsExternalPackage": false, + "Line": 7, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -128,6 +140,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 9, + "FileName": "./cases/ClassDeclaration3.ts", + "IsExternalPackage": false, + "Line": 3, + }, "Text": "string", "_ts": Object { "Kind": 136, diff --git a/tests/cases/__tests__/__snapshots__/ClassDeclaration4.test.ts.snap b/tests/cases/__tests__/__snapshots__/ClassDeclaration4.test.ts.snap index 984615f7..49c2dc4e 100644 --- a/tests/cases/__tests__/__snapshots__/ClassDeclaration4.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ClassDeclaration4.test.ts.snap @@ -12,6 +12,12 @@ Object { "Implements": Array [ Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 33, + "FileName": "./cases/ClassDeclaration4.ts", + "IsExternalPackage": false, + "Line": 10, + }, "ReferenceId": "InterfaceDeclaration-0", "SymbolName": "Foo", "Text": "Foo", @@ -23,6 +29,12 @@ Object { }, Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 38, + "FileName": "./cases/ClassDeclaration4.ts", + "IsExternalPackage": false, + "Line": 10, + }, "ReferenceId": "InterfaceDeclaration-1", "SymbolName": "Foo2", "Text": "Foo2", @@ -145,6 +157,12 @@ Object { "ParentId": "ClassDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 16, + "FileName": "./cases/ClassDeclaration4.ts", + "IsExternalPackage": false, + "Line": 11, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -177,6 +195,12 @@ Object { "ParentId": "ClassDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 17, + "FileName": "./cases/ClassDeclaration4.ts", + "IsExternalPackage": false, + "Line": 12, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -206,6 +230,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 9, + "FileName": "./cases/ClassDeclaration4.ts", + "IsExternalPackage": false, + "Line": 3, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -235,6 +265,12 @@ Object { "ParentId": "InterfaceDeclaration-1", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 10, + "FileName": "./cases/ClassDeclaration4.ts", + "IsExternalPackage": false, + "Line": 7, + }, "Text": "string", "_ts": Object { "Kind": 136, diff --git a/tests/cases/__tests__/__snapshots__/ClassDeclaration5.test.ts.snap b/tests/cases/__tests__/__snapshots__/ClassDeclaration5.test.ts.snap index 309b6cbb..8d2108d3 100644 --- a/tests/cases/__tests__/__snapshots__/ClassDeclaration5.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ClassDeclaration5.test.ts.snap @@ -48,12 +48,24 @@ Object { "ApiKind": "class", "Extends": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 25, + "FileName": "./cases/ClassDeclaration5.ts", + "IsExternalPackage": false, + "Line": 6, + }, "ReferenceId": "ClassDeclaration-0", "SymbolName": "FooBase", "Text": "FooBase", "TypeParameters": Array [ Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 33, + "FileName": "./cases/ClassDeclaration5.ts", + "IsExternalPackage": false, + "Line": 6, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -117,6 +129,12 @@ Object { "ParentId": "ClassDeclaration-0", "ReturnType": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 32, + "FileName": "./cases/ClassDeclaration5.ts", + "IsExternalPackage": false, + "Line": 3, + }, "ReferenceId": "TypeParameter-0", "SymbolName": "TValue", "Text": "TValue", @@ -155,6 +173,12 @@ Object { "ParentId": "ClassDeclaration-1", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 23, + "FileName": "./cases/ClassDeclaration5.ts", + "IsExternalPackage": false, + "Line": 7, + }, "Text": "number", "_ts": Object { "Kind": 133, diff --git a/tests/cases/__tests__/__snapshots__/ClassDeclaration6.test.ts.snap b/tests/cases/__tests__/__snapshots__/ClassDeclaration6.test.ts.snap index b298548f..cefc2db5 100644 --- a/tests/cases/__tests__/__snapshots__/ClassDeclaration6.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ClassDeclaration6.test.ts.snap @@ -48,12 +48,24 @@ Object { "ApiKind": "class", "Extends": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 25, + "FileName": "./cases/ClassDeclaration6.ts", + "IsExternalPackage": false, + "Line": 10, + }, "ReferenceId": "ClassDeclaration-0", "SymbolName": "FooBase", "Text": "FooBase", "TypeParameters": Array [ Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 33, + "FileName": "./cases/ClassDeclaration6.ts", + "IsExternalPackage": false, + "Line": 10, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -69,6 +81,12 @@ Object { "Implements": Array [ Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 52, + "FileName": "./cases/ClassDeclaration6.ts", + "IsExternalPackage": false, + "Line": 10, + }, "ReferenceId": "InterfaceDeclaration-0", "SymbolName": "Bar", "Text": "Bar", @@ -164,6 +182,12 @@ Object { "ParentId": "ClassDeclaration-0", "ReturnType": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 32, + "FileName": "./cases/ClassDeclaration6.ts", + "IsExternalPackage": false, + "Line": 3, + }, "ReferenceId": "TypeParameter-0", "SymbolName": "TValue", "Text": "TValue", @@ -202,6 +226,12 @@ Object { "ParentId": "ClassDeclaration-1", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 23, + "FileName": "./cases/ClassDeclaration6.ts", + "IsExternalPackage": false, + "Line": 11, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -235,6 +265,12 @@ Object { "ParentId": "ClassDeclaration-1", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 20, + "FileName": "./cases/ClassDeclaration6.ts", + "IsExternalPackage": false, + "Line": 15, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -264,6 +300,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 13, + "FileName": "./cases/ClassDeclaration6.ts", + "IsExternalPackage": false, + "Line": 7, + }, "Text": "string", "_ts": Object { "Kind": 136, diff --git a/tests/cases/__tests__/__snapshots__/ClassDeclaration8.test.ts.snap b/tests/cases/__tests__/__snapshots__/ClassDeclaration8.test.ts.snap index 8cfdd573..b56972a1 100644 --- a/tests/cases/__tests__/__snapshots__/ClassDeclaration8.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ClassDeclaration8.test.ts.snap @@ -41,6 +41,12 @@ Object { "ApiKind": "class", "Extends": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 28, + "FileName": "./cases/ClassDeclaration8.ts", + "IsExternalPackage": false, + "Line": 8, + }, "ReferenceId": "ClassDeclaration-0", "SymbolName": "Control", "Text": "Control", @@ -53,6 +59,12 @@ Object { "Implements": Array [ Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 47, + "FileName": "./cases/ClassDeclaration8.ts", + "IsExternalPackage": false, + "Line": 8, + }, "ReferenceId": "InterfaceDeclaration-0", "SymbolName": "SelectableControl", "Text": "SelectableControl", @@ -95,6 +107,12 @@ Object { "Extends": Array [ Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 43, + "FileName": "./cases/ClassDeclaration8.ts", + "IsExternalPackage": false, + "Line": 4, + }, "ReferenceId": "ClassDeclaration-0", "SymbolName": "Control", "Text": "Control", @@ -154,6 +172,12 @@ Object { "ParentId": "ClassDeclaration-1", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 4, + "FileName": "./cases/ClassDeclaration8.ts", + "IsExternalPackage": false, + "Line": 9, + }, "Text": "void", "_ts": Object { "Kind": 105, @@ -185,6 +209,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 14, + "FileName": "./cases/ClassDeclaration8.ts", + "IsExternalPackage": false, + "Line": 5, + }, "Text": "void", "_ts": Object { "Kind": 105, @@ -218,6 +248,12 @@ Object { "ParentId": "ClassDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 19, + "FileName": "./cases/ClassDeclaration8.ts", + "IsExternalPackage": false, + "Line": 1, + }, "Text": "any", "_ts": Object { "Kind": 119, diff --git a/tests/cases/__tests__/__snapshots__/ClassDeclaration9.test.ts.snap b/tests/cases/__tests__/__snapshots__/ClassDeclaration9.test.ts.snap index 6954bb11..07c559dc 100644 --- a/tests/cases/__tests__/__snapshots__/ClassDeclaration9.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ClassDeclaration9.test.ts.snap @@ -49,6 +49,12 @@ Object { "Implements": Array [ Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 32, + "FileName": "./cases/ClassDeclaration9.ts", + "IsExternalPackage": false, + "Line": 7, + }, "ReferenceId": "ClassDeclaration-0", "SymbolName": "Point", "Text": "Point", @@ -119,6 +125,12 @@ Object { "ParentId": "ClassDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 7, + "FileName": "./cases/ClassDeclaration9.ts", + "IsExternalPackage": false, + "Line": 3, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -151,6 +163,12 @@ Object { "ParentId": "ClassDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 7, + "FileName": "./cases/ClassDeclaration9.ts", + "IsExternalPackage": false, + "Line": 4, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -183,6 +201,12 @@ Object { "ParentId": "ClassDeclaration-1", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 7, + "FileName": "./cases/ClassDeclaration9.ts", + "IsExternalPackage": false, + "Line": 8, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -215,6 +239,12 @@ Object { "ParentId": "ClassDeclaration-1", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 7, + "FileName": "./cases/ClassDeclaration9.ts", + "IsExternalPackage": false, + "Line": 9, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -247,6 +277,12 @@ Object { "ParentId": "ClassDeclaration-1", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 7, + "FileName": "./cases/ClassDeclaration9.ts", + "IsExternalPackage": false, + "Line": 10, + }, "Text": "number", "_ts": Object { "Kind": 133, diff --git a/tests/cases/__tests__/__snapshots__/ConstructSignature1.test.ts.snap b/tests/cases/__tests__/__snapshots__/ConstructSignature1.test.ts.snap index f3fbbdf1..e1cfc9e2 100644 --- a/tests/cases/__tests__/__snapshots__/ConstructSignature1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ConstructSignature1.test.ts.snap @@ -31,6 +31,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "ReturnType": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 22, + "FileName": "./cases/ConstructSignature1.ts", + "IsExternalPackage": false, + "Line": 1, + }, "ReferenceId": "InterfaceDeclaration-0", "SymbolName": "Foo", "Text": "Foo", @@ -94,6 +100,12 @@ Object { "ParentId": "ConstructSignature-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 13, + "FileName": "./cases/ConstructSignature1.ts", + "IsExternalPackage": false, + "Line": 1, + }, "Text": "string", "_ts": Object { "Kind": 136, diff --git a/tests/cases/__tests__/__snapshots__/ConstructSignature2.test.ts.snap b/tests/cases/__tests__/__snapshots__/ConstructSignature2.test.ts.snap index bf09ccba..788394dd 100644 --- a/tests/cases/__tests__/__snapshots__/ConstructSignature2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ConstructSignature2.test.ts.snap @@ -24,6 +24,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "ReturnType": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 15, + "FileName": "./cases/ConstructSignature2.ts", + "IsExternalPackage": false, + "Line": 1, + }, "ReferenceId": "TypeParameter-0", "SymbolName": "T", "Text": "T", diff --git a/tests/cases/__tests__/__snapshots__/ExportDeclaration1.test.ts.snap b/tests/cases/__tests__/__snapshots__/ExportDeclaration1.test.ts.snap index 5460d312..4e76bcea 100644 --- a/tests/cases/__tests__/__snapshots__/ExportDeclaration1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ExportDeclaration1.test.ts.snap @@ -119,6 +119,12 @@ Object { "ParentId": "ClassDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 37, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 11, + }, "Text": "void", "_ts": Object { "Kind": 105, @@ -163,6 +169,12 @@ GetFoo without A parameter comment line.", "ParentId": "ClassDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 33, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 17, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -207,6 +219,12 @@ GetFoo without A parameter comment line.", "ParentId": "ClassDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 34, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 22, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -251,6 +269,12 @@ GetFoo without A parameter comment line.", "ParentId": "ClassDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 42, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 26, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -286,12 +310,24 @@ GetFoo without A parameter comment line.", "ParentId": "ClassDeclaration-0", "ReturnType": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 33, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 30, + }, "ReferenceId": undefined, "SymbolName": "Promise", "Text": "Promise", "TypeParameters": Array [ Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 41, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 30, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -329,6 +365,12 @@ GetFoo without A parameter comment line.", "ParentId": "MethodDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 28, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 11, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -359,6 +401,12 @@ GetFoo without A parameter comment line.", "ParentId": "MethodDeclaration-1", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 24, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 17, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -389,6 +437,12 @@ GetFoo without A parameter comment line.", "ParentId": "MethodDeclaration-2", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 24, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 22, + }, "Text": "boolean", "_ts": Object { "Kind": 122, @@ -419,9 +473,21 @@ GetFoo without A parameter comment line.", "ParentId": "MethodDeclaration-3", "Type": Object { "ApiTypeKind": "union", + "Location": Object { + "Character": 23, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 26, + }, "Members": Array [ Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 23, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 26, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -430,6 +496,12 @@ GetFoo without A parameter comment line.", }, Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 32, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 26, + }, "Text": "boolean", "_ts": Object { "Kind": 122, @@ -474,6 +546,12 @@ GetFoo without A parameter comment line.", "ParentId": "ClassDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 32, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 36, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -506,6 +584,12 @@ GetFoo without A parameter comment line.", "ParentId": "ClassDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 31, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 37, + }, "Text": "string", "_ts": Object { "Kind": 136, diff --git a/tests/cases/__tests__/__snapshots__/ExportSpecifier1.test.ts.snap b/tests/cases/__tests__/__snapshots__/ExportSpecifier1.test.ts.snap index c0be45a0..6eca7492 100644 --- a/tests/cases/__tests__/__snapshots__/ExportSpecifier1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ExportSpecifier1.test.ts.snap @@ -113,6 +113,12 @@ Object { "ParentId": "ClassDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 44, + "FileName": "./cases/ClassDeclaration2.ts", + "IsExternalPackage": false, + "Line": 3, + }, "Text": "void", "_ts": Object { "Kind": 105, @@ -148,6 +154,12 @@ Object { "ParentId": "ClassDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 21, + "FileName": "./cases/ClassDeclaration2.ts", + "IsExternalPackage": false, + "Line": 7, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -179,6 +191,12 @@ Object { "ParentId": "MethodDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 35, + "FileName": "./cases/ClassDeclaration2.ts", + "IsExternalPackage": false, + "Line": 3, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -211,6 +229,12 @@ Object { "ParentId": "ClassDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 22, + "FileName": "./cases/ClassDeclaration2.ts", + "IsExternalPackage": false, + "Line": 5, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -243,6 +267,12 @@ Object { "ParentId": "ClassDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 33, + "FileName": "./cases/ClassDeclaration2.ts", + "IsExternalPackage": false, + "Line": 11, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -275,6 +305,12 @@ Object { "ParentId": "ClassDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 23, + "FileName": "./cases/ClassDeclaration2.ts", + "IsExternalPackage": false, + "Line": 12, + }, "Text": "string", "_ts": Object { "Kind": 136, diff --git a/tests/cases/__tests__/__snapshots__/ExportSpecifier2.test.ts.snap b/tests/cases/__tests__/__snapshots__/ExportSpecifier2.test.ts.snap index af2d11b5..73157737 100644 --- a/tests/cases/__tests__/__snapshots__/ExportSpecifier2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ExportSpecifier2.test.ts.snap @@ -12,6 +12,12 @@ Object { "Implements": Array [ Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 33, + "FileName": "./cases/ClassDeclaration4.ts", + "IsExternalPackage": false, + "Line": 10, + }, "ReferenceId": "InterfaceDeclaration-0", "SymbolName": "Foo", "Text": "Foo", @@ -23,6 +29,12 @@ Object { }, Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 38, + "FileName": "./cases/ClassDeclaration4.ts", + "IsExternalPackage": false, + "Line": 10, + }, "ReferenceId": "InterfaceDeclaration-1", "SymbolName": "Foo2", "Text": "Foo2", @@ -189,6 +201,12 @@ Object { "ParentId": "ClassDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 16, + "FileName": "./cases/ClassDeclaration4.ts", + "IsExternalPackage": false, + "Line": 11, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -221,6 +239,12 @@ Object { "ParentId": "ClassDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 17, + "FileName": "./cases/ClassDeclaration4.ts", + "IsExternalPackage": false, + "Line": 12, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -250,6 +274,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 9, + "FileName": "./cases/ClassDeclaration4.ts", + "IsExternalPackage": false, + "Line": 3, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -279,6 +309,12 @@ Object { "ParentId": "InterfaceDeclaration-1", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 10, + "FileName": "./cases/ClassDeclaration4.ts", + "IsExternalPackage": false, + "Line": 7, + }, "Text": "string", "_ts": Object { "Kind": 136, diff --git a/tests/cases/__tests__/__snapshots__/ExportSpecifier3.test.ts.snap b/tests/cases/__tests__/__snapshots__/ExportSpecifier3.test.ts.snap index 0cf6792d..e599fc09 100644 --- a/tests/cases/__tests__/__snapshots__/ExportSpecifier3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ExportSpecifier3.test.ts.snap @@ -12,6 +12,12 @@ Object { "Implements": Array [ Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 33, + "FileName": "./cases/ClassDeclaration4.ts", + "IsExternalPackage": false, + "Line": 10, + }, "ReferenceId": "InterfaceDeclaration-0", "SymbolName": "Foo", "Text": "Foo", @@ -23,6 +29,12 @@ Object { }, Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 38, + "FileName": "./cases/ClassDeclaration4.ts", + "IsExternalPackage": false, + "Line": 10, + }, "ReferenceId": "InterfaceDeclaration-1", "SymbolName": "Foo2", "Text": "Foo2", @@ -189,6 +201,12 @@ Object { "ParentId": "ClassDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 16, + "FileName": "./cases/ClassDeclaration4.ts", + "IsExternalPackage": false, + "Line": 11, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -221,6 +239,12 @@ Object { "ParentId": "ClassDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 17, + "FileName": "./cases/ClassDeclaration4.ts", + "IsExternalPackage": false, + "Line": 12, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -250,6 +274,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 9, + "FileName": "./cases/ClassDeclaration4.ts", + "IsExternalPackage": false, + "Line": 3, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -279,6 +309,12 @@ Object { "ParentId": "InterfaceDeclaration-1", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 10, + "FileName": "./cases/ClassDeclaration4.ts", + "IsExternalPackage": false, + "Line": 7, + }, "Text": "string", "_ts": Object { "Kind": 136, diff --git a/tests/cases/__tests__/__snapshots__/ExportSpecifier4.test.ts.snap b/tests/cases/__tests__/__snapshots__/ExportSpecifier4.test.ts.snap index cb0124d5..c9c0a7cf 100644 --- a/tests/cases/__tests__/__snapshots__/ExportSpecifier4.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ExportSpecifier4.test.ts.snap @@ -133,6 +133,12 @@ Object { "ParentId": "ClassDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 44, + "FileName": "./cases/ClassDeclaration2.ts", + "IsExternalPackage": false, + "Line": 3, + }, "Text": "void", "_ts": Object { "Kind": 105, @@ -168,6 +174,12 @@ Object { "ParentId": "ClassDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 21, + "FileName": "./cases/ClassDeclaration2.ts", + "IsExternalPackage": false, + "Line": 7, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -199,6 +211,12 @@ Object { "ParentId": "MethodDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 35, + "FileName": "./cases/ClassDeclaration2.ts", + "IsExternalPackage": false, + "Line": 3, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -231,6 +249,12 @@ Object { "ParentId": "ClassDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 22, + "FileName": "./cases/ClassDeclaration2.ts", + "IsExternalPackage": false, + "Line": 5, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -263,6 +287,12 @@ Object { "ParentId": "ClassDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 33, + "FileName": "./cases/ClassDeclaration2.ts", + "IsExternalPackage": false, + "Line": 11, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -295,6 +325,12 @@ Object { "ParentId": "ClassDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 23, + "FileName": "./cases/ClassDeclaration2.ts", + "IsExternalPackage": false, + "Line": 12, + }, "Text": "string", "_ts": Object { "Kind": 136, diff --git a/tests/cases/__tests__/__snapshots__/FunctionDeclaration1.test.ts.snap b/tests/cases/__tests__/__snapshots__/FunctionDeclaration1.test.ts.snap index b0ecde1e..0ebc279e 100644 --- a/tests/cases/__tests__/__snapshots__/FunctionDeclaration1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/FunctionDeclaration1.test.ts.snap @@ -25,6 +25,12 @@ Object { "ParentId": "SourceFile-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 23, + "FileName": "./cases/FunctionDeclaration1.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Text": "string", "_ts": Object { "Kind": 136, diff --git a/tests/cases/__tests__/__snapshots__/FunctionDeclaration2.test.ts.snap b/tests/cases/__tests__/__snapshots__/FunctionDeclaration2.test.ts.snap index 049528db..65015ce7 100644 --- a/tests/cases/__tests__/__snapshots__/FunctionDeclaration2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/FunctionDeclaration2.test.ts.snap @@ -32,6 +32,12 @@ Object { "ParentId": "SourceFile-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 44, + "FileName": "./cases/FunctionDeclaration2.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Text": "void", "_ts": Object { "Kind": 105, @@ -70,6 +76,12 @@ Object { "ParentId": "FunctionDeclaration-0", "Type": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 35, + "FileName": "./cases/FunctionDeclaration2.ts", + "IsExternalPackage": false, + "Line": 0, + }, "ReferenceId": "TypeParameter-0", "SymbolName": "TValue", "Text": "TValue", diff --git a/tests/cases/__tests__/__snapshots__/FunctionDeclaration3.test.ts.snap b/tests/cases/__tests__/__snapshots__/FunctionDeclaration3.test.ts.snap index 9768f646..81527dc8 100644 --- a/tests/cases/__tests__/__snapshots__/FunctionDeclaration3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/FunctionDeclaration3.test.ts.snap @@ -25,12 +25,24 @@ Object { "ParentId": "SourceFile-0", "ReturnType": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 34, + "FileName": "./cases/FunctionDeclaration3.ts", + "IsExternalPackage": false, + "Line": 0, + }, "ReferenceId": undefined, "SymbolName": "Promise", "Text": "Promise", "TypeParameters": Array [ Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 42, + "FileName": "./cases/FunctionDeclaration3.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Text": "void", "_ts": Object { "Kind": 105, diff --git a/tests/cases/__tests__/__snapshots__/FunctionDeclaration4.test.ts.snap b/tests/cases/__tests__/__snapshots__/FunctionDeclaration4.test.ts.snap index a52e55c6..d42d50f7 100644 --- a/tests/cases/__tests__/__snapshots__/FunctionDeclaration4.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/FunctionDeclaration4.test.ts.snap @@ -32,9 +32,21 @@ Object { "ParentId": "SourceFile-0", "ReturnType": Object { "ApiTypeKind": "array", + "Location": Object { + "Character": 0, + "FileName": "./cases/FunctionDeclaration4.ts", + "IsExternalPackage": false, + "Line": 2, + }, "Text": "string[]", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 0, + "FileName": "./cases/FunctionDeclaration4.ts", + "IsExternalPackage": false, + "Line": 2, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -71,9 +83,21 @@ Object { "ParentId": "FunctionDeclaration-0", "Type": Object { "ApiTypeKind": "array", + "Location": Object { + "Character": 25, + "FileName": "./cases/FunctionDeclaration4.ts", + "IsExternalPackage": false, + "Line": 2, + }, "Text": "string[]", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 25, + "FileName": "./cases/FunctionDeclaration4.ts", + "IsExternalPackage": false, + "Line": 2, + }, "Text": "string", "_ts": Object { "Kind": 136, diff --git a/tests/cases/__tests__/__snapshots__/FunctionDeclaration5.test.ts.snap b/tests/cases/__tests__/__snapshots__/FunctionDeclaration5.test.ts.snap index ffa1efd0..e9390361 100644 --- a/tests/cases/__tests__/__snapshots__/FunctionDeclaration5.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/FunctionDeclaration5.test.ts.snap @@ -32,10 +32,22 @@ Object { "ParentId": "SourceFile-0", "ReturnType": Object { "ApiTypeKind": "type-predicate", + "Location": Object { + "Character": 48, + "FileName": "./cases/FunctionDeclaration5.ts", + "IsExternalPackage": false, + "Line": 0, + }, "ParameterName": "arg", "Text": "arg is string", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 55, + "FileName": "./cases/FunctionDeclaration5.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -72,9 +84,21 @@ Object { "ParentId": "FunctionDeclaration-0", "Type": Object { "ApiTypeKind": "union", + "Location": Object { + "Character": 30, + "FileName": "./cases/FunctionDeclaration5.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Members": Array [ Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 30, + "FileName": "./cases/FunctionDeclaration5.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -83,6 +107,12 @@ Object { }, Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 39, + "FileName": "./cases/FunctionDeclaration5.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Text": "number", "_ts": Object { "Kind": 133, diff --git a/tests/cases/__tests__/__snapshots__/FunctionDeclaration6.test.ts.snap b/tests/cases/__tests__/__snapshots__/FunctionDeclaration6.test.ts.snap index 5e5889e0..1a9e0f7e 100644 --- a/tests/cases/__tests__/__snapshots__/FunctionDeclaration6.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/FunctionDeclaration6.test.ts.snap @@ -32,6 +32,12 @@ Object { "ParentId": "SourceFile-0", "ReturnType": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 0, + "FileName": "./cases/FunctionDeclaration6.ts", + "IsExternalPackage": false, + "Line": 4, + }, "ReferenceId": "InterfaceDeclaration-0", "SymbolName": "Foo", "Text": "Foo", @@ -88,6 +94,12 @@ Object { "ParentId": "FunctionDeclaration-0", "Type": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 25, + "FileName": "./cases/FunctionDeclaration6.ts", + "IsExternalPackage": false, + "Line": 4, + }, "ReferenceId": "InterfaceDeclaration-0", "SymbolName": "Foo", "Text": "Foo", diff --git a/tests/cases/__tests__/__snapshots__/FunctionDeclaration7.test.ts.snap b/tests/cases/__tests__/__snapshots__/FunctionDeclaration7.test.ts.snap index be913927..b969ceae 100644 --- a/tests/cases/__tests__/__snapshots__/FunctionDeclaration7.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/FunctionDeclaration7.test.ts.snap @@ -32,9 +32,21 @@ Object { "ParentId": "SourceFile-0", "ReturnType": Object { "ApiTypeKind": "union", + "Location": Object { + "Character": 0, + "FileName": "./cases/FunctionDeclaration7.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Members": Array [ Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 0, + "FileName": "./cases/FunctionDeclaration7.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -43,6 +55,12 @@ Object { }, Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 0, + "FileName": "./cases/FunctionDeclaration7.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Text": "true", "_ts": Object { "Kind": 101, @@ -51,6 +69,12 @@ Object { }, Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 0, + "FileName": "./cases/FunctionDeclaration7.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Text": "false", "_ts": Object { "Kind": 86, @@ -89,9 +113,21 @@ Object { "ParentId": "FunctionDeclaration-0", "Type": Object { "ApiTypeKind": "union", + "Location": Object { + "Character": 25, + "FileName": "./cases/FunctionDeclaration7.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Members": Array [ Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 25, + "FileName": "./cases/FunctionDeclaration7.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -100,6 +136,12 @@ Object { }, Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 34, + "FileName": "./cases/FunctionDeclaration7.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Text": "boolean", "_ts": Object { "Kind": 122, diff --git a/tests/cases/__tests__/__snapshots__/FunctionDeclaration8.test.ts.snap b/tests/cases/__tests__/__snapshots__/FunctionDeclaration8.test.ts.snap index 43c87968..6c8cce99 100644 --- a/tests/cases/__tests__/__snapshots__/FunctionDeclaration8.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/FunctionDeclaration8.test.ts.snap @@ -32,9 +32,21 @@ Object { "ParentId": "SourceFile-0", "ReturnType": Object { "ApiTypeKind": "tuple", + "Location": Object { + "Character": 0, + "FileName": "./cases/FunctionDeclaration8.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Members": Array [ Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 0, + "FileName": "./cases/FunctionDeclaration8.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -43,6 +55,12 @@ Object { }, Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 0, + "FileName": "./cases/FunctionDeclaration8.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -81,9 +99,21 @@ Object { "ParentId": "FunctionDeclaration-0", "Type": Object { "ApiTypeKind": "tuple", + "Location": Object { + "Character": 25, + "FileName": "./cases/FunctionDeclaration8.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Members": Array [ Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 26, + "FileName": "./cases/FunctionDeclaration8.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -92,6 +122,12 @@ Object { }, Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 34, + "FileName": "./cases/FunctionDeclaration8.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Text": "number", "_ts": Object { "Kind": 133, diff --git a/tests/cases/__tests__/__snapshots__/GetAccessor1.test.ts.snap b/tests/cases/__tests__/__snapshots__/GetAccessor1.test.ts.snap index e4b50b21..97923295 100644 --- a/tests/cases/__tests__/__snapshots__/GetAccessor1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/GetAccessor1.test.ts.snap @@ -56,6 +56,12 @@ Object { "ParentId": "ClassDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 22, + "FileName": "./cases/GetAccessor1.ts", + "IsExternalPackage": false, + "Line": 1, + }, "Text": "string", "_ts": Object { "Kind": 136, diff --git a/tests/cases/__tests__/__snapshots__/GetAccessor3.test.ts.snap b/tests/cases/__tests__/__snapshots__/GetAccessor3.test.ts.snap index 89451ee8..7037f750 100644 --- a/tests/cases/__tests__/__snapshots__/GetAccessor3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/GetAccessor3.test.ts.snap @@ -74,6 +74,12 @@ Object { "ParentId": "ClassDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 31, + "FileName": "./cases/GetAccessor3.ts", + "IsExternalPackage": false, + "Line": 1, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -104,6 +110,12 @@ Object { "ParentId": "ClassDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 35, + "FileName": "./cases/GetAccessor3.ts", + "IsExternalPackage": false, + "Line": 3, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -134,6 +146,12 @@ Object { "ParentId": "ClassDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 23, + "FileName": "./cases/GetAccessor3.ts", + "IsExternalPackage": false, + "Line": 7, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -164,6 +182,12 @@ Object { "ParentId": "ClassDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 34, + "FileName": "./cases/GetAccessor3.ts", + "IsExternalPackage": false, + "Line": 11, + }, "Text": "string", "_ts": Object { "Kind": 136, diff --git a/tests/cases/__tests__/__snapshots__/ImportDeclaration1.test.ts.snap b/tests/cases/__tests__/__snapshots__/ImportDeclaration1.test.ts.snap index b61207f0..fa9a1006 100644 --- a/tests/cases/__tests__/__snapshots__/ImportDeclaration1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ImportDeclaration1.test.ts.snap @@ -120,6 +120,12 @@ Object { "ParentId": "ClassDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 37, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 11, + }, "Text": "void", "_ts": Object { "Kind": 105, @@ -164,6 +170,12 @@ GetFoo without A parameter comment line.", "ParentId": "ClassDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 33, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 17, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -208,6 +220,12 @@ GetFoo without A parameter comment line.", "ParentId": "ClassDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 34, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 22, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -252,6 +270,12 @@ GetFoo without A parameter comment line.", "ParentId": "ClassDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 42, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 26, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -287,12 +311,24 @@ GetFoo without A parameter comment line.", "ParentId": "ClassDeclaration-0", "ReturnType": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 33, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 30, + }, "ReferenceId": undefined, "SymbolName": "Promise", "Text": "Promise", "TypeParameters": Array [ Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 41, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 30, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -357,6 +393,12 @@ GetFoo without A parameter comment line.", "ParentId": "MethodDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 28, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 11, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -387,6 +429,12 @@ GetFoo without A parameter comment line.", "ParentId": "MethodDeclaration-1", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 24, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 17, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -417,6 +465,12 @@ GetFoo without A parameter comment line.", "ParentId": "MethodDeclaration-2", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 24, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 22, + }, "Text": "boolean", "_ts": Object { "Kind": 122, @@ -447,9 +501,21 @@ GetFoo without A parameter comment line.", "ParentId": "MethodDeclaration-3", "Type": Object { "ApiTypeKind": "union", + "Location": Object { + "Character": 23, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 26, + }, "Members": Array [ Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 23, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 26, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -458,6 +524,12 @@ GetFoo without A parameter comment line.", }, Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 32, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 26, + }, "Text": "boolean", "_ts": Object { "Kind": 122, @@ -502,6 +574,12 @@ GetFoo without A parameter comment line.", "ParentId": "ClassDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 32, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 36, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -534,6 +612,12 @@ GetFoo without A parameter comment line.", "ParentId": "ClassDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 31, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 37, + }, "Text": "string", "_ts": Object { "Kind": 136, diff --git a/tests/cases/__tests__/__snapshots__/ImportSpecifier1.test.ts.snap b/tests/cases/__tests__/__snapshots__/ImportSpecifier1.test.ts.snap index 53ab3621..eec3f2f5 100644 --- a/tests/cases/__tests__/__snapshots__/ImportSpecifier1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ImportSpecifier1.test.ts.snap @@ -152,6 +152,12 @@ Object { "ParentId": "ClassDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 37, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 11, + }, "Text": "void", "_ts": Object { "Kind": 105, @@ -196,6 +202,12 @@ GetFoo without A parameter comment line.", "ParentId": "ClassDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 33, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 17, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -240,6 +252,12 @@ GetFoo without A parameter comment line.", "ParentId": "ClassDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 34, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 22, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -284,6 +302,12 @@ GetFoo without A parameter comment line.", "ParentId": "ClassDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 42, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 26, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -319,12 +343,24 @@ GetFoo without A parameter comment line.", "ParentId": "ClassDeclaration-0", "ReturnType": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 33, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 30, + }, "ReferenceId": undefined, "SymbolName": "Promise", "Text": "Promise", "TypeParameters": Array [ Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 41, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 30, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -362,6 +398,12 @@ GetFoo without A parameter comment line.", "ParentId": "MethodDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 28, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 11, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -392,6 +434,12 @@ GetFoo without A parameter comment line.", "ParentId": "MethodDeclaration-1", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 24, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 17, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -422,6 +470,12 @@ GetFoo without A parameter comment line.", "ParentId": "MethodDeclaration-2", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 24, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 22, + }, "Text": "boolean", "_ts": Object { "Kind": 122, @@ -452,9 +506,21 @@ GetFoo without A parameter comment line.", "ParentId": "MethodDeclaration-3", "Type": Object { "ApiTypeKind": "union", + "Location": Object { + "Character": 23, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 26, + }, "Members": Array [ Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 23, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 26, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -463,6 +529,12 @@ GetFoo without A parameter comment line.", }, Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 32, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 26, + }, "Text": "boolean", "_ts": Object { "Kind": 122, @@ -507,6 +579,12 @@ GetFoo without A parameter comment line.", "ParentId": "ClassDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 32, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 36, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -539,6 +617,12 @@ GetFoo without A parameter comment line.", "ParentId": "ClassDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 31, + "FileName": "./cases/ClassDeclaration1.ts", + "IsExternalPackage": false, + "Line": 37, + }, "Text": "string", "_ts": Object { "Kind": 136, diff --git a/tests/cases/__tests__/__snapshots__/IndexSignature1.test.ts.snap b/tests/cases/__tests__/__snapshots__/IndexSignature1.test.ts.snap index cd6f7f99..e9361f95 100644 --- a/tests/cases/__tests__/__snapshots__/IndexSignature1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/IndexSignature1.test.ts.snap @@ -24,6 +24,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 19, + "FileName": "./cases/IndexSignature1.ts", + "IsExternalPackage": false, + "Line": 1, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -83,6 +89,12 @@ Object { "ParentId": "IndexSignature-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 10, + "FileName": "./cases/IndexSignature1.ts", + "IsExternalPackage": false, + "Line": 1, + }, "Text": "string", "_ts": Object { "Kind": 136, diff --git a/tests/cases/__tests__/__snapshots__/IndexSignature2.test.ts.snap b/tests/cases/__tests__/__snapshots__/IndexSignature2.test.ts.snap index 1957bd81..7197d5e1 100644 --- a/tests/cases/__tests__/__snapshots__/IndexSignature2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/IndexSignature2.test.ts.snap @@ -24,6 +24,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 28, + "FileName": "./cases/IndexSignature2.ts", + "IsExternalPackage": false, + "Line": 1, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -83,6 +89,12 @@ Object { "ParentId": "IndexSignature-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 19, + "FileName": "./cases/IndexSignature2.ts", + "IsExternalPackage": false, + "Line": 1, + }, "Text": "string", "_ts": Object { "Kind": 136, diff --git a/tests/cases/__tests__/__snapshots__/IndexSignature3.test.ts.snap b/tests/cases/__tests__/__snapshots__/IndexSignature3.test.ts.snap index 38015e55..7c125874 100644 --- a/tests/cases/__tests__/__snapshots__/IndexSignature3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/IndexSignature3.test.ts.snap @@ -24,6 +24,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 33, + "FileName": "./cases/IndexSignature3.ts", + "IsExternalPackage": false, + "Line": 2, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -53,6 +59,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 4, + "FileName": "./cases/IndexSignature3.ts", + "IsExternalPackage": false, + "Line": 5, + }, "Text": "any", "_ts": Object { "Kind": 119, @@ -113,6 +125,12 @@ Object { "ParentId": "IndexSignature-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 10, + "FileName": "./cases/IndexSignature3.ts", + "IsExternalPackage": false, + "Line": 2, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -143,6 +161,12 @@ Object { "ParentId": "IndexSignature-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 24, + "FileName": "./cases/IndexSignature3.ts", + "IsExternalPackage": false, + "Line": 2, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -173,6 +197,12 @@ Object { "ParentId": "IndexSignature-1", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 8, + "FileName": "./cases/IndexSignature3.ts", + "IsExternalPackage": false, + "Line": 5, + }, "Text": "number", "_ts": Object { "Kind": 133, diff --git a/tests/cases/__tests__/__snapshots__/InterfaceClassMerging.test.ts.snap b/tests/cases/__tests__/__snapshots__/InterfaceClassMerging.test.ts.snap index 2e4fb56f..6318b229 100644 --- a/tests/cases/__tests__/__snapshots__/InterfaceClassMerging.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/InterfaceClassMerging.test.ts.snap @@ -47,6 +47,12 @@ Object { "ApiKind": "class", "Extends": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 25, + "FileName": "./cases/InterfaceClassMerging.ts", + "IsExternalPackage": false, + "Line": 15, + }, "ReferenceId": "InterfaceDeclaration-0", "SymbolName": "Foo", "Text": "Foo", @@ -161,6 +167,12 @@ Object { "ParentId": "ClassDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 40, + "FileName": "./cases/InterfaceClassMerging.ts", + "IsExternalPackage": false, + "Line": 10, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -203,6 +215,12 @@ Object { "ParentId": "ClassDeclaration-1", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 30, + "FileName": "./cases/InterfaceClassMerging.ts", + "IsExternalPackage": false, + "Line": 16, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -241,6 +259,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 23, + "FileName": "./cases/InterfaceClassMerging.ts", + "IsExternalPackage": false, + "Line": 1, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -279,6 +303,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 32, + "FileName": "./cases/InterfaceClassMerging.ts", + "IsExternalPackage": false, + "Line": 2, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -310,6 +340,12 @@ Object { "ParentId": "MethodSignature-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 14, + "FileName": "./cases/InterfaceClassMerging.ts", + "IsExternalPackage": false, + "Line": 1, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -340,6 +376,12 @@ Object { "ParentId": "MethodSignature-1", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 23, + "FileName": "./cases/InterfaceClassMerging.ts", + "IsExternalPackage": false, + "Line": 2, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -370,6 +412,12 @@ Object { "ParentId": "MethodDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 31, + "FileName": "./cases/InterfaceClassMerging.ts", + "IsExternalPackage": false, + "Line": 10, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -400,6 +448,12 @@ Object { "ParentId": "MethodDeclaration-1", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 21, + "FileName": "./cases/InterfaceClassMerging.ts", + "IsExternalPackage": false, + "Line": 16, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -432,6 +486,12 @@ Object { "ParentId": "ClassDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 31, + "FileName": "./cases/InterfaceClassMerging.ts", + "IsExternalPackage": false, + "Line": 8, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -461,6 +521,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 14, + "FileName": "./cases/InterfaceClassMerging.ts", + "IsExternalPackage": false, + "Line": 3, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -490,6 +556,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 23, + "FileName": "./cases/InterfaceClassMerging.ts", + "IsExternalPackage": false, + "Line": 4, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -569,6 +641,12 @@ Object { "ParentId": undefined, "Type": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 11, + "FileName": "./cases/InterfaceClassMerging.ts", + "IsExternalPackage": false, + "Line": 21, + }, "ReferenceId": "ClassDeclaration-1", "SymbolName": "Bar", "Text": "Bar", @@ -600,6 +678,12 @@ Object { "ParentId": undefined, "Type": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 11, + "FileName": "./cases/InterfaceClassMerging.ts", + "IsExternalPackage": false, + "Line": 22, + }, "ReferenceId": "InterfaceDeclaration-0", "SymbolName": "Foo", "Text": "Foo", @@ -631,6 +715,12 @@ Object { "ParentId": undefined, "Type": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 17, + "FileName": "./cases/InterfaceClassMerging.ts", + "IsExternalPackage": false, + "Line": 23, + }, "ReferenceId": "InterfaceDeclaration-0", "SymbolName": "Foo", "Text": "Foo", diff --git a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration2.test.ts.snap b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration2.test.ts.snap index 04d9300e..61269cf6 100644 --- a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration2.test.ts.snap @@ -53,6 +53,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 7, + "FileName": "./cases/InterfaceDeclaration2.ts", + "IsExternalPackage": false, + "Line": 1, + }, "Text": "string", "_ts": Object { "Kind": 136, diff --git a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration3.test.ts.snap b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration3.test.ts.snap index 1461a2af..b12db7a8 100644 --- a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration3.test.ts.snap @@ -60,6 +60,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "Type": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 7, + "FileName": "./cases/InterfaceDeclaration3.ts", + "IsExternalPackage": false, + "Line": 1, + }, "ReferenceId": "TypeParameter-0", "SymbolName": "T", "Text": "T", @@ -144,12 +150,24 @@ Object { "ParentId": undefined, "Type": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 16, + "FileName": "./cases/InterfaceDeclaration3.ts", + "IsExternalPackage": false, + "Line": 4, + }, "ReferenceId": "InterfaceDeclaration-0", "SymbolName": "Generic", "Text": "Generic", "TypeParameters": Array [ Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 24, + "FileName": "./cases/InterfaceDeclaration3.ts", + "IsExternalPackage": false, + "Line": 4, + }, "Text": "number", "_ts": Object { "Kind": 133, diff --git a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration4.test.ts.snap b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration4.test.ts.snap index 25d7b00a..84d17c93 100644 --- a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration4.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration4.test.ts.snap @@ -24,6 +24,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 8, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 1, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -73,6 +79,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 24, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 2, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -91,6 +103,12 @@ Object { "Implements": Array [ Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 27, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 42, + }, "ReferenceId": "InterfaceDeclaration-3", "SymbolName": "a", "Text": "a", @@ -139,6 +157,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 11, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 4, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -176,6 +200,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 4, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 5, + }, "Text": "any", "_ts": Object { "Kind": 119, @@ -206,6 +236,12 @@ Object { "ParentId": "IndexSignature-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 23, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 7, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -236,6 +272,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "Type": Object { "ApiTypeKind": "function-type", + "Location": Object { + "Character": 17, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 7, + }, "ReferenceId": "FunctionType-0", "Text": "() => string", "_ts": Object { @@ -266,6 +308,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 17, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 8, + }, "Text": "any", "_ts": Object { "Kind": 119, @@ -295,6 +343,12 @@ Object { "ParentId": "InterfaceDeclaration-1", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 17, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 23, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -324,6 +378,12 @@ Object { "ParentId": "InterfaceDeclaration-2", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 17, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 27, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -518,6 +578,12 @@ Object { "Extends": Array [ Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 27, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 33, + }, "ReferenceId": "InterfaceDeclaration-3", "SymbolName": "a", "Text": "a", @@ -552,6 +618,12 @@ Object { "Extends": Array [ Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 27, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 36, + }, "ReferenceId": "InterfaceDeclaration-3", "SymbolName": "a", "Text": "a", @@ -563,6 +635,12 @@ Object { }, Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 30, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 36, + }, "ReferenceId": "InterfaceDeclaration-4", "SymbolName": "b", "Text": "b", @@ -597,6 +675,12 @@ Object { "Extends": Array [ Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 27, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 39, + }, "ReferenceId": "InterfaceDeclaration-3", "SymbolName": "a", "Text": "a", @@ -652,6 +736,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 19, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 14, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -683,6 +773,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 4, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 16, + }, "Text": "any", "_ts": Object { "Kind": 119, @@ -714,6 +810,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 4, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 17, + }, "Text": "any", "_ts": Object { "Kind": 119, @@ -752,6 +854,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 19, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 18, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -790,6 +898,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 20, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 19, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -821,6 +935,12 @@ Object { "ParentId": "CallSignature-1", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 5, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 2, + }, "Text": "any", "_ts": Object { "Kind": 119, @@ -851,6 +971,12 @@ Object { "ParentId": "CallSignature-1", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 8, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 2, + }, "Text": "any", "_ts": Object { "Kind": 119, @@ -881,6 +1007,12 @@ Object { "ParentId": "IndexSignature-3", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 8, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 27, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -911,6 +1043,12 @@ Object { "ParentId": "CallSignature-1", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 15, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 2, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -941,6 +1079,12 @@ Object { "ParentId": "ConstructSignature-1", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 11, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 5, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -971,6 +1115,12 @@ Object { "ParentId": "IndexSignature-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 8, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 7, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -1001,6 +1151,12 @@ Object { "ParentId": "IndexSignature-1", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 8, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 8, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -1031,6 +1187,12 @@ Object { "ParentId": "MethodSignature-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 10, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 14, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -1061,6 +1223,12 @@ Object { "ParentId": "MethodSignature-3", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 10, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 18, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -1091,6 +1259,12 @@ Object { "ParentId": "MethodSignature-4", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 11, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 19, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -1121,6 +1295,12 @@ Object { "ParentId": "IndexSignature-2", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 8, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 23, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -1150,6 +1330,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 4, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 10, + }, "Text": "any", "_ts": Object { "Kind": 119, @@ -1179,6 +1365,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 4, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 11, + }, "Text": "any", "_ts": Object { "Kind": 119, @@ -1208,6 +1400,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 8, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 12, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -1237,6 +1435,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 9, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 13, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -1339,6 +1543,12 @@ Object { "ParentId": undefined, "Type": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 11, + "FileName": "./cases/InterfaceDeclaration4.ts", + "IsExternalPackage": false, + "Line": 45, + }, "ReferenceId": "ClassDeclaration-0", "SymbolName": "c1", "Text": "c1", diff --git a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration5.test.ts.snap b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration5.test.ts.snap index 623a43c7..648e6184 100644 --- a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration5.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration5.test.ts.snap @@ -31,6 +31,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "ReturnType": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 29, + "FileName": "./cases/InterfaceDeclaration5.ts", + "IsExternalPackage": false, + "Line": 1, + }, "ReferenceId": "TypeParameter-0", "SymbolName": "TValue", "Text": "TValue", @@ -101,6 +107,12 @@ Object { "ParentId": "CallSignature-0", "Type": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 20, + "FileName": "./cases/InterfaceDeclaration5.ts", + "IsExternalPackage": false, + "Line": 1, + }, "ReferenceId": "TypeParameter-0", "SymbolName": "TValue", "Text": "TValue", diff --git a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration6.test.ts.snap b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration6.test.ts.snap index 8da26ab1..3b3a41de 100644 --- a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration6.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration6.test.ts.snap @@ -68,6 +68,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 31, + "FileName": "./cases/InterfaceDeclaration6.ts", + "IsExternalPackage": false, + "Line": 3, + }, "Text": "void", "_ts": Object { "Kind": 105, @@ -106,6 +112,12 @@ Object { "ParentId": "MethodSignature-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 22, + "FileName": "./cases/InterfaceDeclaration6.ts", + "IsExternalPackage": false, + "Line": 3, + }, "Text": "string", "_ts": Object { "Kind": 136, diff --git a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration7.test.ts.snap b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration7.test.ts.snap index 7f33bc58..e171155f 100644 --- a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration7.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration7.test.ts.snap @@ -53,6 +53,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 18, + "FileName": "./cases/InterfaceDeclaration7.ts", + "IsExternalPackage": false, + "Line": 1, + }, "Text": "string", "_ts": Object { "Kind": 136, diff --git a/tests/cases/__tests__/__snapshots__/InterfaceSubtyping.test.ts.snap b/tests/cases/__tests__/__snapshots__/InterfaceSubtyping.test.ts.snap index 64fdb036..441a81f5 100644 --- a/tests/cases/__tests__/__snapshots__/InterfaceSubtyping.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/InterfaceSubtyping.test.ts.snap @@ -12,6 +12,12 @@ Object { "Implements": Array [ Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 31, + "FileName": "./cases/InterfaceSubtyping.ts", + "IsExternalPackage": false, + "Line": 4, + }, "ReferenceId": "InterfaceDeclaration-0", "SymbolName": "Face", "Text": "Face", @@ -137,6 +143,12 @@ Object { "ParentId": "ClassDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 18, + "FileName": "./cases/InterfaceSubtyping.ts", + "IsExternalPackage": false, + "Line": 7, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -168,6 +180,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 11, + "FileName": "./cases/InterfaceSubtyping.ts", + "IsExternalPackage": false, + "Line": 1, + }, "Text": "void", "_ts": Object { "Kind": 105, @@ -199,6 +217,12 @@ Object { "ParentId": "Constructor-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 28, + "FileName": "./cases/InterfaceSubtyping.ts", + "IsExternalPackage": false, + "Line": 5, + }, "Text": "string", "_ts": Object { "Kind": 136, diff --git a/tests/cases/__tests__/__snapshots__/MappedDeclaration1.test.ts.snap b/tests/cases/__tests__/__snapshots__/MappedDeclaration1.test.ts.snap index 353e70e6..78001e76 100644 --- a/tests/cases/__tests__/__snapshots__/MappedDeclaration1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/MappedDeclaration1.test.ts.snap @@ -24,6 +24,12 @@ Object { "ParentId": "TypeAliasDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 38, + "FileName": "./cases/MappedDeclaration1.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -79,6 +85,12 @@ Object { "ParentId": "SourceFile-0", "Type": Object { "ApiTypeKind": "mapped", + "Location": Object { + "Character": 21, + "FileName": "./cases/MappedDeclaration1.ts", + "IsExternalPackage": false, + "Line": 0, + }, "ReferenceId": "MappedType-0", "Text": "mapped", "_ts": Object { @@ -96,6 +108,12 @@ Object { "ApiKind": "type-parameter", "ConstraintType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 28, + "FileName": "./cases/MappedDeclaration1.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Text": "\\"a-b-c\\"", "_ts": Object { "Kind": 173, diff --git a/tests/cases/__tests__/__snapshots__/MappedDeclaration2.test.ts.snap b/tests/cases/__tests__/__snapshots__/MappedDeclaration2.test.ts.snap index 3a5633fa..36474406 100644 --- a/tests/cases/__tests__/__snapshots__/MappedDeclaration2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/MappedDeclaration2.test.ts.snap @@ -59,6 +59,12 @@ Object { "ParentId": "TypeAliasDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 40, + "FileName": "./cases/MappedDeclaration2.ts", + "IsExternalPackage": false, + "Line": 5, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -89,6 +95,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 10, + "FileName": "./cases/MappedDeclaration2.ts", + "IsExternalPackage": false, + "Line": 1, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -118,6 +130,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 9, + "FileName": "./cases/MappedDeclaration2.ts", + "IsExternalPackage": false, + "Line": 2, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -178,6 +196,12 @@ Object { "ParentId": "SourceFile-0", "Type": Object { "ApiTypeKind": "mapped", + "Location": Object { + "Character": 21, + "FileName": "./cases/MappedDeclaration2.ts", + "IsExternalPackage": false, + "Line": 5, + }, "ReferenceId": "MappedType-0", "Text": "mapped", "_ts": Object { @@ -196,9 +220,21 @@ Object { "ConstraintType": Object { "ApiTypeKind": "type-operator", "Keyword": "keyof", + "Location": Object { + "Character": 28, + "FileName": "./cases/MappedDeclaration2.ts", + "IsExternalPackage": false, + "Line": 5, + }, "Text": "keyof Foo", "Type": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 34, + "FileName": "./cases/MappedDeclaration2.ts", + "IsExternalPackage": false, + "Line": 5, + }, "ReferenceId": "InterfaceDeclaration-0", "SymbolName": "Foo", "Text": "Foo", diff --git a/tests/cases/__tests__/__snapshots__/MappedDeclaration3.test.ts.snap b/tests/cases/__tests__/__snapshots__/MappedDeclaration3.test.ts.snap index 5045094e..951952d5 100644 --- a/tests/cases/__tests__/__snapshots__/MappedDeclaration3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/MappedDeclaration3.test.ts.snap @@ -59,6 +59,12 @@ Object { "ParentId": "TypeAliasDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 31, + "FileName": "./cases/MappedDeclaration3.ts", + "IsExternalPackage": false, + "Line": 6, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -89,6 +95,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 10, + "FileName": "./cases/MappedDeclaration3.ts", + "IsExternalPackage": false, + "Line": 1, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -118,6 +130,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 9, + "FileName": "./cases/MappedDeclaration3.ts", + "IsExternalPackage": false, + "Line": 2, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -178,6 +196,12 @@ Object { "ParentId": "SourceFile-0", "Type": Object { "ApiTypeKind": "mapped", + "Location": Object { + "Character": 21, + "FileName": "./cases/MappedDeclaration3.ts", + "IsExternalPackage": false, + "Line": 5, + }, "ReferenceId": "MappedType-0", "Text": "mapped", "_ts": Object { @@ -196,9 +220,21 @@ Object { "ConstraintType": Object { "ApiTypeKind": "type-operator", "Keyword": "keyof", + "Location": Object { + "Character": 19, + "FileName": "./cases/MappedDeclaration3.ts", + "IsExternalPackage": false, + "Line": 6, + }, "Text": "keyof Foo", "Type": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 25, + "FileName": "./cases/MappedDeclaration3.ts", + "IsExternalPackage": false, + "Line": 6, + }, "ReferenceId": "InterfaceDeclaration-0", "SymbolName": "Foo", "Text": "Foo", diff --git a/tests/cases/__tests__/__snapshots__/MappedDeclaration4.test.ts.snap b/tests/cases/__tests__/__snapshots__/MappedDeclaration4.test.ts.snap index e4531b10..6573c4d2 100644 --- a/tests/cases/__tests__/__snapshots__/MappedDeclaration4.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/MappedDeclaration4.test.ts.snap @@ -59,6 +59,12 @@ Object { "ParentId": "TypeAliasDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 23, + "FileName": "./cases/MappedDeclaration4.ts", + "IsExternalPackage": false, + "Line": 6, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -89,6 +95,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 10, + "FileName": "./cases/MappedDeclaration4.ts", + "IsExternalPackage": false, + "Line": 1, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -118,6 +130,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 9, + "FileName": "./cases/MappedDeclaration4.ts", + "IsExternalPackage": false, + "Line": 2, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -178,6 +196,12 @@ Object { "ParentId": "SourceFile-0", "Type": Object { "ApiTypeKind": "mapped", + "Location": Object { + "Character": 21, + "FileName": "./cases/MappedDeclaration4.ts", + "IsExternalPackage": false, + "Line": 5, + }, "ReferenceId": "MappedType-0", "Text": "mapped", "_ts": Object { @@ -196,9 +220,21 @@ Object { "ConstraintType": Object { "ApiTypeKind": "type-operator", "Keyword": "keyof", + "Location": Object { + "Character": 10, + "FileName": "./cases/MappedDeclaration4.ts", + "IsExternalPackage": false, + "Line": 6, + }, "Text": "keyof Foo", "Type": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 16, + "FileName": "./cases/MappedDeclaration4.ts", + "IsExternalPackage": false, + "Line": 6, + }, "ReferenceId": "InterfaceDeclaration-0", "SymbolName": "Foo", "Text": "Foo", diff --git a/tests/cases/__tests__/__snapshots__/MultipleDeclaration.test.ts.snap b/tests/cases/__tests__/__snapshots__/MultipleDeclaration.test.ts.snap index bf59eaf5..90ffe3e6 100644 --- a/tests/cases/__tests__/__snapshots__/MultipleDeclaration.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/MultipleDeclaration.test.ts.snap @@ -195,6 +195,12 @@ Object { "ParentId": "ClassDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 14, + "FileName": "./cases/MultipleDeclaration.ts", + "IsExternalPackage": false, + "Line": 12, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -227,6 +233,12 @@ Object { "ParentId": "ClassDeclaration-1", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 14, + "FileName": "./cases/MultipleDeclaration.ts", + "IsExternalPackage": false, + "Line": 16, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -256,6 +268,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 7, + "FileName": "./cases/MultipleDeclaration.ts", + "IsExternalPackage": false, + "Line": 8, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -285,6 +303,12 @@ Object { "ParentId": "InterfaceDeclaration-1", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 7, + "FileName": "./cases/MultipleDeclaration.ts", + "IsExternalPackage": false, + "Line": 20, + }, "Text": "string", "_ts": Object { "Kind": 136, diff --git a/tests/cases/__tests__/__snapshots__/NamespaceDeclaration3.test.ts.snap b/tests/cases/__tests__/__snapshots__/NamespaceDeclaration3.test.ts.snap index 0bc36f09..573537a6 100644 --- a/tests/cases/__tests__/__snapshots__/NamespaceDeclaration3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/NamespaceDeclaration3.test.ts.snap @@ -103,6 +103,12 @@ Object { "ParentId": undefined, "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 21, + "FileName": "./cases/NamespaceDeclaration3.ts", + "IsExternalPackage": false, + "Line": 2, + }, "Text": "\\"world!\\"", "_ts": Object { "Kind": 173, diff --git a/tests/cases/__tests__/__snapshots__/ObjectLiteral1.test.ts.snap b/tests/cases/__tests__/__snapshots__/ObjectLiteral1.test.ts.snap index d106c8ca..8820a9ab 100644 --- a/tests/cases/__tests__/__snapshots__/ObjectLiteral1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ObjectLiteral1.test.ts.snap @@ -51,6 +51,12 @@ Object { "ParentId": "ObjectLiteralExpression-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 36, + "FileName": "./cases/ObjectLiteral1.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -105,6 +111,12 @@ Object { "ParentId": undefined, "Type": Object { "ApiTypeKind": "type-literal", + "Location": Object { + "Character": 13, + "FileName": "./cases/ObjectLiteral1.ts", + "IsExternalPackage": false, + "Line": 0, + }, "ReferenceId": "ObjectLiteralExpression-0", "Text": "{ Property: string; }", "_ts": Object { diff --git a/tests/cases/__tests__/__snapshots__/ParameterDeclaration1.test.ts.snap b/tests/cases/__tests__/__snapshots__/ParameterDeclaration1.test.ts.snap index af59f13e..e790f29f 100644 --- a/tests/cases/__tests__/__snapshots__/ParameterDeclaration1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ParameterDeclaration1.test.ts.snap @@ -32,6 +32,12 @@ Object { "ParentId": "SourceFile-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 44, + "FileName": "./cases/ParameterDeclaration1.ts", + "IsExternalPackage": false, + "Line": 2, + }, "Text": "void", "_ts": Object { "Kind": 105, @@ -63,6 +69,12 @@ Object { "ParentId": "FunctionDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 34, + "FileName": "./cases/ParameterDeclaration1.ts", + "IsExternalPackage": false, + "Line": 2, + }, "Text": "boolean", "_ts": Object { "Kind": 122, diff --git a/tests/cases/__tests__/__snapshots__/ParameterDeclaration2.test.ts.snap b/tests/cases/__tests__/__snapshots__/ParameterDeclaration2.test.ts.snap index 37a9b11b..e10821f3 100644 --- a/tests/cases/__tests__/__snapshots__/ParameterDeclaration2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ParameterDeclaration2.test.ts.snap @@ -32,6 +32,12 @@ Object { "ParentId": "SourceFile-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 47, + "FileName": "./cases/ParameterDeclaration2.ts", + "IsExternalPackage": false, + "Line": 2, + }, "Text": "void", "_ts": Object { "Kind": 105, @@ -63,9 +69,21 @@ Object { "ParentId": "FunctionDeclaration-0", "Type": Object { "ApiTypeKind": "array", + "Location": Object { + "Character": 36, + "FileName": "./cases/ParameterDeclaration2.ts", + "IsExternalPackage": false, + "Line": 2, + }, "Text": "string[]", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 36, + "FileName": "./cases/ParameterDeclaration2.ts", + "IsExternalPackage": false, + "Line": 2, + }, "Text": "string", "_ts": Object { "Kind": 136, diff --git a/tests/cases/__tests__/__snapshots__/ParameterDeclaration3.test.ts.snap b/tests/cases/__tests__/__snapshots__/ParameterDeclaration3.test.ts.snap index a9d6cbe9..11c52cdc 100644 --- a/tests/cases/__tests__/__snapshots__/ParameterDeclaration3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ParameterDeclaration3.test.ts.snap @@ -32,6 +32,12 @@ Object { "ParentId": "SourceFile-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 59, + "FileName": "./cases/ParameterDeclaration3.ts", + "IsExternalPackage": false, + "Line": 2, + }, "Text": "void", "_ts": Object { "Kind": 105, @@ -63,6 +69,12 @@ Object { "ParentId": "FunctionDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 33, + "FileName": "./cases/ParameterDeclaration3.ts", + "IsExternalPackage": false, + "Line": 2, + }, "Text": "string", "_ts": Object { "Kind": 136, diff --git a/tests/cases/__tests__/__snapshots__/SetAccessor1.test.ts.snap b/tests/cases/__tests__/__snapshots__/SetAccessor1.test.ts.snap index af4138d4..03140393 100644 --- a/tests/cases/__tests__/__snapshots__/SetAccessor1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/SetAccessor1.test.ts.snap @@ -56,6 +56,12 @@ Object { "ParentId": "SetAccessor-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 24, + "FileName": "./cases/SetAccessor1.ts", + "IsExternalPackage": false, + "Line": 1, + }, "Text": "string", "_ts": Object { "Kind": 136, diff --git a/tests/cases/__tests__/__snapshots__/SetAccessor2.test.ts.snap b/tests/cases/__tests__/__snapshots__/SetAccessor2.test.ts.snap index bb750dff..31611adf 100644 --- a/tests/cases/__tests__/__snapshots__/SetAccessor2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/SetAccessor2.test.ts.snap @@ -56,6 +56,12 @@ Object { "ParentId": "SetAccessor-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 24, + "FileName": "./cases/SetAccessor2.ts", + "IsExternalPackage": false, + "Line": 2, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -86,6 +92,12 @@ Object { "ParentId": "SetAccessor-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 38, + "FileName": "./cases/SetAccessor2.ts", + "IsExternalPackage": false, + "Line": 2, + }, "Text": "string", "_ts": Object { "Kind": 136, diff --git a/tests/cases/__tests__/__snapshots__/SetAccessor3.test.ts.snap b/tests/cases/__tests__/__snapshots__/SetAccessor3.test.ts.snap index 9447a554..85d1fc3e 100644 --- a/tests/cases/__tests__/__snapshots__/SetAccessor3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/SetAccessor3.test.ts.snap @@ -74,6 +74,12 @@ Object { "ParentId": "SetAccessor-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 33, + "FileName": "./cases/SetAccessor3.ts", + "IsExternalPackage": false, + "Line": 1, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -104,6 +110,12 @@ Object { "ParentId": "SetAccessor-1", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 37, + "FileName": "./cases/SetAccessor3.ts", + "IsExternalPackage": false, + "Line": 2, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -134,6 +146,12 @@ Object { "ParentId": "SetAccessor-2", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 25, + "FileName": "./cases/SetAccessor3.ts", + "IsExternalPackage": false, + "Line": 3, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -164,6 +182,12 @@ Object { "ParentId": "SetAccessor-3", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 36, + "FileName": "./cases/SetAccessor3.ts", + "IsExternalPackage": false, + "Line": 4, + }, "Text": "string", "_ts": Object { "Kind": 136, diff --git a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration1.test.ts.snap b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration1.test.ts.snap index 79c214bd..b561bc92 100644 --- a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration1.test.ts.snap @@ -24,6 +24,12 @@ Object { "ParentId": "TypeLiteral-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 13, + "FileName": "./cases/TypeAliasDeclaration1.ts", + "IsExternalPackage": false, + "Line": 3, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -84,6 +90,12 @@ Object { "ParentId": "SourceFile-0", "Type": Object { "ApiTypeKind": "type-literal", + "Location": Object { + "Character": 21, + "FileName": "./cases/TypeAliasDeclaration1.ts", + "IsExternalPackage": false, + "Line": 2, + }, "ReferenceId": "TypeLiteral-0", "Text": "MyType", "_ts": Object { @@ -113,6 +125,12 @@ Object { "ParentId": "SourceFile-0", "Type": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 26, + "FileName": "./cases/TypeAliasDeclaration1.ts", + "IsExternalPackage": false, + "Line": 6, + }, "ReferenceId": "TypeAliasDeclaration-0", "SymbolName": "MyType", "Text": "MyType", diff --git a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration2.test.ts.snap b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration2.test.ts.snap index b843e226..0ceb93d8 100644 --- a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration2.test.ts.snap @@ -24,6 +24,12 @@ Object { "ParentId": "TypeLiteral-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 13, + "FileName": "./cases/TypeAliasDeclaration2.ts", + "IsExternalPackage": false, + "Line": 1, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -53,6 +59,12 @@ Object { "ParentId": "TypeLiteral-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 13, + "FileName": "./cases/TypeAliasDeclaration2.ts", + "IsExternalPackage": false, + "Line": 2, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -82,6 +94,12 @@ Object { "ParentId": "TypeLiteral-1", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 13, + "FileName": "./cases/TypeAliasDeclaration2.ts", + "IsExternalPackage": false, + "Line": 6, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -111,6 +129,12 @@ Object { "ParentId": "TypeLiteral-1", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 13, + "FileName": "./cases/TypeAliasDeclaration2.ts", + "IsExternalPackage": false, + "Line": 7, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -177,6 +201,12 @@ Object { "ParentId": "SourceFile-0", "Type": Object { "ApiTypeKind": "type-literal", + "Location": Object { + "Character": 30, + "FileName": "./cases/TypeAliasDeclaration2.ts", + "IsExternalPackage": false, + "Line": 0, + }, "ReferenceId": "TypeLiteral-0", "Text": "OneCommonField1", "_ts": Object { @@ -206,6 +236,12 @@ Object { "ParentId": "SourceFile-0", "Type": Object { "ApiTypeKind": "type-literal", + "Location": Object { + "Character": 30, + "FileName": "./cases/TypeAliasDeclaration2.ts", + "IsExternalPackage": false, + "Line": 5, + }, "ReferenceId": "TypeLiteral-1", "Text": "OneCommonField2", "_ts": Object { @@ -235,9 +271,21 @@ Object { "ParentId": "SourceFile-0", "Type": Object { "ApiTypeKind": "union", + "Location": Object { + "Character": 45, + "FileName": "./cases/TypeAliasDeclaration2.ts", + "IsExternalPackage": false, + "Line": 10, + }, "Members": Array [ Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 45, + "FileName": "./cases/TypeAliasDeclaration2.ts", + "IsExternalPackage": false, + "Line": 10, + }, "ReferenceId": "TypeAliasDeclaration-0", "SymbolName": "OneCommonField1", "Text": "OneCommonField1", @@ -249,6 +297,12 @@ Object { }, Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 63, + "FileName": "./cases/TypeAliasDeclaration2.ts", + "IsExternalPackage": false, + "Line": 10, + }, "ReferenceId": "TypeAliasDeclaration-1", "SymbolName": "OneCommonField2", "Text": "OneCommonField2", diff --git a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration3.test.ts.snap b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration3.test.ts.snap index 7e68c6cb..566d9147 100644 --- a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration3.test.ts.snap @@ -24,6 +24,12 @@ Object { "ParentId": "TypeLiteral-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 13, + "FileName": "./cases/TypeAliasDeclaration3.ts", + "IsExternalPackage": false, + "Line": 4, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -53,6 +59,12 @@ Object { "ParentId": "TypeLiteral-0", "Type": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 13, + "FileName": "./cases/TypeAliasDeclaration3.ts", + "IsExternalPackage": false, + "Line": 5, + }, "ReferenceId": "TypeParameter-0", "SymbolName": "TType", "Text": "TType", @@ -85,6 +97,12 @@ Object { "ParentId": "TypeLiteral-1", "Type": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 13, + "FileName": "./cases/TypeAliasDeclaration3.ts", + "IsExternalPackage": false, + "Line": 9, + }, "ReferenceId": "TypeParameter-1", "SymbolName": "TType", "Text": "TType", @@ -117,6 +135,12 @@ Object { "ParentId": "TypeLiteral-2", "Type": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 13, + "FileName": "./cases/TypeAliasDeclaration3.ts", + "IsExternalPackage": false, + "Line": 18, + }, "ReferenceId": "TypeParameter-2", "SymbolName": "TType", "Text": "TType", @@ -149,6 +173,12 @@ Object { "ParentId": "TypeLiteral-2", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 13, + "FileName": "./cases/TypeAliasDeclaration3.ts", + "IsExternalPackage": false, + "Line": 19, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -178,6 +208,12 @@ Object { "ParentId": "TypeLiteral-3", "Type": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 13, + "FileName": "./cases/TypeAliasDeclaration3.ts", + "IsExternalPackage": false, + "Line": 23, + }, "ReferenceId": "TypeParameter-3", "SymbolName": "TType", "Text": "TType", @@ -210,6 +246,12 @@ Object { "ParentId": "TypeLiteral-3", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 13, + "FileName": "./cases/TypeAliasDeclaration3.ts", + "IsExternalPackage": false, + "Line": 24, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -300,6 +342,12 @@ Object { "ParentId": "SourceFile-0", "Type": Object { "ApiTypeKind": "type-literal", + "Location": Object { + "Character": 37, + "FileName": "./cases/TypeAliasDeclaration3.ts", + "IsExternalPackage": false, + "Line": 3, + }, "ReferenceId": "TypeLiteral-0", "Text": "NoCommonFields1", "_ts": Object { @@ -336,6 +384,12 @@ Object { "ParentId": "SourceFile-0", "Type": Object { "ApiTypeKind": "type-literal", + "Location": Object { + "Character": 37, + "FileName": "./cases/TypeAliasDeclaration3.ts", + "IsExternalPackage": false, + "Line": 8, + }, "ReferenceId": "TypeLiteral-1", "Text": "NoCommonFields2", "_ts": Object { @@ -372,15 +426,33 @@ Object { "ParentId": "SourceFile-0", "Type": Object { "ApiTypeKind": "union", + "Location": Object { + "Character": 26, + "FileName": "./cases/TypeAliasDeclaration3.ts", + "IsExternalPackage": false, + "Line": 12, + }, "Members": Array [ Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 26, + "FileName": "./cases/TypeAliasDeclaration3.ts", + "IsExternalPackage": false, + "Line": 12, + }, "ReferenceId": "TypeAliasDeclaration-0", "SymbolName": "NoCommonFields1", "Text": "NoCommonFields1", "TypeParameters": Array [ Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 42, + "FileName": "./cases/TypeAliasDeclaration3.ts", + "IsExternalPackage": false, + "Line": 12, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -395,12 +467,24 @@ Object { }, Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 52, + "FileName": "./cases/TypeAliasDeclaration3.ts", + "IsExternalPackage": false, + "Line": 12, + }, "ReferenceId": "TypeAliasDeclaration-1", "SymbolName": "NoCommonFields2", "Text": "NoCommonFields2", "TypeParameters": Array [ Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 68, + "FileName": "./cases/TypeAliasDeclaration3.ts", + "IsExternalPackage": false, + "Line": 12, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -442,6 +526,12 @@ Object { "ParentId": "SourceFile-0", "Type": Object { "ApiTypeKind": "type-literal", + "Location": Object { + "Character": 37, + "FileName": "./cases/TypeAliasDeclaration3.ts", + "IsExternalPackage": false, + "Line": 17, + }, "ReferenceId": "TypeLiteral-2", "Text": "OneCommonField1", "_ts": Object { @@ -478,6 +568,12 @@ Object { "ParentId": "SourceFile-0", "Type": Object { "ApiTypeKind": "type-literal", + "Location": Object { + "Character": 37, + "FileName": "./cases/TypeAliasDeclaration3.ts", + "IsExternalPackage": false, + "Line": 22, + }, "ReferenceId": "TypeLiteral-3", "Text": "OneCommonField2", "_ts": Object { @@ -514,15 +610,33 @@ Object { "ParentId": "SourceFile-0", "Type": Object { "ApiTypeKind": "union", + "Location": Object { + "Character": 45, + "FileName": "./cases/TypeAliasDeclaration3.ts", + "IsExternalPackage": false, + "Line": 27, + }, "Members": Array [ Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 45, + "FileName": "./cases/TypeAliasDeclaration3.ts", + "IsExternalPackage": false, + "Line": 27, + }, "ReferenceId": "TypeAliasDeclaration-3", "SymbolName": "OneCommonField1", "Text": "OneCommonField1", "TypeParameters": Array [ Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 61, + "FileName": "./cases/TypeAliasDeclaration3.ts", + "IsExternalPackage": false, + "Line": 27, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -537,12 +651,24 @@ Object { }, Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 71, + "FileName": "./cases/TypeAliasDeclaration3.ts", + "IsExternalPackage": false, + "Line": 27, + }, "ReferenceId": "TypeAliasDeclaration-4", "SymbolName": "OneCommonField2", "Text": "OneCommonField2", "TypeParameters": Array [ Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 87, + "FileName": "./cases/TypeAliasDeclaration3.ts", + "IsExternalPackage": false, + "Line": 27, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -584,15 +710,33 @@ Object { "ParentId": "SourceFile-0", "Type": Object { "ApiTypeKind": "intersection", + "Location": Object { + "Character": 63, + "FileName": "./cases/TypeAliasDeclaration3.ts", + "IsExternalPackage": false, + "Line": 29, + }, "Members": Array [ Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 63, + "FileName": "./cases/TypeAliasDeclaration3.ts", + "IsExternalPackage": false, + "Line": 29, + }, "ReferenceId": "TypeAliasDeclaration-3", "SymbolName": "OneCommonField1", "Text": "OneCommonField1", "TypeParameters": Array [ Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 79, + "FileName": "./cases/TypeAliasDeclaration3.ts", + "IsExternalPackage": false, + "Line": 29, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -607,12 +751,24 @@ Object { }, Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 89, + "FileName": "./cases/TypeAliasDeclaration3.ts", + "IsExternalPackage": false, + "Line": 29, + }, "ReferenceId": "TypeAliasDeclaration-4", "SymbolName": "OneCommonField2", "Text": "OneCommonField2", "TypeParameters": Array [ Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 105, + "FileName": "./cases/TypeAliasDeclaration3.ts", + "IsExternalPackage": false, + "Line": 29, + }, "Text": "string", "_ts": Object { "Kind": 136, diff --git a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration4.test.ts.snap b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration4.test.ts.snap index c51ed9e9..2dbb8c19 100644 --- a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration4.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration4.test.ts.snap @@ -24,6 +24,12 @@ Object { "ParentId": "TypeLiteral-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 10, + "FileName": "./cases/TypeAliasDeclaration4.ts", + "IsExternalPackage": false, + "Line": 1, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -84,6 +90,12 @@ Object { "ParentId": "SourceFile-0", "Type": Object { "ApiTypeKind": "type-literal", + "Location": Object { + "Character": 19, + "FileName": "./cases/TypeAliasDeclaration4.ts", + "IsExternalPackage": false, + "Line": 0, + }, "ReferenceId": "TypeLiteral-0", "Text": "User", "_ts": Object { @@ -113,12 +125,24 @@ Object { "ParentId": "SourceFile-0", "Type": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 27, + "FileName": "./cases/TypeAliasDeclaration4.ts", + "IsExternalPackage": false, + "Line": 4, + }, "ReferenceId": undefined, "SymbolName": "Readonly", "Text": "Readonly", "TypeParameters": Array [ Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 36, + "FileName": "./cases/TypeAliasDeclaration4.ts", + "IsExternalPackage": false, + "Line": 4, + }, "ReferenceId": "TypeAliasDeclaration-0", "SymbolName": "User", "Text": "User", diff --git a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration5.test.ts.snap b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration5.test.ts.snap index fb9f9d92..30cd1b69 100644 --- a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration5.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration5.test.ts.snap @@ -49,9 +49,21 @@ Object { "ParentId": "SourceFile-0", "Type": Object { "ApiTypeKind": "tuple", + "Location": Object { + "Character": 23, + "FileName": "./cases/TypeAliasDeclaration5.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Members": Array [ Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 24, + "FileName": "./cases/TypeAliasDeclaration5.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -60,6 +72,12 @@ Object { }, Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 32, + "FileName": "./cases/TypeAliasDeclaration5.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Text": "number", "_ts": Object { "Kind": 133, diff --git a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration6.test.ts.snap b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration6.test.ts.snap index 9c488016..4a6bba0e 100644 --- a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration6.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration6.test.ts.snap @@ -61,6 +61,12 @@ Object { "ApiTypeKind": "indexed-access", "IndexType": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 29, + "FileName": "./cases/TypeAliasDeclaration6.ts", + "IsExternalPackage": false, + "Line": 6, + }, "ReferenceId": "TypeParameter-0", "SymbolName": "TKey", "Text": "TKey", @@ -70,8 +76,20 @@ Object { "KindString": "TypeReference", }, }, + "Location": Object { + "Character": 25, + "FileName": "./cases/TypeAliasDeclaration6.ts", + "IsExternalPackage": false, + "Line": 6, + }, "ObjectType": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 25, + "FileName": "./cases/TypeAliasDeclaration6.ts", + "IsExternalPackage": false, + "Line": 6, + }, "ReferenceId": "InterfaceDeclaration-0", "SymbolName": "Foo", "Text": "Foo", @@ -111,6 +129,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 10, + "FileName": "./cases/TypeAliasDeclaration6.ts", + "IsExternalPackage": false, + "Line": 1, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -140,6 +164,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 14, + "FileName": "./cases/TypeAliasDeclaration6.ts", + "IsExternalPackage": false, + "Line": 2, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -200,6 +230,12 @@ Object { "ParentId": "SourceFile-0", "Type": Object { "ApiTypeKind": "mapped", + "Location": Object { + "Character": 18, + "FileName": "./cases/TypeAliasDeclaration6.ts", + "IsExternalPackage": false, + "Line": 5, + }, "ReferenceId": "MappedType-0", "Text": "Bar", "_ts": Object { @@ -218,9 +254,21 @@ Object { "ConstraintType": Object { "ApiTypeKind": "type-operator", "Keyword": "keyof", + "Location": Object { + "Character": 13, + "FileName": "./cases/TypeAliasDeclaration6.ts", + "IsExternalPackage": false, + "Line": 6, + }, "Text": "keyof Foo", "Type": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 19, + "FileName": "./cases/TypeAliasDeclaration6.ts", + "IsExternalPackage": false, + "Line": 6, + }, "ReferenceId": "InterfaceDeclaration-0", "SymbolName": "Foo", "Text": "Foo", diff --git a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration7.test.ts.snap b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration7.test.ts.snap index d1532514..035ed489 100644 --- a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration7.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration7.test.ts.snap @@ -49,15 +49,39 @@ Object { "ParentId": "SourceFile-0", "Type": Object { "ApiTypeKind": "array", + "Location": Object { + "Character": 18, + "FileName": "./cases/TypeAliasDeclaration7.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Text": "(string | number)[]", "Type": Object { "ApiTypeKind": "parenthesized", + "Location": Object { + "Character": 18, + "FileName": "./cases/TypeAliasDeclaration7.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Text": "string | number", "Type": Object { "ApiTypeKind": "union", + "Location": Object { + "Character": 19, + "FileName": "./cases/TypeAliasDeclaration7.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Members": Array [ Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 19, + "FileName": "./cases/TypeAliasDeclaration7.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -66,6 +90,12 @@ Object { }, Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 28, + "FileName": "./cases/TypeAliasDeclaration7.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Text": "number", "_ts": Object { "Kind": 133, diff --git a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration8.test.ts.snap b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration8.test.ts.snap index 2fbaec6c..74d52304 100644 --- a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration8.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration8.test.ts.snap @@ -24,6 +24,12 @@ Object { "ParentId": "TypeAliasDeclaration-0", "ReturnType": Object { "ApiTypeKind": "type-literal", + "Location": Object { + "Character": 28, + "FileName": "./cases/TypeAliasDeclaration8.ts", + "IsExternalPackage": false, + "Line": 0, + }, "ReferenceId": "TypeLiteral-0", "Text": "{ Name: string; Age: number; }", "_ts": Object { @@ -55,6 +61,12 @@ Object { "ParentId": "TypeLiteral-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 10, + "FileName": "./cases/TypeAliasDeclaration8.ts", + "IsExternalPackage": false, + "Line": 1, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -84,6 +96,12 @@ Object { "ParentId": "TypeLiteral-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 9, + "FileName": "./cases/TypeAliasDeclaration8.ts", + "IsExternalPackage": false, + "Line": 2, + }, "Text": "number", "_ts": Object { "Kind": 133, @@ -138,6 +156,12 @@ Object { "ParentId": "SourceFile-0", "Type": Object { "ApiTypeKind": "constructor", + "Location": Object { + "Character": 18, + "FileName": "./cases/TypeAliasDeclaration8.ts", + "IsExternalPackage": false, + "Line": 0, + }, "ReferenceId": "ConstructorType-0", "Text": "Foo", "_ts": Object { diff --git a/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration1.test.ts.snap b/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration1.test.ts.snap index 1ea47802..7915c119 100644 --- a/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration1.test.ts.snap @@ -32,6 +32,12 @@ Object { "ParentId": "SourceFile-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 49, + "FileName": "./cases/TypeParameterDeclaration1.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Text": "void", "_ts": Object { "Kind": 105, @@ -70,6 +76,12 @@ Object { "ParentId": "FunctionDeclaration-0", "Type": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 40, + "FileName": "./cases/TypeParameterDeclaration1.ts", + "IsExternalPackage": false, + "Line": 0, + }, "ReferenceId": "TypeParameter-0", "SymbolName": "TValue", "Text": "TValue", @@ -116,6 +128,12 @@ Object { "ConstraintType": undefined, "DefaultType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 29, + "FileName": "./cases/TypeParameterDeclaration1.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Text": "string", "_ts": Object { "Kind": 136, diff --git a/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration2.test.ts.snap b/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration2.test.ts.snap index 59c59ca4..898fb26c 100644 --- a/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration2.test.ts.snap @@ -32,6 +32,12 @@ Object { "ParentId": "SourceFile-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 53, + "FileName": "./cases/TypeParameterDeclaration2.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Text": "void", "_ts": Object { "Kind": 105, @@ -70,6 +76,12 @@ Object { "ParentId": "FunctionDeclaration-0", "Type": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 44, + "FileName": "./cases/TypeParameterDeclaration2.ts", + "IsExternalPackage": false, + "Line": 0, + }, "ReferenceId": "TypeParameter-0", "SymbolName": "TValue", "Text": "TValue", @@ -115,6 +127,12 @@ Object { "ApiKind": "type-parameter", "ConstraintType": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 35, + "FileName": "./cases/TypeParameterDeclaration2.ts", + "IsExternalPackage": false, + "Line": 0, + }, "ReferenceId": undefined, "SymbolName": "Date", "Text": "Date", diff --git a/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration3.test.ts.snap b/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration3.test.ts.snap index 5db91418..2cd154ad 100644 --- a/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration3.test.ts.snap @@ -32,6 +32,12 @@ Object { "ParentId": "SourceFile-0", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 60, + "FileName": "./cases/TypeParameterDeclaration3.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Text": "void", "_ts": Object { "Kind": 105, @@ -70,6 +76,12 @@ Object { "ParentId": "FunctionDeclaration-0", "Type": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 51, + "FileName": "./cases/TypeParameterDeclaration3.ts", + "IsExternalPackage": false, + "Line": 0, + }, "ReferenceId": "TypeParameter-0", "SymbolName": "TValue", "Text": "TValue", @@ -115,6 +127,12 @@ Object { "ApiKind": "type-parameter", "ConstraintType": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 35, + "FileName": "./cases/TypeParameterDeclaration3.ts", + "IsExternalPackage": false, + "Line": 0, + }, "ReferenceId": undefined, "SymbolName": "Date", "Text": "Date", @@ -126,6 +144,12 @@ Object { }, "DefaultType": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 42, + "FileName": "./cases/TypeParameterDeclaration3.ts", + "IsExternalPackage": false, + "Line": 0, + }, "ReferenceId": undefined, "SymbolName": "Date", "Text": "Date", diff --git a/tests/cases/__tests__/__snapshots__/VariableDeclaration1.test.ts.snap b/tests/cases/__tests__/__snapshots__/VariableDeclaration1.test.ts.snap index ec3d6ad2..e3017383 100644 --- a/tests/cases/__tests__/__snapshots__/VariableDeclaration1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/VariableDeclaration1.test.ts.snap @@ -49,6 +49,12 @@ Object { "ParentId": undefined, "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 18, + "FileName": "./cases/VariableDeclaration1.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Text": "undefined", "_ts": Object { "Kind": 139, diff --git a/tests/cases/__tests__/__snapshots__/VariableDeclaration2.test.ts.snap b/tests/cases/__tests__/__snapshots__/VariableDeclaration2.test.ts.snap index 3bd24ce5..6f9fb4e1 100644 --- a/tests/cases/__tests__/__snapshots__/VariableDeclaration2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/VariableDeclaration2.test.ts.snap @@ -31,6 +31,12 @@ Object { "ParentId": "VariableDeclaration-1", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 34, + "FileName": "./cases/VariableDeclaration2.ts", + "IsExternalPackage": false, + "Line": 2, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -61,6 +67,12 @@ Object { "ParentId": "VariableDeclaration-2", "ReturnType": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 38, + "FileName": "./cases/VariableDeclaration2.ts", + "IsExternalPackage": false, + "Line": 4, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -92,6 +104,12 @@ Object { "ParentId": "ArrowFunction-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 38, + "FileName": "./cases/VariableDeclaration2.ts", + "IsExternalPackage": false, + "Line": 2, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -158,6 +176,12 @@ Object { "ParentId": undefined, "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 18, + "FileName": "./cases/VariableDeclaration2.ts", + "IsExternalPackage": false, + "Line": 0, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -186,6 +210,12 @@ Object { "ParentId": undefined, "Type": Object { "ApiTypeKind": "function-type", + "Location": Object { + "Character": 13, + "FileName": "./cases/VariableDeclaration2.ts", + "IsExternalPackage": false, + "Line": 2, + }, "ReferenceId": "ArrowFunction-0", "Text": "(a: string) => string", "_ts": Object { @@ -215,6 +245,12 @@ Object { "ParentId": undefined, "Type": Object { "ApiTypeKind": "function-type", + "Location": Object { + "Character": 11, + "FileName": "./cases/VariableDeclaration2.ts", + "IsExternalPackage": false, + "Line": 4, + }, "ReferenceId": "FunctionExpression-0", "Text": "() => string", "_ts": Object { diff --git a/tests/cases/__tests__/__snapshots__/VariableDeclaration3.test.ts.snap b/tests/cases/__tests__/__snapshots__/VariableDeclaration3.test.ts.snap index 771f3b59..a5726f1d 100644 --- a/tests/cases/__tests__/__snapshots__/VariableDeclaration3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/VariableDeclaration3.test.ts.snap @@ -50,6 +50,12 @@ Object { "Type": Object { "ApiTypeKind": "type-query", "Keyword": "typeof", + "Location": Object { + "Character": 16, + "FileName": "./cases/VariableDeclaration3.ts", + "IsExternalPackage": false, + "Line": 2, + }, "ReferenceId": undefined, "Text": "string", "_ts": Object { diff --git a/tests/cases/__tests__/__snapshots__/VariableDeclaration4.test.ts.snap b/tests/cases/__tests__/__snapshots__/VariableDeclaration4.test.ts.snap index 2be35171..7e404f5f 100644 --- a/tests/cases/__tests__/__snapshots__/VariableDeclaration4.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/VariableDeclaration4.test.ts.snap @@ -53,6 +53,12 @@ Object { "ParentId": "InterfaceDeclaration-0", "Type": Object { "ApiTypeKind": "basic", + "Location": Object { + "Character": 7, + "FileName": "./cases/VariableDeclaration4.ts", + "IsExternalPackage": false, + "Line": 1, + }, "Text": "string", "_ts": Object { "Kind": 136, @@ -119,6 +125,12 @@ Object { "ParentId": undefined, "Type": Object { "ApiTypeKind": "reference", + "Location": Object { + "Character": 16, + "FileName": "./cases/VariableDeclaration4.ts", + "IsExternalPackage": false, + "Line": 4, + }, "ReferenceId": "InterfaceDeclaration-0", "SymbolName": "A", "Text": "A", @@ -151,6 +163,12 @@ Object { "Type": Object { "ApiTypeKind": "type-query", "Keyword": "typeof", + "Location": Object { + "Character": 16, + "FileName": "./cases/VariableDeclaration4.ts", + "IsExternalPackage": false, + "Line": 8, + }, "ReferenceId": "InterfaceDeclaration-0", "Text": "A", "_ts": Object {