From 1561088c3c84fb637c762940c91255f60d4e4c1d Mon Sep 17 00:00:00 2001 From: Ives van Hoorne Date: Wed, 8 Nov 2023 03:13:51 +0100 Subject: [PATCH] fix: use same paths as vscode for settings --- src/missing-services.ts | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/missing-services.ts b/src/missing-services.ts index 5d7f80fb..52c59f74 100644 --- a/src/missing-services.ts +++ b/src/missing-services.ts @@ -28,7 +28,7 @@ import { IPreferencesService } from 'vs/workbench/services/preferences/common/pr import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey' import { StandaloneServices } from 'vs/editor/standalone/browser/standaloneServices' import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService' -import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile' +import { IUserDataProfile, IUserDataProfilesService, toUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile' import { IPolicyService } from 'vs/platform/policy/common/policy' import { IUserDataProfileImportExportService, IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile' import { UserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfileService' @@ -174,6 +174,8 @@ import { ITitleService } from 'vs/workbench/services/title/common/titleService' import { IChatAgentService } from 'vs/workbench/contrib/chat/common/chatAgents' import { unsupported } from './tools' import { getBuiltInExtensionTranslationsUris } from './l10n' +import { Schemas } from 'vs/base/common/network' +import { joinPath } from 'vs/base/common/resources' class NullLoggerService extends AbstractLoggerService { constructor () { @@ -534,18 +536,11 @@ registerSingleton(ITextMateTokenizationService, class NullTextMateService implem createTokenizer = unsupported }, InstantiationType.Eager) +const userRoamingDataHome = URI.from({ scheme: Schemas.vscodeUserData, path: '/User' }) +const defaultProfile = toUserDataProfile('__default__profile__', 'Default', userRoamingDataHome, joinPath(userRoamingDataHome, 'caches', 'CachedProfilesData')) const profile: IUserDataProfile = { - id: 'default', - isDefault: true, - name: 'default', - location: URI.from({ scheme: 'user', path: '/profile.json' }), - globalStorageHome: URI.from({ scheme: 'user', path: '/globalStorage' }), - settingsResource: URI.from({ scheme: 'user', path: '/settings.json' }), - keybindingsResource: URI.from({ scheme: 'user', path: '/keybindings.json' }), - tasksResource: URI.from({ scheme: 'user', path: '/tasks.json' }), - snippetsHome: URI.from({ scheme: 'user', path: '/snippets' }), - extensionsResource: URI.from({ scheme: 'user', path: '/extensions.json' }), - cacheHome: URI.from({ scheme: 'cache', path: '/' }) + ...defaultProfile, + isDefault: true } registerSingleton(IUserDataProfilesService, class UserDataProfilesService implements IUserDataProfilesService {