Skip to content

Debug Failure. False expression: Token end is child endΒ #58205

Closed
@Andarist

Description

@Andarist

πŸ”Ž Search Terms

completions formatting class member snippets constructor

πŸ•— Version & Regression Information

  • This is a crash

⏯ Playground Link

N/A

πŸ’» Code

/// <reference path="fourslash.ts" />

// @strict: true

// @filename: KlassConstructor.ts

//// type GenericConstructor<T> = new (...args: any[]) => T;
//// export type KlassConstructor<Cls extends GenericConstructor<any>> =
////   GenericConstructor<InstanceType<Cls>> & { [k in keyof Cls]: Cls[k] };

// @filename: ElementNode.ts
//// import { KlassConstructor } from "./KlassConstructor";
////
//// export type NodeKey = string;
////
//// export class ElementNode {
////   ["constructor"]!: KlassConstructor<typeof ElementNode>;
////   constructor(key?: NodeKey) {}
//// }

// @filename: CollapsibleContainerNode.ts
//// import { ElementNode, NodeKey } from "./ElementNode";
////
//// export class CollapsibleContainerNode extends ElementNode {
////   __open: boolean;
////
////   constructor(open: boolean, key?: NodeKey) {
////     super(key);
////     this.__open = open;
////   }
////   /*1*/
//// }

format.setFormatOptions({
  insertSpaceAfterConstructor: false,
});

verify.completions({
    marker: "1",
    preferences: {
        includeCompletionsWithClassMemberSnippets: true,
        includeCompletionsWithInsertText: true,
    },
    // TODO: tweak this line after fixing the issue
    includes: ["constructor"]
});

πŸ™ Actual behavior

it crashes

πŸ™‚ Expected behavior

it shouldn't crash

Additional information about the issue

repro based on #58191 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions