Rust: Difference between revisions

(fix links)
(Remove Neovim Completion Section. This section references racer, which hasn't been relevant for rust autocomplete in years now (the last commit on the project was 2 years ago). It's also not a valid, working snippet - nor does it configure neovim in a way you'd expect.)
Line 250: Line 250:


You can use the [https://marketplace.visualstudio.com/items?itemName=arrterian.nix-env-selector arrterian.nix-env-selector] extension to enable your nix-shell inside VSCode and have these settings picked up by other extensions.
You can use the [https://marketplace.visualstudio.com/items?itemName=arrterian.nix-env-selector arrterian.nix-env-selector] extension to enable your nix-shell inside VSCode and have these settings picked up by other extensions.
=== Neovim Completion ===
Racer completion can be configured using the following snippet:
<syntaxHighlight lang="nix">
(neovim.override {
  configure = {
    customRC = ''
      if filereadable($HOME . "/.vimrc")
        source ~/.vimrc
      endif
      let $RUST_SRC_PATH = '${stdenv.mkDerivation {
        inherit (rustc) src;
        inherit (rustc.src) name;
        phases = ["unpackPhase" "installPhase"];
        installPhase = ''cp -r library $out'';
      }}'
    '';
    packages.nixbundle.start = with vimPlugins; [
      nvim-completion-manager
      nvim-cm-racer
    ];
  };
})
</syntaxHighlight>


== FAQ ==
== FAQ ==