lapce-rust
lapce-rust copied to clipboard
Tell rust-analyzer to only look at **.rs files
This will fix an issue when trying to open the log file with the rust plugin installed. It causes a loop of error -> log -> error
[2023-01-22][12:16:06][lapce_data::proxy][ERROR] lsp server stderr: [ERROR rust_analyzer::main_loop] unexpected DidChangeTextDocument: /home/hbina/.local/share/lapce-stable/logs/20230122-121351.log
[2023-01-22][12:16:06][lapce_data::proxy][ERROR] lsp server stderr: [ERROR rust_analyzer::main_loop] unexpected DidChangeTextDocument: /home/hbina/.local/share/lapce-stable/logs/20230122-121351.log
[2023-01-22][12:16:06][lapce_data::proxy][ERROR] lsp server stderr: [ERROR rust_analyzer::main_loop] unexpected DidChangeTextDocument: /home/hbina/.local/share/lapce-stable/logs/20230122-121351.log
[2023-01-22][12:16:06][lapce_data::proxy][ERROR] lsp server stderr: [ERROR rust_analyzer::main_loop] unexpected DidChangeTextDocument: /home/hbina/.local/share/lapce-stable/logs/20230122-121351.log
[2023-01-22][12:16:06][lapce_data::proxy][ERROR] lsp server stderr: [ERROR rust_analyzer::main_loop] unexpected DidChangeTextDocument: /home/hbina/.local/share/lapce-stable/logs/20230122-121351.log
[2023-01-22][12:16:06][lapce_data::proxy][ERROR] lsp server stderr: [ERROR rust_analyzer::main_loop] unexpected DidChangeTextDocument: /home/hbina/.local/share/lapce-stable/logs/20230122-121351.log
[2023-01-22][12:16:06][lapce_data::proxy][ERROR] lsp server stderr: [ERROR rust_analyzer::main_loop] unexpected DidChangeTextDocument: /home/hbina/.local/share/lapce-stable/logs/20230122-121351.log
[2023-01-22][12:16:06][lapce_data::proxy][ERROR] lsp server stderr: [ERROR rust_analyzer::main_loop] unexpected DidChangeTextDocument: /home/hbina/.local/share/lapce-stable/logs/20230122-121351.log
[2023-01-22][12:16:06][lapce_data::proxy][ERROR] lsp server stderr: [ERROR rust_analyzer::main_loop] unexpected DidChangeTextDocument: /home/hbina/.local/share/lapce-stable/logs/20230122-121351.log
[2023-01-22][12:16:06][lapce_data::proxy][ERROR] lsp server stderr: [ERROR rust_analyzer::main_loop] unexpected DidChangeTextDocument: /home/hbina/.local/share/lapce-stable/logs/20230122-121351.log
[2023-01-22][12:16:06][lapce_data::proxy][ERROR] lsp server stderr: [ERROR rust_analyzer::main_loop] unexpected DidChangeTextDocument: /home/hbina/.local/share/lapce-stable/logs/20230122-121351.log
[2023-01-22][12:16:06][lapce_data::proxy][ERROR] lsp server stderr: [ERROR rust_analyzer::main_loop] unexpected DidChangeTextDocument: /home/hbina/.local/share/lapce-stable/logs/20230122-121351.log
[2023-01-22][12:16:06][lapce_data::proxy][ERROR] lsp server stderr: [ERROR rust_analyzer::main_loop] unexpected DidChangeTextDocument: /home/hbina/.local/share/lapce-stable/logs/20230122-121351.log
[2023-01-22][12:16:06][lapce_data::proxy][ERROR] lsp server stderr: [ERROR rust_analyzer::main_loop] unexpected DidChangeTextDocument: /home/hbina/.local/share/lapce-stable/logs/20230122-121351.log
[2023-01-22][12:16:06][lapce_data::proxy][ERROR] lsp server stderr: [ERROR rust_analyzer::main_loop] unexpected DidChangeTextDocument: /home/hbina/.local/share/lapce-stable/logs/20230122-121351.log
[2023-01-22][12:16:06][lapce_data::proxy][ERROR] lsp server stderr: [ERROR rust_analyzer::main_loop] unexpected DidChangeTextDocument: /home/hbina/.local/share/lapce-stable/logs/20230122-121351.log
[2023-01-22][12:16:06][lapce_data::proxy][ERROR] lsp server stderr: [ERROR rust_analyzer::main_loop] unexpected DidChangeTextDocument: /home/hbina/.local/share/lapce-stable/logs/20230122-121351.log
[2023-01-22][12:16:06][lapce_data::proxy][ERROR] lsp server stderr: [ERROR rust_analyzer::main_loop] unexpected DidChangeTextDocument: /home/hbina/.local/share/lapce-stable/logs/20230122-121351.log
[2023-01-22][12:16:06][lapce_data::proxy][ERROR] lsp server stderr: [ERROR rust_analyzer::main_loop] unexpected DidChangeTextDocument: /home/hbina/.local/share/lapce-stable/logs/20230122-121351.log
[2023-01-22][12:16:06][lapce_data::proxy][ERROR] lsp server stderr: [ERROR rust_analyzer::main_loop] unexpected DidChangeTextDocument: /home/hbina/.local/share/lapce-stable/logs/20230122-121351.log
Signed-off-by: Hanif Bin Ariffin [email protected]
It might also want Cargo.toml files and the like too? (I'm not too sure if your change would block that, but I'd suggest testing whether saving a Cargo.toml file - with a new dependency or whatever - causes RA to analyze based on that)
You are right. RA should refresh its state whenever Cargo.toml
is edited so we should also pattern match for Cargo.toml
. I checked the official RA plugin for VSCode and it seems to not use any patterns at all?
https://github.com/rust-lang/rust-analyzer/blob/master/editors/code/src/client.ts#L75