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

Immediate panic when I put a custom syntax in ~/Library/Application\ Support/amp/syntaxes/ #216

Open
mnemnion opened this issue Apr 14, 2021 · 3 comments

Comments

@mnemnion
Copy link

This is a syntax which I've used successfully with bat in the past.

Running amp after moving one .sublime-theme file into the indicated directory causes an immediate panic with this message:

thread 'main' panicked at 'attempted to leave type `linked_hash_map::Node<yaml::Yaml, yaml::Yaml>` uninitialized, which is invalid', /private/tmp/rust-20210325-49675-3ca9nq/rustc-1.51.0-src/library/core/src/mem/mod.rs:671:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

So I did, giving this

thread 'main' panicked at 'attempted to leave type `linked_hash_map::Node<yaml::Yaml, yaml::Yaml>` uninitialized, which is invalid', /private/tmp/rust-20210325-49675-3ca9nq/rustc-1.51.0-src/library/core/src/mem/mod.rs:671:9
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: linked_hash_map::LinkedHashMap<K,V,S>::insert
   4: yaml_rust::yaml::YamlLoader::insert_new_node
   5: <yaml_rust::yaml::YamlLoader as yaml_rust::parser::MarkedEventReceiver>::on_event
   6: yaml_rust::parser::Parser<T>::load_node
   7: yaml_rust::parser::Parser<T>::load_mapping
   8: yaml_rust::parser::Parser<T>::load
   9: yaml_rust::yaml::YamlLoader::load_from_str
  10: syntect::parsing::yaml_load::<impl syntect::parsing::syntax_definition::SyntaxDefinition>::load_from_str
  11: syntect::parsing::syntax_set::load_syntax_file
  12: syntect::parsing::syntax_set::SyntaxSet::load_syntaxes
  13: amp::models::application::Application::new
  14: amp::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Leaving off the xterm commands which restore the terminal to cooked mode and so on.

This .sublime-syntax doesn't rely on any other syntaxes, it's self-contained, and works in Sublime Text and bat.

I can provide the syntax file if that would be helpful.

@pbgc
Copy link

pbgc commented Apr 14, 2021

@mnemnion this seems related to: #205

@jmacdonald
Copy link
Owner

@mnemnion thanks for the heads up! How did you go about installing amp? I can issue a new release for this, but want to make sure I'm covering your installation method.

@mnemnion
Copy link
Author

Hi @jmacdonald I used Homebrew. I do have the Rust toolchain already, so if you want to give me a heads-up I'd be happy to test a release. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants