-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fix: respect customStoragePath setting for custom modes #7155
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
import { mkdir } from "fs/promises" | ||
import { join } from "path" | ||
import { ExtensionContext } from "vscode" | ||
import { getStorageBasePath, getSettingsDirectoryPath } from "./storage" | ||
|
||
export async function getGlobalFsPath(context: ExtensionContext): Promise<string> { | ||
return context.globalStorageUri.fsPath | ||
return getStorageBasePath(context.globalStorageUri.fsPath) | ||
} | ||
|
||
export async function ensureSettingsDirectoryExists(context: ExtensionContext): Promise<string> { | ||
const settingsDir = join(context.globalStorageUri.fsPath, "settings") | ||
await mkdir(settingsDir, { recursive: true }) | ||
return settingsDir | ||
return getSettingsDirectoryPath(context.globalStorageUri.fsPath) | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change looks correct in delegating to the storage utilities, but I'm wondering if there might be a subtle issue here. The However, have we verified that all 17 call sites of |
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.
Is this intentional? You're passing
context.globalStorageUri.fsPath
togetSettingsDirectoryPath()
, but that function expects the default storage path and internally callsgetStorageBasePath()
to apply custom path logic. This could cause the custom path resolution to be applied twice, potentially breaking the path resolution.Should this instead just pass the context or ensure the function signature matches the expected input?