Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Andarist opened this issue Apr 15, 2024 · 0 comments Β· May be fixed by #58216
Open

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

Andarist opened this issue Apr 15, 2024 · 0 comments Β· May be fixed by #58216
Labels
Bug A bug in TypeScript Help Wanted You can do this
Milestone

Comments

@Andarist
Copy link
Contributor

πŸ”Ž 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)

@RyanCavanaugh RyanCavanaugh added Bug A bug in TypeScript Help Wanted You can do this labels Apr 17, 2024
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Help Wanted You can do this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants