rust-lang / rust-analyzer

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

Request failed in remote development(vscode) #11139

Open rxda opened 2 years ago

rxda commented 2 years ago

I often get a "request failed" pop-up prompt in vscode remote development, and the completion and goto definition failed or always loading, but local development does not have this problem. I have tried v0.2.880 and v0.3.882 and had the same problem. The log is as follows

extension version: v0.2.880 and v0.3.882 rustc version: 1.57.0

v0.2.880 Rust Analyzer Language Server log

[Info  - 4:59:48 PM] Connection to server got closed. Server will restart.
[Error - 4:59:48 PM] Request textDocument/definition failed.
Error: Connection got disposed.
    at Object.dispose (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:29:4406)
    at Object.dispose (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:34:9492)
    at Bp.handleConnectionClosed (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:36:9144)
    at Bp.handleConnectionClosed (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:39:24418)
    at t (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:36:8852)
    at Cl.invoke (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:2:14424)
    at Xr.fire (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:2:15189)
    at vt (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:3:6159)
    at Cl.invoke (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:2:14424)
    at Xr.fire (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:2:15189)
    at ws.fireClose (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:2:17440)
    at Socket.<anonymous> (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:2:18992)
    at Socket.emit (events.js:327:22)
    at Pipe.<anonymous> (net.js:673:12)
[Error - 4:59:48 PM] Request textDocument/documentHighlight failed.
Error: Connection got disposed.
    at Object.dispose (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:29:4406)
    at Object.dispose (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:34:9492)
    at Bp.handleConnectionClosed (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:36:9144)
    at Bp.handleConnectionClosed (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:39:24418)
    at t (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:36:8852)
    at Cl.invoke (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:2:14424)
    at Xr.fire (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:2:15189)
    at vt (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:3:6159)
    at Cl.invoke (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:2:14424)
    at Xr.fire (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:2:15189)
    at ws.fireClose (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:2:17440)
    at Socket.<anonymous> (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:2:18992)
    at Socket.emit (events.js:327:22)
    at Pipe.<anonymous> (net.js:673:12)
[Error - 4:59:48 PM] Request textDocument/definition failed.
Error: Connection got disposed.
    at Object.dispose (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:29:4406)
    at Object.dispose (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:34:9492)
    at Bp.handleConnectionClosed (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:36:9144)
    at Bp.handleConnectionClosed (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:39:24418)
    at t (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:36:8852)
    at Cl.invoke (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:2:14424)
    at Xr.fire (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:2:15189)
    at vt (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:3:6159)
    at Cl.invoke (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:2:14424)
    at Xr.fire (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:2:15189)
    at ws.fireClose (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:2:17440)
    at Socket.<anonymous> (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:2:18992)
    at Socket.emit (events.js:327:22)
    at Pipe.<anonymous> (net.js:673:12)

v0.2.880 Rust Analyzer Client log

WARN [12/29/2021, 4:46:02 PM]: LSP request failed {
  method: 'rust-analyzer/inlayHints',
  param: {
    textDocument: {
      uri: 'file:///home/ubuntu/code/rust/geek-course/thumbor/src/main.rs'
    }
  },
  error: [Error: Connection got disposed.
    at Object.dispose (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:29:4406)
    at Object.dispose (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:34:9492)
    at Bp.handleConnectionClosed (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:36:9144)
    at Bp.handleConnectionClosed (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:39:24418)
    at t (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:36:8852)
    at Cl.invoke (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:2:14424)
    at Xr.fire (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:2:15189)
    at vt (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:3:6159)
    at Cl.invoke (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:2:14424)
    at Xr.fire (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:2:15189)
    at ws.fireClose (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:2:17440)
    at Socket.<anonymous> (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:2:18992)
    at Socket.emit (events.js:327:22)
    at Pipe.<anonymous> (net.js:673:12)]
}
INFO [12/29/2021, 4:55:01 PM]: Extension version: 0.2.880
INFO [12/29/2021, 4:55:01 PM]: Using configuration {
  cargoRunner: null,
  runnableEnv: null,
  inlayHints: {
    enable: true,
    smallerHints: true,
    chainingHints: true,
    maxLength: 25,
    parameterHints: true,
    typeHints: true,
    hideNamedConstructorHints: false
  },
  server: { path: null, extraEnv: null },
  trace: { server: 'off', extension: true },
  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 [12/29/2021, 4:55:01 PM]: PersistentState: { serverVersion: '0.2.880' }
INFO [12/29/2021, 4:55:01 PM]: Using server binary at /home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/server/rust-analyzer
DEBUG [12/29/2021, 4:55:01 PM]: Checking availability of a binary at /home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/server/rust-analyzer
DEBUG [12/29/2021, 4:55:01 PM]: /home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/server/rust-analyzer --version: {
  status: 0,
  signal: null,
  output: [ null, 'rust-analyzer 68319187d 2021-12-27 stable\n', '' ],
  pid: 128248,
  stdout: 'rust-analyzer 68319187d 2021-12-27 stable\n',
  stderr: ''
}
WARN [12/29/2021, 4:55:17 PM]: LSP request timed out {
  method: 'rust-analyzer/inlayHints',
  param: {
    textDocument: {
      uri: 'file:///home/ubuntu/code/rust/geek-course/thumbor/src/main.rs'
    }
  },
  error: [$i [Error]: canceled by client
    at Gt (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:4:223)
    at rn (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:3:6520)
    at Immediate.<anonymous> (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.2.880/out/main.js:3:6373)
    at processImmediate (internal/timers.js:461:21)] {
    code: -32800,
    data: undefined
  }
}

v0.3.882 Rust Analyzer Language Server log

[Error - 3:16:13 PM] Request textDocument/codeLens failed.
Error: Connection got disposed.
    at Object.dispose (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.3.882/out/main.js:29:4406)
    at Object.dispose (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.3.882/out/main.js:34:9492)
    at Bp.handleConnectionClosed (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.3.882/out/main.js:36:9144)
    at Bp.handleConnectionClosed (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.3.882/out/main.js:39:24418)
    at t (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.3.882/out/main.js:36:8852)
    at Cl.invoke (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.3.882/out/main.js:2:14424)
    at Xr.fire (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.3.882/out/main.js:2:15189)
    at vt (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.3.882/out/main.js:3:6159)
    at Cl.invoke (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.3.882/out/main.js:2:14424)
    at Xr.fire (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.3.882/out/main.js:2:15189)
    at ws.fireClose (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.3.882/out/main.js:2:17440)
    at Socket.<anonymous> (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.3.882/out/main.js:2:18992)
    at Socket.emit (events.js:327:22)
    at Pipe.<anonymous> (net.js:673:12)

v0.3.882 Rust Analyzer Client log

```prolog
INFO [12/29/2021, 3:01:02 PM]: Extension version: 0.3.882
INFO [12/29/2021, 3:01:02 PM]: Using configuration {
  cargoRunner: null,
  runnableEnv: null,
  inlayHints: {
    enable: true,
    smallerHints: true,
    chainingHints: true,
    maxLength: 25,
    parameterHints: true,
    typeHints: true,
    hideNamedConstructorHints: false
  },
  server: { path: null, extraEnv: null },
  trace: { server: 'off', extension: true },
  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 [12/29/2021, 3:01:02 PM]: PersistentState: { serverVersion: '0.3.882' }
INFO [12/29/2021, 3:01:02 PM]: Using server binary at /home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.3.882/server/rust-analyzer
DEBUG [12/29/2021, 3:01:02 PM]: Checking availability of a binary at /home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.3.882/server/rust-analyzer
DEBUG [12/29/2021, 3:01:02 PM]: /home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.3.882/server/rust-analyzer --version: {
  status: 0,
  signal: null,
  output: [ null, 'rust-analyzer 355a4bdb8 2021-12-29 nightly\n', '' ],
  pid: 114165,
  stdout: 'rust-analyzer 355a4bdb8 2021-12-29 nightly\n',
  stderr: ''
}
WARN [12/29/2021, 3:06:55 PM]: LSP request failed {
  method: 'rust-analyzer/inlayHints',
  param: {
    textDocument: {
      uri: 'file:///home/ubuntu/code/rust/geek-course/thumbor/src/main.rs'
    }
  },
  error: [Error: Connection got disposed.
    at Object.dispose (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.3.882/out/main.js:29:4406)
    at Object.dispose (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.3.882/out/main.js:34:9492)
    at Bp.handleConnectionClosed (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.3.882/out/main.js:36:9144)
    at Bp.handleConnectionClosed (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.3.882/out/main.js:39:24418)
    at t (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.3.882/out/main.js:36:8852)
    at Cl.invoke (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.3.882/out/main.js:2:14424)
    at Xr.fire (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.3.882/out/main.js:2:15189)
    at vt (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.3.882/out/main.js:3:6159)
    at Cl.invoke (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.3.882/out/main.js:2:14424)
    at Xr.fire (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.3.882/out/main.js:2:15189)
    at ws.fireClose (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.3.882/out/main.js:2:17440)
    at Socket.<anonymous> (/home/ubuntu/.vscode-server/extensions/matklad.rust-analyzer-0.3.882/out/main.js:2:18992)
    at Socket.emit (events.js:327:22)
    at Pipe.<anonymous> (net.js:673:12)]
}
rxda commented 2 years ago

And my local machine os is Mac Monterey, remote machine os is ubuntu 20.04

bjorn3 commented 2 years ago

Did you manage to fix the issue?

rxda commented 2 years ago

Did you manage to fix the issue?

No ,I just found the cause of the problem. In this workspace project, if I remove the thumbor from cargo.toml members, it works fine. If I add it back, analyzer keep crash, but thumbor can compile normally with cargo run/build

bjorn3 commented 2 years ago

I wonder if it is related to the prost proc macros in https://github.com/RXDA/geek-course/blob/main/thumbor/src/pb/abi.rs

rxda commented 2 years ago

I wonder if it is related to the prost proc macros in https://github.com/RXDA/geek-course/blob/main/thumbor/src/pb/abi.rs

After I removed pb/abi.rs and related code, analyzer works.

mtsr commented 2 years ago

I have a similar issue when remoting from Mac OS to Windows:

[Error - 17:10:04] Request textDocument/hover failed.
  Message: url is not a file
  Code: -32603 
WARN [17-2-2022 17:10:34]: LSP request failed {
  method: 'rust-analyzer/inlayHints',
  param: {
    textDocument: {
      uri: 'file:///Development/Burning%20Wheel/new-build-generator/src/main.rs'
    }
  },
  error: [fo [Error]: url is not a file
    at Yn (c:\Users\mtsr\.vscode-server\extensions\matklad.rust-analyzer-0.2.940\out\main.js:7:223)
    at Ln (c:\Users\mtsr\.vscode-server\extensions\matklad.rust-analyzer-0.2.940\out\main.js:6:6732)
    at Immediate.<anonymous> (c:\Users\mtsr\.vscode-server\extensions\matklad.rust-analyzer-0.2.940\out\main.js:6:6579)
    at processImmediate (internal/timers.js:461:21)] {
    code: -32603,
    data: undefined
  }
}

This is on a nearly empty project with just

[dependencies]
serde = "1.0.29"
serde_json = "1.0.11"
serde_derive = "1.0.29"
json = "0.12.4"
rxda commented 2 years ago

I have a similar issue when remoting from Mac OS to Windows:

[Error - 17:10:04] Request textDocument/hover failed.
  Message: url is not a file
  Code: -32603 
WARN [17-2-2022 17:10:34]: LSP request failed {
  method: 'rust-analyzer/inlayHints',
  param: {
    textDocument: {
      uri: 'file:///Development/Burning%20Wheel/new-build-generator/src/main.rs'
    }
  },
  error: [fo [Error]: url is not a file
      at Yn (c:\Users\mtsr\.vscode-server\extensions\matklad.rust-analyzer-0.2.940\out\main.js:7:223)
      at Ln (c:\Users\mtsr\.vscode-server\extensions\matklad.rust-analyzer-0.2.940\out\main.js:6:6732)
      at Immediate.<anonymous> (c:\Users\mtsr\.vscode-server\extensions\matklad.rust-analyzer-0.2.940\out\main.js:6:6579)
      at processImmediate (internal/timers.js:461:21)] {
    code: -32603,
    data: undefined
  }
}

This is on a nearly empty project with just

[dependencies]
serde = "1.0.29"
serde_json = "1.0.11"
serde_derive = "1.0.29"
json = "0.12.4"

maybe caused by space in uri path

mtsr commented 2 years ago

Removing the space doesn't help, unfortunately.

I changed the path to Development/bw/builds/src/main.rs, but still the same issue. Note that other projects within Development work fine.

Starting a completely new project, it works fine again. I'm going to try reproducing the issue.

I recreated the exact same project from scratch and have no issues. Seems like something was being cached that caused the issue to stay even after fixing the space in the uri.

McFacePunch commented 9 months ago

I have been having a similar issue as well, vscode on a mac, new project with less than 300 lines of code as well. I have to entirely restart vscode and cant simply restart the plugin.

Screenshot 2024-02-27 at 18 28 59

My cargo TOML

[dependencies]
axum = { version = "0.7", features = ["tokio"] }
axum-server = { version = "0.6", features = ["tls-rustls"] }
tokio = { version = "1", features = ["full"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
serde = { version = "1.0.197", features = ["derive"] }
clap = { version = "4.0", features = ["derive"] } 
serde_json = "1.0.114"
rustls = "0.22.2"
tokio-rustls = "0.25.0"
tower = "0.4.13"
tower-http = "0.5.2"
http-body-util = "0.1.0"