Skip to content

Generated edgeql TypeScript files are very slow to resolve  #555

@alexgorbatchev

Description

@alexgorbatchev

Code
The code causing the error.

e.app.User

Schema

module app {
  abstract type WithCreatedBy {
    required link createdBy -> User;
  }

  abstract type WithCreatedAt {
    required property createdAt -> datetime {
      default := (SELECT datetime_current());
      readonly := true;
    }
  }

  # -------------------------------------------------------------------------------------------------

  type User extending
    WithCreatedAt
  {
    # multi link accounts := .<users[is Account];
    required property email -> str {
      constraint exclusive;
    }
  }

  type Account extending
    WithCreatedAt
  {
    multi link users -> User;
  }

  abstract type WithAccount {
    required link account -> Account;
  }
}

Error or desired behavior

I'm observing that any time there's a generated edgeql code in currently opened file, or anywhere down the tree from currently opened file, type resolution slows down to a crawl. Generated types for some reason cause TS language server ~30s to resolve types. This happens every single time I open a file which has edgeql in it (or somewhere down the import tree).

in the screen cap below, i'm opening a file and moving mouse over one of the generated types

ezgif-1-1f4ace40b7

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions