title: Vscode rust-analyser plugin, on macOS; failing to load workspace due to permission denied
body: <p><strong>Goal</strong></p>
  <p>I'm trying to setup Visual Studio Code(vscode) on macOS for rust development.
  I had my setup working, using the official rust extension, but it wasn't always consistent.
  I saw that the rust-analyzer extension could provide a better experience.</p>
  <p><strong>Problem</strong></p>
  <p>Now that I have installed the extension, It keep throwing the following error:</p>
  <pre><code>rust-analyzer failed to load workspace: &quot;/Users/michaelbailey/.cargo&quot; &quot;--version&quot; failed: Permission denied (os error 13)
  </code></pre>
  <p>From my understanding, the plugin is trying to execute the .cargo folder rather than cargo itself.</p>
  <p>running</p>
  <pre><code>$ /Users/michaelbailey/.cargo --version  
  zsh: permission denied: /Users/michaelbailey/.cargo
  </code></pre>
  <p>instead of</p>
  <pre><code>$ /Users/michaelbailey/.cargo/bin/cargo --version 
  cargo 1.61.0 (a028ae42f 2022-04-29)
  </code></pre>
  <p>This is causing rust analyser to fail loading any project.</p>
  <p><strong>What i have tried</strong></p>
  <ul>
  <li>Reinstalling the Rust-analyzer extension.</li>
  <li>Disabling other rust based plugins.</li>
  <li>Switching to the pre-release version.</li>
  <li>reinstalling rust from the rust website.</li>
  <li>clearing all rust settings.</li>
  <li>creating a new project to test if my project was misconfigured somehow.</li>
  </ul>
  <p><strong>what i need help with</strong></p>
  <ul>
  <li>finding out a way to config rust-analyzer to point to the right file.</li>
  <li>another way to resolve rust-analyzer.</li>
  </ul>
  <p>Any help or pointers on the matter would be greatly appreciated.</p>
  <p><strong>Logs</strong></p>
  <p>output of rust-analyzer, in the vscode output tab.</p>
  <pre><code>INFO [6/9/2022, 6:10:00 PM]: Extension version: 0.3.1083
  INFO [6/9/2022, 6:10:00 PM]: Using configuration {
    cargoRunner: null,
    runnableEnv: null,
    server: { path: null, extraEnv: null },
    trace: { server: 'off', extension: false },
    debug: {
      engine: 'auto',
      sourceFileMap: {
        '/rustc/&lt;id&gt;': '${env:USERPROFILE}/.rustup/toolchains/&lt;toolchain-id&gt;/lib/rustlib/src/rust'
      },
      openDebugPane: false,
      engineSettings: {}
    },
    assist: { expressionFillDefault: 'todo' },
    cachePriming: { enable: true, numThreads: 0 },
    cargo: {
      autoreload: true,
      buildScripts: { enable: true, overrideCommand: null, useRustcWrapper: true },
      features: [],
      noDefaultFeatures: false,
      noSysroot: false,
      target: null,
      unsetTest: [ 'core' ]
    },
    checkOnSave: {
      allTargets: true,
      command: 'check',
      enable: true,
      extraArgs: [],
      features: null,
      noDefaultFeatures: null,
      overrideCommand: null,
      target: null
    },
    completion: {
      autoimport: { enable: true },
      autoself: { enable: true },
      callable: { snippets: 'fill_arguments' },
      postfix: { enable: true },
      privateEditable: { enable: false },
      snippets: {
        custom: {
          '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'
          }
        }
      }
    },
    diagnostics: {
      disabled: [],
      enable: true,
      experimental: { enable: false },
      remapPrefix: {},
      warningsAsHint: [],
      warningsAsInfo: []
    },
    files: { excludeDirs: [], watcher: 'client' },
    highlightRelated: {
      breakPoints: { enable: true },
      exitPoints: { enable: true },
      references: { enable: true },
      yieldPoints: { enable: true }
    },
    hover: {
      actions: {
        debug: { enable: true },
        enable: true,
        gotoTypeDef: { enable: true },
        implementations: { enable: true },
        references: { enable: false },
        run: { enable: true }
      },
      documentation: { enable: true },
      links: { enable: true }
    },
    imports: {
      granularity: { enforce: false, group: 'crate' },
      group: { enable: true },
      merge: { glob: true },
      prefix: 'plain'
    },
    inlayHints: {
      bindingModeHints: { enable: false },
      chainingHints: { enable: true },
      closingBraceHints: { enable: true, minLines: 25 },
      closureReturnTypeHints: { enable: 'never' },
      lifetimeElisionHints: { enable: 'never', useParameterNames: false },
      maxLength: 25,
      parameterHints: { enable: true },
      reborrowHints: { enable: 'never' },
      renderColons: true,
      typeHints: {
        enable: true,
        hideClosureInitialization: false,
        hideNamedConstructor: false
      }
    },
    joinLines: {
      joinAssignments: true,
      joinElseIf: true,
      removeTrailingComma: true,
      unwrapTrivialBlock: true
    },
    lens: {
      debug: { enable: true },
      enable: true,
      forceCustomCommands: true,
      implementations: { enable: true },
      references: {
        adt: { enable: false },
        enumVariant: { enable: false },
        method: { enable: false },
        trait: { enable: false }
      },
      run: { enable: true }
    },
    linkedProjects: [],
    lru: { capacity: null },
    notifications: { cargoTomlNotFound: true },
    procMacro: {
      attributes: { enable: true },
      enable: true,
      ignored: {},
      server: null
    },
    runnables: { command: null, extraArgs: [] },
    rustc: { source: null },
    rustfmt: {
      extraArgs: [],
      overrideCommand: null,
      rangeFormatting: { enable: false }
    },
    semanticHighlighting: { strings: { enable: true } },
    signatureInfo: { detail: 'full', documentation: { enable: true } },
    typing: { autoClosingAngleBrackets: { enable: false } },
    workspace: {
      symbol: { search: { kind: 'only_types', limit: 128, scope: 'workspace' } }
    }
  }
  INFO [6/9/2022, 6:10:00 PM]: PersistentState: { serverVersion: '0.3.1083' }
  INFO [6/9/2022, 6:10:00 PM]: Using server binary at /Users/michaelbailey/.vscode/extensions/rust-lang.rust-analyzer-0.3.1083-darwin-x64/server/rust-analyzer
  INFO [6/9/2022, 6:10:01 PM]: Extension version: 0.3.1083
  INFO [6/9/2022, 6:10:01 PM]: Using configuration {
    cargoRunner: null,
    runnableEnv: null,
    server: { path: null, extraEnv: null },
    trace: { server: 'off', extension: false },
    debug: {
      engine: 'auto',
      sourceFileMap: {
        '/rustc/&lt;id&gt;': '${env:USERPROFILE}/.rustup/toolchains/&lt;toolchain-id&gt;/lib/rustlib/src/rust'
      },
      openDebugPane: false,
      engineSettings: {}
    },
    assist: { expressionFillDefault: 'todo' },
    cachePriming: { enable: true, numThreads: 0 },
    cargo: {
      autoreload: true,
      buildScripts: { enable: true, overrideCommand: null, useRustcWrapper: true },
      features: [],
      noDefaultFeatures: false,
      noSysroot: false,
      target: null,
      unsetTest: [ 'core' ]
    },
    checkOnSave: {
      allTargets: true,
      command: 'check',
      enable: true,
      extraArgs: [],
      features: null,
      noDefaultFeatures: null,
      overrideCommand: null,
      target: null
    },
    completion: {
      autoimport: { enable: true },
      autoself: { enable: true },
      callable: { snippets: 'fill_arguments' },
      postfix: { enable: true },
      privateEditable: { enable: false },
      snippets: {
        custom: {
          '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'
          }
        }
      }
    },
    diagnostics: {
      disabled: [],
      enable: true,
      experimental: { enable: false },
      remapPrefix: {},
      warningsAsHint: [],
      warningsAsInfo: []
    },
    files: { excludeDirs: [], watcher: 'client' },
    highlightRelated: {
      breakPoints: { enable: true },
      exitPoints: { enable: true },
      references: { enable: true },
      yieldPoints: { enable: true }
    },
    hover: {
      actions: {
        debug: { enable: true },
        enable: true,
        gotoTypeDef: { enable: true },
        implementations: { enable: true },
        references: { enable: false },
        run: { enable: true }
      },
      documentation: { enable: true },
      links: { enable: true }
    },
    imports: {
      granularity: { enforce: false, group: 'crate' },
      group: { enable: true },
      merge: { glob: true },
      prefix: 'plain'
    },
    inlayHints: {
      bindingModeHints: { enable: false },
      chainingHints: { enable: true },
      closingBraceHints: { enable: true, minLines: 25 },
      closureReturnTypeHints: { enable: 'never' },
      lifetimeElisionHints: { enable: 'never', useParameterNames: false },
      maxLength: 25,
      parameterHints: { enable: true },
      reborrowHints: { enable: 'never' },
      renderColons: true,
      typeHints: {
        enable: true,
        hideClosureInitialization: false,
        hideNamedConstructor: false
      }
    },
    joinLines: {
      joinAssignments: true,
      joinElseIf: true,
      removeTrailingComma: true,
      unwrapTrivialBlock: true
    },
    lens: {
      debug: { enable: true },
      enable: true,
      forceCustomCommands: true,
      implementations: { enable: true },
      references: {
        adt: { enable: false },
        enumVariant: { enable: false },
        method: { enable: false },
        trait: { enable: false }
      },
      run: { enable: true }
    },
    linkedProjects: [],
    lru: { capacity: null },
    notifications: { cargoTomlNotFound: true },
    procMacro: {
      attributes: { enable: true },
      enable: true,
      ignored: {},
      server: null
    },
    runnables: { command: null, extraArgs: [] },
    rustc: { source: null },
    rustfmt: {
      extraArgs: [],
      overrideCommand: null,
      rangeFormatting: { enable: false }
    },
    semanticHighlighting: { strings: { enable: true } },
    signatureInfo: { detail: 'full', documentation: { enable: true } },
    typing: { autoClosingAngleBrackets: { enable: false } },
    workspace: {
      symbol: { search: { kind: 'only_types', limit: 128, scope: 'workspace' } }
    }
  }
  </code></pre>