-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Added getUserDataPath command #30
base: main
Are you sure you want to change the base?
Conversation
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.
I get why this could be super useful, but curious when you plan to call this. Eg every time they focus VSCode? Just once, lazily, the first time they focus VSCode?
import * as path from "path"; | ||
|
||
export function getUserDataPath(context: vscode.ExtensionContext): string { | ||
const userPath = path.resolve(context.globalStorageUri.fsPath, "../.."); |
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 there not a more reliable way to do this? seems slightly brittle, though I'd imagine they're very unlikely to change this at any time in the future? Assuming it works on all platforms?
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.
I didn't find any unfortunately. That's why the if statement is there as a sanity check.
This should work on all platforms but I can't really verify that for myself.
I was thinking the first time you focus a vscode application. We would basically just cache the application name/exe/bundle and if that changes we query it again. |
I need to think some more on this one |
Will support all platforms and different forks of vscode for things like getting the settings.json path
https://github.com/cursorless-dev/cursorless/blob/25a838fa4cc238d37ecf23f388301e8e1287b315/cursorless-talon/src/apps/vscode_settings.py#L29-L31