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

Print full error chain when failing to load grammar #12744

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

NiklasJonsson
Copy link

As per the documentation in anyhow: https://docs.rs/anyhow/latest/anyhow/struct.Error.html#display-representations to print the full error, one should use {:#}.

This helped me debug an error where a .so file would fail to load for a treesitter grammar by giving more information on the error so I'd figured I'd open a PR so that it might help others.

I didn't write a test because I'm not very familiar with the helix code and test structure but if you'd like one, please give some suggestion on how to implement it and I will 😄

@drybalka
Copy link
Contributor

drybalka commented Feb 2, 2025

I don't think a test is needed, as your PR only changes the error display. It would be helpful, however, if you could provide a recipe for testing it manually, so that I can compare the errors. In other words, what do I need to do to break the treesitter grammar loading and get an error from this part of code?

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

Successfully merging this pull request may close these issues.

2 participants