alefragnani / vscode-project-manager

Project Manager Extension for Visual Studio Code
GNU General Public License v3.0
1.96k stars 228 forks source link

[BUG] - Activation fails if `projectManager.git.baseFolders` contains an invalid path #702

Closed carlocardella closed 8 months ago

carlocardella commented 1 year ago

Environment/version

Version: 1.82.0-insider Commit: a0377f0c51dbb2d3188565cdf35e89929f864e65 Date: 2023-08-24T05:32:35.024Z Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Code-Insiders/1.82.0-insider Chrome/114.0.5735.289 Electron/25.5.0 Safari/537.36

Steps to reproduce

VSCode settings are sync'ed on two separate machines using the built-in Setting Sync service. My Git projects are in differen paths on these two machines:

  1. PC1: C:\Git
  2. PC2: E:\Git

In my user settings I have

    "projectManager.git.baseFolders": [
        "C:\\Git\\",
        "E:\\Git\\"
    ],

Git projects are not shown because of this error (from Extension Host):

2023-08-24 13:37:12.228 [error] Activating extension alefragnani.project-manager failed due to an error:
2023-08-24 13:37:12.228 [error] Error: ENOENT: no such file or directory, lstat 'E:\Git\'
    at lstatSync (node:fs:1595:3)
    at Object.t.lstatSync (node:electron/js2c/asar_bundle:2:3729)
    at Function.handleSymlinks (c:\Users\carloc\.vscode-insiders\extensions\alefragnani.project-manager-12.7.0\dist\extension.js:1:113300)
    at t.CustomProjectLocator.locateProjects (c:\Users\carloc\.vscode-insiders\extensions\alefragnani.project-manager-12.7.0\dist\extension.js:1:87907)
    at t.AutodetectProvider.showTreeView (c:\Users\carloc\.vscode-insiders\extensions\alefragnani.project-manager-12.7.0\dist\extension.js:1:99533)
    at t.Providers.showTreeViewFromAllProviders (c:\Users\carloc\.vscode-insiders\extensions\alefragnani.project-manager-12.7.0\dist\extension.js:1:103545)
    at e.activate (c:\Users\carloc\.vscode-insiders\extensions\alefragnani.project-manager-12.7.0\dist\extension.js:1:176061)
    at E.n (c:\Users\carloc\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:107:6206)
    at E.m (c:\Users\carloc\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:107:6169)
    at E.l (c:\Users\carloc\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:107:5626)

For a number of reasons I cannot unify those paths:

I understand there might be workarounds but it would be really great if the extension could just use valid paths from the array and ignore the rest rather than failing

alefragnani commented 8 months ago

Hi @carlocardella ,

This has already been reported in #657, and should be fixed in the next release.

Stay tuned