vscode-gitlens
vscode-gitlens copied to clipboard
Inline blame does not work on Windows when the workspace was opened through a virtual drive (subst command)
Description
The issue happens on both Win10 and Win11, all versions. Created virtual drives with the subst command for the project folders. Opening the Code workspace through the virtual drive causes problems for the GitLens plugin.
-
If the workspace is opened through the long path, not using the virtual drives, GitLens works properly. Files opened from the Source Control view by right-clicking and selecting Open File and files opened from Explorer (or ctrl-p) are recognized as the same file. E.g., I open a file from the Source Control view, switch to another editor tab and then try to open the same file from Explorer, the previously opened file is activated. When I hover the mouse on the editor tab, I can see the absolute path to the file in Windows format. Below that (breadcrumbs?) there is the workspace relative path displayed. GitLens and ErrorLens messages are nicely combined, both messages are shown with the proper color.
-
When using the virtual drive, operation is weird:
- There is inline blame info in the diff editor (click a changed file in the Source Control view and then click into the file)
- There is inline blame, if a file is opened for editing from the Source Control view by right clicking and then Open File. The inline errors from ErrorLens are not displayed.
- There is no inline blame if the file is opened in any other way (Explorer, ctrl-P etc...). ErrorLens works.
If a file was opened from the Source Control view, both hover and breadcrumbs show absolute Windows path to the file. The file can be opened once again from the Explorer or through control-P, and Code does not seem to recognize that they're the same file! For the second file, hover shows the absolute path to the file through the virtual drive in POSIX format, and below that the breadcrumbs show the workspace relative path. Very different from the same file opened through Source Control.
The issue might be with Code itself. (?)
GitLens Version
12.1.2
VS Code Version
Version: 1.70.2 (system setup) Commit: e4503b30fc78200f846c62cf8091b76ff5547662 Date: 2022-08-16T05:35:13.448Z Electron: 18.3.5 Chromium: 100.0.4896.160 Node.js: 16.13.2 V8: 10.0.139.17-electron.0 OS: Windows_NT x64 10.0.22000
Git Version
git version 2.37.1.windows.1
Logs, Screenshots, Screen Captures, etc
No response