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

prisma-fmt panics at comments on block attributes #3658

Closed
carmenberndt opened this issue Sep 15, 2020 · 1 comment · Fixed by prisma/prisma-engines#1149
Closed

prisma-fmt panics at comments on block attributes #3658

carmenberndt opened this issue Sep 15, 2020 · 1 comment · Fixed by prisma/prisma-engines#1149
Assignees
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. tech/engines Issue for tech Engines. topic: prisma format CLI: prisma format
Milestone

Comments

@carmenberndt
Copy link

With the following model:

model Blog {
  id1 Int
  id2 Int
  @@id([id1, id2]) /// id comment
}

prisma-fmt errors with this output:

Screenshot 2020-09-15 at 10 52 05

@pantharshit00
Copy link
Contributor

I can also reproduce this:

Error: Schema parsing
thread 'main' panicked at 'internal error: entered unreachable code: Encountered impossible model during parsing: doc_comment_and_new_line [Start { rule: doc_comment_and_new_line, pos: Position { pos: 180 } }, Start { rule: doc_comment, pos: Position { pos: 180 } }, Start { rule: doc_content, pos: Position { pos: 183 } }, End { rule: doc_content, pos: Position { pos: 194 } }, End { rule: doc_comment, pos: Position { pos: 194 } }, Start { rule: NEWLINE, pos: Position { pos: 194 } }, End { rule: NEWLINE, pos: Position { pos: 195 } }, End { rule: doc_comment_and_new_line, pos: Position { pos: 195 } }]', libs/datamodel/core/src/ast/parser/helpers.rs:9:14
stack backtrace:
   0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
   1: core::fmt::write
   2: std::io::Write::write_fmt
   3: std::panicking::default_hook::{{closure}}
   4: std::panicking::default_hook
   5: std::panicking::rust_panic_with_hook
   6: rust_begin_unwind
   7: std::panicking::begin_panic_fmt
   8: datamodel::ast::parser::helpers::parsing_catch_all
   9: datamodel::ast::parser::parse_model::parse_model
  10: datamodel::ast::parser::parse_schema::parse_schema
  11: datamodel::parse_datamodel_internal
  12: datamodel::parse_datamodel_and_ignore_datasource_urls
  13: query_engine::opt::PrismaOpt::datamodel
  14: query_engine::cli::CliCommand::from_opt
  15: query_engine::main::main::{{closure}}::main::{{closure}}
  16: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
  17: std::thread::local::LocalKey<T>::with
  18: scoped_tls::ScopedKey<T>::set
  19: async_executor::LocalExecutor::run
  20: scoped_tls::ScopedKey<T>::set
  21: tokio::runtime::context::enter
  22: tokio::runtime::Runtime::enter
  23: std::thread::local::LocalKey<T>::with
  24: std::thread::local::LocalKey<T>::with
  25: async_std::task::builder::Builder::blocking
  26: query_engine::main
  27: std::rt::lang_start::{{closure}}
  28: std::rt::lang_start_internal
  29: main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. tech/engines Issue for tech Engines. topic: prisma format CLI: prisma format
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants