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

Assertion failure when viewing a file that was deleted #7504

Closed
jyn514 opened this issue Feb 1, 2021 · 1 comment
Closed

Assertion failure when viewing a file that was deleted #7504

jyn514 opened this issue Feb 1, 2021 · 1 comment

Comments

@jyn514
Copy link
Member

jyn514 commented Feb 1, 2021

thread '<unnamed>' panicked at 'assertion failed: self.hl_range.range.contains_range(hl_range.range)', crates/ide/src/syntax_highlighting/highlights.rs:42:9
stack backtrace:
   0: std::panicking::begin_panic
   1: ide::syntax_highlighting::highlights::Node::add
   2: ide::syntax_highlighting::inject::doc_comment
   3: ide::syntax_highlighting::highlight
   4: std::panicking::try
   5: ide::Analysis::highlight_range
   6: rust_analyzer::handlers::handle_semantic_tokens_range
   7: <F as threadpool::FnBox>::call_box
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 7:02:22 PM] Request textDocument/definition failed.
  Message: file not found: /home/joshua/src/yottadb/YDBRust/src/context_api/tests.rs
  Code: -32603

Steps to reproduce: Check out https://gitlab.com/jyn514/YDBRust/-/commit/afd6e66c73030dff19e465d8493a4c2f247a6990, open src/context_api/tests.rs, then check out https://gitlab.com/jyn514/YDBRust/-/commit/cf544736b8366bdfd3dac7b472dfbbdcb61b14bb.

@lnicola
Copy link
Member

lnicola commented Feb 1, 2021

Duplicate of #7299.

@lnicola lnicola closed this as completed Feb 1, 2021
bors bot added a commit that referenced this issue Feb 5, 2021
7505: Widen Highlights root range to covering element r=Veykril a=Veykril

There have been a few issues about/containing spurious syntax highlighting panics, which all seem to come from the `rust_analyzer::handlers::handle_semantic_tokens_range` request, which I believe this to be the cause of as the text range we want to highlight here is currently potentially smaller than that of the covering element, so we might highlight something that is inside the covering element, but outside of the text range we wish to highlight causing the assert to fail.
Unfortunately this isn't really easy to test since I have yet to find a reproducible cause(#7504 doesn't work for me cause I can't seem to checkout the given commit).

See #7504, #7298, #7299 and #7416, all of those contain an assertion failure in syntax highlighting, but only in the range request.

Co-authored-by: Lukas Wirth <[email protected]>
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

2 participants