-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[vscode] support globalStoragePath
#6354
Conversation
@svenefftinge how did you get the git graph extension working? |
I did not. Webviews are not really supported by theia atm. |
I see so the check is to see if any error is logged related to this. |
checked with current master. the extension fails to activate because
|
a157652
to
e7bb225
Compare
} | ||
return globalStorage; | ||
} | ||
const globalStoragePath = join(configStorage.hostGlobalStoragePath || (await defaultGlobalStorage()), plugin.model.id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e.g.~/.theia/globalStorage/mhutchie.git-graph
I think this fine now, thanks!
@@ -266,6 +268,18 @@ export class PluginManagerExtImpl implements PluginManagerExt, PluginManager { | |||
const asAbsolutePath = (relativePath: string): string => join(plugin.pluginFolder, relativePath); | |||
const logPath = join(configStorage.hostLogPath, plugin.model.id); // todo check format | |||
const storagePath = join(configStorage.hostStoragePath || '', plugin.model.id); | |||
async function defaultGlobalStorage(): Promise<string> { | |||
const homeTheia = join(os.homedir(), '.theia'); | |||
if (!(await fs.pathExists(homeTheia))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is a short cut for this in fs-extra
: fs.ensureDir(join(os.homedir(), '.theia', 'globalStorage'))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works nicely! 👍
ensureDir
if you like
Signed-off-by: Sven Efftinge <sven.efftinge@typefox.io>
e7bb225
to
59e3a06
Compare
What it does
Added
globalStoragePath
to the ExtensionContext object.How to test
Install an extension that accesses this property (e.g. git graph).
Review checklist
Reminder for reviewers