vscode-bookmarks icon indicating copy to clipboard operation
vscode-bookmarks copied to clipboard

[BUG] Bookmarks on external files doesn't work if located on different drive (Windows only)

Open jbengineer opened this issue 5 years ago • 7 comments

I tried [13.0.2] 2021-02-25 , and the book toggle , if the file is not included in the explorer , does not work.

Just open an outside file , and try to book mark any line, It does not work. but if the code file is included, in the project/explorer , the book works without an any issue

jbengineer avatar Feb 26 '21 01:02 jbengineer

Seems to work for me.

Untitled

fade2gray avatar Feb 26 '21 10:02 fade2gray

Hi @gbil-sys ,

Are you using Windows, opening the external file from a different drive than the folder you opened in VS Code?

I mean, you open a folder in D: but the file is from C:, or vice-versa?

As @fade2gray reported, it is working, for me too, but I could reproduce an error while doing that different location scenario. On MacOS I had no issue using files from a different device.

Hope this helps

ps. @fade2gray, thanks for testing 👍

alefragnani avatar Feb 26 '21 17:02 alefragnani

Hello @alefragnani Thanks a lot for your response. I have done further troubleshooting on this issue. I am on a windows system and using subst command to map a local folder to a drive letter N:. The vscode is confused between C:\home\working directory and N:. Any time I am opening a file from N: drive, it does not show a bookmark but adds a big ///////////////////////////////////n:// in the "BOOKMARKS: explore" and bookmark does not work.

I tried to reproduce this after removing the drive mapping but this issue does not show anymore.

*** Another feature request. Could you please make "BOOKMARK: Explorer" window full link option configurable? image

jbengineer avatar Feb 27 '21 11:02 jbengineer

Hi @jbengineer ,

If you use subst, even if you open the same physical folder, VS Code will understand as two different workspaces, so it will save/load different set of bookmarks.

If you open the folder from N:, but then for some reason open a file using the C: notation, it will add a bunch of / because that file will be relative to the current location (../../../../c:/../.. and so on). But, if instead you are open the folder from N: and open a file from the same N:` location, it shouldn’t do this.

About your request, the link doesn’t display full path if the file is inside the workspace/folder you opened. I’m not in from a my computer right now, but I guess it’s the same behavior VS Code has. I see the full path is important for files outside the opened folder/workspace, but I understand it can be hard to read. Feel free to open a new issue about this request.

Hope this helps

alefragnani avatar Mar 06 '21 19:03 alefragnani

Are you using Windows, opening the external file from a different drive than the folder you opened in VS Code?

I mean, you open a folder in D: but the file is from C:, or vice-versa?

I have the same issue

Eugeny48 avatar Apr 01 '21 09:04 Eugeny48

Despite my earlier comment, I have just discovered that I can't create bookmarks in a file stored anywhere other than on the C:\ drive - not on a different partition on the same physical drive as C:\ (D:) or on a removable drive etc.

fade2gray avatar Jun 01 '21 15:06 fade2gray

@alefragnani I cannot test and contribute because of the private submodule, but I think this issue is probably caused by using Uri.path instead of Uri.fsPath.

Foo-x avatar Nov 14 '23 08:11 Foo-x