Open ntn-x2 opened 2 years ago
Does this happen on any project for you, or only a specific one?
Not on any, but not on only one either. One of them is https://github.com/KILTprotocol/kilt-node.
AND, hovering over the following line https://github.com/KILTprotocol/kilt-node/blob/develop/pallets/attestation/src/lib.rs#L158=, seems to never reach the end. I had to cancel it by moving the cursor out of the hover area.
[DEBUG rust_analyzer::main_loop] handle_event(Request(Request { id: RequestId(I32(20)), method: "textDocument/hover", params: Object({"textDocument": Object({"uri": String("file:///home/antonio/Developer/mashnet-node/pallets/attestation/src/lib.rs")}), "position": Object({"line": Number(157), "character": Number(16)})}) }))
[DEBUG rust_analyzer::main_loop] handle_event(Notification(Notification { method: "$/cancelRequest", params: Object({"id": Number(20)}) }))
[Trace - 3:07:54 PM] Sending request 'textDocument/hover - (20)'.
Params: {
"textDocument": {
"uri": "file:///home/antonio/Developer/mashnet-node/pallets/attestation/src/lib.rs"
},
"position": {
"line": 157,
"character": 16
}
}
[Trace - 3:10:11 PM] Sending notification '$/cancelRequest'.
Params: {
"id": 20
}
[Trace - 3:10:11 PM] Received response 'textDocument/hover - (20)' in 137784ms. Request failed: canceled by client (-32800).
Last but not least, opening the following file results in the following log (which includes a queue that apparently never gets emptied, probably because one of the tasks is taking forever):
[DEBUG rust_analyzer::main_loop] handle_event(Notification { method: "textDocument/didOpen" })
[TRACE rust_analyzer::main_loop] updating notifications for [FileId(576)]
[DEBUG rust_analyzer::main_loop] handle_event(Request(Request { id: RequestId(I32(32)), method: "textDocument/documentSymbol", params: Object({"textDocument": Object({"uri": String("file:///home/antonio/Developer/mashnet-node/pallets/public-credentials/src/lib.rs")})}) }))
[DEBUG rust_analyzer::main_loop] handle_event(Request(Request { id: RequestId(I32(33)), method: "textDocument/codeAction", params: Object({"textDocument": Object({"uri": String("file:///home/antonio/Developer/mashnet-node/pallets/public-credentials/src/lib.rs")}), "range": Object({"start": Object({"line": Number(0), "character": Number(0)}), "end": Object({"line": Number(0), "character": Number(0)})}), "context": Object({"diagnostics": Array([]), "triggerKind": Number(2)})}) }))
[DEBUG rust_analyzer::main_loop] handle_event(Response { id: RequestId(I32(32)), error: None })
[DEBUG rust_analyzer::global_state] handled textDocument/documentSymbol - (32) in 445.97µs
[DEBUG rust_analyzer::main_loop] handle_event(Notification(Notification { method: "$/cancelRequest", params: Object({"id": Number(33)}) }))
[DEBUG rust_analyzer::main_loop] handle_event(Request(Request { id: RequestId(I32(34)), method: "textDocument/codeAction", params: Object({"textDocument": Object({"uri": String("file:///home/antonio/Developer/mashnet-node/pallets/public-credentials/src/lib.rs")}), "range": Object({"start": Object({"line": Number(180), "character": Number(4)}), "end": Object({"line": Number(180), "character": Number(102)})}), "context": Object({"diagnostics": Array([]), "triggerKind": Number(2)})}) }))
[DEBUG rust_analyzer::main_loop] handle_event(Request(Request { id: RequestId(I32(35)), method: "textDocument/foldingRange", params: Object({"textDocument": Object({"uri": String("file:///home/antonio/Developer/mashnet-node/pallets/public-credentials/src/lib.rs")})}) }))
[DEBUG rust_analyzer::main_loop] handle_event(Response { id: RequestId(I32(35)), error: None })
[DEBUG rust_analyzer::global_state] handled textDocument/foldingRange - (35) in 324.38µs
[DEBUG rust_analyzer::main_loop] handle_event(Notification(Notification { method: "$/cancelRequest", params: Object({"id": Number(34)}) }))
[DEBUG rust_analyzer::main_loop] handle_event(Request(Request { id: RequestId(I32(36)), method: "textDocument/codeAction", params: Object({"textDocument": Object({"uri": String("file:///home/antonio/Developer/mashnet-node/pallets/public-credentials/src/lib.rs")}), "range": Object({"start": Object({"line": Number(180), "character": Number(4)}), "end": Object({"line": Number(180), "character": Number(102)})}), "context": Object({"diagnostics": Array([]), "triggerKind": Number(2)})}) }))
[DEBUG rust_analyzer::main_loop] handle_event(Request(Request { id: RequestId(I32(37)), method: "textDocument/inlayHint", params: Object({"textDocument": Object({"uri": String("file:///home/antonio/Developer/mashnet-node/pallets/public-credentials/src/lib.rs")}), "range": Object({"start": Object({"line": Number(85), "character": Number(0)}), "end": Object({"line": Number(267), "character": Number(0)})})}) }))
[DEBUG rust_analyzer::main_loop] handle_event(Request(Request { id: RequestId(I32(38)), method: "textDocument/hover", params: Object({"textDocument": Object({"uri": String("file:///home/antonio/Developer/mashnet-node/pallets/public-credentials/src/lib.rs")}), "position": Object({"line": Number(204), "character": Number(45)})}) }))
[DEBUG rust_analyzer::main_loop] handle_event(Response { id: RequestId(I32(38)), error: None })
[DEBUG rust_analyzer::global_state] handled textDocument/hover - (38) in 737.57µs
[DEBUG rust_analyzer::main_loop] handle_event(Request(Request { id: RequestId(I32(39)), method: "textDocument/codeLens", params: Object({"textDocument": Object({"uri": String("file:///home/antonio/Developer/mashnet-node/pallets/public-credentials/src/lib.rs")})}) }))
[DEBUG rust_analyzer::main_loop] handle_event(Response { id: RequestId(I32(39)), error: None })
[DEBUG rust_analyzer::global_state] handled textDocument/codeLens - (39) in 24.82ms
[DEBUG rust_analyzer::main_loop] handle_event(Notification(Notification { method: "$/cancelRequest", params: Object({"id": Number(37)}) }))
[DEBUG rust_analyzer::main_loop] handle_event(Request(Request { id: RequestId(I32(40)), method: "textDocument/inlayHint", params: Object({"textDocument": Object({"uri": String("file:///home/antonio/Developer/mashnet-node/pallets/public-credentials/src/lib.rs")}), "range": Object({"start": Object({"line": Number(96), "character": Number(0)}), "end": Object({"line": Number(267), "character": Number(0)})})}) }))
[DEBUG rust_analyzer::main_loop] handle_event(Request(Request { id: RequestId(I32(41)), method: "codeLens/resolve", params: Object({"range": Object({"start": Object({"line": Number(197), "character": Number(9)}), "end": Object({"line": Number(197), "character": Number(15)})}), "data": Object({"references": Object({"textDocument": Object({"uri": String("file:///home/antonio/Developer/mashnet-node/pallets/public-credentials/src/lib.rs")}), "position": Object({"line": Number(197), "character": Number(9)})})})}) }))
[DEBUG rust_analyzer::main_loop] handle_event(Request(Request { id: RequestId(I32(42)), method: "codeLens/resolve", params: Object({"range": Object({"start": Object({"line": Number(218), "character": Number(9)}), "end": Object({"line": Number(218), "character": Number(24)})}), "data": Object({"references": Object({"textDocument": Object({"uri": String("file:///home/antonio/Developer/mashnet-node/pallets/public-credentials/src/lib.rs")}), "position": Object({"line": Number(218), "character": Number(9)})})})}) }))
[INFO rust_analyzer::main_loop] task queue len: 1
[DEBUG rust_analyzer::main_loop] handle_event(Request(Request { id: RequestId(I32(43)), method: "textDocument/codeLens", params: Object({"textDocument": Object({"uri": String("file:///home/antonio/Developer/mashnet-node/pallets/public-credentials/src/lib.rs")})}) }))
[DEBUG rust_analyzer::main_loop] handle_event(Response { id: RequestId(I32(43)), error: None })
[DEBUG rust_analyzer::global_state] handled textDocument/codeLens - (43) in 44.32ms
[DEBUG rust_analyzer::main_loop] handle_event(Notification(Notification { method: "$/cancelRequest", params: Object({"id": Number(36)}) }))
[DEBUG rust_analyzer::main_loop] handle_event(Request(Request { id: RequestId(I32(44)), method: "textDocument/codeAction", params: Object({"textDocument": Object({"uri": String("file:///home/antonio/Developer/mashnet-node/pallets/public-credentials/src/lib.rs")}), "range": Object({"start": Object({"line": Number(210), "character": Number(90)}), "end": Object({"line": Number(210), "character": Number(90)})}), "context": Object({"diagnostics": Array([]), "triggerKind": Number(2)})}) }))
[DEBUG rust_analyzer::main_loop] handle_event(Request(Request { id: RequestId(I32(45)), method: "textDocument/inlayHint", params: Object({"textDocument": Object({"uri": String("file:///home/antonio/Developer/mashnet-node/pallets/public-credentials/src/lib.rs")}), "range": Object({"start": Object({"line": Number(96), "character": Number(0)}), "end": Object({"line": Number(267), "character": Number(0)})})}) }))
[INFO rust_analyzer::main_loop] task queue len: 1
[DEBUG rust_analyzer::main_loop] handle_event(Notification(Notification { method: "$/cancelRequest", params: Object({"id": Number(41)}) }))
[INFO rust_analyzer::main_loop] task queue len: 1
[DEBUG rust_analyzer::main_loop] handle_event(Notification(Notification { method: "$/cancelRequest", params: Object({"id": Number(42)}) }))
[INFO rust_analyzer::main_loop] task queue len: 1
[DEBUG rust_analyzer::main_loop] handle_event(Request(Request { id: RequestId(I32(46)), method: "codeLens/resolve", params: Object({"range": Object({"start": Object({"line": Number(197), "character": Number(9)}), "end": Object({"line": Number(197), "character": Number(15)})}), "data": Object({"references": Object({"textDocument": Object({"uri": String("file:///home/antonio/Developer/mashnet-node/pallets/public-credentials/src/lib.rs")}), "position": Object({"line": Number(197), "character": Number(9)})})})}) }))
[INFO rust_analyzer::main_loop] task queue len: 1
[DEBUG rust_analyzer::main_loop] handle_event(Request(Request { id: RequestId(I32(47)), method: "codeLens/resolve", params: Object({"range": Object({"start": Object({"line": Number(218), "character": Number(9)}), "end": Object({"line": Number(218), "character": Number(24)})}), "data": Object({"references": Object({"textDocument": Object({"uri": String("file:///home/antonio/Developer/mashnet-node/pallets/public-credentials/src/lib.rs")}), "position": Object({"line": Number(218), "character": Number(9)})})})}) }))
[INFO rust_analyzer::main_loop] task queue len: 2
[DEBUG rust_analyzer::main_loop] handle_event(Notification { method: "textDocument/didChange" })
[INFO rust_analyzer::main_loop] task queue len: 3
[TRACE rust_analyzer::main_loop] updating notifications for [FileId(576)]
[WARN rust_analyzer::main_loop] overly long loop turn: 416.357349ms
[DEBUG rust_analyzer::main_loop] handle_event(Notification(Notification { method: "$/cancelRequest", params: Object({"id": Number(44)}) }))
[DEBUG rust_analyzer::main_loop] handle_event(Retry(Request { id: RequestId(I32(41)), method: "codeLens/resolve", params: Object({"range": Object({"start": Object({"line": Number(197), "character": Number(9)}), "end": Object({"line": Number(197), "character": Number(15)})}), "data": Object({"references": Object({"textDocument": Object({"uri": String("file:///home/antonio/Developer/mashnet-node/pallets/public-credentials/src/lib.rs")}), "position": Object({"line": Number(197), "character": Number(9)})})})}) }))
[DEBUG rust_analyzer::main_loop] handle_event(Request(Request { id: RequestId(I32(48)), method: "textDocument/foldingRange", params: Object({"textDocument": Object({"uri": String("file:///home/antonio/Developer/mashnet-node/pallets/public-credentials/src/lib.rs")})}) }))
[INFO rust_analyzer::main_loop] task queue len: 11
[DEBUG rust_analyzer::main_loop] handle_event(Request(Request { id: RequestId(I32(49)), method: "textDocument/codeLens", params: Object({"textDocument": Object({"uri": String("file:///home/antonio/Developer/mashnet-node/pallets/public-credentials/src/lib.rs")})}) }))
[INFO rust_analyzer::main_loop] task queue len: 11
[DEBUG rust_analyzer::main_loop] handle_event(Request(Request { id: RequestId(I32(50)), method: "textDocument/documentSymbol", params: Object({"textDocument": Object({"uri": String("file:///home/antonio/Developer/mashnet-node/pallets/public-credentials/src/lib.rs")})}) }))
[INFO rust_analyzer::main_loop] task queue len: 12
[DEBUG rust_analyzer::main_loop] handle_event(Response(Response { id: RequestId(I32(21)), result: None, error: None }))
[INFO rust_analyzer::main_loop] task queue len: 13
[DEBUG rust_analyzer::main_loop] handle_event(Response(Response { id: RequestId(I32(22)), result: None, error: None }))
[INFO rust_analyzer::main_loop] task queue len: 13
[DEBUG rust_analyzer::main_loop] handle_event(Notification(Notification { method: "$/cancelRequest", params: Object({"id": Number(49)}) }))
[INFO rust_analyzer::main_loop] task queue len: 5
[DEBUG rust_analyzer::main_loop] handle_event(Request(Request { id: RequestId(I32(51)), method: "textDocument/codeLens", params: Object({"textDocument": Object({"uri": String("file:///home/antonio/Developer/mashnet-node/pallets/public-credentials/src/lib.rs")})}) }))
[INFO rust_analyzer::main_loop] task queue len: 5
[DEBUG rust_analyzer::main_loop] handle_event(Notification(Notification { method: "$/cancelRequest", params: Object({"id": Number(48)}) }))
[INFO rust_analyzer::main_loop] task queue len: 6
[DEBUG rust_analyzer::main_loop] handle_event(Notification { method: "textDocument/didChange" })
[INFO rust_analyzer::main_loop] task queue len: 6
[TRACE rust_analyzer::main_loop] updating notifications for [FileId(576)]
[DEBUG rust_analyzer::main_loop] handle_event(Retry(Request { id: RequestId(I32(11)), method: "textDocument/inlayHint", params: Object({"textDocument": Object({"uri": String("file:///home/antonio/Developer/mashnet-node/pallets/attestation/src/lib.rs")}), "range": Object({"start": Object({"line": Number(242), "character": Number(0)}), "end": Object({"line": Number(451), "character": Number(0)})})}) }))
[DEBUG rust_analyzer::main_loop] handle_event(Response(Response { id: RequestId(I32(23)), result: None, error: None }))
[INFO rust_analyzer::main_loop] task queue len: 6
[DEBUG rust_analyzer::main_loop] handle_event(Response { id: RequestId(I32(48)), error: None })
[INFO rust_analyzer::main_loop] task queue len: 5
[DEBUG rust_analyzer::main_loop] handle_event(Response { id: RequestId(I32(50)), error: None })
[INFO rust_analyzer::main_loop] task queue len: 4
[DEBUG rust_analyzer::global_state] handled textDocument/documentSymbol - (50) in 325.06ms
[DEBUG rust_analyzer::main_loop] handle_event(Response(Response { id: RequestId(I32(24)), result: None, error: None }))
[INFO rust_analyzer::main_loop] task queue len: 4
[DEBUG rust_analyzer::main_loop] handle_event(Request(Request { id: RequestId(I32(52)), method: "textDocument/documentSymbol", params: Object({"textDocument": Object({"uri": String("file:///home/antonio/Developer/mashnet-node/pallets/public-credentials/src/lib.rs")})}) }))
[INFO rust_analyzer::main_loop] task queue len: 4
[DEBUG rust_analyzer::main_loop] handle_event(Response { id: RequestId(I32(51)), error: None })
[INFO rust_analyzer::main_loop] task queue len: 4
[DEBUG rust_analyzer::global_state] handled textDocument/codeLens - (51) in 164.78ms
[DEBUG rust_analyzer::main_loop] handle_event(Response { id: RequestId(I32(49)), error: None })
[INFO rust_analyzer::main_loop] task queue len: 3
[DEBUG rust_analyzer::main_loop] handle_event(Request(Request { id: RequestId(I32(53)), method: "textDocument/foldingRange", params: Object({"textDocument": Object({"uri": String("file:///home/antonio/Developer/mashnet-node/pallets/public-credentials/src/lib.rs")})}) }))
[INFO rust_analyzer::main_loop] task queue len: 3
[DEBUG rust_analyzer::main_loop] handle_event(Request(Request { id: RequestId(I32(54)), method: "textDocument/codeLens", params: Object({"textDocument": Object({"uri": String("file:///home/antonio/Developer/mashnet-node/pallets/public-credentials/src/lib.rs")})}) }))
[INFO rust_analyzer::main_loop] task queue len: 4
[DEBUG rust_analyzer::main_loop] handle_event(Request(Request { id: RequestId(I32(55)), method: "textDocument/codeAction", params: Object({"textDocument": Object({"uri": String("file:///home/antonio/Developer/mashnet-node/pallets/public-credentials/src/lib.rs")}), "range": Object({"start": Object({"line": Number(210), "character": Number(90)}), "end": Object({"line": Number(210), "character": Number(90)})}), "context": Object({"diagnostics": Array([]), "triggerKind": Number(2)})}) }))
[INFO rust_analyzer::main_loop] task queue len: 5
[DEBUG rust_analyzer::main_loop] handle_event(Notification(Notification { method: "$/cancelRequest", params: Object({"id": Number(45)}) }))
[INFO rust_analyzer::main_loop] task queue len: 6
[DEBUG rust_analyzer::main_loop] handle_event(Request(Request { id: RequestId(I32(56)), method: "textDocument/inlayHint", params: Object({"textDocument": Object({"uri": String("file:///home/antonio/Developer/mashnet-node/pallets/public-credentials/src/lib.rs")}), "range": Object({"start": Object({"line": Number(96), "character": Number(0)}), "end": Object({"line": Number(267), "character": Number(0)})})}) }))
[INFO rust_analyzer::main_loop] task queue len: 6
After trying out different settings to make sure that the extensions is usable in VSCode, I arrived to the following solution which seems decent enough for now (few logs enable to understand what is going on):
Now I noticed that there are few operations which get added to the queue even with no interaction with VSCode from my side, but apparently never get resolved, hence the queue always have a number of items that is > 0, and only increasing.
rust-analyzer version: v0.3.1091 (366bd7242 2022-06-12)
rustc version: 1.61.0 (fe5b13d68 2022-05-18)
This is part of the output I get: