From 3d7fbec40f820ab6552bfa0d16c2d2efaf663b62 Mon Sep 17 00:00:00 2001 From: Asher Date: Fri, 20 Nov 2020 13:47:58 -0600 Subject: [PATCH 1/2] Use file system for settings and fix data home path It's possible that using browser storage makes more sense with settings sync, so we might want to revisit this once/if we get settings sync working. As it currently is though, browser storage just causes jank. The path was also missing a `User` at the end so I added that. This might affect the Vim extension which would have been writing to the wrong path previously but I don't believe it should affect anything else since they would have been writing to browser storage. - Fixes #2208 - Fixes #2231 - Fixes #2279 - Fixes #2274 --- ci/dev/vscode.patch | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/ci/dev/vscode.patch b/ci/dev/vscode.patch index f6af1c227..b900f53d0 100644 --- a/ci/dev/vscode.patch +++ b/ci/dev/vscode.patch @@ -3797,18 +3797,25 @@ index 85d83f37da179a1e39266cf72a02e971f590308e..0659738b36df1747c9afcabf8d9abf26 }; diff --git a/src/vs/workbench/services/environment/browser/environmentService.ts b/src/vs/workbench/services/environment/browser/environmentService.ts -index a8d43045ecc8cbe04b3f8440cff16d42aadbcad0..cd589c6f75eccbeefbf364d426ac882396b26fb4 100644 +index a8d43045ecc8cbe04b3f8440cff16d42aadbcad0..8e122c761ac7ddfee11f9dda2ac5e845b893cc28 100644 --- a/src/vs/workbench/services/environment/browser/environmentService.ts +++ b/src/vs/workbench/services/environment/browser/environmentService.ts -@@ -119,8 +119,18 @@ export class BrowserWorkbenchEnvironmentService implements IWorkbenchEnvironment +@@ -119,8 +119,25 @@ export class BrowserWorkbenchEnvironmentService implements IWorkbenchEnvironment @memoize get logFile(): URI { return joinPath(this.options.logsPath, 'window.log'); } -+ // NOTE@coder: Use the regular path for extensions that write directly to disk -+ // instead of using the VS Code API. ++ // NOTE@coder: Use the same path in // ../../../../platform/environment/node/environmentService.ts ++ // and don't use the user data scheme. This solves two problems: ++ // 1. Extensions running in the browser (like Vim) might use these paths ++ // directly instead of using the file service and most likely can't write ++ // to `/User` on disk. ++ // 2. Settings will be stored in the file system instead of in browser ++ // storage. Using browser storage makes sharing or seeding settings ++ // between browsers difficult. We may want to revisit this once/if we get ++ // settings sync. @memoize - get userRoamingDataHome(): URI { return URI.file('/User').with({ scheme: Schemas.userData }); } -+ get userRoamingDataHome(): URI { return URI.file(this.userDataPath).with({ scheme: Schemas.userData }); } ++ get userRoamingDataHome(): URI { return joinPath(URI.file(this.userDataPath).with({ scheme: Schemas.vscodeRemote }), 'User'); } + @memoize + get userDataPath(): string { + const dataPath = this.payload?.get("userDataPath"); @@ -3820,7 +3827,7 @@ index a8d43045ecc8cbe04b3f8440cff16d42aadbcad0..cd589c6f75eccbeefbf364d426ac8823 @memoize get settingsResource(): URI { return joinPath(this.userRoamingDataHome, 'settings.json'); } -@@ -301,7 +311,12 @@ export class BrowserWorkbenchEnvironmentService implements IWorkbenchEnvironment +@@ -301,7 +318,12 @@ export class BrowserWorkbenchEnvironmentService implements IWorkbenchEnvironment extensionHostDebugEnvironment.params.port = parseInt(value); break; case 'enableProposedApi': From fb835838db90e4a846dc11f1a0c214bc9c5d58b0 Mon Sep 17 00:00:00 2001 From: Asher Date: Fri, 20 Nov 2020 15:35:18 -0600 Subject: [PATCH 2/2] Remove semver-umd link This is included in the bundle now. --- src/browser/pages/vscode.html | 5 ----- src/browser/pages/vscode.ts | 1 - 2 files changed, 6 deletions(-) diff --git a/src/browser/pages/vscode.html b/src/browser/pages/vscode.html index d9305fe9d..727a1ca87 100644 --- a/src/browser/pages/vscode.html +++ b/src/browser/pages/vscode.html @@ -32,11 +32,6 @@ - - - diff --git a/src/browser/pages/vscode.ts b/src/browser/pages/vscode.ts index 2cb7973f1..d95e91741 100644 --- a/src/browser/pages/vscode.ts +++ b/src/browser/pages/vscode.ts @@ -41,7 +41,6 @@ try { "xterm-addon-search": `../node_modules/xterm-addon-search/lib/xterm-addon-search.js`, "xterm-addon-unicode11": `../node_modules/xterm-addon-unicode11/lib/xterm-addon-unicode11.js`, "xterm-addon-webgl": `../node_modules/xterm-addon-webgl/lib/xterm-addon-webgl.js`, - "semver-umd": `../node_modules/semver-umd/lib/semver-umd.js`, "tas-client-umd": `../node_modules/tas-client-umd/lib/tas-client-umd.js`, "iconv-lite-umd": `../node_modules/iconv-lite-umd/lib/iconv-lite-umd.js`, jschardet: `../node_modules/jschardet/dist/jschardet.min.js`,