mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
check cancellation when expanding macros
This commit is contained in:
parent
0d2f97e83e
commit
a2845bb1f5
@ -61,6 +61,7 @@ impl HirFileId {
|
||||
db: &impl DefDatabase,
|
||||
file_id: HirFileId,
|
||||
) -> Option<TreeArc<SyntaxNode>> {
|
||||
db.check_canceled();
|
||||
let _p = profile("parse_or_expand_query");
|
||||
match file_id.0 {
|
||||
HirFileIdRepr::File(file_id) => Some(db.parse(file_id).syntax().to_owned()),
|
||||
|
@ -365,7 +365,6 @@ fn main() {{}}
|
||||
librs, libs
|
||||
));
|
||||
server.wait_until_workspace_is_loaded();
|
||||
eprintln!("workspace loaded");
|
||||
for i in 0..10 {
|
||||
server.notification::<DidOpenTextDocument>(DidOpenTextDocumentParams {
|
||||
text_document: TextDocumentItem {
|
||||
@ -376,7 +375,6 @@ fn main() {{}}
|
||||
},
|
||||
});
|
||||
}
|
||||
eprintln!("docs opened");
|
||||
let start = std::time::Instant::now();
|
||||
server.request::<OnEnter>(
|
||||
TextDocumentPositionParams {
|
||||
@ -407,5 +405,6 @@ fn main() {{}}
|
||||
}
|
||||
}),
|
||||
);
|
||||
eprintln!("handled: {:?}", start.elapsed());
|
||||
let elapsed = start.elapsed();
|
||||
assert!(elapsed.as_millis() < 2000, "typing enter took {:?}", elapsed);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user