Local configuratoin for rust-analyzer

I read the user manual and try to find out where to put my local configuration of the project, can any one tell me about that ?

usually you don't invoke the rust-analyzer LSP server directly, it depends on what editor (or what LSP client, to be more precise) you are using.

for vscode, you can put your configurations into the workspace settings:

  • stored in .vscode/settings.json located at root directory for common cases (there's an implicit workspace when you open a directory in vscode)
  • stored in .code-workspace for multi-root workspace senarios.

I'm not familiar with other editors, but most editors support some form of "per directory config", for examle, emacs will load the .dir-locals.el file if exists.

1 Like