-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
[ExtensionDev] Expose API to get at file system locations #2741
Comments
Interesting... the insider version should be considered as a separate product, with its own user settings and extensions folders. This enables a clean side-by-side install. Therefore, the code-sittings-sync extension is product specific, depending on whether it is installed in the insiders or the stable product it should sync the corresponding product settings. An extension gets its path passed in the Having said this a workaround, an extension should not have to do this path math and we exposing API to avoid this. |
To recap, the paths we should expose
I am unsure if we should also expose the individual files inside that folder like |
@alefragnani for the bookmark extension I believe you need the user config folder. is that right? @SrTobi I am unsure if you only looking at sync'ing the user-level |
@jrieken exactly... thanks 👍 |
FYI #5570 is moving the user data directory to be a sibling of the extensions dir. |
@Tyriar so should we expose the parent folder of those two directories? |
no clue... @joaomoreno or @bpasero will know |
Historic reasons, we only had extensions folder a lot later. |
Is it worth simplifying the structure further as part of #5570?
|
Moving to June considering those potential upcoming changes |
I like that very much. |
@joaomoreno @Tyriar where are we with this and what's the plan? |
The pull is quite stale and probably needs to be redone, there is also the complication of Windows directory changing as well #7035. Just a matter of prioritizing it against the other stuff in my backlog (mainly terminal bugs and linux packaging improvements). |
@jrieken I'd like #7035 to be figured out before moving on this again. We don't really want to be migrating settings around multiple times if we can prevent it. It sounds like #7035 would need an extensions manifest to correctly support roaming on Windows. Considering that settings.json and keybindings.json would probably best be situated at the root directory, not in Chromium's user data, how about we make an API to get at the User directory for now, which will eventually become the root?
|
Sorry, again we didn't get to this... Tho we added a |
Just wanted to check in on this. I assume this is also being pushed out past August like #3884 |
yeah - I am handcuffed as long as the underlying api/data isn't ready |
Any movement on this item? I'm after a way to reliably locate the snippets folder. |
Sorry no - there is still no decision on how to re-structure the fs layout (which might then be a breaking change) |
Most links related to obtaining the user-data-dir refer here, but the provided solution of using It seems Is there a similar option somewhere for the fs-equivalent of the memento I could use the extension folder |
const isInsiders = /insiders/i.test(vscode.env.appName); Is there anything terribly wrong with this way of getting const UserDirPath = path.join(extensionContext.logPath, '..', '..', '..', '..', 'User'); |
This comment has been minimized.
This comment has been minimized.
I have been thinking it would be possible to get it from the shell
but an API is better for sure. |
I have a bit of an odd need for this: I'm using an extension that has an interactive help showing the keybindings that can be used, edamagit. Here's a small example: Now the problem is, the user can change the keybindings in their keybindings.json. To make sure the correct keybindings are shown, the extension parses the keybindings.json. Now the problem is, when using the extension remotely, there appears to be no way to get to this keybindings.json file. Delving into the vscode source, it appears that the correct URI to access keybindings.json is something like The only way I've found to access it is by spawning the settings editor with await commands.executeCommand('workbench.action.openGlobalKeybindingsFile');
let keybindingsPath = null;
for (let f of workspace.textDocuments) {
if (f.uri.path.endsWith('keybindings.json')) {
KEYBINDINGS_FILE_URI_CACHE = f.uri;
break;
}
}
// Close the keybinding and default keybinding views.
await commands.executeCommand('workbench.action.closeActiveEditor');
await commands.executeCommand('workbench.action.closeActiveEditor'); which is a pretty terrible idea (it temporarily spawns a visible keybinding editor, which makes for a rather jarring experience...). Otherwise, the URI is available through the IEnvironmentService::keybindingsResource field, but this seems to be entirely inaccessible from extensions. |
Some extension relay on hard coded paths that are not exposed by vscode. See for example code-sittings-sync. Those extension are broken in the insiders version. I see t two possible ways:
-insiders
, but I have not found a way to get this information either.The text was updated successfully, but these errors were encountered: