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

Disable rust-analyzer for a single file. #3660

Closed
XAMPPRocky opened this issue Mar 19, 2020 · 8 comments
Closed

Disable rust-analyzer for a single file. #3660

XAMPPRocky opened this issue Mar 19, 2020 · 8 comments

Comments

@XAMPPRocky
Copy link
Member

XAMPPRocky commented Mar 19, 2020

Hello, I've started trying out rust analyzer and minor annoyance is that I can't disable RLS on a per file basis. Tokei's codebase actually uses Rust mixed with handlebars for code generation, so RLS will never be able to correctly handle this file and I have a lot of errors whenever I'm editing.

It would be nice if I could set a modeline or similar comment or attribute inside the file itself to disable RLS for just that file.

Proposed Solution

// rust-analyzer: disable
@Veetaha
Copy link
Contributor

Veetaha commented Mar 20, 2020

@XAMPPRocky
Copy link
Member Author

@Veetaha Thank you, this seems to only configure it for my editor, but I'd like to check in this change in the repository so that it's the same for anyone opening that file, or if I open it from a different machine with a different configuration it is still disabled.

@lnicola
Copy link
Member

lnicola commented Mar 20, 2020

You can check in a Code configuration snippet under .vscode. Of course, it won't work for developers who use a different editor.

@XAMPPRocky
Copy link
Member Author

Yes, sorry, I should have mentioned I'm using Vim with coc.nvim. 😅

@Veetaha
Copy link
Contributor

Veetaha commented Mar 20, 2020

So, should we consider this issue resolved?

@XAMPPRocky XAMPPRocky changed the title Disable RLS for a single file. Disable rust-analyzer for a single file. Mar 20, 2020
@XAMPPRocky
Copy link
Member Author

@Veetaha Well not unless this is a wontfix, ideally there would be a way to disable (or configure) that is editor agnostic.

@Veetaha
Copy link
Contributor

Veetaha commented Mar 20, 2020

This do is editor agnostic, coc nvim does provide a way to pass this parameter

@lnicola
Copy link
Member

lnicola commented Jan 22, 2021

Editor-agnostic configuration is tracked in #6113, let's close this.

@lnicola lnicola closed this as completed Jan 22, 2021
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

No branches or pull requests

3 participants