Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions 6 src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2389,7 +2389,7 @@ namespace ts {
const formattedUnionTypes = formatUnionTypes((<UnionType>type).types);
const unionTypeNodes = formattedUnionTypes && mapToTypeNodeArray(formattedUnionTypes);
if (unionTypeNodes && unionTypeNodes.length > 0) {
return createUnionOrIntersectionTypeNode(SyntaxKind.UnionType, unionTypeNodes);
return createUnionTypeNode(unionTypeNodes);
}
else {
if (!context.encounteredError && !(context.flags & NodeBuilderFlags.allowEmptyUnionOrIntersection)) {
Expand All @@ -2400,7 +2400,7 @@ namespace ts {
}

if (type.flags & TypeFlags.Intersection) {
return createUnionOrIntersectionTypeNode(SyntaxKind.IntersectionType, mapToTypeNodeArray((type as UnionType).types));
return createIntersectionTypeNode(mapToTypeNodeArray((type as IntersectionType).types));
}

if (objectFlags & (ObjectFlags.Anonymous | ObjectFlags.Mapped)) {
Expand Down Expand Up @@ -2660,7 +2660,7 @@ namespace ts {
indexerTypeNode,
/*initializer*/ undefined);
const typeNode = typeToTypeNodeHelper(indexInfo.type);
return createIndexSignatureDeclaration(
return createIndexSignature(
/*decorators*/ undefined,
indexInfo.isReadonly ? [createToken(SyntaxKind.ReadonlyKeyword)] : undefined,
[indexingParameter],
Expand Down
793 changes: 414 additions & 379 deletions 793 src/compiler/factory.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion 2 src/compiler/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1506,7 +1506,7 @@ namespace ts {
// for the same reasons we treat NewExpression as a PrimaryExpression.
export interface MetaProperty extends PrimaryExpression {
kind: SyntaxKind.MetaProperty;
keywordToken: SyntaxKind;
keywordToken: SyntaxKind.NewKeyword;
name: Identifier;
}

Expand Down
13 changes: 12 additions & 1 deletion 13 src/compiler/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3648,7 +3648,18 @@ namespace ts {
|| kind === SyntaxKind.GetAccessor
|| kind === SyntaxKind.SetAccessor
|| kind === SyntaxKind.IndexSignature
|| kind === SyntaxKind.SemicolonClassElement;
|| kind === SyntaxKind.SemicolonClassElement
|| kind === SyntaxKind.MissingDeclaration;
}

export function isTypeElement(node: Node): node is TypeElement {
const kind = node.kind;
return kind === SyntaxKind.ConstructSignature
|| kind === SyntaxKind.CallSignature
|| kind === SyntaxKind.PropertySignature
|| kind === SyntaxKind.MethodSignature
|| kind === SyntaxKind.IndexSignature
|| kind === SyntaxKind.MissingDeclaration;
}

export function isObjectLiteralElementLike(node: Node): node is ObjectLiteralElementLike {
Expand Down
267 changes: 149 additions & 118 deletions 267 src/compiler/visitor.ts

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions 16 src/services/codefixes/fixAddMissingMember.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,16 @@ namespace ts.codefix {
if (!isStatic) {
const stringTypeNode = createKeywordTypeNode(SyntaxKind.StringKeyword);
const indexingParameter = createParameter(
/*decorators*/ undefined,
/*modifiers*/ undefined,
/*dotDotDotToken*/ undefined,
/*decorators*/ undefined,
/*modifiers*/ undefined,
/*dotDotDotToken*/ undefined,
"x",
/*questionToken*/ undefined,
/*questionToken*/ undefined,
stringTypeNode,
/*initializer*/ undefined);
const indexSignature = createIndexSignatureDeclaration(
/*decorators*/ undefined,
/*modifiers*/ undefined,
/*initializer*/ undefined);
const indexSignature = createIndexSignature(
/*decorators*/ undefined,
/*modifiers*/ undefined,
[indexingParameter],
typeNode);

Expand Down
2 changes: 1 addition & 1 deletion 2 src/services/codefixes/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ namespace ts.codefix {
}

export function createStubbedMethod(modifiers: Modifier[], name: PropertyName, optional: boolean, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], returnType: TypeNode | undefined) {
return createMethodDeclaration(
return createMethod(
/*decorators*/ undefined,
modifiers,
/*asteriskToken*/ undefined,
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.