rust-lang / rust-lang/rust-analyzer

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

Open
#10,843 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-macro C-bug S-unactionable
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the attribute macro m example in a project outside the workspace, comparing local access with VS Code Remote SSH against the listed Rust Analyzer and Rust versions. Trace why the generated new method is available locally but not shown in remote intellisense; done means the remote view provides the same correct hint.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.