rust-lang / rust-analyzer

A Rust compiler front-end for IDEs
https://rust-analyzer.github.io/
Apache License 2.0
14.07k stars 1.57k forks source link

VS Code Remote SSH does not allow attribute macros to provide correct intellisense hints #10843

Open SyntheticGoop opened 2 years ago

SyntheticGoop commented 2 years ago

OS: Manjaro 21.2.0 (Linux Kernel 5.13.19-2) Remote OS: Fedora 32 (Container Image) (Proxmox 6 LXC Linux 5.4.143) VS Code: 1.62.3 Rust Analyzer: 0.3.827, nightly Rust (remote and local): 1.58.0-nightly (936f2600b 2021-11-22)

With the following macro:

use proc_macro::TokenStream;
use quote::quote;
use syn::{parse_macro_input, DeriveInput};

#[proc_macro_attribute]
pub fn m(_meta: TokenStream, input: TokenStream) -> TokenStream {
    let input = parse_macro_input!(input as DeriveInput);

    let ident = input.ident.clone();

    TokenStream::from(quote! {
        #input

        impl #ident {
            fn new(_: String) {}
        }
    })
}

When the macro is imported into another rust project (not workspace) on a local machine (files mounted via CIFS share) image

When accessed via VS Code Remote SSH image

Not particularly world ending for me, but thought I'd post here for anyone encountering this.

Veykril commented 2 years ago

Looks like we are unable to even resolve the proc-macro in your second screenshot(as the attribute coloring is white) so this isn't a macro problem most likely but possibly something with your setup?

SyntheticGoop commented 2 years ago

My guess is it's the way the remote ssh plugin interacts with the rust analyzer plugin since it works locally.