Skip to content

Commit

Permalink
Add panic context for server vfs.file_contents call
Browse files Browse the repository at this point in the history
Summary:
We are getting some panics around it, try to understand what is going on.
First step is to isolate which call is the problem.

Reviewed By: robertoaloi

Differential Revision: D55417318

fbshipit-source-id: 273a88696a89bc6c15f6922f0dcbab6f61f6a979
  • Loading branch information
alanz authored and facebook-github-bot committed Mar 27, 2024
1 parent 141baa4 commit db161fc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions crates/elp/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,11 @@ impl Server {
};
let mut vfs = this.vfs.write();
let file_id = vfs.file_id(&path).unwrap();
// Temporary for T183487471
let _pctx = stdx::panic_context::enter(format!(
"\nserver::DidChangeTextDocument:{:?}:{}\n",
&file_id, &path
));
let mut document = Document::from_bytes(vfs.file_contents(file_id).to_vec());
document.apply_changes(params.content_changes);

Expand Down Expand Up @@ -775,6 +780,11 @@ impl Server {

for file in &changed_files {
if file.exists() {
// Temporary for T183487471
let _pctx = stdx::panic_context::enter(format!(
"\nserver::process_changes_to_vfs_store:{:?}:{:?}",
&file.file_id, &file.change_kind
));
let bytes = vfs.file_contents(file.file_id).to_vec();
let document = Document::from_bytes(bytes);
let (text, line_ending) = LineEndings::normalize(document.content);
Expand Down

0 comments on commit db161fc

Please sign in to comment.