Favorites.vscode icon indicating copy to clipboard operation
Favorites.vscode copied to clipboard

If `'Data Location'` is set `<default>`, the `favorites.user` folder could be created within portable path (e.g. '..\globalStorage\favorites.user`)

Open carloscadux opened this issue 2 years ago • 8 comments

Hey Oleg,

The path ${execPath}\..\[userfolder] you just implemented Issue #33 is perfect already for improving the portability experience of VSCode.

Just thinking further about full portability of VSCode out of the box, I'd suggest when Favorites extension is run from a VSCode portable instance and 'Data Location' is set <default>, the favorites.user folder could be created within the portable path, for instance under data\user-data\User\globalStorage\favorites.user.

I just tested the last release v1.5.13, and even I ran VSCode portable, the extension has created its default storage under roaming C:\Users\%username%\AppData\Roaming\Code\User\favorites.user

I've noticed that by default many extensions are creating their storage under the portable globalStorage folder, and my suggestion is aligned with that idea of a full VSCode portability experience.

Thank you, Carlos

carloscadux avatar Mar 05 '22 14:03 carloscadux

Hm....

It supposed to do exactly what you described:

 ///////////////////////////////////////
    let extensionRoot = path.dirname(path.dirname(path.dirname(__dirname)));
    let isPortable = path.basename(extensionRoot).toLowerCase() == "data" || path.basename(extensionRoot).toLowerCase() == "code-portable-data";
    ///////////////////////////////////////

    if (isPortable) {
        return path.join(extensionRoot, 'user-data', 'User', 'favorites.user');
    } else { . . . 

Meaning that for some reason it's not detecting that it is portable. Will need to check again

oleg-shilo avatar Mar 09 '22 11:03 oleg-shilo

Can you check if your portable has <vscode_root>/data || <vscode_root>/code-portable-data

The very latest portable download cannot start for me for some reason :(

oleg-shilo avatar Mar 09 '22 12:03 oleg-shilo

Can you check if your portable has <vscode_root>/data || <vscode_root>/code-portable-data

I just created a clean portable installation (v1.65.2) having <vscode_root>/data Then I installed and ran your extension, which is still pointing to C:\Users\%username%\AppData\Roaming\Code\User\favorites.user I recorded all this test here: https://bit.ly/3HY7xIx

carloscadux avatar Mar 11 '22 13:03 carloscadux

Thank you, it helped.

Indeed it was a problem with the ``IsPortabledetection algorithm, It was based on the extension location but a more reliable approach is to do it bycode.exe` location.

I have updated the extension but do not want to publish it on the marketplace until it is fully verified. Can you please test the release v1.5.14 by loading the extension from the file ("Install from VSIX").

oleg-shilo avatar Mar 13 '22 08:03 oleg-shilo

Can you please test the release v1.5.14 by loading the extension from the file ("Install from VSIX").

Tested. Thanks for the improvements!

A couple of comments:

a) "Fixed faulty IsPortable detection" Fixed. The extension main folder is created in \data\user-data\User\globalStorage\favorites.user

b) "Added context menu for setting alias" I could set aliases for favorited folders properly. However, there is an error message when setting aliases for files which were favorited through the extension GUI: You can set alias only to file or folder items. The issue is that when adding 'active document to favorites' through the GUI it is inserted in the favorite list having this path format: file:///c%3A/_Data/_DataProg/_DataProg_TEST/File1.txt If I add files to the favorite list manually, using the standard path copied through Windows Explorer, the alias functionality works: C:\_Data\_DataProg\_DataProg_TEST\File1.txt

c) File theme icons Because of the same issue described in (b), files added through the GUI aren't showing the theme icons. When I add manually the files to the list using the default Windows Explorer path, the file theme icons are appearing properly.

d) Folder theme icons Folder theme icons aren't appearing anymore, even if added manually to the list using the default Windows Explorer path.

If you need further testing, just let me know.

carloscadux avatar Mar 13 '22 17:03 carloscadux

Txs, will process it on weekend

oleg-shilo avatar Mar 18 '22 05:03 oleg-shilo

My apologies. COVID had other plans. Only now I was able to address it. https://github.com/oleg-shilo/Favorites.vscode/releases/tag/v1.5.15

It was actually harder than I thought. The problem was that all extension business logic is based on fs module for all file system operations. And it does not support URI so quite a few conversions needed to be made.

Carlos, can I ask you to test it again please before I publish it on marketplace

oleg-shilo avatar Mar 30 '22 09:03 oleg-shilo

Done. Published on Market Plase

oleg-shilo avatar Apr 04 '22 08:04 oleg-shilo