On an ArchLinux based distro, I have installed Visual Studio Code, I have installed the Rust extension, I installed Rust via this command sudo pacman -S rust and it installed fine, cargo works fine, I can even compile the code just fine. But vscode doesn't seem to recognise that Rustup is installed. Is there a way to fix this?
The easiest/best way is to uninstall the distro package and install rustup instead. RLS and rust-analyzer depend on additional components besides the compiler, and rustup is the supported way to install those components.
Remove the rust package, make sure you have a rustup toolchain installed (e.g. rustup default stable), and make sure that ~/.cargo/bin is in your PATH.
If you get errors, please paste the full error message here.
Rustup manages toolchains in your home dir at ~/.rustup. When you install rustup for your user, it will automatically install a default toolchain. When you install rustup globally using your package manager it can't install a default toolchain, as it doesn't know for which user it should install one.
Arch is annoying when it comes to rust because any packages you install with pacman or an AUR helper that require rustc or cargo will not recognize the installation done with rustup. This has been true for me even though both rustc and cargo are in my PATH. What I do is just let pacman (or your AUR helper) install the distro version of rustc and then uninstall it afterwards, keeping the version from rustup. I have encountered this on 3 separate installs of Arch and Manjaro.