Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tell rust-analyzer to only look at **.rs files #20

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

hbina
Copy link

@hbina hbina commented Jan 22, 2023

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]

@MinusGix
Copy link
Member

MinusGix commented Jan 22, 2023

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)

@hbina
Copy link
Author

hbina commented Jan 22, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants