GithubHelp home page GithubHelp logo

Comments (5)

mkloubert avatar mkloubert commented on June 15, 2024

@rubensa

The extension uses the Memento API of the ExtensionContext:

public static loadList(extension: vscode.ExtensionContext): ego_contracts.TcpProxyListItem[] {

To find out, where the storage path might be on your own system, you can create a button, which shows the path in a new info window at the right bottom corner of VSCode:

exports.execute = async (args) => {
    // args => https://egomobile.github.io/vscode-powertools/api/interfaces/_contracts_.buttonactionscriptarguments.html

    // s. https://code.visualstudio.com/api/references/vscode-api
    const vscode = args.require('vscode');

    // args.extension => https://code.visualstudio.com/api/references/vscode-api#ExtensionContext
    vscode.window.showInformationMessage(
        "globalStatePath: " + args.extension.globalStoragePath
    );
};

On a Mac, this could be someting like: /Users/<USERNAME>/Library/Application Support/Code/User/globalStorage/egomobile.vscode-powertools

from vscode-powertools.

rubensa avatar rubensa commented on June 15, 2024

Hello @mkloubert
Thanks for the answer.
So... the tools config works differently from than the rest that can be configured by settings.xml
Can't this be "unified" so any configuration goes to settings.xml and allow config per user or workspace?

from vscode-powertools.

rubensa avatar rubensa commented on June 15, 2024

@mkloubert
Curious but, in my case, the reported path does not exists.

I'm using VSCode Dev Conteainer so my workspace is running inside a Docker container.
When I click the button I get globalStatePath: /home/user/.vscode-server/data/User/globalStorage/egomobile.vscode-powertools
/home/user is the $HOME of the user used under the Docker container and /home/user/.vscode-server/data/User/globalStorage/ exists but it does not contain a egomobile.vscode-powertools folder (despite I have a TCP proxy configured).

How this might be possible?

NOTE: Just in case I checked if /home/user/.vscode-server/data/User/globalStorage/egomobile.vscode-powertools existed in the host computer, but there is no such folder, and also checked in the host the path /home/rubensa/.config/Code/User/globalStorage/ (/home/rubensa is my $HOME in the host) but there is no egomobile.vscode-powertools folder there.

from vscode-powertools.

rubensa avatar rubensa commented on June 15, 2024

Ouch!! I think that I finally found where the data is persisted... and is a pain cause it can't be easily configured/modified.

Looking at the docs it appears that the extension.globalStoragePath (now deprecated and replaced by globalStorageUri) directory does not exists. It must be created by the extension if it needs it. It is supposed to be a "safe" place for the extension to save configuration (but must be done "manually").
Whatever you save using extension.globalState.update(key, value) (that is what proxies.ts is doing) is saved in a sqlite database file in ~/.config/Code/User/globalStorage/state.vscdb

Screenshot from 2022-12-22 08-14-35

from vscode-powertools.

rubensa avatar rubensa commented on June 15, 2024

Definitely it would be great if this configuration could be saved in settings.xml (like the rest of configurations for the extension).

from vscode-powertools.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.