Rust analyzer intellisense/autocomplete for vscode not working

On basic projects r-a works fine but with a larger project (GitHub - paritytech/substrate-archive: Blockchain Indexing Engine) it breaks down and refuses to do any intellisense (will only give string hints). Note that the type hints are still working fine which means that r-a is running. when checking the r-a logs it gives me timeout errors but the r-a language server trace is always empty.

Here is the r-a client output, and as mentioned the r-a server trace is completely empty

INFO [23/12/2021, 10:54:33 am]: Extension version: 0.3.872
INFO [23/12/2021, 10:54:33 am]: Using configuration {
  cargoRunner: null,
  runnableEnv: null,
  inlayHints: {
    enable: true,
    smallerHints: true,
    chainingHints: true,
    maxLength: 25,
    parameterHints: true,
    typeHints: true,
    hideNamedConstructorHints: false
  },
  updates: { channel: 'stable', askBeforeDownload: false },
  server: { path: null, extraEnv: null },
  trace: { server: 'off', extension: false },
  debug: {
    engine: 'auto',
    sourceFileMap: {
      '/rustc/<id>': '${env:USERPROFILE}/.rustup/toolchains/<toolchain-id>/lib/rustlib/src/rust'
    },
    openDebugPane: false,
    engineSettings: {}
  },
  assist: {
    importGranularity: 'crate',
    importEnforceGranularity: false,
    importPrefix: 'plain',
    importGroup: true,
    allowMergingIntoGlobImports: true
  },
  cache: { warmup: true },
  callInfo: { full: true },
  cargo: {
    autoreload: true,
    allFeatures: false,
    unsetTest: [ 'core' ],
    features: [],
    runBuildScripts: true,
    useRustcWrapperForBuildScripts: true,
    noDefaultFeatures: false,
    target: null,
    noSysroot: false
  },
  checkOnSave: {
    enable: true,
    allFeatures: null,
    allTargets: true,
    command: 'check',
    noDefaultFeatures: null,
    target: null,
    extraArgs: [],
    features: null,
    overrideCommand: null
  },
  completion: {
    addCallArgumentSnippets: true,
    addCallParenthesis: true,
    snippets: {
      'Arc::new': {
        postfix: 'arc',
        body: 'Arc::new(${receiver})',
        requires: 'std::sync::Arc',
        description: 'Put the expression into an `Arc`',
        scope: 'expr'
      },
      'Rc::new': {
        postfix: 'rc',
        body: 'Rc::new(${receiver})',
        requires: 'std::rc::Rc',
        description: 'Put the expression into an `Rc`',
        scope: 'expr'
      },
      'Box::pin': {
        postfix: 'pinbox',
        body: 'Box::pin(${receiver})',
        requires: 'std::boxed::Box',
        description: 'Put the expression into a pinned `Box`',
        scope: 'expr'
      },
      Ok: {
        postfix: 'ok',
        body: 'Ok(${receiver})',
        description: 'Wrap the expression in a `Result::Ok`',
        scope: 'expr'
      },
      Err: {
        postfix: 'err',
        body: 'Err(${receiver})',
        description: 'Wrap the expression in a `Result::Err`',
        scope: 'expr'
      },
      Some: {
        postfix: 'some',
        body: 'Some(${receiver})',
        description: 'Wrap the expression in an `Option::Some`',
        scope: 'expr'
      }
    },
    postfix: { enable: true },
    autoimport: { enable: true },
    autoself: { enable: true }
  },
  diagnostics: {
    enable: true,
    enableExperimental: true,
    disabled: [],
    remapPrefix: {},
    warningsAsHint: [],
    warningsAsInfo: []
  },
  experimental: { procAttrMacros: true },
  files: { watcher: 'client', excludeDirs: [] },
  highlightRelated: {
    references: true,
    exitPoints: true,
    breakPoints: true,
    yieldPoints: true
  },
  highlighting: { strings: true },
  hover: { documentation: true, linksInHover: true },
  hoverActions: {
    debug: true,
    enable: true,
    gotoTypeDef: true,
    implementations: true,
    references: false,
    run: true
  },
  joinLines: {
    joinElseIf: true,
    removeTrailingComma: true,
    unwrapTrivialBlock: true,
    joinAssignments: true
  },
  lens: {
    debug: true,
    enable: true,
    implementations: true,
    run: true,
    methodReferences: false,
    references: false,
    enumVariantReferences: false,
    forceCustomCommands: true
  },
  linkedProjects: [],
  lruCapacity: null,
  notifications: { cargoTomlNotFound: true },
  procMacro: { enable: true, server: null },
  runnables: { overrideCargo: null, cargoExtraArgs: [] },
  rustcSource: null,
  rustfmt: {
    extraArgs: [],
    overrideCommand: null,
    enableRangeFormatting: false
  },
  workspace: { symbol: { search: { scope: 'workspace', kind: 'only_types' } } }
}
INFO [23/12/2021, 10:54:33 am]: PersistentState: {
  lastCheck: undefined,
  nightlyReleaseId: undefined,
  serverVersion: '0.2.853'
}
INFO [23/12/2021, 10:54:34 am]: Using server binary at /home/wqsz7xn/.vscode/extensions/matklad.rust-analyzer-0.3.872/server/rust-analyzer
WARN [23/12/2021, 10:55:10 am]: LSP request timed out {
  method: 'rust-analyzer/inlayHints',
  param: {
    textDocument: {
      uri: 'file:///home/wqsz7xn/Desktop/substrate-archive/substrate-archive/src/actors/workers/database.rs'
    }
  },
  error: Ca [Error]: content modified
      at gr (/home/wqsz7xn/.vscode/extensions/matklad.rust-analyzer-0.3.872/out/main.js:4:223)
      at Or (/home/wqsz7xn/.vscode/extensions/matklad.rust-analyzer-0.3.872/out/main.js:3:6574)
      at Immediate.<anonymous> (/home/wqsz7xn/.vscode/extensions/matklad.rust-analyzer-0.3.872/out/main.js:3:6424)
      at processImmediate (internal/timers.js:461:21) {
    code: -32801,
    data: undefined
  }
}
WARN [23/12/2021, 10:55:10 am]: LSP request timed out {
  method: 'rust-analyzer/inlayHints',
  param: {
    textDocument: {
      uri: 'file:///home/wqsz7xn/Desktop/substrate-archive/substrate-archive/src/actors.rs'
    }
  },
  error: Ca [Error]: content modified
      at gr (/home/wqsz7xn/.vscode/extensions/matklad.rust-analyzer-0.3.872/out/main.js:4:223)
      at Or (/home/wqsz7xn/.vscode/extensions/matklad.rust-analyzer-0.3.872/out/main.js:3:6574)
      at Immediate.<anonymous> (/home/wqsz7xn/.vscode/extensions/matklad.rust-analyzer-0.3.872/out/main.js:3:6424)
      at processImmediate (internal/timers.js:461:21) {
    code: -32801,
    data: undefined
  }
}

using vscode 1.63.2 with r-a v0.3.872 (prerelease from vscode marketplace)

No intellisense provided:


I think that's all the information that I can give, let me know if there's anything I missed. Thanks

Are you typing inside an attributed function? If yes try and see if it also fails to do completions if you remove the attribute. If it works without the attribute then that is a known issue.

If there is no attribute involved, do completions appear if you manually invoke them(ctrl + space by default)?

Ah the method that I'm tying in includes attribute for async_trait. I'll try in some methods that don't have an attribute

Thank you for the help that works! I can temporarily remove the trait for intellisense and comment it back in when i need to compile

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.