check cancellation when expanding macros

This commit is contained in:
Aleksey Kladov 2019-05-27 14:41:14 +03:00
parent 0d2f97e83e
commit a2845bb1f5
2 changed files with 3 additions and 3 deletions

View File

@ -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()),

View File

@ -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);
}