@codingame/monaco-vscode-api 1.78.4 → 1.78.5-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -9
- package/dist/api.js +192 -2
- package/dist/assets/breakpointWidget.css +31 -0
- package/dist/assets/callStackEditorContribution.css +12 -0
- package/dist/assets/debug.contribution.css +138 -0
- package/dist/assets/debugHover.css +80 -0
- package/dist/assets/debugToolBar.css +49 -0
- package/dist/assets/editorquickaccess.css +8 -0
- package/dist/assets/editorstatus.css +51 -0
- package/dist/assets/exceptionWidget.css +52 -0
- package/dist/assets/notificationsActions.css +14 -0
- package/dist/assets/notificationsCenter.css +69 -0
- package/dist/assets/notificationsList.css +152 -0
- package/dist/assets/notificationsToasts.css +63 -0
- package/dist/assets/panelpart.css +75 -0
- package/dist/assets/paneview.css +148 -0
- package/dist/assets/paneviewlet.css +79 -0
- package/dist/assets/sidebysideeditor.css +9 -0
- package/dist/assets.js +15 -0
- package/dist/default-extensions/bat.js +6 -6
- package/dist/default-extensions/clojure.js +5 -5
- package/dist/default-extensions/coffeescript.js +6 -6
- package/dist/default-extensions/cpp.js +11 -11
- package/dist/default-extensions/csharp.js +6 -6
- package/dist/default-extensions/css.js +5 -5
- package/dist/default-extensions/dart.js +5 -5
- package/dist/default-extensions/diff.js +5 -5
- package/dist/default-extensions/docker.js +5 -5
- package/dist/default-extensions/fsharp.js +6 -6
- package/dist/default-extensions/go.js +5 -5
- package/dist/default-extensions/groovy.js +6 -6
- package/dist/default-extensions/handlebars.js +5 -5
- package/dist/default-extensions/hlsl.js +5 -5
- package/dist/default-extensions/html.js +7 -7
- package/dist/default-extensions/ini.js +6 -6
- package/dist/default-extensions/java.js +6 -6
- package/dist/default-extensions/javascript.js +9 -9
- package/dist/default-extensions/json.js +6 -6
- package/dist/default-extensions/julia.js +5 -5
- package/dist/default-extensions/latex.js +11 -11
- package/dist/default-extensions/less.js +5 -5
- package/dist/default-extensions/log.js +4 -4
- package/dist/default-extensions/lua.js +5 -5
- package/dist/default-extensions/make.js +5 -5
- package/dist/default-extensions/markdown-basics.js +6 -6
- package/dist/default-extensions/objective-c.js +6 -6
- package/dist/default-extensions/perl.js +7 -7
- package/dist/default-extensions/php.js +7 -7
- package/dist/default-extensions/powershell.js +5 -5
- package/dist/default-extensions/pug.js +5 -5
- package/dist/default-extensions/python.js +6 -6
- package/dist/default-extensions/r.js +5 -5
- package/dist/default-extensions/razor.js +5 -5
- package/dist/default-extensions/ruby.js +5 -5
- package/dist/default-extensions/rust.js +5 -5
- package/dist/default-extensions/scss.js +6 -6
- package/dist/default-extensions/shaderlab.js +5 -5
- package/dist/default-extensions/shellscript.js +5 -5
- package/dist/default-extensions/sql.js +5 -5
- package/dist/default-extensions/swift.js +6 -6
- package/dist/default-extensions/theme-abyss.js +4 -4
- package/dist/default-extensions/theme-defaults.js +12 -12
- package/dist/default-extensions/theme-kimbie-dark.js +4 -4
- package/dist/default-extensions/theme-monokai-dimmed.js +4 -4
- package/dist/default-extensions/theme-monokai.js +4 -4
- package/dist/default-extensions/theme-quietlight.js +4 -4
- package/dist/default-extensions/theme-red.js +4 -4
- package/dist/default-extensions/theme-seti.js +4 -4
- package/dist/default-extensions/theme-solarized-dark.js +4 -4
- package/dist/default-extensions/theme-solarized-light.js +4 -4
- package/dist/default-extensions/theme-tomorrow-night-blue.js +4 -4
- package/dist/default-extensions/typescript-basics.js +9 -9
- package/dist/default-extensions/typescript-language-features.js +3 -3
- package/dist/default-extensions/vb.js +6 -6
- package/dist/default-extensions/xml.js +7 -7
- package/dist/default-extensions/yaml.js +5 -5
- package/dist/{extension-tools-b2d018a3.js → extension-tools-b68a64de.js} +2 -15
- package/dist/extensions.js +150 -4
- package/dist/json.js +92 -0
- package/dist/monaco-treemending.js +882 -0
- package/dist/monaco.js +24 -458
- package/dist/node_modules/tslib/tslib.es6.js +21 -0
- package/dist/override/vs/workbench/browser/parts/editor/textEditor.js +2 -0
- package/dist/rollup-extension-directory-plugin.js +1 -1
- package/dist/rollup-vsix-plugin.js +1 -1
- package/dist/service-override/_46__46__47__46__46__47_vscode_47_vs_47_platform_47_audioCues_47_browser_47_media_47__42__46_mp3.js +11 -0
- package/dist/service-override/audioCue.js +13 -0
- package/dist/service-override/configuration.js +100 -0
- package/dist/service-override/debug.js +23 -0
- package/dist/service-override/dialogs.js +13 -0
- package/dist/service-override/files.js +244 -0
- package/dist/service-override/keybindings.js +100 -0
- package/dist/service-override/languages.js +27 -0
- package/dist/service-override/layout.js +41 -0
- package/dist/service-override/modelEditor.js +128 -0
- package/dist/service-override/notifications.js +34 -0
- package/dist/service-override/preferences.js +10 -0
- package/dist/{snippets.js → service-override/snippets.js} +5 -3
- package/dist/service-override/textmate.js +36 -0
- package/dist/service-override/theme.js +26 -0
- package/dist/services.d.ts +118 -1
- package/dist/services.js +59 -3
- package/dist/tools.js +20 -0
- package/dist/vscode/vs/base/browser/ui/splitview/paneview.js +289 -0
- package/dist/vscode/vs/base/common/console.js +58 -0
- package/dist/vscode/vs/base/common/date.js +204 -0
- package/dist/vscode/vs/base/common/json.js +713 -0
- package/dist/vscode/vs/base/common/jsonEdit.js +164 -0
- package/dist/vscode/vs/base/common/jsonFormatter.js +187 -0
- package/dist/vscode/vs/base/common/keybindingParser.js +87 -0
- package/dist/vscode/vs/base/common/performance.js +18 -0
- package/dist/vscode/vs/base/common/skipList.js +160 -0
- package/dist/vscode/vs/base/common/stream.js +300 -0
- package/dist/vscode/vs/base/common/uriIpc.js +32 -0
- package/dist/vscode/vs/base/parts/ipc/common/ipc.net.js +45 -0
- package/dist/vscode/vs/base/parts/request/browser/request.js +60 -0
- package/dist/vscode/vs/base/parts/request/common/request.js +8 -0
- package/dist/vscode/vs/editor/browser/config/editorConfiguration.js +91 -0
- package/dist/vscode/vs/editor/common/services/languageFeaturesService.js +41 -0
- package/dist/vscode/vs/editor/common/services/modelUndoRedoParticipant.js +56 -0
- package/dist/vscode/vs/editor/common/services/textResourceConfigurationService.js +112 -0
- package/dist/vscode/vs/platform/actions/browser/dropdownWithPrimaryActionViewItem.js +112 -0
- package/dist/vscode/vs/platform/debug/common/extensionHostDebug.js +3 -0
- package/dist/{extensionManagement.js → vscode/vs/platform/extensionManagement/common/extensionManagement.js} +2 -1
- package/dist/vscode/vs/platform/extensionManagement/common/extensionManagementUtil.js +14 -0
- package/dist/vscode/vs/platform/extensionManagement/common/extensionNls.js +66 -0
- package/dist/vscode/vs/platform/extensionManagement/common/implicitActivationEvents.js +53 -0
- package/dist/vscode/vs/platform/extensionResourceLoader/common/extensionResourceLoader.js +69 -0
- package/dist/vscode/vs/platform/externalServices/common/serviceMachineId.js +27 -0
- package/dist/vscode/vs/platform/files/common/fileService.js +920 -0
- package/dist/vscode/vs/platform/files/common/inMemoryFilesystemProvider.js +175 -0
- package/dist/vscode/vs/platform/files/common/io.js +80 -0
- package/dist/vscode/vs/platform/files/common/watcher.js +69 -0
- package/dist/vscode/vs/platform/keyboardLayout/common/keyboardConfig.js +42 -0
- package/dist/vscode/vs/platform/keyboardLayout/common/keyboardLayout.js +12 -0
- package/dist/vscode/vs/platform/keyboardLayout/common/keyboardMapper.js +23 -0
- package/dist/vscode/vs/platform/product/common/productService.js +4 -0
- package/dist/vscode/vs/platform/remote/common/remoteAuthorityResolver.js +17 -0
- package/dist/vscode/vs/platform/remote/common/remoteHosts.js +18 -0
- package/dist/vscode/vs/platform/request/browser/requestService.js +25 -0
- package/dist/vscode/vs/platform/request/common/request.js +50 -0
- package/dist/vscode/vs/platform/telemetry/common/telemetryUtils.js +119 -0
- package/dist/{tokenClassificationRegistry.js → vscode/vs/platform/theme/common/tokenClassificationRegistry.js} +82 -136
- package/dist/vscode/vs/platform/tunnel/common/tunnel.js +3 -0
- package/dist/vscode/vs/platform/uriIdentity/common/uriIdentity.js +3 -0
- package/dist/vscode/vs/platform/uriIdentity/common/uriIdentityService.js +80 -0
- package/dist/vscode/vs/platform/userDataProfile/common/userDataProfile.js +427 -0
- package/dist/vscode/vs/platform/userDataSync/common/content.js +9 -0
- package/dist/vscode/vs/platform/userDataSync/common/settingsMerge.js +299 -0
- package/dist/vscode/vs/platform/workspace/common/editSessions.js +3 -0
- package/dist/vscode/vs/platform/workspace/common/virtualWorkspace.js +17 -0
- package/dist/vscode/vs/platform/workspaces/common/workspaces.js +195 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadBulkEdits.js +49 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadClipboard.js +22 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadCommands.js +93 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadConfiguration.js +78 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadConsole.js +33 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadDebugService.js +347 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadDiagnostics.js +67 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadDocumentContentProviders.js +73 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadDocuments.js +246 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +379 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadEditor.js +410 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadEditors.js +223 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadExtensionService.js +213 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadFileSystem.js +270 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadFileSystemEventService.js +223 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadLanguageFeatures.js +909 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadLanguages.js +76 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadMessageService.js +114 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadOutputService.js +73 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadProgress.js +62 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadQuickOpen.js +183 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadSaveParticipant.js +43 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadTelemetry.js +50 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadWindow.js +48 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadWorkspace.js +227 -0
- package/dist/vscode/vs/workbench/api/common/cache.js +28 -0
- package/dist/vscode/vs/workbench/api/common/configurationExtensionPoint.js +450 -0
- package/dist/vscode/vs/workbench/api/common/extHost.protocol.js +131 -0
- package/dist/vscode/vs/workbench/api/common/extHostApiCommands.js +656 -0
- package/dist/vscode/vs/workbench/api/common/extHostApiDeprecationService.js +35 -0
- package/dist/vscode/vs/workbench/api/common/extHostBulkEdits.js +21 -0
- package/dist/vscode/vs/workbench/api/common/extHostClipboard.js +15 -0
- package/dist/vscode/vs/workbench/api/common/extHostCommands.js +415 -0
- package/dist/vscode/vs/workbench/api/common/extHostConfiguration.js +264 -0
- package/dist/vscode/vs/workbench/api/common/extHostDebugService.js +786 -0
- package/dist/vscode/vs/workbench/api/common/extHostDecorations.js +94 -0
- package/dist/vscode/vs/workbench/api/common/extHostDiagnostics.js +292 -0
- package/dist/vscode/vs/workbench/api/common/extHostDocumentContentProviders.js +65 -0
- package/dist/vscode/vs/workbench/api/common/extHostDocumentData.js +212 -0
- package/dist/vscode/vs/workbench/api/common/extHostDocumentSaveParticipant.js +126 -0
- package/dist/vscode/vs/workbench/api/common/extHostDocuments.js +144 -0
- package/dist/vscode/vs/workbench/api/common/extHostDocumentsAndEditors.js +147 -0
- package/dist/vscode/vs/workbench/api/common/extHostEditorTabs.js +328 -0
- package/dist/vscode/vs/workbench/api/common/extHostExtensionActivator.js +309 -0
- package/dist/vscode/vs/workbench/api/common/extHostExtensionService.js +814 -0
- package/dist/vscode/vs/workbench/api/common/extHostFileSystem.js +272 -0
- package/dist/vscode/vs/workbench/api/common/extHostFileSystemConsumer.js +153 -0
- package/dist/vscode/vs/workbench/api/common/extHostFileSystemEventService.js +193 -0
- package/dist/vscode/vs/workbench/api/common/extHostFileSystemInfo.js +35 -0
- package/dist/vscode/vs/workbench/api/common/extHostInitDataService.js +3 -0
- package/dist/vscode/vs/workbench/api/common/extHostLanguageFeatures.js +2038 -0
- package/dist/vscode/vs/workbench/api/common/extHostLanguages.js +164 -0
- package/dist/vscode/vs/workbench/api/common/extHostLocalizationService.js +85 -0
- package/dist/vscode/vs/workbench/api/common/extHostMemento.js +74 -0
- package/dist/vscode/vs/workbench/api/common/extHostMessageService.js +55 -0
- package/dist/vscode/vs/workbench/api/common/extHostOutput.js +257 -0
- package/dist/vscode/vs/workbench/api/common/extHostProgress.js +80 -0
- package/dist/vscode/vs/workbench/api/common/extHostQuickOpen.js +580 -0
- package/dist/vscode/vs/workbench/api/common/extHostRpcService.js +12 -0
- package/dist/vscode/vs/workbench/api/common/extHostSecretState.js +24 -0
- package/dist/vscode/vs/workbench/api/common/extHostSecrets.js +29 -0
- package/dist/vscode/vs/workbench/api/common/extHostStorage.js +42 -0
- package/dist/vscode/vs/workbench/api/common/extHostStoragePaths.js +64 -0
- package/dist/vscode/vs/workbench/api/common/extHostTelemetry.js +266 -0
- package/dist/vscode/vs/workbench/api/common/extHostTerminalService.js +3 -0
- package/dist/vscode/vs/workbench/api/common/extHostTestItem.js +122 -0
- package/dist/vscode/vs/workbench/api/common/extHostTestingPrivateApi.js +15 -0
- package/dist/vscode/vs/workbench/api/common/extHostTextEditor.js +511 -0
- package/dist/vscode/vs/workbench/api/common/extHostTextEditors.js +128 -0
- package/dist/vscode/vs/workbench/api/common/extHostTunnelService.js +36 -0
- package/dist/vscode/vs/workbench/api/common/extHostTypeConverters.js +1766 -0
- package/dist/vscode/vs/workbench/api/common/extHostTypes.js +2810 -0
- package/dist/vscode/vs/workbench/api/common/extHostUriTransformerService.js +19 -0
- package/dist/vscode/vs/workbench/api/common/extHostVariableResolverService.js +138 -0
- package/dist/vscode/vs/workbench/api/common/extHostWindow.js +59 -0
- package/dist/vscode/vs/workbench/api/common/extHostWorkspace.js +534 -0
- package/dist/vscode/vs/workbench/api/common/jsonValidationExtensionPoint.js +97 -0
- package/dist/vscode/vs/workbench/api/common/shared/dataTransferCache.js +36 -0
- package/dist/vscode/vs/workbench/browser/actions/layoutActions.js +1201 -0
- package/dist/vscode/vs/workbench/browser/actions.js +77 -0
- package/dist/vscode/vs/workbench/browser/codeeditor.js +185 -0
- package/dist/vscode/vs/workbench/browser/composite.js +102 -0
- package/dist/vscode/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.js +146 -0
- package/dist/vscode/vs/workbench/browser/parts/dialogs/dialog.web.contribution.js +68 -0
- package/dist/vscode/vs/workbench/browser/parts/dialogs/dialogHandler.js +124 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/editor.contribution.js +876 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/editor.js +4 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/editorActions.js +1946 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/editorAutoSave.js +157 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/editorCommands.js +1289 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/editorPane.js +242 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/editorQuickAccess.js +213 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/editorStatus.js +460 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/editorWithViewState.js +139 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/sideBySideEditor.js +387 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/textDiffEditor.js +289 -0
- package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsActions.js +124 -0
- package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsAlerts.js +58 -0
- package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsCenter.js +224 -0
- package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsCommands.js +241 -0
- package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsList.js +185 -0
- package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsTelemetry.js +35 -0
- package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsToasts.js +417 -0
- package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsViewer.js +392 -0
- package/dist/vscode/vs/workbench/browser/parts/panel/panelActions.js +422 -0
- package/dist/vscode/vs/workbench/browser/parts/views/viewPane.js +520 -0
- package/dist/vscode/vs/workbench/browser/quickaccess.js +17 -0
- package/dist/vscode/vs/workbench/common/component.js +23 -0
- package/dist/vscode/vs/workbench/common/configuration.js +8 -0
- package/dist/vscode/vs/workbench/common/contextkeys.js +170 -0
- package/dist/vscode/vs/workbench/common/contributions.js +111 -0
- package/dist/vscode/vs/workbench/common/dialogs.js +31 -0
- package/dist/vscode/vs/workbench/common/editor/binaryEditorModel.js +39 -0
- package/dist/vscode/vs/workbench/common/editor/diffEditorInput.js +164 -0
- package/dist/vscode/vs/workbench/common/editor/diffEditorModel.js +23 -0
- package/dist/vscode/vs/workbench/common/editor/editorInput.js +97 -0
- package/dist/vscode/vs/workbench/common/editor/editorModel.js +26 -0
- package/dist/vscode/vs/workbench/common/editor/editorOptions.js +48 -0
- package/dist/vscode/vs/workbench/common/editor/resourceEditorInput.js +133 -0
- package/dist/vscode/vs/workbench/common/editor/sideBySideEditorInput.js +228 -0
- package/dist/vscode/vs/workbench/common/editor/textDiffEditorModel.js +42 -0
- package/dist/vscode/vs/workbench/common/editor/textEditorModel.js +165 -0
- package/dist/vscode/vs/workbench/common/editor/textResourceEditorInput.js +146 -0
- package/dist/vscode/vs/workbench/common/editor/textResourceEditorModel.js +24 -0
- package/dist/vscode/vs/workbench/common/editor.js +307 -0
- package/dist/{memento.js → vscode/vs/workbench/common/memento.js} +1 -1
- package/dist/vscode/vs/workbench/common/notifications.js +448 -0
- package/dist/vscode/vs/workbench/common/resources.js +86 -0
- package/dist/{theme2.js → vscode/vs/workbench/common/theme.js} +1 -168
- package/dist/vscode/vs/workbench/common/views.js +20 -0
- package/dist/vscode/vs/workbench/contrib/audioCues/browser/audioCueDebuggerContribution.js +45 -0
- package/dist/vscode/vs/workbench/contrib/audioCues/browser/audioCueLineFeatureContribution.js +170 -0
- package/dist/vscode/vs/workbench/contrib/audioCues/browser/audioCues.contribution.js +160 -0
- package/dist/vscode/vs/workbench/contrib/audioCues/browser/commands.js +49 -0
- package/dist/vscode/vs/workbench/contrib/bulkEdit/browser/bulkCellEdits.js +25 -0
- package/dist/vscode/vs/workbench/contrib/callHierarchy/common/callHierarchy.js +126 -0
- package/dist/vscode/vs/workbench/contrib/codeEditor/browser/editorLineNumberMenu.js +100 -0
- package/dist/{languages.js → vscode/vs/workbench/contrib/codeEditor/browser/languageConfigurationExtensionPoint.js} +154 -180
- package/dist/vscode/vs/workbench/contrib/codeEditor/browser/menuPreventer.js +35 -0
- package/dist/vscode/vs/workbench/contrib/codeEditor/browser/selectionClipboard.js +2 -0
- package/dist/vscode/vs/workbench/contrib/codeEditor/browser/simpleEditorOptions.js +50 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/baseDebugView.js +192 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +776 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/breakpointWidget.js +378 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/breakpointsView.js +714 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/callStackEditorContribution.js +172 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debug.contribution.js +451 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugActionViewItems.js +294 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugAdapterManager.js +397 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugColors.js +309 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugCommands.js +749 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugConfigurationManager.js +619 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugConsoleQuickAccess.js +58 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugEditorContribution.js +675 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugHover.js +317 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugIcons.js +135 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugMemory.js +204 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugQuickAccess.js +142 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugService.js +1171 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugSession.js +1134 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugSessionPicker.js +104 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugTaskRunner.js +273 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugToolBar.js +312 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/exceptionWidget.js +103 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/linkDetector.js +229 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/rawDebugSession.js +666 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/variablesView.js +287 -0
- package/dist/vscode/vs/workbench/contrib/debug/common/abstractDebugAdapter.js +150 -0
- package/dist/vscode/vs/workbench/contrib/debug/common/breakpoints.js +19 -0
- package/dist/vscode/vs/workbench/contrib/debug/common/debug.js +285 -0
- package/dist/vscode/vs/workbench/contrib/debug/common/debugCompoundRoot.js +15 -0
- package/dist/vscode/vs/workbench/contrib/debug/common/debugContentProvider.js +96 -0
- package/dist/vscode/vs/workbench/contrib/debug/common/debugModel.js +1451 -0
- package/dist/vscode/vs/workbench/contrib/debug/common/debugSchemas.js +344 -0
- package/dist/vscode/vs/workbench/contrib/debug/common/debugSource.js +121 -0
- package/dist/vscode/vs/workbench/contrib/debug/common/debugStorage.js +148 -0
- package/dist/vscode/vs/workbench/contrib/debug/common/debugTelemetry.js +34 -0
- package/dist/vscode/vs/workbench/contrib/debug/common/debugUtils.js +292 -0
- package/dist/vscode/vs/workbench/contrib/debug/common/debugViewModel.js +107 -0
- package/dist/vscode/vs/workbench/contrib/debug/common/debugger.js +254 -0
- package/dist/vscode/vs/workbench/contrib/debug/common/disassemblyViewInput.js +25 -0
- package/dist/vscode/vs/workbench/contrib/debug/common/loadedScriptsPicker.js +81 -0
- package/dist/vscode/vs/workbench/contrib/debug/common/replModel.js +230 -0
- package/dist/vscode/vs/workbench/contrib/extensions/common/extensions.js +3 -0
- package/dist/vscode/vs/workbench/contrib/files/browser/editors/fileEditorInput.js +321 -0
- package/dist/vscode/vs/workbench/contrib/files/browser/explorerService.js +398 -0
- package/dist/vscode/vs/workbench/contrib/files/browser/files.contribution.js +389 -0
- package/dist/vscode/vs/workbench/contrib/files/browser/files.js +3 -0
- package/dist/vscode/vs/workbench/contrib/files/common/explorerFileNestingTrie.js +212 -0
- package/dist/vscode/vs/workbench/contrib/files/common/explorerModel.js +369 -0
- package/dist/{files2.js → vscode/vs/workbench/contrib/files/common/files.js} +1 -1
- package/dist/vscode/vs/workbench/contrib/markers/common/markers.js +20 -0
- package/dist/vscode/vs/workbench/contrib/notebook/common/notebookCommon.js +9 -0
- package/dist/vscode/vs/workbench/contrib/output/browser/outputLinkProvider.js +74 -0
- package/dist/vscode/vs/workbench/contrib/output/browser/outputServices.js +166 -0
- package/dist/vscode/vs/workbench/contrib/output/common/outputChannelModel.js +317 -0
- package/dist/vscode/vs/workbench/contrib/output/common/outputChannelModelService.js +31 -0
- package/dist/vscode/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.js +153 -0
- package/dist/vscode/vs/workbench/contrib/search/common/search.js +27 -0
- package/dist/vscode/vs/workbench/contrib/snippets/browser/snippetCompletionProvider.js +159 -0
- package/dist/vscode/vs/workbench/contrib/snippets/browser/snippets.js +3 -0
- package/dist/vscode/vs/workbench/contrib/snippets/browser/snippetsFile.js +229 -0
- package/dist/{snippetsService.js → vscode/vs/workbench/contrib/snippets/browser/snippetsService.js} +28 -412
- package/dist/vscode/vs/workbench/contrib/snippets/browser/tabCompletion.js +166 -0
- package/dist/vscode/vs/workbench/contrib/tasks/common/taskDefinitionRegistry.js +161 -0
- package/dist/vscode/vs/workbench/contrib/tasks/common/taskService.js +3 -0
- package/dist/vscode/vs/workbench/contrib/testing/common/testId.js +109 -0
- package/dist/vscode/vs/workbench/contrib/testing/common/testItemCollection.js +75 -0
- package/dist/vscode/vs/workbench/contrib/testing/common/testTypes.js +7 -0
- package/dist/vscode/vs/workbench/contrib/typeHierarchy/common/typeHierarchy.js +133 -0
- package/dist/vscode/vs/workbench/services/actions/common/menusExtensionPoint.js +829 -0
- package/dist/vscode/vs/workbench/services/activity/common/activity.js +22 -0
- package/dist/vscode/vs/workbench/services/configuration/browser/configuration.js +847 -0
- package/dist/vscode/vs/workbench/services/configuration/browser/configurationService.js +1104 -0
- package/dist/{configuration2.js → vscode/vs/workbench/services/configuration/common/configuration.js} +1 -1
- package/dist/vscode/vs/workbench/services/configuration/common/configurationCache.js +80 -0
- package/dist/vscode/vs/workbench/services/configuration/common/configurationEditing.js +590 -0
- package/dist/vscode/vs/workbench/services/configuration/common/configurationModels.js +119 -0
- package/dist/vscode/vs/workbench/services/configuration/common/jsonEditing.js +9 -0
- package/dist/vscode/vs/workbench/services/configuration/common/jsonEditingService.js +119 -0
- package/dist/vscode/vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService.js +303 -0
- package/dist/vscode/vs/workbench/services/configurationResolver/browser/configurationResolverService.js +26 -0
- package/dist/vscode/vs/workbench/services/configurationResolver/common/configurationResolver.js +36 -0
- package/dist/vscode/vs/workbench/services/configurationResolver/common/configurationResolverSchema.js +174 -0
- package/dist/vscode/vs/workbench/services/configurationResolver/common/configurationResolverUtils.js +10 -0
- package/dist/vscode/vs/workbench/services/configurationResolver/common/variableResolver.js +299 -0
- package/dist/vscode/vs/workbench/services/decorations/browser/decorationsService.js +312 -0
- package/dist/vscode/vs/workbench/services/decorations/common/decorations.js +3 -0
- package/dist/vscode/vs/workbench/services/dialogs/common/dialogService.js +65 -0
- package/dist/vscode/vs/workbench/services/editor/browser/codeEditorService.js +80 -0
- package/dist/vscode/vs/workbench/services/editor/common/editorGroupColumn.js +23 -0
- package/dist/vscode/vs/workbench/services/editor/common/editorGroupsService.js +14 -0
- package/dist/vscode/vs/workbench/services/editor/common/editorResolverService.js +31 -0
- package/dist/vscode/vs/workbench/services/editor/common/editorService.js +10 -0
- package/dist/vscode/vs/workbench/services/environment/browser/environmentService.js +4 -0
- package/dist/vscode/vs/workbench/services/environment/common/environmentService.js +4 -0
- package/dist/vscode/vs/workbench/services/extensionManagement/common/extensionManagement.js +6 -0
- package/dist/vscode/vs/workbench/services/extensions/common/extHostCustomers.js +40 -0
- package/dist/vscode/vs/workbench/services/extensions/common/extensionDescriptionRegistry.js +189 -0
- package/dist/vscode/vs/workbench/services/extensions/common/extensionDevOptions.js +23 -0
- package/dist/vscode/vs/workbench/services/extensions/common/extensionHostProtocol.js +6 -0
- package/dist/vscode/vs/workbench/services/extensions/common/extensions.js +57 -0
- package/dist/vscode/vs/workbench/services/extensions/common/extensionsApiProposals.js +74 -0
- package/dist/{extensionsRegistry.js → vscode/vs/workbench/services/extensions/common/extensionsRegistry.js} +87 -208
- package/dist/vscode/vs/workbench/services/extensions/common/lazyPromise.js +70 -0
- package/dist/vscode/vs/workbench/services/extensions/common/proxyIdentifier.js +23 -0
- package/dist/vscode/vs/workbench/services/extensions/common/remoteConsoleUtil.js +47 -0
- package/dist/vscode/vs/workbench/services/extensions/common/rpcProtocol.js +762 -0
- package/dist/vscode/vs/workbench/services/extensions/common/workspaceContains.js +92 -0
- package/dist/vscode/vs/workbench/services/files/browser/elevatedFileService.js +9 -0
- package/dist/vscode/vs/workbench/services/files/common/elevatedFileService.js +3 -0
- package/dist/vscode/vs/workbench/services/files/common/files.js +4 -0
- package/dist/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService.js +124 -0
- package/dist/vscode/vs/workbench/services/history/common/history.js +3 -0
- package/dist/vscode/vs/workbench/services/host/browser/host.js +3 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keybindingService.js +855 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayoutService.js +490 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/cz.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/de-swiss.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/de.darwin.js +125 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/de.linux.js +180 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/de.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/dk.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/dvorak.darwin.js +125 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en-belgian.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en-ext.darwin.js +125 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en-in.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en-intl.darwin.js +125 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en-intl.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en-uk.darwin.js +125 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en-uk.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en.darwin.js +133 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en.linux.js +182 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en.win.js +167 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/es-latin.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/es.darwin.js +125 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/es.linux.js +180 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/es.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/fr.darwin.js +125 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/fr.linux.js +180 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/fr.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/hu.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/it.darwin.js +125 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/it.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/jp-roman.darwin.js +125 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/jp.darwin.js +125 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/ko.darwin.js +125 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.darwin.js +17 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.linux.js +6 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.win.js +23 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/no.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/pl.darwin.js +125 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/pl.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/pt-br.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/pt.darwin.js +125 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/pt.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/ru.darwin.js +125 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/ru.linux.js +180 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/ru.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/sv.win.js +164 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/thai.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/tr.win.js +162 -0
- package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/zh-hans.darwin.js +125 -0
- package/dist/vscode/vs/workbench/services/keybinding/common/fallbackKeyboardMapper.js +28 -0
- package/dist/vscode/vs/workbench/services/keybinding/common/keybindingIO.js +72 -0
- package/dist/vscode/vs/workbench/services/keybinding/common/keymapInfo.js +108 -0
- package/dist/vscode/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.js +888 -0
- package/dist/vscode/vs/workbench/services/keybinding/common/windowsKeyboardMapper.js +350 -0
- package/dist/vscode/vs/workbench/services/label/common/labelService.js +302 -0
- package/dist/{languageService.js → vscode/vs/workbench/services/language/common/languageService.js} +8 -163
- package/dist/vscode/vs/workbench/services/languageDetection/common/languageDetectionWorkerService.js +5 -0
- package/dist/vscode/vs/workbench/services/languageStatus/common/languageStatusService.js +3 -0
- package/dist/vscode/vs/workbench/services/layout/browser/layoutService.js +12 -0
- package/dist/vscode/vs/workbench/services/lifecycle/common/lifecycle.js +11 -0
- package/dist/vscode/vs/workbench/services/lifecycle/common/lifecycleService.js +85 -0
- package/dist/vscode/vs/workbench/services/notification/common/notificationService.js +186 -0
- package/dist/vscode/vs/workbench/services/output/common/output.js +51 -0
- package/dist/vscode/vs/workbench/services/panecomposite/browser/panecomposite.js +3 -0
- package/dist/vscode/vs/workbench/services/path/browser/pathService.js +34 -0
- package/dist/vscode/vs/workbench/services/path/common/pathService.js +107 -0
- package/dist/vscode/vs/workbench/services/preferences/browser/keybindingsEditorInput.js +35 -0
- package/dist/vscode/vs/workbench/services/preferences/browser/keybindingsEditorModel.js +555 -0
- package/dist/vscode/vs/workbench/services/preferences/browser/preferencesService.js +547 -0
- package/dist/vscode/vs/workbench/services/preferences/common/preferences.js +20 -0
- package/dist/vscode/vs/workbench/services/preferences/common/preferencesEditorInput.js +37 -0
- package/dist/vscode/vs/workbench/services/preferences/common/preferencesModels.js +1031 -0
- package/dist/vscode/vs/workbench/services/preferences/common/preferencesValidation.js +357 -0
- package/dist/vscode/vs/workbench/services/progress/browser/progressIndicator.js +174 -0
- package/dist/vscode/vs/workbench/services/remote/common/remoteAgentService.js +3 -0
- package/dist/vscode/vs/workbench/services/search/common/queryBuilder.js +428 -0
- package/dist/vscode/vs/workbench/services/search/common/search.js +158 -0
- package/dist/vscode/vs/workbench/services/search/common/searchHelpers.js +72 -0
- package/dist/vscode/vs/workbench/services/search/common/searchService.js +355 -0
- package/dist/vscode/vs/workbench/services/textMate/browser/arrayOperation.js +62 -0
- package/dist/vscode/vs/workbench/services/textMate/browser/textMateTokenizationFeature.js +3 -0
- package/dist/vscode/vs/workbench/services/textMate/browser/textMateTokenizationFeatureImpl.js +422 -0
- package/dist/vscode/vs/workbench/services/textMate/browser/tokenizationSupport/textMateTokenizationSupport.js +60 -0
- package/dist/vscode/vs/workbench/services/textMate/browser/tokenizationSupport/tokenizationSupportWithLineLimit.js +36 -0
- package/dist/vscode/vs/workbench/services/textMate/browser/workerHost/textMateWorkerHost.js +198 -0
- package/dist/vscode/vs/workbench/services/textMate/browser/workerHost/textMateWorkerTokenizerController.js +151 -0
- package/dist/vscode/vs/workbench/services/textMate/common/TMGrammarFactory.js +117 -0
- package/dist/vscode/vs/workbench/services/textMate/common/TMGrammars.js +93 -0
- package/dist/vscode/vs/workbench/services/textMate/common/TMScopeRegistry.js +24 -0
- package/dist/vscode/vs/workbench/services/textfile/browser/browserTextFileService.js +55 -0
- package/dist/vscode/vs/workbench/services/textfile/browser/textFileService.js +578 -0
- package/dist/vscode/vs/workbench/services/textfile/common/encoding.js +493 -0
- package/dist/vscode/vs/workbench/services/textfile/common/textEditorService.js +150 -0
- package/dist/vscode/vs/workbench/services/textfile/common/textFileEditorModel.js +711 -0
- package/dist/vscode/vs/workbench/services/textfile/common/textFileEditorModelManager.js +401 -0
- package/dist/vscode/vs/workbench/services/textfile/common/textFileSaveParticipant.js +54 -0
- package/dist/vscode/vs/workbench/services/textfile/common/textfiles.js +45 -0
- package/dist/vscode/vs/workbench/services/textmodelResolver/common/textModelResolverService.js +187 -0
- package/dist/vscode/vs/workbench/services/themes/browser/browserHostColorSchemeService.js +37 -0
- package/dist/vscode/vs/workbench/services/themes/browser/fileIconThemeData.js +353 -0
- package/dist/vscode/vs/workbench/services/themes/browser/productIconThemeData.js +291 -0
- package/dist/vscode/vs/workbench/services/themes/browser/workbenchThemeService.js +736 -0
- package/dist/vscode/vs/workbench/services/themes/common/colorExtensionPoint.js +171 -0
- package/dist/vscode/vs/workbench/services/themes/common/colorThemeData.js +864 -0
- package/dist/vscode/vs/workbench/services/themes/common/colorThemeSchema.js +265 -0
- package/dist/vscode/vs/workbench/services/themes/common/fileIconThemeSchema.js +303 -0
- package/dist/vscode/vs/workbench/services/themes/common/hostColorSchemeService.js +3 -0
- package/dist/vscode/vs/workbench/services/themes/common/plistParser.js +439 -0
- package/dist/vscode/vs/workbench/services/themes/common/productIconThemeSchema.js +94 -0
- package/dist/vscode/vs/workbench/services/themes/common/textMateScopeMatcher.js +120 -0
- package/dist/vscode/vs/workbench/services/themes/common/themeCompatibility.js +66 -0
- package/dist/vscode/vs/workbench/services/themes/common/themeConfiguration.js +374 -0
- package/dist/vscode/vs/workbench/services/themes/common/themeExtensionPoints.js +258 -0
- package/dist/vscode/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.js +268 -0
- package/dist/vscode/vs/workbench/services/themes/common/workbenchThemeService.js +46 -0
- package/dist/vscode/vs/workbench/services/timer/browser/timerService.js +3 -0
- package/dist/vscode/vs/workbench/services/untitled/common/untitledTextEditorInput.js +122 -0
- package/dist/vscode/vs/workbench/services/untitled/common/untitledTextEditorModel.js +240 -0
- package/dist/vscode/vs/workbench/services/untitled/common/untitledTextEditorService.js +3 -0
- package/dist/vscode/vs/workbench/services/userData/browser/userDataInit.js +3 -0
- package/dist/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.js +7 -0
- package/dist/vscode/vs/workbench/services/userDataProfile/common/userDataProfileService.js +52 -0
- package/dist/vscode/vs/workbench/services/workingCopy/common/storedFileWorkingCopySaveParticipant.js +55 -0
- package/dist/vscode/vs/workbench/services/workingCopy/common/workingCopy.js +2 -0
- package/dist/vscode/vs/workbench/services/workingCopy/common/workingCopyBackup.js +3 -0
- package/dist/vscode/vs/workbench/services/workingCopy/common/workingCopyBackupService.js +414 -0
- package/dist/vscode/vs/workbench/services/workingCopy/common/workingCopyFileOperationParticipant.js +39 -0
- package/dist/vscode/vs/workbench/services/workingCopy/common/workingCopyFileService.js +181 -0
- package/dist/vscode/vs/workbench/services/workingCopy/common/workingCopyService.js +112 -0
- package/dist/vscode/vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService.js +325 -0
- package/dist/vscode/vs/workbench/services/workspaces/browser/workspaces.js +11 -0
- package/dist/vscode/vs/workbench/services/workspaces/browser/workspacesService.js +154 -0
- package/dist/vscode/vs/workbench/services/workspaces/common/workspaceEditing.js +3 -0
- package/dist/vscode-default-extensions/bat/package.json.js +2 -0
- package/dist/vscode-default-extensions/clojure/package.json.js +2 -0
- package/dist/vscode-default-extensions/coffeescript/package.json.js +2 -0
- package/dist/vscode-default-extensions/cpp/package.json.js +2 -0
- package/dist/vscode-default-extensions/csharp/package.json.js +2 -0
- package/dist/vscode-default-extensions/css/package.json.js +2 -0
- package/dist/vscode-default-extensions/dart/package.json.js +2 -0
- package/dist/vscode-default-extensions/diff/package.json.js +2 -0
- package/dist/vscode-default-extensions/docker/package.json.js +2 -0
- package/dist/vscode-default-extensions/fsharp/package.json.js +2 -0
- package/dist/vscode-default-extensions/go/package.json.js +2 -0
- package/dist/vscode-default-extensions/groovy/package.json.js +2 -0
- package/dist/vscode-default-extensions/handlebars/package.json.js +2 -0
- package/dist/vscode-default-extensions/hlsl/package.json.js +2 -0
- package/dist/vscode-default-extensions/html/package.json.js +2 -0
- package/dist/vscode-default-extensions/ini/package.json.js +2 -0
- package/dist/vscode-default-extensions/java/package.json.js +2 -0
- package/dist/vscode-default-extensions/javascript/package.json.js +2 -0
- package/dist/vscode-default-extensions/json/package.json.js +2 -0
- package/dist/vscode-default-extensions/julia/package.json.js +2 -0
- package/dist/vscode-default-extensions/latex/package.json.js +2 -0
- package/dist/vscode-default-extensions/less/package.json.js +2 -0
- package/dist/vscode-default-extensions/log/package.json.js +2 -0
- package/dist/vscode-default-extensions/lua/package.json.js +2 -0
- package/dist/vscode-default-extensions/make/package.json.js +2 -0
- package/dist/vscode-default-extensions/markdown-basics/package.json.js +2 -0
- package/dist/vscode-default-extensions/objective-c/package.json.js +2 -0
- package/dist/vscode-default-extensions/perl/package.json.js +2 -0
- package/dist/vscode-default-extensions/php/package.json.js +2 -0
- package/dist/vscode-default-extensions/powershell/package.json.js +2 -0
- package/dist/vscode-default-extensions/pug/package.json.js +2 -0
- package/dist/vscode-default-extensions/python/package.json.js +2 -0
- package/dist/vscode-default-extensions/r/package.json.js +2 -0
- package/dist/vscode-default-extensions/razor/package.json.js +2 -0
- package/dist/vscode-default-extensions/ruby/package.json.js +2 -0
- package/dist/vscode-default-extensions/rust/package.json.js +2 -0
- package/dist/vscode-default-extensions/scss/package.json.js +2 -0
- package/dist/vscode-default-extensions/shaderlab/package.json.js +2 -0
- package/dist/vscode-default-extensions/shellscript/package.json.js +2 -0
- package/dist/vscode-default-extensions/sql/package.json.js +2 -0
- package/dist/vscode-default-extensions/swift/package.json.js +2 -0
- package/dist/vscode-default-extensions/theme-abyss/package.json.js +2 -0
- package/dist/vscode-default-extensions/theme-defaults/package.json.js +2 -0
- package/dist/vscode-default-extensions/theme-kimbie-dark/package.json.js +2 -0
- package/dist/vscode-default-extensions/theme-monokai/package.json.js +2 -0
- package/dist/vscode-default-extensions/theme-monokai-dimmed/package.json.js +2 -0
- package/dist/vscode-default-extensions/theme-quietlight/package.json.js +2 -0
- package/dist/vscode-default-extensions/theme-red/package.json.js +2 -0
- package/dist/vscode-default-extensions/theme-seti/package.json.js +2 -0
- package/dist/vscode-default-extensions/theme-solarized-dark/package.json.js +2 -0
- package/dist/vscode-default-extensions/theme-solarized-light/package.json.js +2 -0
- package/dist/vscode-default-extensions/theme-tomorrow-night-blue/package.json.js +2 -0
- package/dist/vscode-default-extensions/typescript-basics/package.json.js +2 -0
- package/dist/vscode-default-extensions/typescript-language-features/package.json.js +2 -0
- package/dist/vscode-default-extensions/vb/package.json.js +2 -0
- package/dist/vscode-default-extensions/xml/package.json.js +2 -0
- package/dist/vscode-default-extensions/yaml/package.json.js +2 -0
- package/dist/vscode-services/commands.js +37 -0
- package/dist/vscode-services/debug.js +74 -0
- package/dist/vscode-services/env.js +69 -0
- package/dist/vscode-services/extHost.js +385 -0
- package/dist/vscode-services/extensions.js +46 -0
- package/dist/vscode-services/languages.js +203 -0
- package/dist/vscode-services/missing-services.js +959 -0
- package/dist/vscode-services/window.js +189 -0
- package/dist/vscode-services/workspace.js +164 -0
- package/monaco-editor-treemending.patch +23574 -0
- package/monaco-treemending.js +3 -0
- package/package.json +55 -59
- package/dist/api2.js +0 -1294
- package/dist/audioCue.js +0 -805
- package/dist/button.js +0 -352
- package/dist/configuration.js +0 -4438
- package/dist/debug.js +0 -15673
- package/dist/dialogs.js +0 -752
- package/dist/dom.js +0 -101
- package/dist/files.js +0 -3167
- package/dist/keybindings.js +0 -4310
- package/dist/layout.contribution.darwin.js +0 -1994
- package/dist/layout.contribution.linux.js +0 -899
- package/dist/layout.contribution.win.js +0 -3551
- package/dist/modelEditor.js +0 -8893
- package/dist/notifications.js +0 -2302
- package/dist/platform.js +0 -105
- package/dist/polyfill.js +0 -55651
- package/dist/preferences.js +0 -2532
- package/dist/textmate.js +0 -1428
- package/dist/theme.js +0 -4116
- package/dist/utils.js +0 -345
- package/dist/webpack-loader.cjs +0 -18
- package/dist/webpack-loader.d.ts +0 -4
- package/dist/{iconv.js → override/iconv.js} +0 -0
- package/dist/{jschardet.js → override/jschardet.js} +0 -0
- package/dist/{audioCue.d.ts → service-override/audioCue.d.ts} +0 -0
- package/dist/{configuration.d.ts → service-override/configuration.d.ts} +0 -0
- package/dist/{debug.d.ts → service-override/debug.d.ts} +0 -0
- package/dist/{dialogs.d.ts → service-override/dialogs.d.ts} +0 -0
- package/dist/{files.d.ts → service-override/files.d.ts} +0 -0
- package/dist/{keybindings.d.ts → service-override/keybindings.d.ts} +0 -0
- package/dist/{languages.d.ts → service-override/languages.d.ts} +0 -0
- package/dist/{modelEditor.d.ts → service-override/modelEditor.d.ts} +0 -0
- package/dist/{notifications.d.ts → service-override/notifications.d.ts} +0 -0
- package/dist/{preferences.d.ts → service-override/preferences.d.ts} +0 -0
- package/dist/{snippets.d.ts → service-override/snippets.d.ts} +0 -0
- package/dist/{textmate.d.ts → service-override/textmate.d.ts} +0 -0
- package/dist/{theme.d.ts → service-override/theme.d.ts} +0 -0
- package/dist/{injection.js → tools/injection.js} +0 -0
- package/dist/{jsonErrorMessages.js → vscode/vs/base/common/jsonErrorMessages.js} +0 -0
- package/dist/{_.contribution.js → vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/_.contribution.js} +0 -0
- package/dist/{unboundCommands.js → vscode/vs/workbench/services/keybinding/browser/unboundCommands.js} +2 -2
- /package/dist/{language-configuration.js → vscode-default-extensions/bat/language-configuration.json.js} +0 -0
- /package/dist/{batchfile.js → vscode-default-extensions/bat/snippets/batchfile.code-snippets.js} +0 -0
- /package/dist/{batchfile.tmLanguage.js → vscode-default-extensions/bat/syntaxes/batchfile.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration2.js → vscode-default-extensions/clojure/language-configuration.json.js} +0 -0
- /package/dist/{clojure.tmLanguage.js → vscode-default-extensions/clojure/syntaxes/clojure.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration3.js → vscode-default-extensions/coffeescript/language-configuration.json.js} +0 -0
- /package/dist/{coffeescript.js → vscode-default-extensions/coffeescript/snippets/coffeescript.code-snippets.js} +0 -0
- /package/dist/{coffeescript.tmLanguage.js → vscode-default-extensions/coffeescript/syntaxes/coffeescript.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration4.js → vscode-default-extensions/cpp/language-configuration.json.js} +0 -0
- /package/dist/{c.js → vscode-default-extensions/cpp/snippets/c.code-snippets.js} +0 -0
- /package/dist/{cpp.js → vscode-default-extensions/cpp/snippets/cpp.code-snippets.js} +0 -0
- /package/dist/{c.tmLanguage.js → vscode-default-extensions/cpp/syntaxes/c.tmLanguage.json.js} +0 -0
- /package/dist/{cpp.embedded.macro.tmLanguage.js → vscode-default-extensions/cpp/syntaxes/cpp.embedded.macro.tmLanguage.json.js} +0 -0
- /package/dist/{cpp.tmLanguage.js → vscode-default-extensions/cpp/syntaxes/cpp.tmLanguage.json.js} +0 -0
- /package/dist/{cuda-cpp.tmLanguage.js → vscode-default-extensions/cpp/syntaxes/cuda-cpp.tmLanguage.json.js} +0 -0
- /package/dist/{platform.tmLanguage.js → vscode-default-extensions/cpp/syntaxes/platform.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration5.js → vscode-default-extensions/csharp/language-configuration.json.js} +0 -0
- /package/dist/{csharp.js → vscode-default-extensions/csharp/snippets/csharp.code-snippets.js} +0 -0
- /package/dist/{csharp.tmLanguage.js → vscode-default-extensions/csharp/syntaxes/csharp.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration6.js → vscode-default-extensions/css/language-configuration.json.js} +0 -0
- /package/dist/{css.tmLanguage.js → vscode-default-extensions/css/syntaxes/css.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration7.js → vscode-default-extensions/dart/language-configuration.json.js} +0 -0
- /package/dist/{dart.tmLanguage.js → vscode-default-extensions/dart/syntaxes/dart.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration8.js → vscode-default-extensions/diff/language-configuration.json.js} +0 -0
- /package/dist/{diff.tmLanguage.js → vscode-default-extensions/diff/syntaxes/diff.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration9.js → vscode-default-extensions/docker/language-configuration.json.js} +0 -0
- /package/dist/{docker.tmLanguage.js → vscode-default-extensions/docker/syntaxes/docker.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration10.js → vscode-default-extensions/fsharp/language-configuration.json.js} +0 -0
- /package/dist/{fsharp.js → vscode-default-extensions/fsharp/snippets/fsharp.code-snippets.js} +0 -0
- /package/dist/{fsharp.tmLanguage.js → vscode-default-extensions/fsharp/syntaxes/fsharp.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration11.js → vscode-default-extensions/go/language-configuration.json.js} +0 -0
- /package/dist/{go.tmLanguage.js → vscode-default-extensions/go/syntaxes/go.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration12.js → vscode-default-extensions/groovy/language-configuration.json.js} +0 -0
- /package/dist/{groovy.js → vscode-default-extensions/groovy/snippets/groovy.code-snippets.js} +0 -0
- /package/dist/{groovy.tmLanguage.js → vscode-default-extensions/groovy/syntaxes/groovy.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration13.js → vscode-default-extensions/handlebars/language-configuration.json.js} +0 -0
- /package/dist/{Handlebars.tmLanguage.js → vscode-default-extensions/handlebars/syntaxes/Handlebars.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration14.js → vscode-default-extensions/hlsl/language-configuration.json.js} +0 -0
- /package/dist/{hlsl.tmLanguage.js → vscode-default-extensions/hlsl/syntaxes/hlsl.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration15.js → vscode-default-extensions/html/language-configuration.json.js} +0 -0
- /package/dist/{html.js → vscode-default-extensions/html/snippets/html.code-snippets.js} +0 -0
- /package/dist/{html-derivative.tmLanguage.js → vscode-default-extensions/html/syntaxes/html-derivative.tmLanguage.json.js} +0 -0
- /package/dist/{html.tmLanguage.js → vscode-default-extensions/html/syntaxes/html.tmLanguage.json.js} +0 -0
- /package/dist/{ini.language-configuration.js → vscode-default-extensions/ini/ini.language-configuration.json.js} +0 -0
- /package/dist/{properties.language-configuration.js → vscode-default-extensions/ini/properties.language-configuration.json.js} +0 -0
- /package/dist/{ini.tmLanguage.js → vscode-default-extensions/ini/syntaxes/ini.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration16.js → vscode-default-extensions/java/language-configuration.json.js} +0 -0
- /package/dist/{java.js → vscode-default-extensions/java/snippets/java.code-snippets.js} +0 -0
- /package/dist/{java.tmLanguage.js → vscode-default-extensions/java/syntaxes/java.tmLanguage.json.js} +0 -0
- /package/dist/{javascript-language-configuration.js → vscode-default-extensions/javascript/javascript-language-configuration.json.js} +0 -0
- /package/dist/{javascript.js → vscode-default-extensions/javascript/snippets/javascript.code-snippets.js} +0 -0
- /package/dist/{JavaScript.tmLanguage.js → vscode-default-extensions/javascript/syntaxes/JavaScript.tmLanguage.json.js} +0 -0
- /package/dist/{JavaScriptReact.tmLanguage.js → vscode-default-extensions/javascript/syntaxes/JavaScriptReact.tmLanguage.json.js} +0 -0
- /package/dist/{Regular Expressions (JavaScript).js → vscode-default-extensions/javascript/syntaxes/Regular Expressions (JavaScript).tmLanguage.js} +0 -0
- /package/dist/{tags-language-configuration.js → vscode-default-extensions/javascript/tags-language-configuration.json.js} +0 -0
- /package/dist/{language-configuration17.js → vscode-default-extensions/json/language-configuration.json.js} +0 -0
- /package/dist/{JSON.tmLanguage.js → vscode-default-extensions/json/syntaxes/JSON.tmLanguage.json.js} +0 -0
- /package/dist/{JSONC.tmLanguage.js → vscode-default-extensions/json/syntaxes/JSONC.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration18.js → vscode-default-extensions/julia/language-configuration.json.js} +0 -0
- /package/dist/{julia.tmLanguage.js → vscode-default-extensions/julia/syntaxes/julia.tmLanguage.json.js} +0 -0
- /package/dist/{latex-cpp-embedded-language-configuration.js → vscode-default-extensions/latex/latex-cpp-embedded-language-configuration.json.js} +0 -0
- /package/dist/{latex-language-configuration.js → vscode-default-extensions/latex/latex-language-configuration.json.js} +0 -0
- /package/dist/{markdown-latex-combined-language-configuration.js → vscode-default-extensions/latex/markdown-latex-combined-language-configuration.json.js} +0 -0
- /package/dist/{Bibtex.tmLanguage.js → vscode-default-extensions/latex/syntaxes/Bibtex.tmLanguage.json.js} +0 -0
- /package/dist/{LaTeX.tmLanguage.js → vscode-default-extensions/latex/syntaxes/LaTeX.tmLanguage.json.js} +0 -0
- /package/dist/{TeX.tmLanguage.js → vscode-default-extensions/latex/syntaxes/TeX.tmLanguage.json.js} +0 -0
- /package/dist/{cpp-grammar-bailout.tmLanguage.js → vscode-default-extensions/latex/syntaxes/cpp-grammar-bailout.tmLanguage.json.js} +0 -0
- /package/dist/{markdown-latex-combined.tmLanguage.js → vscode-default-extensions/latex/syntaxes/markdown-latex-combined.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration19.js → vscode-default-extensions/less/language-configuration.json.js} +0 -0
- /package/dist/{less.tmLanguage.js → vscode-default-extensions/less/syntaxes/less.tmLanguage.json.js} +0 -0
- /package/dist/{log.tmLanguage.js → vscode-default-extensions/log/syntaxes/log.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration20.js → vscode-default-extensions/lua/language-configuration.json.js} +0 -0
- /package/dist/{lua.tmLanguage.js → vscode-default-extensions/lua/syntaxes/lua.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration21.js → vscode-default-extensions/make/language-configuration.json.js} +0 -0
- /package/dist/{make.tmLanguage.js → vscode-default-extensions/make/syntaxes/make.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration22.js → vscode-default-extensions/markdown-basics/language-configuration.json.js} +0 -0
- /package/dist/{markdown.js → vscode-default-extensions/markdown-basics/snippets/markdown.code-snippets.js} +0 -0
- /package/dist/{markdown.tmLanguage.js → vscode-default-extensions/markdown-basics/syntaxes/markdown.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration23.js → vscode-default-extensions/objective-c/language-configuration.json.js} +0 -0
- /package/dist/{objective-c.tmLanguage.js → vscode-default-extensions/objective-c/syntaxes/objective-c.tmLanguage.json.js} +0 -0
- /package/dist/{objective-c__.tmLanguage.js → vscode-default-extensions/objective-c/syntaxes/objective-c__.tmLanguage.json.js} +0 -0
- /package/dist/{perl.language-configuration.js → vscode-default-extensions/perl/perl.language-configuration.json.js} +0 -0
- /package/dist/{perl6.language-configuration.js → vscode-default-extensions/perl/perl6.language-configuration.json.js} +0 -0
- /package/dist/{perl.tmLanguage.js → vscode-default-extensions/perl/syntaxes/perl.tmLanguage.json.js} +0 -0
- /package/dist/{perl6.tmLanguage.js → vscode-default-extensions/perl/syntaxes/perl6.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration24.js → vscode-default-extensions/php/language-configuration.json.js} +0 -0
- /package/dist/{php.js → vscode-default-extensions/php/snippets/php.code-snippets.js} +0 -0
- /package/dist/{html.tmLanguage2.js → vscode-default-extensions/php/syntaxes/html.tmLanguage.json.js} +0 -0
- /package/dist/{php.tmLanguage.js → vscode-default-extensions/php/syntaxes/php.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration25.js → vscode-default-extensions/powershell/language-configuration.json.js} +0 -0
- /package/dist/{powershell.tmLanguage.js → vscode-default-extensions/powershell/syntaxes/powershell.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration26.js → vscode-default-extensions/pug/language-configuration.json.js} +0 -0
- /package/dist/{pug.tmLanguage.js → vscode-default-extensions/pug/syntaxes/pug.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration27.js → vscode-default-extensions/python/language-configuration.json.js} +0 -0
- /package/dist/{MagicPython.tmLanguage.js → vscode-default-extensions/python/syntaxes/MagicPython.tmLanguage.json.js} +0 -0
- /package/dist/{MagicRegExp.tmLanguage.js → vscode-default-extensions/python/syntaxes/MagicRegExp.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration28.js → vscode-default-extensions/r/language-configuration.json.js} +0 -0
- /package/dist/{r.tmLanguage.js → vscode-default-extensions/r/syntaxes/r.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration29.js → vscode-default-extensions/razor/language-configuration.json.js} +0 -0
- /package/dist/{cshtml.tmLanguage.js → vscode-default-extensions/razor/syntaxes/cshtml.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration30.js → vscode-default-extensions/ruby/language-configuration.json.js} +0 -0
- /package/dist/{ruby.tmLanguage.js → vscode-default-extensions/ruby/syntaxes/ruby.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration31.js → vscode-default-extensions/rust/language-configuration.json.js} +0 -0
- /package/dist/{rust.tmLanguage.js → vscode-default-extensions/rust/syntaxes/rust.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration32.js → vscode-default-extensions/scss/language-configuration.json.js} +0 -0
- /package/dist/{sassdoc.tmLanguage.js → vscode-default-extensions/scss/syntaxes/sassdoc.tmLanguage.json.js} +0 -0
- /package/dist/{scss.tmLanguage.js → vscode-default-extensions/scss/syntaxes/scss.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration33.js → vscode-default-extensions/shaderlab/language-configuration.json.js} +0 -0
- /package/dist/{shaderlab.tmLanguage.js → vscode-default-extensions/shaderlab/syntaxes/shaderlab.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration34.js → vscode-default-extensions/shellscript/language-configuration.json.js} +0 -0
- /package/dist/{shell-unix-bash.tmLanguage.js → vscode-default-extensions/shellscript/syntaxes/shell-unix-bash.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration35.js → vscode-default-extensions/sql/language-configuration.json.js} +0 -0
- /package/dist/{sql.tmLanguage.js → vscode-default-extensions/sql/syntaxes/sql.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration36.js → vscode-default-extensions/swift/language-configuration.json.js} +0 -0
- /package/dist/{swift.js → vscode-default-extensions/swift/snippets/swift.code-snippets.js} +0 -0
- /package/dist/{swift.tmLanguage.js → vscode-default-extensions/swift/syntaxes/swift.tmLanguage.json.js} +0 -0
- /package/dist/{abyss-color-theme.js → vscode-default-extensions/theme-abyss/themes/abyss-color-theme.json.js} +0 -0
- /package/dist/{vs_minimal-icon-theme.js → vscode-default-extensions/theme-defaults/fileicons/vs_minimal-icon-theme.json.js} +0 -0
- /package/dist/{dark_plus.js → vscode-default-extensions/theme-defaults/themes/dark_plus.json.js} +0 -0
- /package/dist/{dark_plus_experimental.js → vscode-default-extensions/theme-defaults/themes/dark_plus_experimental.json.js} +0 -0
- /package/dist/{dark_vs.js → vscode-default-extensions/theme-defaults/themes/dark_vs.json.js} +0 -0
- /package/dist/{hc_black.js → vscode-default-extensions/theme-defaults/themes/hc_black.json.js} +0 -0
- /package/dist/{hc_light.js → vscode-default-extensions/theme-defaults/themes/hc_light.json.js} +0 -0
- /package/dist/{light_plus.js → vscode-default-extensions/theme-defaults/themes/light_plus.json.js} +0 -0
- /package/dist/{light_plus_experimental.js → vscode-default-extensions/theme-defaults/themes/light_plus_experimental.json.js} +0 -0
- /package/dist/{light_vs.js → vscode-default-extensions/theme-defaults/themes/light_vs.json.js} +0 -0
- /package/dist/{kimbie-dark-color-theme.js → vscode-default-extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json.js} +0 -0
- /package/dist/{monokai-color-theme.js → vscode-default-extensions/theme-monokai/themes/monokai-color-theme.json.js} +0 -0
- /package/dist/{dimmed-monokai-color-theme.js → vscode-default-extensions/theme-monokai-dimmed/themes/dimmed-monokai-color-theme.json.js} +0 -0
- /package/dist/{quietlight-color-theme.js → vscode-default-extensions/theme-quietlight/themes/quietlight-color-theme.json.js} +0 -0
- /package/dist/{Red-color-theme.js → vscode-default-extensions/theme-red/themes/Red-color-theme.json.js} +0 -0
- /package/dist/{vs-seti-icon-theme.js → vscode-default-extensions/theme-seti/icons/vs-seti-icon-theme.json.js} +0 -0
- /package/dist/{solarized-dark-color-theme.js → vscode-default-extensions/theme-solarized-dark/themes/solarized-dark-color-theme.json.js} +0 -0
- /package/dist/{solarized-light-color-theme.js → vscode-default-extensions/theme-solarized-light/themes/solarized-light-color-theme.json.js} +0 -0
- /package/dist/{tomorrow-night-blue-color-theme.js → vscode-default-extensions/theme-tomorrow-night-blue/themes/tomorrow-night-blue-color-theme.json.js} +0 -0
- /package/dist/{language-configuration37.js → vscode-default-extensions/typescript-basics/language-configuration.json.js} +0 -0
- /package/dist/{typescript.js → vscode-default-extensions/typescript-basics/snippets/typescript.code-snippets.js} +0 -0
- /package/dist/{TypeScript.tmLanguage.js → vscode-default-extensions/typescript-basics/syntaxes/TypeScript.tmLanguage.json.js} +0 -0
- /package/dist/{TypeScriptReact.tmLanguage.js → vscode-default-extensions/typescript-basics/syntaxes/TypeScriptReact.tmLanguage.json.js} +0 -0
- /package/dist/{jsdoc.js.injection.tmLanguage.js → vscode-default-extensions/typescript-basics/syntaxes/jsdoc.js.injection.tmLanguage.json.js} +0 -0
- /package/dist/{jsdoc.ts.injection.tmLanguage.js → vscode-default-extensions/typescript-basics/syntaxes/jsdoc.ts.injection.tmLanguage.json.js} +0 -0
- /package/dist/{language-configuration38.js → vscode-default-extensions/vb/language-configuration.json.js} +0 -0
- /package/dist/{vb.js → vscode-default-extensions/vb/snippets/vb.code-snippets.js} +0 -0
- /package/dist/{asp-vb-net.tmlanguage.js → vscode-default-extensions/vb/syntaxes/asp-vb-net.tmlanguage.json.js} +0 -0
- /package/dist/{xml.tmLanguage.js → vscode-default-extensions/xml/syntaxes/xml.tmLanguage.json.js} +0 -0
- /package/dist/{xsl.tmLanguage.js → vscode-default-extensions/xml/syntaxes/xsl.tmLanguage.json.js} +0 -0
- /package/dist/{xml.language-configuration.js → vscode-default-extensions/xml/xml.language-configuration.json.js} +0 -0
- /package/dist/{xsl.language-configuration.js → vscode-default-extensions/xml/xsl.language-configuration.json.js} +0 -0
- /package/dist/{language-configuration39.js → vscode-default-extensions/yaml/language-configuration.json.js} +0 -0
- /package/dist/{yaml.tmLanguage.js → vscode-default-extensions/yaml/syntaxes/yaml.tmLanguage.json.js} +0 -0
package/dist/theme.js
DELETED
|
@@ -1,4116 +0,0 @@
|
|
|
1
|
-
import { Emitter, Sequencer, getRemoteAuthority, __decorate, __param, IExtensionService, IBrowserWorkbenchEnvironmentService, IFileService, IExtensionResourceLoaderService, IWorkbenchLayoutService, IHostColorSchemeService, IUserDataInitializationService, parse$1, getNodeType } from './polyfill.js';
|
|
2
|
-
import { ThemeSettings, tokenStylingSchemaId, ExtensionData, VS_DARK_THEME, VS_LIGHT_THEME, VS_HC_THEME, VS_HC_LIGHT_THEME, TokenStyle, parseClassifierString, THEME_SCOPE_OPEN_PAREN, THEME_SCOPE_CLOSE_PAREN, THEME_SCOPE_WILDCARD, themeScopeRegex, SemanticTokenRule, getTokenClassificationRegistry } from './tokenClassificationRegistry.js';
|
|
3
|
-
import { editorBackground, editorForeground, editorSelectionBackground, editorInactiveSelection, editorSelectionHighlight, editorFindMatchHighlight, editorFindMatch, editorHoverHighlight, editorFindRangeHighlight, workbenchColorsSchemaId, asCssVariableName, Extensions as Extensions$2 } from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
|
|
4
|
-
import { Color } from 'monaco-editor/esm/vs/base/common/color.js';
|
|
5
|
-
import { editorLineHighlight, editorRangeHighlight, editorCursorForeground, editorWhitespaces, editorIndentGuides, editorActiveIndentGuides } from 'monaco-editor/esm/vs/editor/common/core/editorColorRegistry.js';
|
|
6
|
-
import { getParseErrorMessage } from './jsonErrorMessages.js';
|
|
7
|
-
import { isUndefined, isString, isObject, isBoolean } from 'monaco-editor/esm/vs/base/common/types.js';
|
|
8
|
-
import { ColorScheme } from 'monaco-editor/esm/vs/platform/theme/common/theme.js';
|
|
9
|
-
import { IThemeService, getThemeTypeSelector, Extensions as Extensions$3 } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
|
|
10
|
-
import { basename } from 'monaco-editor/esm/vs/base/common/path.js';
|
|
11
|
-
import { joinPath, isEqual, extname, dirname, isEqualOrParent } from 'monaco-editor/esm/vs/base/common/resources.js';
|
|
12
|
-
import { localize } from 'monaco-editor/esm/vs/nls.js';
|
|
13
|
-
import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
14
|
-
import { getIconRegistry, iconsSchemaId, IconFontDefinition } from 'monaco-editor/esm/vs/platform/theme/common/iconRegistry.js';
|
|
15
|
-
import { Extensions as Extensions$1 } from 'monaco-editor/esm/vs/platform/jsonschemas/common/jsonContributionRegistry.js';
|
|
16
|
-
import { createStyleSheet, asCSSUrl } from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
17
|
-
import { ExtensionsRegistry } from './extensionsRegistry.js';
|
|
18
|
-
import { Extensions } from 'monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js';
|
|
19
|
-
import { isWeb } from 'monaco-editor/esm/vs/base/common/platform.js';
|
|
20
|
-
import { ThemeIcon } from 'monaco-editor/esm/vs/base/common/themables.js';
|
|
21
|
-
import { onUnexpectedError } from 'monaco-editor/esm/vs/base/common/errors.js';
|
|
22
|
-
import { getIconsStyleSheet } from 'monaco-editor/esm/vs/platform/theme/browser/iconsStyleSheet.js';
|
|
23
|
-
import { IStorageService } from 'monaco-editor/esm/vs/platform/storage/common/storage.js';
|
|
24
|
-
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
25
|
-
import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
|
|
26
|
-
import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
|
|
27
|
-
import { ILanguageService } from 'monaco-editor/esm/vs/editor/common/languages/language.js';
|
|
28
|
-
import { dispose } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
29
|
-
import { RunOnceScheduler } from 'monaco-editor/esm/vs/base/common/async.js';
|
|
30
|
-
import getServiceOverride$1 from './files.js';
|
|
31
|
-
import { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/common/descriptors.js';
|
|
32
|
-
function getColorRegistry () {
|
|
33
|
-
return ( Registry.as(Extensions$2.ColorContribution));
|
|
34
|
-
}
|
|
35
|
-
const settingToColorIdMapping = {};
|
|
36
|
-
function addSettingMapping(settingId, colorId) {
|
|
37
|
-
let colorIds = settingToColorIdMapping[settingId];
|
|
38
|
-
if (!colorIds) {
|
|
39
|
-
settingToColorIdMapping[settingId] = colorIds = [];
|
|
40
|
-
}
|
|
41
|
-
colorIds.push(colorId);
|
|
42
|
-
}
|
|
43
|
-
function convertSettings(oldSettings, result) {
|
|
44
|
-
for (const rule of oldSettings) {
|
|
45
|
-
result.textMateRules.push(rule);
|
|
46
|
-
if (!rule.scope) {
|
|
47
|
-
const settings = rule.settings;
|
|
48
|
-
if (!settings) {
|
|
49
|
-
rule.settings = {};
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
for (const settingKey in settings) {
|
|
53
|
-
const key = settingKey;
|
|
54
|
-
const mappings = settingToColorIdMapping[key];
|
|
55
|
-
if (mappings) {
|
|
56
|
-
const colorHex = settings[key];
|
|
57
|
-
if (typeof colorHex === 'string') {
|
|
58
|
-
const color = ( (Color.fromHex(colorHex)));
|
|
59
|
-
for (const colorId of mappings) {
|
|
60
|
-
result.colors[colorId] = color;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
if (key !== 'foreground' && key !== 'background' && key !== 'fontStyle') {
|
|
65
|
-
delete settings[key];
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
addSettingMapping('background', editorBackground);
|
|
73
|
-
addSettingMapping('foreground', editorForeground);
|
|
74
|
-
addSettingMapping('selection', editorSelectionBackground);
|
|
75
|
-
addSettingMapping('inactiveSelection', editorInactiveSelection);
|
|
76
|
-
addSettingMapping('selectionHighlightColor', editorSelectionHighlight);
|
|
77
|
-
addSettingMapping('findMatchHighlight', editorFindMatchHighlight);
|
|
78
|
-
addSettingMapping('currentFindMatchHighlight', editorFindMatch);
|
|
79
|
-
addSettingMapping('hoverHighlight', editorHoverHighlight);
|
|
80
|
-
addSettingMapping('wordHighlight', 'editor.wordHighlightBackground');
|
|
81
|
-
addSettingMapping('wordHighlightStrong', 'editor.wordHighlightStrongBackground');
|
|
82
|
-
addSettingMapping('findRangeHighlight', editorFindRangeHighlight);
|
|
83
|
-
addSettingMapping('findMatchHighlight', 'peekViewResult.matchHighlightBackground');
|
|
84
|
-
addSettingMapping('referenceHighlight', 'peekViewEditor.matchHighlightBackground');
|
|
85
|
-
addSettingMapping('lineHighlight', editorLineHighlight);
|
|
86
|
-
addSettingMapping('rangeHighlight', editorRangeHighlight);
|
|
87
|
-
addSettingMapping('caret', editorCursorForeground);
|
|
88
|
-
addSettingMapping('invisibles', editorWhitespaces);
|
|
89
|
-
addSettingMapping('guide', editorIndentGuides);
|
|
90
|
-
addSettingMapping('activeGuide', editorActiveIndentGuides);
|
|
91
|
-
const ansiColorMap = ['ansiBlack', 'ansiRed', 'ansiGreen', 'ansiYellow', 'ansiBlue', 'ansiMagenta', 'ansiCyan', 'ansiWhite',
|
|
92
|
-
'ansiBrightBlack', 'ansiBrightRed', 'ansiBrightGreen', 'ansiBrightYellow', 'ansiBrightBlue', 'ansiBrightMagenta', 'ansiBrightCyan', 'ansiBrightWhite'
|
|
93
|
-
];
|
|
94
|
-
for (const color of ansiColorMap) {
|
|
95
|
-
addSettingMapping(color, 'terminal.' + color);
|
|
96
|
-
}
|
|
97
|
-
function parse(content) {
|
|
98
|
-
return _parse(content, null, null);
|
|
99
|
-
}
|
|
100
|
-
function _parse(content, filename, locationKeyName) {
|
|
101
|
-
const len = content.length;
|
|
102
|
-
let pos = 0;
|
|
103
|
-
let line = 1;
|
|
104
|
-
let char = 0;
|
|
105
|
-
if (len > 0 && content.charCodeAt(0) === 65279 ) {
|
|
106
|
-
pos = 1;
|
|
107
|
-
}
|
|
108
|
-
function advancePosBy(by) {
|
|
109
|
-
if (locationKeyName === null) {
|
|
110
|
-
pos = pos + by;
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
while (by > 0) {
|
|
114
|
-
const chCode = content.charCodeAt(pos);
|
|
115
|
-
if (chCode === 10 ) {
|
|
116
|
-
pos++;
|
|
117
|
-
line++;
|
|
118
|
-
char = 0;
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
pos++;
|
|
122
|
-
char++;
|
|
123
|
-
}
|
|
124
|
-
by--;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
function advancePosTo(to) {
|
|
129
|
-
if (locationKeyName === null) {
|
|
130
|
-
pos = to;
|
|
131
|
-
}
|
|
132
|
-
else {
|
|
133
|
-
advancePosBy(to - pos);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
function skipWhitespace() {
|
|
137
|
-
while (pos < len) {
|
|
138
|
-
const chCode = content.charCodeAt(pos);
|
|
139
|
-
if (chCode !== 32 && chCode !== 9 && chCode !== 13 && chCode !== 10 ) {
|
|
140
|
-
break;
|
|
141
|
-
}
|
|
142
|
-
advancePosBy(1);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
function advanceIfStartsWith(str) {
|
|
146
|
-
if (content.substr(pos, str.length) === str) {
|
|
147
|
-
advancePosBy(str.length);
|
|
148
|
-
return true;
|
|
149
|
-
}
|
|
150
|
-
return false;
|
|
151
|
-
}
|
|
152
|
-
function advanceUntil(str) {
|
|
153
|
-
const nextOccurence = content.indexOf(str, pos);
|
|
154
|
-
if (nextOccurence !== -1) {
|
|
155
|
-
advancePosTo(nextOccurence + str.length);
|
|
156
|
-
}
|
|
157
|
-
else {
|
|
158
|
-
advancePosTo(len);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
function captureUntil(str) {
|
|
162
|
-
const nextOccurence = content.indexOf(str, pos);
|
|
163
|
-
if (nextOccurence !== -1) {
|
|
164
|
-
const r = content.substring(pos, nextOccurence);
|
|
165
|
-
advancePosTo(nextOccurence + str.length);
|
|
166
|
-
return r;
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
const r = content.substr(pos);
|
|
170
|
-
advancePosTo(len);
|
|
171
|
-
return r;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
let state = 0 ;
|
|
175
|
-
let cur = null;
|
|
176
|
-
const stateStack = [];
|
|
177
|
-
const objStack = [];
|
|
178
|
-
let curKey = null;
|
|
179
|
-
function pushState(newState, newCur) {
|
|
180
|
-
stateStack.push(state);
|
|
181
|
-
objStack.push(cur);
|
|
182
|
-
state = newState;
|
|
183
|
-
cur = newCur;
|
|
184
|
-
}
|
|
185
|
-
function popState() {
|
|
186
|
-
if (stateStack.length === 0) {
|
|
187
|
-
return fail('illegal state stack');
|
|
188
|
-
}
|
|
189
|
-
state = stateStack.pop();
|
|
190
|
-
cur = objStack.pop();
|
|
191
|
-
}
|
|
192
|
-
function fail(msg) {
|
|
193
|
-
throw new Error('Near offset ' + pos + ': ' + msg + ' ~~~' + content.substr(pos, 50) + '~~~');
|
|
194
|
-
}
|
|
195
|
-
const dictState = {
|
|
196
|
-
enterDict: function () {
|
|
197
|
-
if (curKey === null) {
|
|
198
|
-
return fail('missing <key>');
|
|
199
|
-
}
|
|
200
|
-
const newDict = {};
|
|
201
|
-
if (locationKeyName !== null) {
|
|
202
|
-
newDict[locationKeyName] = {
|
|
203
|
-
filename: filename,
|
|
204
|
-
line: line,
|
|
205
|
-
char: char
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
cur[curKey] = newDict;
|
|
209
|
-
curKey = null;
|
|
210
|
-
pushState(1 , newDict);
|
|
211
|
-
},
|
|
212
|
-
enterArray: function () {
|
|
213
|
-
if (curKey === null) {
|
|
214
|
-
return fail('missing <key>');
|
|
215
|
-
}
|
|
216
|
-
const newArr = [];
|
|
217
|
-
cur[curKey] = newArr;
|
|
218
|
-
curKey = null;
|
|
219
|
-
pushState(2 , newArr);
|
|
220
|
-
}
|
|
221
|
-
};
|
|
222
|
-
const arrState = {
|
|
223
|
-
enterDict: function () {
|
|
224
|
-
const newDict = {};
|
|
225
|
-
if (locationKeyName !== null) {
|
|
226
|
-
newDict[locationKeyName] = {
|
|
227
|
-
filename: filename,
|
|
228
|
-
line: line,
|
|
229
|
-
char: char
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
cur.push(newDict);
|
|
233
|
-
pushState(1 , newDict);
|
|
234
|
-
},
|
|
235
|
-
enterArray: function () {
|
|
236
|
-
const newArr = [];
|
|
237
|
-
cur.push(newArr);
|
|
238
|
-
pushState(2 , newArr);
|
|
239
|
-
}
|
|
240
|
-
};
|
|
241
|
-
function enterDict() {
|
|
242
|
-
if (state === 1 ) {
|
|
243
|
-
dictState.enterDict();
|
|
244
|
-
}
|
|
245
|
-
else if (state === 2 ) {
|
|
246
|
-
arrState.enterDict();
|
|
247
|
-
}
|
|
248
|
-
else {
|
|
249
|
-
cur = {};
|
|
250
|
-
if (locationKeyName !== null) {
|
|
251
|
-
cur[locationKeyName] = {
|
|
252
|
-
filename: filename,
|
|
253
|
-
line: line,
|
|
254
|
-
char: char
|
|
255
|
-
};
|
|
256
|
-
}
|
|
257
|
-
pushState(1 , cur);
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
function leaveDict() {
|
|
261
|
-
if (state === 1 ) {
|
|
262
|
-
popState();
|
|
263
|
-
}
|
|
264
|
-
else if (state === 2 ) {
|
|
265
|
-
return fail('unexpected </dict>');
|
|
266
|
-
}
|
|
267
|
-
else {
|
|
268
|
-
return fail('unexpected </dict>');
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
function enterArray() {
|
|
272
|
-
if (state === 1 ) {
|
|
273
|
-
dictState.enterArray();
|
|
274
|
-
}
|
|
275
|
-
else if (state === 2 ) {
|
|
276
|
-
arrState.enterArray();
|
|
277
|
-
}
|
|
278
|
-
else {
|
|
279
|
-
cur = [];
|
|
280
|
-
pushState(2 , cur);
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
function leaveArray() {
|
|
284
|
-
if (state === 1 ) {
|
|
285
|
-
return fail('unexpected </array>');
|
|
286
|
-
}
|
|
287
|
-
else if (state === 2 ) {
|
|
288
|
-
popState();
|
|
289
|
-
}
|
|
290
|
-
else {
|
|
291
|
-
return fail('unexpected </array>');
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
function acceptKey(val) {
|
|
295
|
-
if (state === 1 ) {
|
|
296
|
-
if (curKey !== null) {
|
|
297
|
-
return fail('too many <key>');
|
|
298
|
-
}
|
|
299
|
-
curKey = val;
|
|
300
|
-
}
|
|
301
|
-
else if (state === 2 ) {
|
|
302
|
-
return fail('unexpected <key>');
|
|
303
|
-
}
|
|
304
|
-
else {
|
|
305
|
-
return fail('unexpected <key>');
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
function acceptString(val) {
|
|
309
|
-
if (state === 1 ) {
|
|
310
|
-
if (curKey === null) {
|
|
311
|
-
return fail('missing <key>');
|
|
312
|
-
}
|
|
313
|
-
cur[curKey] = val;
|
|
314
|
-
curKey = null;
|
|
315
|
-
}
|
|
316
|
-
else if (state === 2 ) {
|
|
317
|
-
cur.push(val);
|
|
318
|
-
}
|
|
319
|
-
else {
|
|
320
|
-
cur = val;
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
function acceptReal(val) {
|
|
324
|
-
if (isNaN(val)) {
|
|
325
|
-
return fail('cannot parse float');
|
|
326
|
-
}
|
|
327
|
-
if (state === 1 ) {
|
|
328
|
-
if (curKey === null) {
|
|
329
|
-
return fail('missing <key>');
|
|
330
|
-
}
|
|
331
|
-
cur[curKey] = val;
|
|
332
|
-
curKey = null;
|
|
333
|
-
}
|
|
334
|
-
else if (state === 2 ) {
|
|
335
|
-
cur.push(val);
|
|
336
|
-
}
|
|
337
|
-
else {
|
|
338
|
-
cur = val;
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
function acceptInteger(val) {
|
|
342
|
-
if (isNaN(val)) {
|
|
343
|
-
return fail('cannot parse integer');
|
|
344
|
-
}
|
|
345
|
-
if (state === 1 ) {
|
|
346
|
-
if (curKey === null) {
|
|
347
|
-
return fail('missing <key>');
|
|
348
|
-
}
|
|
349
|
-
cur[curKey] = val;
|
|
350
|
-
curKey = null;
|
|
351
|
-
}
|
|
352
|
-
else if (state === 2 ) {
|
|
353
|
-
cur.push(val);
|
|
354
|
-
}
|
|
355
|
-
else {
|
|
356
|
-
cur = val;
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
function acceptDate(val) {
|
|
360
|
-
if (state === 1 ) {
|
|
361
|
-
if (curKey === null) {
|
|
362
|
-
return fail('missing <key>');
|
|
363
|
-
}
|
|
364
|
-
cur[curKey] = val;
|
|
365
|
-
curKey = null;
|
|
366
|
-
}
|
|
367
|
-
else if (state === 2 ) {
|
|
368
|
-
cur.push(val);
|
|
369
|
-
}
|
|
370
|
-
else {
|
|
371
|
-
cur = val;
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
function acceptData(val) {
|
|
375
|
-
if (state === 1 ) {
|
|
376
|
-
if (curKey === null) {
|
|
377
|
-
return fail('missing <key>');
|
|
378
|
-
}
|
|
379
|
-
cur[curKey] = val;
|
|
380
|
-
curKey = null;
|
|
381
|
-
}
|
|
382
|
-
else if (state === 2 ) {
|
|
383
|
-
cur.push(val);
|
|
384
|
-
}
|
|
385
|
-
else {
|
|
386
|
-
cur = val;
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
function acceptBool(val) {
|
|
390
|
-
if (state === 1 ) {
|
|
391
|
-
if (curKey === null) {
|
|
392
|
-
return fail('missing <key>');
|
|
393
|
-
}
|
|
394
|
-
cur[curKey] = val;
|
|
395
|
-
curKey = null;
|
|
396
|
-
}
|
|
397
|
-
else if (state === 2 ) {
|
|
398
|
-
cur.push(val);
|
|
399
|
-
}
|
|
400
|
-
else {
|
|
401
|
-
cur = val;
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
function escapeVal(str) {
|
|
405
|
-
return str.replace(/&#([0-9]+);/g, function (_, m0) {
|
|
406
|
-
return String.fromCodePoint(parseInt(m0, 10));
|
|
407
|
-
}).replace(/&#x([0-9a-f]+);/g, function (_, m0) {
|
|
408
|
-
return String.fromCodePoint(parseInt(m0, 16));
|
|
409
|
-
}).replace(/&|<|>|"|'/g, function (_) {
|
|
410
|
-
switch (_) {
|
|
411
|
-
case '&': return '&';
|
|
412
|
-
case '<': return '<';
|
|
413
|
-
case '>': return '>';
|
|
414
|
-
case '"': return '"';
|
|
415
|
-
case ''': return '\'';
|
|
416
|
-
}
|
|
417
|
-
return _;
|
|
418
|
-
});
|
|
419
|
-
}
|
|
420
|
-
function parseOpenTag() {
|
|
421
|
-
let r = captureUntil('>');
|
|
422
|
-
let isClosed = false;
|
|
423
|
-
if (r.charCodeAt(r.length - 1) === 47 ) {
|
|
424
|
-
isClosed = true;
|
|
425
|
-
r = r.substring(0, r.length - 1);
|
|
426
|
-
}
|
|
427
|
-
return {
|
|
428
|
-
name: r.trim(),
|
|
429
|
-
isClosed: isClosed
|
|
430
|
-
};
|
|
431
|
-
}
|
|
432
|
-
function parseTagValue(tag) {
|
|
433
|
-
if (tag.isClosed) {
|
|
434
|
-
return '';
|
|
435
|
-
}
|
|
436
|
-
const val = captureUntil('</');
|
|
437
|
-
advanceUntil('>');
|
|
438
|
-
return escapeVal(val);
|
|
439
|
-
}
|
|
440
|
-
while (pos < len) {
|
|
441
|
-
skipWhitespace();
|
|
442
|
-
if (pos >= len) {
|
|
443
|
-
break;
|
|
444
|
-
}
|
|
445
|
-
const chCode = content.charCodeAt(pos);
|
|
446
|
-
advancePosBy(1);
|
|
447
|
-
if (chCode !== 60 ) {
|
|
448
|
-
return fail('expected <');
|
|
449
|
-
}
|
|
450
|
-
if (pos >= len) {
|
|
451
|
-
return fail('unexpected end of input');
|
|
452
|
-
}
|
|
453
|
-
const peekChCode = content.charCodeAt(pos);
|
|
454
|
-
if (peekChCode === 63 ) {
|
|
455
|
-
advancePosBy(1);
|
|
456
|
-
advanceUntil('?>');
|
|
457
|
-
continue;
|
|
458
|
-
}
|
|
459
|
-
if (peekChCode === 33 ) {
|
|
460
|
-
advancePosBy(1);
|
|
461
|
-
if (advanceIfStartsWith('--')) {
|
|
462
|
-
advanceUntil('-->');
|
|
463
|
-
continue;
|
|
464
|
-
}
|
|
465
|
-
advanceUntil('>');
|
|
466
|
-
continue;
|
|
467
|
-
}
|
|
468
|
-
if (peekChCode === 47 ) {
|
|
469
|
-
advancePosBy(1);
|
|
470
|
-
skipWhitespace();
|
|
471
|
-
if (advanceIfStartsWith('plist')) {
|
|
472
|
-
advanceUntil('>');
|
|
473
|
-
continue;
|
|
474
|
-
}
|
|
475
|
-
if (advanceIfStartsWith('dict')) {
|
|
476
|
-
advanceUntil('>');
|
|
477
|
-
leaveDict();
|
|
478
|
-
continue;
|
|
479
|
-
}
|
|
480
|
-
if (advanceIfStartsWith('array')) {
|
|
481
|
-
advanceUntil('>');
|
|
482
|
-
leaveArray();
|
|
483
|
-
continue;
|
|
484
|
-
}
|
|
485
|
-
return fail('unexpected closed tag');
|
|
486
|
-
}
|
|
487
|
-
const tag = parseOpenTag();
|
|
488
|
-
switch (tag.name) {
|
|
489
|
-
case 'dict':
|
|
490
|
-
enterDict();
|
|
491
|
-
if (tag.isClosed) {
|
|
492
|
-
leaveDict();
|
|
493
|
-
}
|
|
494
|
-
continue;
|
|
495
|
-
case 'array':
|
|
496
|
-
enterArray();
|
|
497
|
-
if (tag.isClosed) {
|
|
498
|
-
leaveArray();
|
|
499
|
-
}
|
|
500
|
-
continue;
|
|
501
|
-
case 'key':
|
|
502
|
-
acceptKey(parseTagValue(tag));
|
|
503
|
-
continue;
|
|
504
|
-
case 'string':
|
|
505
|
-
acceptString(parseTagValue(tag));
|
|
506
|
-
continue;
|
|
507
|
-
case 'real':
|
|
508
|
-
acceptReal(parseFloat(parseTagValue(tag)));
|
|
509
|
-
continue;
|
|
510
|
-
case 'integer':
|
|
511
|
-
acceptInteger(parseInt(parseTagValue(tag), 10));
|
|
512
|
-
continue;
|
|
513
|
-
case 'date':
|
|
514
|
-
acceptDate(( (new Date(parseTagValue(tag)))));
|
|
515
|
-
continue;
|
|
516
|
-
case 'data':
|
|
517
|
-
acceptData(parseTagValue(tag));
|
|
518
|
-
continue;
|
|
519
|
-
case 'true':
|
|
520
|
-
parseTagValue(tag);
|
|
521
|
-
acceptBool(true);
|
|
522
|
-
continue;
|
|
523
|
-
case 'false':
|
|
524
|
-
parseTagValue(tag);
|
|
525
|
-
acceptBool(false);
|
|
526
|
-
continue;
|
|
527
|
-
}
|
|
528
|
-
if (/^plist/.test(tag.name)) {
|
|
529
|
-
continue;
|
|
530
|
-
}
|
|
531
|
-
return fail('unexpected opened tag ' + tag.name);
|
|
532
|
-
}
|
|
533
|
-
return cur;
|
|
534
|
-
}
|
|
535
|
-
function createMatchers(selector, matchesName, results) {
|
|
536
|
-
const tokenizer = newTokenizer(selector);
|
|
537
|
-
let token = tokenizer.next();
|
|
538
|
-
while (token !== null) {
|
|
539
|
-
let priority = 0;
|
|
540
|
-
if (token.length === 2 && token.charAt(1) === ':') {
|
|
541
|
-
switch (token.charAt(0)) {
|
|
542
|
-
case 'R':
|
|
543
|
-
priority = 1;
|
|
544
|
-
break;
|
|
545
|
-
case 'L':
|
|
546
|
-
priority = -1;
|
|
547
|
-
break;
|
|
548
|
-
default:
|
|
549
|
-
console.log(`Unknown priority ${token} in scope selector`);
|
|
550
|
-
}
|
|
551
|
-
token = tokenizer.next();
|
|
552
|
-
}
|
|
553
|
-
const matcher = parseConjunction();
|
|
554
|
-
if (matcher) {
|
|
555
|
-
results.push({ matcher, priority });
|
|
556
|
-
}
|
|
557
|
-
if (token !== ',') {
|
|
558
|
-
break;
|
|
559
|
-
}
|
|
560
|
-
token = tokenizer.next();
|
|
561
|
-
}
|
|
562
|
-
function parseOperand() {
|
|
563
|
-
if (token === '-') {
|
|
564
|
-
token = tokenizer.next();
|
|
565
|
-
const expressionToNegate = parseOperand();
|
|
566
|
-
if (!expressionToNegate) {
|
|
567
|
-
return null;
|
|
568
|
-
}
|
|
569
|
-
return matcherInput => {
|
|
570
|
-
const score = expressionToNegate(matcherInput);
|
|
571
|
-
return score < 0 ? 0 : -1;
|
|
572
|
-
};
|
|
573
|
-
}
|
|
574
|
-
if (token === '(') {
|
|
575
|
-
token = tokenizer.next();
|
|
576
|
-
const expressionInParents = parseInnerExpression();
|
|
577
|
-
if (token === ')') {
|
|
578
|
-
token = tokenizer.next();
|
|
579
|
-
}
|
|
580
|
-
return expressionInParents;
|
|
581
|
-
}
|
|
582
|
-
if (isIdentifier(token)) {
|
|
583
|
-
const identifiers = [];
|
|
584
|
-
do {
|
|
585
|
-
identifiers.push(token);
|
|
586
|
-
token = tokenizer.next();
|
|
587
|
-
} while (isIdentifier(token));
|
|
588
|
-
return matcherInput => matchesName(identifiers, matcherInput);
|
|
589
|
-
}
|
|
590
|
-
return null;
|
|
591
|
-
}
|
|
592
|
-
function parseConjunction() {
|
|
593
|
-
let matcher = parseOperand();
|
|
594
|
-
if (!matcher) {
|
|
595
|
-
return null;
|
|
596
|
-
}
|
|
597
|
-
const matchers = [];
|
|
598
|
-
while (matcher) {
|
|
599
|
-
matchers.push(matcher);
|
|
600
|
-
matcher = parseOperand();
|
|
601
|
-
}
|
|
602
|
-
return matcherInput => {
|
|
603
|
-
let min = matchers[0](matcherInput);
|
|
604
|
-
for (let i = 1; min >= 0 && i < matchers.length; i++) {
|
|
605
|
-
min = Math.min(min, matchers[i](matcherInput));
|
|
606
|
-
}
|
|
607
|
-
return min;
|
|
608
|
-
};
|
|
609
|
-
}
|
|
610
|
-
function parseInnerExpression() {
|
|
611
|
-
let matcher = parseConjunction();
|
|
612
|
-
if (!matcher) {
|
|
613
|
-
return null;
|
|
614
|
-
}
|
|
615
|
-
const matchers = [];
|
|
616
|
-
while (matcher) {
|
|
617
|
-
matchers.push(matcher);
|
|
618
|
-
if (token === '|' || token === ',') {
|
|
619
|
-
do {
|
|
620
|
-
token = tokenizer.next();
|
|
621
|
-
} while (token === '|' || token === ',');
|
|
622
|
-
}
|
|
623
|
-
else {
|
|
624
|
-
break;
|
|
625
|
-
}
|
|
626
|
-
matcher = parseConjunction();
|
|
627
|
-
}
|
|
628
|
-
return matcherInput => {
|
|
629
|
-
let max = matchers[0](matcherInput);
|
|
630
|
-
for (let i = 1; i < matchers.length; i++) {
|
|
631
|
-
max = Math.max(max, matchers[i](matcherInput));
|
|
632
|
-
}
|
|
633
|
-
return max;
|
|
634
|
-
};
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
|
-
function isIdentifier(token) {
|
|
638
|
-
return !!token && !!token.match(/[\w\.:]+/);
|
|
639
|
-
}
|
|
640
|
-
function newTokenizer(input) {
|
|
641
|
-
const regex = /([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g;
|
|
642
|
-
let match = regex.exec(input);
|
|
643
|
-
return {
|
|
644
|
-
next: () => {
|
|
645
|
-
if (!match) {
|
|
646
|
-
return null;
|
|
647
|
-
}
|
|
648
|
-
const res = match[0];
|
|
649
|
-
match = regex.exec(input);
|
|
650
|
-
return res;
|
|
651
|
-
}
|
|
652
|
-
};
|
|
653
|
-
}
|
|
654
|
-
const colorRegistry = ( (Registry.as(Extensions$2.ColorContribution)));
|
|
655
|
-
const tokenClassificationRegistry = getTokenClassificationRegistry();
|
|
656
|
-
const tokenGroupToScopesMap = {
|
|
657
|
-
comments: ['comment', 'punctuation.definition.comment'],
|
|
658
|
-
strings: ['string', 'meta.embedded.assembly'],
|
|
659
|
-
keywords: ['keyword - keyword.operator', 'keyword.control', 'storage', 'storage.type'],
|
|
660
|
-
numbers: ['constant.numeric'],
|
|
661
|
-
types: ['entity.name.type', 'entity.name.class', 'support.type', 'support.class'],
|
|
662
|
-
functions: ['entity.name.function', 'support.function'],
|
|
663
|
-
variables: ['variable', 'entity.name.variable']
|
|
664
|
-
};
|
|
665
|
-
class ColorThemeData {
|
|
666
|
-
constructor(id, label, settingsId) {
|
|
667
|
-
this.themeTokenColors = [];
|
|
668
|
-
this.customTokenColors = [];
|
|
669
|
-
this.colorMap = {};
|
|
670
|
-
this.customColorMap = {};
|
|
671
|
-
this.semanticTokenRules = [];
|
|
672
|
-
this.customSemanticTokenRules = [];
|
|
673
|
-
this.textMateThemingRules = undefined;
|
|
674
|
-
this.tokenColorIndex = undefined;
|
|
675
|
-
this.id = id;
|
|
676
|
-
this.label = label;
|
|
677
|
-
this.settingsId = settingsId;
|
|
678
|
-
this.isLoaded = false;
|
|
679
|
-
}
|
|
680
|
-
get semanticHighlighting() {
|
|
681
|
-
if (this.customSemanticHighlighting !== undefined) {
|
|
682
|
-
return this.customSemanticHighlighting;
|
|
683
|
-
}
|
|
684
|
-
if (this.customSemanticHighlightingDeprecated !== undefined) {
|
|
685
|
-
return this.customSemanticHighlightingDeprecated;
|
|
686
|
-
}
|
|
687
|
-
return !!this.themeSemanticHighlighting;
|
|
688
|
-
}
|
|
689
|
-
get tokenColors() {
|
|
690
|
-
if (!this.textMateThemingRules) {
|
|
691
|
-
const result = [];
|
|
692
|
-
const foreground = this.getColor(editorForeground) || this.getDefault(editorForeground);
|
|
693
|
-
const background = this.getColor(editorBackground) || this.getDefault(editorBackground);
|
|
694
|
-
result.push({
|
|
695
|
-
settings: {
|
|
696
|
-
foreground: normalizeColor(foreground),
|
|
697
|
-
background: normalizeColor(background)
|
|
698
|
-
}
|
|
699
|
-
});
|
|
700
|
-
let hasDefaultTokens = false;
|
|
701
|
-
function addRule(rule) {
|
|
702
|
-
if (rule.scope && rule.settings) {
|
|
703
|
-
if (rule.scope === 'token.info-token') {
|
|
704
|
-
hasDefaultTokens = true;
|
|
705
|
-
}
|
|
706
|
-
result.push({ scope: rule.scope, settings: { foreground: normalizeColor(rule.settings.foreground), background: normalizeColor(rule.settings.background), fontStyle: rule.settings.fontStyle } });
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
|
-
this.themeTokenColors.forEach(addRule);
|
|
710
|
-
this.customTokenColors.forEach(addRule);
|
|
711
|
-
if (!hasDefaultTokens) {
|
|
712
|
-
defaultThemeColors[this.type].forEach(addRule);
|
|
713
|
-
}
|
|
714
|
-
this.textMateThemingRules = result;
|
|
715
|
-
}
|
|
716
|
-
return this.textMateThemingRules;
|
|
717
|
-
}
|
|
718
|
-
getColor(colorId, useDefault) {
|
|
719
|
-
let color = this.customColorMap[colorId];
|
|
720
|
-
if (color) {
|
|
721
|
-
return color;
|
|
722
|
-
}
|
|
723
|
-
color = this.colorMap[colorId];
|
|
724
|
-
if (useDefault !== false && isUndefined(color)) {
|
|
725
|
-
color = this.getDefault(colorId);
|
|
726
|
-
}
|
|
727
|
-
return color;
|
|
728
|
-
}
|
|
729
|
-
getTokenStyle(type, modifiers, language, useDefault = true, definitions = {}) {
|
|
730
|
-
const result = {
|
|
731
|
-
foreground: undefined,
|
|
732
|
-
bold: undefined,
|
|
733
|
-
underline: undefined,
|
|
734
|
-
strikethrough: undefined,
|
|
735
|
-
italic: undefined
|
|
736
|
-
};
|
|
737
|
-
const score = {
|
|
738
|
-
foreground: -1,
|
|
739
|
-
bold: -1,
|
|
740
|
-
underline: -1,
|
|
741
|
-
strikethrough: -1,
|
|
742
|
-
italic: -1
|
|
743
|
-
};
|
|
744
|
-
function _processStyle(matchScore, style, definition) {
|
|
745
|
-
if (style.foreground && score.foreground <= matchScore) {
|
|
746
|
-
score.foreground = matchScore;
|
|
747
|
-
result.foreground = style.foreground;
|
|
748
|
-
definitions.foreground = definition;
|
|
749
|
-
}
|
|
750
|
-
for (const p of ['bold', 'underline', 'strikethrough', 'italic']) {
|
|
751
|
-
const property = p;
|
|
752
|
-
const info = style[property];
|
|
753
|
-
if (info !== undefined) {
|
|
754
|
-
if (score[property] <= matchScore) {
|
|
755
|
-
score[property] = matchScore;
|
|
756
|
-
result[property] = info;
|
|
757
|
-
definitions[property] = definition;
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
function _processSemanticTokenRule(rule) {
|
|
763
|
-
const matchScore = rule.selector.match(type, modifiers, language);
|
|
764
|
-
if (matchScore >= 0) {
|
|
765
|
-
_processStyle(matchScore, rule.style, rule);
|
|
766
|
-
}
|
|
767
|
-
}
|
|
768
|
-
this.semanticTokenRules.forEach(_processSemanticTokenRule);
|
|
769
|
-
this.customSemanticTokenRules.forEach(_processSemanticTokenRule);
|
|
770
|
-
let hasUndefinedStyleProperty = false;
|
|
771
|
-
for (const k in score) {
|
|
772
|
-
const key = k;
|
|
773
|
-
if (score[key] === -1) {
|
|
774
|
-
hasUndefinedStyleProperty = true;
|
|
775
|
-
}
|
|
776
|
-
else {
|
|
777
|
-
score[key] = Number.MAX_VALUE;
|
|
778
|
-
}
|
|
779
|
-
}
|
|
780
|
-
if (hasUndefinedStyleProperty) {
|
|
781
|
-
for (const rule of tokenClassificationRegistry.getTokenStylingDefaultRules()) {
|
|
782
|
-
const matchScore = rule.selector.match(type, modifiers, language);
|
|
783
|
-
if (matchScore >= 0) {
|
|
784
|
-
let style;
|
|
785
|
-
if (rule.defaults.scopesToProbe) {
|
|
786
|
-
style = this.resolveScopes(rule.defaults.scopesToProbe);
|
|
787
|
-
if (style) {
|
|
788
|
-
_processStyle(matchScore, style, rule.defaults.scopesToProbe);
|
|
789
|
-
}
|
|
790
|
-
}
|
|
791
|
-
if (!style && useDefault !== false) {
|
|
792
|
-
const tokenStyleValue = rule.defaults[this.type];
|
|
793
|
-
style = this.resolveTokenStyleValue(tokenStyleValue);
|
|
794
|
-
if (style) {
|
|
795
|
-
_processStyle(matchScore, style, tokenStyleValue);
|
|
796
|
-
}
|
|
797
|
-
}
|
|
798
|
-
}
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
|
-
return TokenStyle.fromData(result);
|
|
802
|
-
}
|
|
803
|
-
resolveTokenStyleValue(tokenStyleValue) {
|
|
804
|
-
if (tokenStyleValue === undefined) {
|
|
805
|
-
return undefined;
|
|
806
|
-
}
|
|
807
|
-
else if (typeof tokenStyleValue === 'string') {
|
|
808
|
-
const { type, modifiers, language } = parseClassifierString(tokenStyleValue, '');
|
|
809
|
-
return this.getTokenStyle(type, modifiers, language);
|
|
810
|
-
}
|
|
811
|
-
else if (typeof tokenStyleValue === 'object') {
|
|
812
|
-
return tokenStyleValue;
|
|
813
|
-
}
|
|
814
|
-
return undefined;
|
|
815
|
-
}
|
|
816
|
-
getTokenColorIndex() {
|
|
817
|
-
if (!this.tokenColorIndex) {
|
|
818
|
-
const index = ( (new TokenColorIndex()));
|
|
819
|
-
this.tokenColors.forEach(rule => {
|
|
820
|
-
index.add(rule.settings.foreground);
|
|
821
|
-
index.add(rule.settings.background);
|
|
822
|
-
});
|
|
823
|
-
this.semanticTokenRules.forEach(r => index.add(r.style.foreground));
|
|
824
|
-
tokenClassificationRegistry.getTokenStylingDefaultRules().forEach(r => {
|
|
825
|
-
const defaultColor = r.defaults[this.type];
|
|
826
|
-
if (defaultColor && typeof defaultColor === 'object') {
|
|
827
|
-
index.add(defaultColor.foreground);
|
|
828
|
-
}
|
|
829
|
-
});
|
|
830
|
-
this.customSemanticTokenRules.forEach(r => index.add(r.style.foreground));
|
|
831
|
-
this.tokenColorIndex = index;
|
|
832
|
-
}
|
|
833
|
-
return this.tokenColorIndex;
|
|
834
|
-
}
|
|
835
|
-
get tokenColorMap() {
|
|
836
|
-
return this.getTokenColorIndex().asArray();
|
|
837
|
-
}
|
|
838
|
-
getTokenStyleMetadata(typeWithLanguage, modifiers, defaultLanguage, useDefault = true, definitions = {}) {
|
|
839
|
-
const { type, language } = parseClassifierString(typeWithLanguage, defaultLanguage);
|
|
840
|
-
const style = this.getTokenStyle(type, modifiers, language, useDefault, definitions);
|
|
841
|
-
if (!style) {
|
|
842
|
-
return undefined;
|
|
843
|
-
}
|
|
844
|
-
return {
|
|
845
|
-
foreground: this.getTokenColorIndex().get(style.foreground),
|
|
846
|
-
bold: style.bold,
|
|
847
|
-
underline: style.underline,
|
|
848
|
-
strikethrough: style.strikethrough,
|
|
849
|
-
italic: style.italic,
|
|
850
|
-
};
|
|
851
|
-
}
|
|
852
|
-
getTokenStylingRuleScope(rule) {
|
|
853
|
-
if (this.customSemanticTokenRules.indexOf(rule) !== -1) {
|
|
854
|
-
return 'setting';
|
|
855
|
-
}
|
|
856
|
-
if (this.semanticTokenRules.indexOf(rule) !== -1) {
|
|
857
|
-
return 'theme';
|
|
858
|
-
}
|
|
859
|
-
return undefined;
|
|
860
|
-
}
|
|
861
|
-
getDefault(colorId) {
|
|
862
|
-
return colorRegistry.resolveDefaultColor(colorId, this);
|
|
863
|
-
}
|
|
864
|
-
resolveScopes(scopes, definitions) {
|
|
865
|
-
if (!this.themeTokenScopeMatchers) {
|
|
866
|
-
this.themeTokenScopeMatchers = ( (this.themeTokenColors.map(getScopeMatcher)));
|
|
867
|
-
}
|
|
868
|
-
if (!this.customTokenScopeMatchers) {
|
|
869
|
-
this.customTokenScopeMatchers = ( (this.customTokenColors.map(getScopeMatcher)));
|
|
870
|
-
}
|
|
871
|
-
for (const scope of scopes) {
|
|
872
|
-
let foreground = undefined;
|
|
873
|
-
let fontStyle = undefined;
|
|
874
|
-
let foregroundScore = -1;
|
|
875
|
-
let fontStyleScore = -1;
|
|
876
|
-
let fontStyleThemingRule = undefined;
|
|
877
|
-
let foregroundThemingRule = undefined;
|
|
878
|
-
function findTokenStyleForScopeInScopes(scopeMatchers, themingRules) {
|
|
879
|
-
for (let i = 0; i < scopeMatchers.length; i++) {
|
|
880
|
-
const score = scopeMatchers[i](scope);
|
|
881
|
-
if (score >= 0) {
|
|
882
|
-
const themingRule = themingRules[i];
|
|
883
|
-
const settings = themingRules[i].settings;
|
|
884
|
-
if (score >= foregroundScore && settings.foreground) {
|
|
885
|
-
foreground = settings.foreground;
|
|
886
|
-
foregroundScore = score;
|
|
887
|
-
foregroundThemingRule = themingRule;
|
|
888
|
-
}
|
|
889
|
-
if (score >= fontStyleScore && isString(settings.fontStyle)) {
|
|
890
|
-
fontStyle = settings.fontStyle;
|
|
891
|
-
fontStyleScore = score;
|
|
892
|
-
fontStyleThemingRule = themingRule;
|
|
893
|
-
}
|
|
894
|
-
}
|
|
895
|
-
}
|
|
896
|
-
}
|
|
897
|
-
findTokenStyleForScopeInScopes(this.themeTokenScopeMatchers, this.themeTokenColors);
|
|
898
|
-
findTokenStyleForScopeInScopes(this.customTokenScopeMatchers, this.customTokenColors);
|
|
899
|
-
if (foreground !== undefined || fontStyle !== undefined) {
|
|
900
|
-
if (definitions) {
|
|
901
|
-
definitions.foreground = foregroundThemingRule;
|
|
902
|
-
definitions.bold = definitions.italic = definitions.underline = definitions.strikethrough = fontStyleThemingRule;
|
|
903
|
-
definitions.scope = scope;
|
|
904
|
-
}
|
|
905
|
-
return TokenStyle.fromSettings(foreground, fontStyle);
|
|
906
|
-
}
|
|
907
|
-
}
|
|
908
|
-
return undefined;
|
|
909
|
-
}
|
|
910
|
-
defines(colorId) {
|
|
911
|
-
return this.customColorMap.hasOwnProperty(colorId) || this.colorMap.hasOwnProperty(colorId);
|
|
912
|
-
}
|
|
913
|
-
setCustomizations(settings) {
|
|
914
|
-
this.setCustomColors(settings.colorCustomizations);
|
|
915
|
-
this.setCustomTokenColors(settings.tokenColorCustomizations);
|
|
916
|
-
this.setCustomSemanticTokenColors(settings.semanticTokenColorCustomizations);
|
|
917
|
-
}
|
|
918
|
-
setCustomColors(colors) {
|
|
919
|
-
this.customColorMap = {};
|
|
920
|
-
this.overwriteCustomColors(colors);
|
|
921
|
-
const themeSpecificColors = this.getThemeSpecificColors(colors);
|
|
922
|
-
if (isObject(themeSpecificColors)) {
|
|
923
|
-
this.overwriteCustomColors(themeSpecificColors);
|
|
924
|
-
}
|
|
925
|
-
this.tokenColorIndex = undefined;
|
|
926
|
-
this.textMateThemingRules = undefined;
|
|
927
|
-
this.customTokenScopeMatchers = undefined;
|
|
928
|
-
}
|
|
929
|
-
overwriteCustomColors(colors) {
|
|
930
|
-
for (const id in colors) {
|
|
931
|
-
const colorVal = colors[id];
|
|
932
|
-
if (typeof colorVal === 'string') {
|
|
933
|
-
this.customColorMap[id] = ( (Color.fromHex(colorVal)));
|
|
934
|
-
}
|
|
935
|
-
}
|
|
936
|
-
}
|
|
937
|
-
setCustomTokenColors(customTokenColors) {
|
|
938
|
-
this.customTokenColors = [];
|
|
939
|
-
this.customSemanticHighlightingDeprecated = undefined;
|
|
940
|
-
this.addCustomTokenColors(customTokenColors);
|
|
941
|
-
const themeSpecificTokenColors = this.getThemeSpecificColors(customTokenColors);
|
|
942
|
-
if (isObject(themeSpecificTokenColors)) {
|
|
943
|
-
this.addCustomTokenColors(themeSpecificTokenColors);
|
|
944
|
-
}
|
|
945
|
-
this.tokenColorIndex = undefined;
|
|
946
|
-
this.textMateThemingRules = undefined;
|
|
947
|
-
this.customTokenScopeMatchers = undefined;
|
|
948
|
-
}
|
|
949
|
-
setCustomSemanticTokenColors(semanticTokenColors) {
|
|
950
|
-
this.customSemanticTokenRules = [];
|
|
951
|
-
this.customSemanticHighlighting = undefined;
|
|
952
|
-
if (semanticTokenColors) {
|
|
953
|
-
this.customSemanticHighlighting = semanticTokenColors.enabled;
|
|
954
|
-
if (semanticTokenColors.rules) {
|
|
955
|
-
this.readSemanticTokenRules(semanticTokenColors.rules);
|
|
956
|
-
}
|
|
957
|
-
const themeSpecificColors = this.getThemeSpecificColors(semanticTokenColors);
|
|
958
|
-
if (isObject(themeSpecificColors)) {
|
|
959
|
-
if (themeSpecificColors.enabled !== undefined) {
|
|
960
|
-
this.customSemanticHighlighting = themeSpecificColors.enabled;
|
|
961
|
-
}
|
|
962
|
-
if (themeSpecificColors.rules) {
|
|
963
|
-
this.readSemanticTokenRules(themeSpecificColors.rules);
|
|
964
|
-
}
|
|
965
|
-
}
|
|
966
|
-
}
|
|
967
|
-
this.tokenColorIndex = undefined;
|
|
968
|
-
this.textMateThemingRules = undefined;
|
|
969
|
-
}
|
|
970
|
-
isThemeScope(key) {
|
|
971
|
-
return key.charAt(0) === THEME_SCOPE_OPEN_PAREN && key.charAt(key.length - 1) === THEME_SCOPE_CLOSE_PAREN;
|
|
972
|
-
}
|
|
973
|
-
isThemeScopeMatch(themeId) {
|
|
974
|
-
const themeIdFirstChar = themeId.charAt(0);
|
|
975
|
-
const themeIdLastChar = themeId.charAt(themeId.length - 1);
|
|
976
|
-
const themeIdPrefix = themeId.slice(0, -1);
|
|
977
|
-
const themeIdInfix = themeId.slice(1, -1);
|
|
978
|
-
const themeIdSuffix = themeId.slice(1);
|
|
979
|
-
return themeId === this.settingsId
|
|
980
|
-
|| (this.settingsId.includes(themeIdInfix) && themeIdFirstChar === THEME_SCOPE_WILDCARD && themeIdLastChar === THEME_SCOPE_WILDCARD)
|
|
981
|
-
|| (this.settingsId.startsWith(themeIdPrefix) && themeIdLastChar === THEME_SCOPE_WILDCARD)
|
|
982
|
-
|| (this.settingsId.endsWith(themeIdSuffix) && themeIdFirstChar === THEME_SCOPE_WILDCARD);
|
|
983
|
-
}
|
|
984
|
-
getThemeSpecificColors(colors) {
|
|
985
|
-
let themeSpecificColors;
|
|
986
|
-
for (const key in colors) {
|
|
987
|
-
const scopedColors = colors[key];
|
|
988
|
-
if (this.isThemeScope(key) && scopedColors instanceof Object && !Array.isArray(scopedColors)) {
|
|
989
|
-
const themeScopeList = key.match(themeScopeRegex) || [];
|
|
990
|
-
for (const themeScope of themeScopeList) {
|
|
991
|
-
const themeId = themeScope.substring(1, themeScope.length - 1);
|
|
992
|
-
if (this.isThemeScopeMatch(themeId)) {
|
|
993
|
-
if (!themeSpecificColors) {
|
|
994
|
-
themeSpecificColors = {};
|
|
995
|
-
}
|
|
996
|
-
const scopedThemeSpecificColors = scopedColors;
|
|
997
|
-
for (const subkey in scopedThemeSpecificColors) {
|
|
998
|
-
const originalColors = themeSpecificColors[subkey];
|
|
999
|
-
const overrideColors = scopedThemeSpecificColors[subkey];
|
|
1000
|
-
if (Array.isArray(originalColors) && Array.isArray(overrideColors)) {
|
|
1001
|
-
themeSpecificColors[subkey] = originalColors.concat(overrideColors);
|
|
1002
|
-
}
|
|
1003
|
-
else if (overrideColors) {
|
|
1004
|
-
themeSpecificColors[subkey] = overrideColors;
|
|
1005
|
-
}
|
|
1006
|
-
}
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
}
|
|
1010
|
-
}
|
|
1011
|
-
return themeSpecificColors;
|
|
1012
|
-
}
|
|
1013
|
-
readSemanticTokenRules(tokenStylingRuleSection) {
|
|
1014
|
-
for (const key in tokenStylingRuleSection) {
|
|
1015
|
-
if (!this.isThemeScope(key)) {
|
|
1016
|
-
try {
|
|
1017
|
-
const rule = readSemanticTokenRule(key, tokenStylingRuleSection[key]);
|
|
1018
|
-
if (rule) {
|
|
1019
|
-
this.customSemanticTokenRules.push(rule);
|
|
1020
|
-
}
|
|
1021
|
-
}
|
|
1022
|
-
catch (e) {
|
|
1023
|
-
}
|
|
1024
|
-
}
|
|
1025
|
-
}
|
|
1026
|
-
}
|
|
1027
|
-
addCustomTokenColors(customTokenColors) {
|
|
1028
|
-
for (const tokenGroup in tokenGroupToScopesMap) {
|
|
1029
|
-
const group = tokenGroup;
|
|
1030
|
-
const value = customTokenColors[group];
|
|
1031
|
-
if (value) {
|
|
1032
|
-
const settings = typeof value === 'string' ? { foreground: value } : value;
|
|
1033
|
-
const scopes = tokenGroupToScopesMap[group];
|
|
1034
|
-
for (const scope of scopes) {
|
|
1035
|
-
this.customTokenColors.push({ scope, settings });
|
|
1036
|
-
}
|
|
1037
|
-
}
|
|
1038
|
-
}
|
|
1039
|
-
if (Array.isArray(customTokenColors.textMateRules)) {
|
|
1040
|
-
for (const rule of customTokenColors.textMateRules) {
|
|
1041
|
-
if (rule.scope && rule.settings) {
|
|
1042
|
-
this.customTokenColors.push(rule);
|
|
1043
|
-
}
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
if (customTokenColors.semanticHighlighting !== undefined) {
|
|
1047
|
-
this.customSemanticHighlightingDeprecated = customTokenColors.semanticHighlighting;
|
|
1048
|
-
}
|
|
1049
|
-
}
|
|
1050
|
-
ensureLoaded(extensionResourceLoaderService) {
|
|
1051
|
-
return !this.isLoaded ? this.load(extensionResourceLoaderService) : Promise.resolve(undefined);
|
|
1052
|
-
}
|
|
1053
|
-
reload(extensionResourceLoaderService) {
|
|
1054
|
-
return this.load(extensionResourceLoaderService);
|
|
1055
|
-
}
|
|
1056
|
-
load(extensionResourceLoaderService) {
|
|
1057
|
-
if (!this.location) {
|
|
1058
|
-
return Promise.resolve(undefined);
|
|
1059
|
-
}
|
|
1060
|
-
this.themeTokenColors = [];
|
|
1061
|
-
this.clearCaches();
|
|
1062
|
-
const result = {
|
|
1063
|
-
colors: {},
|
|
1064
|
-
textMateRules: [],
|
|
1065
|
-
semanticTokenRules: [],
|
|
1066
|
-
semanticHighlighting: false
|
|
1067
|
-
};
|
|
1068
|
-
return _loadColorTheme(extensionResourceLoaderService, this.location, result).then(_ => {
|
|
1069
|
-
this.isLoaded = true;
|
|
1070
|
-
this.semanticTokenRules = result.semanticTokenRules;
|
|
1071
|
-
this.colorMap = result.colors;
|
|
1072
|
-
this.themeTokenColors = result.textMateRules;
|
|
1073
|
-
this.themeSemanticHighlighting = result.semanticHighlighting;
|
|
1074
|
-
});
|
|
1075
|
-
}
|
|
1076
|
-
clearCaches() {
|
|
1077
|
-
this.tokenColorIndex = undefined;
|
|
1078
|
-
this.textMateThemingRules = undefined;
|
|
1079
|
-
this.themeTokenScopeMatchers = undefined;
|
|
1080
|
-
this.customTokenScopeMatchers = undefined;
|
|
1081
|
-
}
|
|
1082
|
-
toStorage(storageService) {
|
|
1083
|
-
const colorMapData = {};
|
|
1084
|
-
for (const key in this.colorMap) {
|
|
1085
|
-
colorMapData[key] = Color.Format.CSS.formatHexA(this.colorMap[key], true);
|
|
1086
|
-
}
|
|
1087
|
-
const value = JSON.stringify({
|
|
1088
|
-
id: this.id,
|
|
1089
|
-
label: this.label,
|
|
1090
|
-
settingsId: this.settingsId,
|
|
1091
|
-
themeTokenColors: ( (this.themeTokenColors.map(tc => ({ settings: tc.settings, scope: tc.scope })))),
|
|
1092
|
-
semanticTokenRules: ( (this.semanticTokenRules.map(SemanticTokenRule.toJSONObject))),
|
|
1093
|
-
extensionData: ExtensionData.toJSONObject(this.extensionData),
|
|
1094
|
-
themeSemanticHighlighting: this.themeSemanticHighlighting,
|
|
1095
|
-
colorMap: colorMapData,
|
|
1096
|
-
watch: this.watch
|
|
1097
|
-
});
|
|
1098
|
-
storageService.store(ColorThemeData.STORAGE_KEY, value, 0 , 0 );
|
|
1099
|
-
}
|
|
1100
|
-
get baseTheme() {
|
|
1101
|
-
return this.classNames[0];
|
|
1102
|
-
}
|
|
1103
|
-
get classNames() {
|
|
1104
|
-
return this.id.split(' ');
|
|
1105
|
-
}
|
|
1106
|
-
get type() {
|
|
1107
|
-
switch (this.baseTheme) {
|
|
1108
|
-
case VS_LIGHT_THEME: return ColorScheme.LIGHT;
|
|
1109
|
-
case VS_HC_THEME: return ColorScheme.HIGH_CONTRAST_DARK;
|
|
1110
|
-
case VS_HC_LIGHT_THEME: return ColorScheme.HIGH_CONTRAST_LIGHT;
|
|
1111
|
-
default: return ColorScheme.DARK;
|
|
1112
|
-
}
|
|
1113
|
-
}
|
|
1114
|
-
static createUnloadedThemeForThemeType(themeType, colorMap) {
|
|
1115
|
-
return ColorThemeData.createUnloadedTheme(getThemeTypeSelector(themeType), colorMap);
|
|
1116
|
-
}
|
|
1117
|
-
static createUnloadedTheme(id, colorMap) {
|
|
1118
|
-
const themeData = ( (new ColorThemeData(id, '', '__' + id)));
|
|
1119
|
-
themeData.isLoaded = false;
|
|
1120
|
-
themeData.themeTokenColors = [];
|
|
1121
|
-
themeData.watch = false;
|
|
1122
|
-
if (colorMap) {
|
|
1123
|
-
for (const id in colorMap) {
|
|
1124
|
-
themeData.colorMap[id] = ( (Color.fromHex(colorMap[id])));
|
|
1125
|
-
}
|
|
1126
|
-
}
|
|
1127
|
-
return themeData;
|
|
1128
|
-
}
|
|
1129
|
-
static createLoadedEmptyTheme(id, settingsId) {
|
|
1130
|
-
const themeData = ( (new ColorThemeData(id, '', settingsId)));
|
|
1131
|
-
themeData.isLoaded = true;
|
|
1132
|
-
themeData.themeTokenColors = [];
|
|
1133
|
-
themeData.watch = false;
|
|
1134
|
-
return themeData;
|
|
1135
|
-
}
|
|
1136
|
-
static fromStorageData(storageService) {
|
|
1137
|
-
const input = storageService.get(ColorThemeData.STORAGE_KEY, 0 );
|
|
1138
|
-
if (!input) {
|
|
1139
|
-
return undefined;
|
|
1140
|
-
}
|
|
1141
|
-
try {
|
|
1142
|
-
const data = JSON.parse(input);
|
|
1143
|
-
const theme = ( (new ColorThemeData('', '', '')));
|
|
1144
|
-
for (const key in data) {
|
|
1145
|
-
switch (key) {
|
|
1146
|
-
case 'colorMap': {
|
|
1147
|
-
const colorMapData = data[key];
|
|
1148
|
-
for (const id in colorMapData) {
|
|
1149
|
-
theme.colorMap[id] = ( (Color.fromHex(colorMapData[id])));
|
|
1150
|
-
}
|
|
1151
|
-
break;
|
|
1152
|
-
}
|
|
1153
|
-
case 'themeTokenColors':
|
|
1154
|
-
case 'id':
|
|
1155
|
-
case 'label':
|
|
1156
|
-
case 'settingsId':
|
|
1157
|
-
case 'watch':
|
|
1158
|
-
case 'themeSemanticHighlighting':
|
|
1159
|
-
theme[key] = data[key];
|
|
1160
|
-
break;
|
|
1161
|
-
case 'semanticTokenRules': {
|
|
1162
|
-
const rulesData = data[key];
|
|
1163
|
-
if (Array.isArray(rulesData)) {
|
|
1164
|
-
for (const d of rulesData) {
|
|
1165
|
-
const rule = SemanticTokenRule.fromJSONObject(tokenClassificationRegistry, d);
|
|
1166
|
-
if (rule) {
|
|
1167
|
-
theme.semanticTokenRules.push(rule);
|
|
1168
|
-
}
|
|
1169
|
-
}
|
|
1170
|
-
}
|
|
1171
|
-
break;
|
|
1172
|
-
}
|
|
1173
|
-
case 'location':
|
|
1174
|
-
break;
|
|
1175
|
-
case 'extensionData':
|
|
1176
|
-
theme.extensionData = ExtensionData.fromJSONObject(data.extensionData);
|
|
1177
|
-
break;
|
|
1178
|
-
}
|
|
1179
|
-
}
|
|
1180
|
-
if (!theme.id || !theme.settingsId) {
|
|
1181
|
-
return undefined;
|
|
1182
|
-
}
|
|
1183
|
-
return theme;
|
|
1184
|
-
}
|
|
1185
|
-
catch (e) {
|
|
1186
|
-
return undefined;
|
|
1187
|
-
}
|
|
1188
|
-
}
|
|
1189
|
-
static fromExtensionTheme(theme, colorThemeLocation, extensionData) {
|
|
1190
|
-
const baseTheme = theme['uiTheme'] || 'vs-dark';
|
|
1191
|
-
const themeSelector = toCSSSelector(extensionData.extensionId, theme.path);
|
|
1192
|
-
const id = `${baseTheme} ${themeSelector}`;
|
|
1193
|
-
const label = theme.label || basename(theme.path);
|
|
1194
|
-
const settingsId = theme.id || label;
|
|
1195
|
-
const themeData = ( (new ColorThemeData(id, label, settingsId)));
|
|
1196
|
-
themeData.description = theme.description;
|
|
1197
|
-
themeData.watch = theme._watch === true;
|
|
1198
|
-
themeData.location = colorThemeLocation;
|
|
1199
|
-
themeData.extensionData = extensionData;
|
|
1200
|
-
themeData.isLoaded = false;
|
|
1201
|
-
return themeData;
|
|
1202
|
-
}
|
|
1203
|
-
}
|
|
1204
|
-
ColorThemeData.STORAGE_KEY = 'colorThemeData';
|
|
1205
|
-
function toCSSSelector(extensionId, path) {
|
|
1206
|
-
if (path.startsWith('./')) {
|
|
1207
|
-
path = path.substr(2);
|
|
1208
|
-
}
|
|
1209
|
-
let str = `${extensionId}-${path}`;
|
|
1210
|
-
str = str.replace(/[^_a-zA-Z0-9-]/g, '-');
|
|
1211
|
-
if (str.charAt(0).match(/[0-9-]/)) {
|
|
1212
|
-
str = '_' + str;
|
|
1213
|
-
}
|
|
1214
|
-
return str;
|
|
1215
|
-
}
|
|
1216
|
-
async function _loadColorTheme(extensionResourceLoaderService, themeLocation, result) {
|
|
1217
|
-
if (extname(themeLocation) === '.json') {
|
|
1218
|
-
const content = await extensionResourceLoaderService.readExtensionResource(themeLocation);
|
|
1219
|
-
const errors = [];
|
|
1220
|
-
const contentValue = parse$1(content, errors);
|
|
1221
|
-
if (errors.length > 0) {
|
|
1222
|
-
return Promise.reject(( (new Error( (localize(
|
|
1223
|
-
'error.cannotparsejson',
|
|
1224
|
-
"Problems parsing JSON theme file: {0}",
|
|
1225
|
-
( (errors.map(e => getParseErrorMessage(e.error)))).join(', ')
|
|
1226
|
-
))))));
|
|
1227
|
-
}
|
|
1228
|
-
else if (getNodeType(contentValue) !== 'object') {
|
|
1229
|
-
return Promise.reject(( (new Error( (localize(
|
|
1230
|
-
'error.invalidformat',
|
|
1231
|
-
"Invalid format for JSON theme file: Object expected."
|
|
1232
|
-
))))));
|
|
1233
|
-
}
|
|
1234
|
-
if (contentValue.include) {
|
|
1235
|
-
await _loadColorTheme(extensionResourceLoaderService, joinPath(dirname(themeLocation), contentValue.include), result);
|
|
1236
|
-
}
|
|
1237
|
-
if (Array.isArray(contentValue.settings)) {
|
|
1238
|
-
convertSettings(contentValue.settings, result);
|
|
1239
|
-
return null;
|
|
1240
|
-
}
|
|
1241
|
-
result.semanticHighlighting = result.semanticHighlighting || contentValue.semanticHighlighting;
|
|
1242
|
-
const colors = contentValue.colors;
|
|
1243
|
-
if (colors) {
|
|
1244
|
-
if (typeof colors !== 'object') {
|
|
1245
|
-
return Promise.reject(( (new Error( (localize(
|
|
1246
|
-
{ key: 'error.invalidformat.colors', comment: ['{0} will be replaced by a path. Values in quotes should not be translated.'] },
|
|
1247
|
-
"Problem parsing color theme file: {0}. Property 'colors' is not of type 'object'.",
|
|
1248
|
-
(themeLocation.toString())
|
|
1249
|
-
))))));
|
|
1250
|
-
}
|
|
1251
|
-
for (const colorId in colors) {
|
|
1252
|
-
const colorHex = colors[colorId];
|
|
1253
|
-
if (typeof colorHex === 'string') {
|
|
1254
|
-
result.colors[colorId] = ( (Color.fromHex(colors[colorId])));
|
|
1255
|
-
}
|
|
1256
|
-
}
|
|
1257
|
-
}
|
|
1258
|
-
const tokenColors = contentValue.tokenColors;
|
|
1259
|
-
if (tokenColors) {
|
|
1260
|
-
if (Array.isArray(tokenColors)) {
|
|
1261
|
-
result.textMateRules.push(...tokenColors);
|
|
1262
|
-
}
|
|
1263
|
-
else if (typeof tokenColors === 'string') {
|
|
1264
|
-
await _loadSyntaxTokens(extensionResourceLoaderService, joinPath(dirname(themeLocation), tokenColors), result);
|
|
1265
|
-
}
|
|
1266
|
-
else {
|
|
1267
|
-
return Promise.reject(( (new Error( (localize(
|
|
1268
|
-
{ key: 'error.invalidformat.tokenColors', comment: ['{0} will be replaced by a path. Values in quotes should not be translated.'] },
|
|
1269
|
-
"Problem parsing color theme file: {0}. Property 'tokenColors' should be either an array specifying colors or a path to a TextMate theme file",
|
|
1270
|
-
(themeLocation.toString())
|
|
1271
|
-
))))));
|
|
1272
|
-
}
|
|
1273
|
-
}
|
|
1274
|
-
const semanticTokenColors = contentValue.semanticTokenColors;
|
|
1275
|
-
if (semanticTokenColors && typeof semanticTokenColors === 'object') {
|
|
1276
|
-
for (const key in semanticTokenColors) {
|
|
1277
|
-
try {
|
|
1278
|
-
const rule = readSemanticTokenRule(key, semanticTokenColors[key]);
|
|
1279
|
-
if (rule) {
|
|
1280
|
-
result.semanticTokenRules.push(rule);
|
|
1281
|
-
}
|
|
1282
|
-
}
|
|
1283
|
-
catch (e) {
|
|
1284
|
-
return Promise.reject(( (new Error( (localize(
|
|
1285
|
-
{ key: 'error.invalidformat.semanticTokenColors', comment: ['{0} will be replaced by a path. Values in quotes should not be translated.'] },
|
|
1286
|
-
"Problem parsing color theme file: {0}. Property 'semanticTokenColors' contains a invalid selector",
|
|
1287
|
-
(themeLocation.toString())
|
|
1288
|
-
))))));
|
|
1289
|
-
}
|
|
1290
|
-
}
|
|
1291
|
-
}
|
|
1292
|
-
}
|
|
1293
|
-
else {
|
|
1294
|
-
return _loadSyntaxTokens(extensionResourceLoaderService, themeLocation, result);
|
|
1295
|
-
}
|
|
1296
|
-
}
|
|
1297
|
-
function _loadSyntaxTokens(extensionResourceLoaderService, themeLocation, result) {
|
|
1298
|
-
return extensionResourceLoaderService.readExtensionResource(themeLocation).then(content => {
|
|
1299
|
-
try {
|
|
1300
|
-
const contentValue = parse(content);
|
|
1301
|
-
const settings = contentValue.settings;
|
|
1302
|
-
if (!Array.isArray(settings)) {
|
|
1303
|
-
return Promise.reject(( (new Error( (localize(
|
|
1304
|
-
'error.plist.invalidformat',
|
|
1305
|
-
"Problem parsing tmTheme file: {0}. 'settings' is not array."
|
|
1306
|
-
))))));
|
|
1307
|
-
}
|
|
1308
|
-
convertSettings(settings, result);
|
|
1309
|
-
return Promise.resolve(null);
|
|
1310
|
-
}
|
|
1311
|
-
catch (e) {
|
|
1312
|
-
return Promise.reject(( (new Error(
|
|
1313
|
-
(localize('error.cannotparse', "Problems parsing tmTheme file: {0}", e.message))
|
|
1314
|
-
))));
|
|
1315
|
-
}
|
|
1316
|
-
}, error => {
|
|
1317
|
-
return Promise.reject(( (new Error( (localize(
|
|
1318
|
-
'error.cannotload',
|
|
1319
|
-
"Problems loading tmTheme file {0}: {1}",
|
|
1320
|
-
(themeLocation.toString()),
|
|
1321
|
-
error.message
|
|
1322
|
-
))))));
|
|
1323
|
-
});
|
|
1324
|
-
}
|
|
1325
|
-
const defaultThemeColors = {
|
|
1326
|
-
'light': [
|
|
1327
|
-
{ scope: 'token.info-token', settings: { foreground: '#316bcd' } },
|
|
1328
|
-
{ scope: 'token.warn-token', settings: { foreground: '#cd9731' } },
|
|
1329
|
-
{ scope: 'token.error-token', settings: { foreground: '#cd3131' } },
|
|
1330
|
-
{ scope: 'token.debug-token', settings: { foreground: '#800080' } }
|
|
1331
|
-
],
|
|
1332
|
-
'dark': [
|
|
1333
|
-
{ scope: 'token.info-token', settings: { foreground: '#6796e6' } },
|
|
1334
|
-
{ scope: 'token.warn-token', settings: { foreground: '#cd9731' } },
|
|
1335
|
-
{ scope: 'token.error-token', settings: { foreground: '#f44747' } },
|
|
1336
|
-
{ scope: 'token.debug-token', settings: { foreground: '#b267e6' } }
|
|
1337
|
-
],
|
|
1338
|
-
'hcLight': [
|
|
1339
|
-
{ scope: 'token.info-token', settings: { foreground: '#316bcd' } },
|
|
1340
|
-
{ scope: 'token.warn-token', settings: { foreground: '#cd9731' } },
|
|
1341
|
-
{ scope: 'token.error-token', settings: { foreground: '#cd3131' } },
|
|
1342
|
-
{ scope: 'token.debug-token', settings: { foreground: '#800080' } }
|
|
1343
|
-
],
|
|
1344
|
-
'hcDark': [
|
|
1345
|
-
{ scope: 'token.info-token', settings: { foreground: '#6796e6' } },
|
|
1346
|
-
{ scope: 'token.warn-token', settings: { foreground: '#008000' } },
|
|
1347
|
-
{ scope: 'token.error-token', settings: { foreground: '#FF0000' } },
|
|
1348
|
-
{ scope: 'token.debug-token', settings: { foreground: '#b267e6' } }
|
|
1349
|
-
]
|
|
1350
|
-
};
|
|
1351
|
-
const noMatch = (_scope) => -1;
|
|
1352
|
-
function nameMatcher(identifers, scope) {
|
|
1353
|
-
function findInIdents(s, lastIndent) {
|
|
1354
|
-
for (let i = lastIndent - 1; i >= 0; i--) {
|
|
1355
|
-
if (scopesAreMatching(s, identifers[i])) {
|
|
1356
|
-
return i;
|
|
1357
|
-
}
|
|
1358
|
-
}
|
|
1359
|
-
return -1;
|
|
1360
|
-
}
|
|
1361
|
-
if (scope.length < identifers.length) {
|
|
1362
|
-
return -1;
|
|
1363
|
-
}
|
|
1364
|
-
let lastScopeIndex = scope.length - 1;
|
|
1365
|
-
let lastIdentifierIndex = findInIdents(scope[lastScopeIndex--], identifers.length);
|
|
1366
|
-
if (lastIdentifierIndex >= 0) {
|
|
1367
|
-
const score = (lastIdentifierIndex + 1) * 0x10000 + identifers[lastIdentifierIndex].length;
|
|
1368
|
-
while (lastScopeIndex >= 0) {
|
|
1369
|
-
lastIdentifierIndex = findInIdents(scope[lastScopeIndex--], lastIdentifierIndex);
|
|
1370
|
-
if (lastIdentifierIndex === -1) {
|
|
1371
|
-
return -1;
|
|
1372
|
-
}
|
|
1373
|
-
}
|
|
1374
|
-
return score;
|
|
1375
|
-
}
|
|
1376
|
-
return -1;
|
|
1377
|
-
}
|
|
1378
|
-
function scopesAreMatching(thisScopeName, scopeName) {
|
|
1379
|
-
if (!thisScopeName) {
|
|
1380
|
-
return false;
|
|
1381
|
-
}
|
|
1382
|
-
if (thisScopeName === scopeName) {
|
|
1383
|
-
return true;
|
|
1384
|
-
}
|
|
1385
|
-
const len = scopeName.length;
|
|
1386
|
-
return thisScopeName.length > len && thisScopeName.substr(0, len) === scopeName && thisScopeName[len] === '.';
|
|
1387
|
-
}
|
|
1388
|
-
function getScopeMatcher(rule) {
|
|
1389
|
-
const ruleScope = rule.scope;
|
|
1390
|
-
if (!ruleScope || !rule.settings) {
|
|
1391
|
-
return noMatch;
|
|
1392
|
-
}
|
|
1393
|
-
const matchers = [];
|
|
1394
|
-
if (Array.isArray(ruleScope)) {
|
|
1395
|
-
for (const rs of ruleScope) {
|
|
1396
|
-
createMatchers(rs, nameMatcher, matchers);
|
|
1397
|
-
}
|
|
1398
|
-
}
|
|
1399
|
-
else {
|
|
1400
|
-
createMatchers(ruleScope, nameMatcher, matchers);
|
|
1401
|
-
}
|
|
1402
|
-
if (matchers.length === 0) {
|
|
1403
|
-
return noMatch;
|
|
1404
|
-
}
|
|
1405
|
-
return (scope) => {
|
|
1406
|
-
let max = matchers[0].matcher(scope);
|
|
1407
|
-
for (let i = 1; i < matchers.length; i++) {
|
|
1408
|
-
max = Math.max(max, matchers[i].matcher(scope));
|
|
1409
|
-
}
|
|
1410
|
-
return max;
|
|
1411
|
-
};
|
|
1412
|
-
}
|
|
1413
|
-
function readSemanticTokenRule(selectorString, settings) {
|
|
1414
|
-
const selector = tokenClassificationRegistry.parseTokenSelector(selectorString);
|
|
1415
|
-
let style;
|
|
1416
|
-
if (typeof settings === 'string') {
|
|
1417
|
-
style = TokenStyle.fromSettings(settings, undefined);
|
|
1418
|
-
}
|
|
1419
|
-
else if (isSemanticTokenColorizationSetting(settings)) {
|
|
1420
|
-
style = TokenStyle.fromSettings(settings.foreground, settings.fontStyle, settings.bold, settings.underline, settings.strikethrough, settings.italic);
|
|
1421
|
-
}
|
|
1422
|
-
if (style) {
|
|
1423
|
-
return { selector, style };
|
|
1424
|
-
}
|
|
1425
|
-
return undefined;
|
|
1426
|
-
}
|
|
1427
|
-
function isSemanticTokenColorizationSetting(style) {
|
|
1428
|
-
return style && (isString(style.foreground) || isString(style.fontStyle) || isBoolean(style.italic)
|
|
1429
|
-
|| isBoolean(style.underline) || isBoolean(style.strikethrough) || isBoolean(style.bold));
|
|
1430
|
-
}
|
|
1431
|
-
class TokenColorIndex {
|
|
1432
|
-
constructor() {
|
|
1433
|
-
this._lastColorId = 0;
|
|
1434
|
-
this._id2color = [];
|
|
1435
|
-
this._color2id = Object.create(null);
|
|
1436
|
-
}
|
|
1437
|
-
add(color) {
|
|
1438
|
-
color = normalizeColor(color);
|
|
1439
|
-
if (color === undefined) {
|
|
1440
|
-
return 0;
|
|
1441
|
-
}
|
|
1442
|
-
let value = this._color2id[color];
|
|
1443
|
-
if (value) {
|
|
1444
|
-
return value;
|
|
1445
|
-
}
|
|
1446
|
-
value = ++this._lastColorId;
|
|
1447
|
-
this._color2id[color] = value;
|
|
1448
|
-
this._id2color[value] = color;
|
|
1449
|
-
return value;
|
|
1450
|
-
}
|
|
1451
|
-
get(color) {
|
|
1452
|
-
color = normalizeColor(color);
|
|
1453
|
-
if (color === undefined) {
|
|
1454
|
-
return 0;
|
|
1455
|
-
}
|
|
1456
|
-
const value = this._color2id[color];
|
|
1457
|
-
if (value) {
|
|
1458
|
-
return value;
|
|
1459
|
-
}
|
|
1460
|
-
console.log(`Color ${color} not in index.`);
|
|
1461
|
-
return 0;
|
|
1462
|
-
}
|
|
1463
|
-
asArray() {
|
|
1464
|
-
return this._id2color.slice(0);
|
|
1465
|
-
}
|
|
1466
|
-
}
|
|
1467
|
-
function normalizeColor(color) {
|
|
1468
|
-
if (!color) {
|
|
1469
|
-
return undefined;
|
|
1470
|
-
}
|
|
1471
|
-
if (typeof color !== 'string') {
|
|
1472
|
-
color = Color.Format.CSS.formatHexA(color, true);
|
|
1473
|
-
}
|
|
1474
|
-
const len = color.length;
|
|
1475
|
-
if (color.charCodeAt(0) !== 35 || (len !== 4 && len !== 5 && len !== 7 && len !== 9)) {
|
|
1476
|
-
return undefined;
|
|
1477
|
-
}
|
|
1478
|
-
const result = [35 ];
|
|
1479
|
-
for (let i = 1; i < len; i++) {
|
|
1480
|
-
const upper = hexUpper(color.charCodeAt(i));
|
|
1481
|
-
if (!upper) {
|
|
1482
|
-
return undefined;
|
|
1483
|
-
}
|
|
1484
|
-
result.push(upper);
|
|
1485
|
-
if (len === 4 || len === 5) {
|
|
1486
|
-
result.push(upper);
|
|
1487
|
-
}
|
|
1488
|
-
}
|
|
1489
|
-
if (result.length === 9 && result[7] === 70 && result[8] === 70 ) {
|
|
1490
|
-
result.length = 7;
|
|
1491
|
-
}
|
|
1492
|
-
return String.fromCharCode(...result);
|
|
1493
|
-
}
|
|
1494
|
-
function hexUpper(charCode) {
|
|
1495
|
-
if (charCode >= 48 && charCode <= 57 || charCode >= 65 && charCode <= 70 ) {
|
|
1496
|
-
return charCode;
|
|
1497
|
-
}
|
|
1498
|
-
else if (charCode >= 97 && charCode <= 102 ) {
|
|
1499
|
-
return charCode - 97 + 65 ;
|
|
1500
|
-
}
|
|
1501
|
-
return 0;
|
|
1502
|
-
}
|
|
1503
|
-
const fontIdRegex = '^([\\w_-]+)$';
|
|
1504
|
-
const fontStyleRegex = '^(normal|italic|(oblique[ \\w\\s-]+))$';
|
|
1505
|
-
const fontWeightRegex = '^(normal|bold|lighter|bolder|(\\d{0-1000}))$';
|
|
1506
|
-
const fontSizeRegex = '^([\\w .%_-]+)$';
|
|
1507
|
-
const fontFormatRegex = '^woff|woff2|truetype|opentype|embedded-opentype|svg$';
|
|
1508
|
-
const schemaId$1 = 'vscode://schemas/product-icon-theme';
|
|
1509
|
-
const schema$1 = {
|
|
1510
|
-
type: 'object',
|
|
1511
|
-
allowComments: true,
|
|
1512
|
-
allowTrailingCommas: true,
|
|
1513
|
-
properties: {
|
|
1514
|
-
fonts: {
|
|
1515
|
-
type: 'array',
|
|
1516
|
-
items: {
|
|
1517
|
-
type: 'object',
|
|
1518
|
-
properties: {
|
|
1519
|
-
id: {
|
|
1520
|
-
type: 'string',
|
|
1521
|
-
description: ( (localize('schema.id', 'The ID of the font.'))),
|
|
1522
|
-
pattern: fontIdRegex,
|
|
1523
|
-
patternErrorMessage: ( (localize(
|
|
1524
|
-
'schema.id.formatError',
|
|
1525
|
-
'The ID must only contain letters, numbers, underscore and minus.'
|
|
1526
|
-
)))
|
|
1527
|
-
},
|
|
1528
|
-
src: {
|
|
1529
|
-
type: 'array',
|
|
1530
|
-
description: ( (localize('schema.src', 'The location of the font.'))),
|
|
1531
|
-
items: {
|
|
1532
|
-
type: 'object',
|
|
1533
|
-
properties: {
|
|
1534
|
-
path: {
|
|
1535
|
-
type: 'string',
|
|
1536
|
-
description: ( (localize(
|
|
1537
|
-
'schema.font-path',
|
|
1538
|
-
'The font path, relative to the current product icon theme file.'
|
|
1539
|
-
))),
|
|
1540
|
-
},
|
|
1541
|
-
format: {
|
|
1542
|
-
type: 'string',
|
|
1543
|
-
description: ( (localize('schema.font-format', 'The format of the font.'))),
|
|
1544
|
-
enum: ['woff', 'woff2', 'truetype', 'opentype', 'embedded-opentype', 'svg']
|
|
1545
|
-
}
|
|
1546
|
-
},
|
|
1547
|
-
required: [
|
|
1548
|
-
'path',
|
|
1549
|
-
'format'
|
|
1550
|
-
]
|
|
1551
|
-
}
|
|
1552
|
-
},
|
|
1553
|
-
weight: {
|
|
1554
|
-
type: 'string',
|
|
1555
|
-
description: ( (localize(
|
|
1556
|
-
'schema.font-weight',
|
|
1557
|
-
'The weight of the font. See https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight for valid values.'
|
|
1558
|
-
))),
|
|
1559
|
-
anyOf: [
|
|
1560
|
-
{ enum: ['normal', 'bold', 'lighter', 'bolder'] },
|
|
1561
|
-
{ type: 'string', pattern: fontWeightRegex }
|
|
1562
|
-
]
|
|
1563
|
-
},
|
|
1564
|
-
style: {
|
|
1565
|
-
type: 'string',
|
|
1566
|
-
description: ( (localize(
|
|
1567
|
-
'schema.font-style',
|
|
1568
|
-
'The style of the font. See https://developer.mozilla.org/en-US/docs/Web/CSS/font-style for valid values.'
|
|
1569
|
-
))),
|
|
1570
|
-
anyOf: [
|
|
1571
|
-
{ enum: ['normal', 'italic', 'oblique'] },
|
|
1572
|
-
{ type: 'string', pattern: fontStyleRegex }
|
|
1573
|
-
]
|
|
1574
|
-
}
|
|
1575
|
-
},
|
|
1576
|
-
required: [
|
|
1577
|
-
'id',
|
|
1578
|
-
'src'
|
|
1579
|
-
]
|
|
1580
|
-
}
|
|
1581
|
-
},
|
|
1582
|
-
iconDefinitions: {
|
|
1583
|
-
description: ( (localize('schema.iconDefinitions', 'Association of icon name to a font character.'))),
|
|
1584
|
-
$ref: iconsSchemaId
|
|
1585
|
-
}
|
|
1586
|
-
}
|
|
1587
|
-
};
|
|
1588
|
-
function registerProductIconThemeSchemas() {
|
|
1589
|
-
const schemaRegistry = ( (Registry.as(Extensions$1.JSONContribution)));
|
|
1590
|
-
schemaRegistry.registerSchema(schemaId$1, schema$1);
|
|
1591
|
-
}
|
|
1592
|
-
const schemaId = 'vscode://schemas/icon-theme';
|
|
1593
|
-
const schema = {
|
|
1594
|
-
type: 'object',
|
|
1595
|
-
allowComments: true,
|
|
1596
|
-
allowTrailingCommas: true,
|
|
1597
|
-
definitions: {
|
|
1598
|
-
folderExpanded: {
|
|
1599
|
-
type: 'string',
|
|
1600
|
-
description: ( (localize(
|
|
1601
|
-
'schema.folderExpanded',
|
|
1602
|
-
'The folder icon for expanded folders. The expanded folder icon is optional. If not set, the icon defined for folder will be shown.'
|
|
1603
|
-
)))
|
|
1604
|
-
},
|
|
1605
|
-
folder: {
|
|
1606
|
-
type: 'string',
|
|
1607
|
-
description: ( (localize(
|
|
1608
|
-
'schema.folder',
|
|
1609
|
-
'The folder icon for collapsed folders, and if folderExpanded is not set, also for expanded folders.'
|
|
1610
|
-
)))
|
|
1611
|
-
},
|
|
1612
|
-
file: {
|
|
1613
|
-
type: 'string',
|
|
1614
|
-
description: ( (localize(
|
|
1615
|
-
'schema.file',
|
|
1616
|
-
'The default file icon, shown for all files that don\'t match any extension, filename or language id.'
|
|
1617
|
-
)))
|
|
1618
|
-
},
|
|
1619
|
-
folderNames: {
|
|
1620
|
-
type: 'object',
|
|
1621
|
-
description: ( (localize(
|
|
1622
|
-
'schema.folderNames',
|
|
1623
|
-
'Associates folder names to icons. The object key is the folder name, not including any path segments. No patterns or wildcards are allowed. Folder name matching is case insensitive.'
|
|
1624
|
-
))),
|
|
1625
|
-
additionalProperties: {
|
|
1626
|
-
type: 'string',
|
|
1627
|
-
description: ( (localize('schema.folderName', 'The ID of the icon definition for the association.')))
|
|
1628
|
-
}
|
|
1629
|
-
},
|
|
1630
|
-
folderNamesExpanded: {
|
|
1631
|
-
type: 'object',
|
|
1632
|
-
description: ( (localize(
|
|
1633
|
-
'schema.folderNamesExpanded',
|
|
1634
|
-
'Associates folder names to icons for expanded folders. The object key is the folder name, not including any path segments. No patterns or wildcards are allowed. Folder name matching is case insensitive.'
|
|
1635
|
-
))),
|
|
1636
|
-
additionalProperties: {
|
|
1637
|
-
type: 'string',
|
|
1638
|
-
description: ( (localize(
|
|
1639
|
-
'schema.folderNameExpanded',
|
|
1640
|
-
'The ID of the icon definition for the association.'
|
|
1641
|
-
)))
|
|
1642
|
-
}
|
|
1643
|
-
},
|
|
1644
|
-
fileExtensions: {
|
|
1645
|
-
type: 'object',
|
|
1646
|
-
description: ( (localize(
|
|
1647
|
-
'schema.fileExtensions',
|
|
1648
|
-
'Associates file extensions to icons. The object key is the file extension name. The extension name is the last segment of a file name after the last dot (not including the dot). Extensions are compared case insensitive.'
|
|
1649
|
-
))),
|
|
1650
|
-
additionalProperties: {
|
|
1651
|
-
type: 'string',
|
|
1652
|
-
description: ( (localize(
|
|
1653
|
-
'schema.fileExtension',
|
|
1654
|
-
'The ID of the icon definition for the association.'
|
|
1655
|
-
)))
|
|
1656
|
-
}
|
|
1657
|
-
},
|
|
1658
|
-
fileNames: {
|
|
1659
|
-
type: 'object',
|
|
1660
|
-
description: ( (localize(
|
|
1661
|
-
'schema.fileNames',
|
|
1662
|
-
'Associates file names to icons. The object key is the full file name, but not including any path segments. File name can include dots and a possible file extension. No patterns or wildcards are allowed. File name matching is case insensitive.'
|
|
1663
|
-
))),
|
|
1664
|
-
additionalProperties: {
|
|
1665
|
-
type: 'string',
|
|
1666
|
-
description: ( (localize('schema.fileName', 'The ID of the icon definition for the association.')))
|
|
1667
|
-
}
|
|
1668
|
-
},
|
|
1669
|
-
languageIds: {
|
|
1670
|
-
type: 'object',
|
|
1671
|
-
description: ( (localize(
|
|
1672
|
-
'schema.languageIds',
|
|
1673
|
-
'Associates languages to icons. The object key is the language id as defined in the language contribution point.'
|
|
1674
|
-
))),
|
|
1675
|
-
additionalProperties: {
|
|
1676
|
-
type: 'string',
|
|
1677
|
-
description: ( (localize('schema.languageId', 'The ID of the icon definition for the association.')))
|
|
1678
|
-
}
|
|
1679
|
-
},
|
|
1680
|
-
associations: {
|
|
1681
|
-
type: 'object',
|
|
1682
|
-
properties: {
|
|
1683
|
-
folderExpanded: {
|
|
1684
|
-
$ref: '#/definitions/folderExpanded'
|
|
1685
|
-
},
|
|
1686
|
-
folder: {
|
|
1687
|
-
$ref: '#/definitions/folder'
|
|
1688
|
-
},
|
|
1689
|
-
file: {
|
|
1690
|
-
$ref: '#/definitions/file'
|
|
1691
|
-
},
|
|
1692
|
-
folderNames: {
|
|
1693
|
-
$ref: '#/definitions/folderNames'
|
|
1694
|
-
},
|
|
1695
|
-
folderNamesExpanded: {
|
|
1696
|
-
$ref: '#/definitions/folderNamesExpanded'
|
|
1697
|
-
},
|
|
1698
|
-
fileExtensions: {
|
|
1699
|
-
$ref: '#/definitions/fileExtensions'
|
|
1700
|
-
},
|
|
1701
|
-
fileNames: {
|
|
1702
|
-
$ref: '#/definitions/fileNames'
|
|
1703
|
-
},
|
|
1704
|
-
languageIds: {
|
|
1705
|
-
$ref: '#/definitions/languageIds'
|
|
1706
|
-
}
|
|
1707
|
-
}
|
|
1708
|
-
}
|
|
1709
|
-
},
|
|
1710
|
-
properties: {
|
|
1711
|
-
fonts: {
|
|
1712
|
-
type: 'array',
|
|
1713
|
-
description: ( (localize('schema.fonts', 'Fonts that are used in the icon definitions.'))),
|
|
1714
|
-
items: {
|
|
1715
|
-
type: 'object',
|
|
1716
|
-
properties: {
|
|
1717
|
-
id: {
|
|
1718
|
-
type: 'string',
|
|
1719
|
-
description: ( (localize('schema.id', 'The ID of the font.'))),
|
|
1720
|
-
pattern: fontIdRegex,
|
|
1721
|
-
patternErrorMessage: ( (localize(
|
|
1722
|
-
'schema.id.formatError',
|
|
1723
|
-
'The ID must only contain letter, numbers, underscore and minus.'
|
|
1724
|
-
)))
|
|
1725
|
-
},
|
|
1726
|
-
src: {
|
|
1727
|
-
type: 'array',
|
|
1728
|
-
description: ( (localize('schema.src', 'The location of the font.'))),
|
|
1729
|
-
items: {
|
|
1730
|
-
type: 'object',
|
|
1731
|
-
properties: {
|
|
1732
|
-
path: {
|
|
1733
|
-
type: 'string',
|
|
1734
|
-
description: ( (localize(
|
|
1735
|
-
'schema.font-path',
|
|
1736
|
-
'The font path, relative to the current file icon theme file.'
|
|
1737
|
-
))),
|
|
1738
|
-
},
|
|
1739
|
-
format: {
|
|
1740
|
-
type: 'string',
|
|
1741
|
-
description: ( (localize('schema.font-format', 'The format of the font.'))),
|
|
1742
|
-
enum: ['woff', 'woff2', 'truetype', 'opentype', 'embedded-opentype', 'svg']
|
|
1743
|
-
}
|
|
1744
|
-
},
|
|
1745
|
-
required: [
|
|
1746
|
-
'path',
|
|
1747
|
-
'format'
|
|
1748
|
-
]
|
|
1749
|
-
}
|
|
1750
|
-
},
|
|
1751
|
-
weight: {
|
|
1752
|
-
type: 'string',
|
|
1753
|
-
description: ( (localize(
|
|
1754
|
-
'schema.font-weight',
|
|
1755
|
-
'The weight of the font. See https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight for valid values.'
|
|
1756
|
-
))),
|
|
1757
|
-
pattern: fontWeightRegex
|
|
1758
|
-
},
|
|
1759
|
-
style: {
|
|
1760
|
-
type: 'string',
|
|
1761
|
-
description: ( (localize(
|
|
1762
|
-
'schema.font-style',
|
|
1763
|
-
'The style of the font. See https://developer.mozilla.org/en-US/docs/Web/CSS/font-style for valid values.'
|
|
1764
|
-
))),
|
|
1765
|
-
pattern: fontStyleRegex
|
|
1766
|
-
},
|
|
1767
|
-
size: {
|
|
1768
|
-
type: 'string',
|
|
1769
|
-
description: ( (localize(
|
|
1770
|
-
'schema.font-size',
|
|
1771
|
-
'The default size of the font. See https://developer.mozilla.org/en-US/docs/Web/CSS/font-size for valid values.'
|
|
1772
|
-
))),
|
|
1773
|
-
pattern: fontSizeRegex
|
|
1774
|
-
}
|
|
1775
|
-
},
|
|
1776
|
-
required: [
|
|
1777
|
-
'id',
|
|
1778
|
-
'src'
|
|
1779
|
-
]
|
|
1780
|
-
}
|
|
1781
|
-
},
|
|
1782
|
-
iconDefinitions: {
|
|
1783
|
-
type: 'object',
|
|
1784
|
-
description: ( (localize(
|
|
1785
|
-
'schema.iconDefinitions',
|
|
1786
|
-
'Description of all icons that can be used when associating files to icons.'
|
|
1787
|
-
))),
|
|
1788
|
-
additionalProperties: {
|
|
1789
|
-
type: 'object',
|
|
1790
|
-
description: ( (localize(
|
|
1791
|
-
'schema.iconDefinition',
|
|
1792
|
-
'An icon definition. The object key is the ID of the definition.'
|
|
1793
|
-
))),
|
|
1794
|
-
properties: {
|
|
1795
|
-
iconPath: {
|
|
1796
|
-
type: 'string',
|
|
1797
|
-
description: ( (localize(
|
|
1798
|
-
'schema.iconPath',
|
|
1799
|
-
'When using a SVG or PNG: The path to the image. The path is relative to the icon set file.'
|
|
1800
|
-
)))
|
|
1801
|
-
},
|
|
1802
|
-
fontCharacter: {
|
|
1803
|
-
type: 'string',
|
|
1804
|
-
description: ( (localize(
|
|
1805
|
-
'schema.fontCharacter',
|
|
1806
|
-
'When using a glyph font: The character in the font to use.'
|
|
1807
|
-
)))
|
|
1808
|
-
},
|
|
1809
|
-
fontColor: {
|
|
1810
|
-
type: 'string',
|
|
1811
|
-
format: 'color-hex',
|
|
1812
|
-
description: ( (localize('schema.fontColor', 'When using a glyph font: The color to use.')))
|
|
1813
|
-
},
|
|
1814
|
-
fontSize: {
|
|
1815
|
-
type: 'string',
|
|
1816
|
-
description: ( (localize(
|
|
1817
|
-
'schema.fontSize',
|
|
1818
|
-
'When using a font: The font size in percentage to the text font. If not set, defaults to the size in the font definition.'
|
|
1819
|
-
))),
|
|
1820
|
-
pattern: fontSizeRegex
|
|
1821
|
-
},
|
|
1822
|
-
fontId: {
|
|
1823
|
-
type: 'string',
|
|
1824
|
-
description: ( (localize(
|
|
1825
|
-
'schema.fontId',
|
|
1826
|
-
'When using a font: The id of the font. If not set, defaults to the first font definition.'
|
|
1827
|
-
)))
|
|
1828
|
-
}
|
|
1829
|
-
}
|
|
1830
|
-
}
|
|
1831
|
-
},
|
|
1832
|
-
folderExpanded: {
|
|
1833
|
-
$ref: '#/definitions/folderExpanded'
|
|
1834
|
-
},
|
|
1835
|
-
folder: {
|
|
1836
|
-
$ref: '#/definitions/folder'
|
|
1837
|
-
},
|
|
1838
|
-
file: {
|
|
1839
|
-
$ref: '#/definitions/file'
|
|
1840
|
-
},
|
|
1841
|
-
folderNames: {
|
|
1842
|
-
$ref: '#/definitions/folderNames'
|
|
1843
|
-
},
|
|
1844
|
-
folderNamesExpanded: {
|
|
1845
|
-
$ref: '#/definitions/folderNamesExpanded'
|
|
1846
|
-
},
|
|
1847
|
-
fileExtensions: {
|
|
1848
|
-
$ref: '#/definitions/fileExtensions'
|
|
1849
|
-
},
|
|
1850
|
-
fileNames: {
|
|
1851
|
-
$ref: '#/definitions/fileNames'
|
|
1852
|
-
},
|
|
1853
|
-
languageIds: {
|
|
1854
|
-
$ref: '#/definitions/languageIds'
|
|
1855
|
-
},
|
|
1856
|
-
light: {
|
|
1857
|
-
$ref: '#/definitions/associations',
|
|
1858
|
-
description: ( (localize(
|
|
1859
|
-
'schema.light',
|
|
1860
|
-
'Optional associations for file icons in light color themes.'
|
|
1861
|
-
)))
|
|
1862
|
-
},
|
|
1863
|
-
highContrast: {
|
|
1864
|
-
$ref: '#/definitions/associations',
|
|
1865
|
-
description: ( (localize(
|
|
1866
|
-
'schema.highContrast',
|
|
1867
|
-
'Optional associations for file icons in high contrast color themes.'
|
|
1868
|
-
)))
|
|
1869
|
-
},
|
|
1870
|
-
hidesExplorerArrows: {
|
|
1871
|
-
type: 'boolean',
|
|
1872
|
-
description: ( (localize(
|
|
1873
|
-
'schema.hidesExplorerArrows',
|
|
1874
|
-
'Configures whether the file explorer\'s arrows should be hidden when this theme is active.'
|
|
1875
|
-
)))
|
|
1876
|
-
},
|
|
1877
|
-
showLanguageModeIcons: {
|
|
1878
|
-
type: 'boolean',
|
|
1879
|
-
description: ( (localize(
|
|
1880
|
-
'schema.showLanguageModeIcons',
|
|
1881
|
-
'Configures whether the default language icons should be used if the theme does not define an icon for a language.'
|
|
1882
|
-
)))
|
|
1883
|
-
}
|
|
1884
|
-
}
|
|
1885
|
-
};
|
|
1886
|
-
function registerFileIconThemeSchemas() {
|
|
1887
|
-
const schemaRegistry = ( (Registry.as(Extensions$1.JSONContribution)));
|
|
1888
|
-
schemaRegistry.registerSchema(schemaId, schema);
|
|
1889
|
-
}
|
|
1890
|
-
class FileIconThemeData {
|
|
1891
|
-
constructor(id, label, settingsId) {
|
|
1892
|
-
this.id = id;
|
|
1893
|
-
this.label = label;
|
|
1894
|
-
this.settingsId = settingsId;
|
|
1895
|
-
this.isLoaded = false;
|
|
1896
|
-
this.hasFileIcons = false;
|
|
1897
|
-
this.hasFolderIcons = false;
|
|
1898
|
-
this.hidesExplorerArrows = false;
|
|
1899
|
-
}
|
|
1900
|
-
ensureLoaded(themeLoader) {
|
|
1901
|
-
return !this.isLoaded ? this.load(themeLoader) : Promise.resolve(this.styleSheetContent);
|
|
1902
|
-
}
|
|
1903
|
-
reload(themeLoader) {
|
|
1904
|
-
return this.load(themeLoader);
|
|
1905
|
-
}
|
|
1906
|
-
load(themeLoader) {
|
|
1907
|
-
return themeLoader.load(this);
|
|
1908
|
-
}
|
|
1909
|
-
static fromExtensionTheme(iconTheme, iconThemeLocation, extensionData) {
|
|
1910
|
-
const id = extensionData.extensionId + '-' + iconTheme.id;
|
|
1911
|
-
const label = iconTheme.label || basename(iconTheme.path);
|
|
1912
|
-
const settingsId = iconTheme.id;
|
|
1913
|
-
const themeData = ( (new FileIconThemeData(id, label, settingsId)));
|
|
1914
|
-
themeData.description = iconTheme.description;
|
|
1915
|
-
themeData.location = iconThemeLocation;
|
|
1916
|
-
themeData.extensionData = extensionData;
|
|
1917
|
-
themeData.watch = iconTheme._watch;
|
|
1918
|
-
themeData.isLoaded = false;
|
|
1919
|
-
return themeData;
|
|
1920
|
-
}
|
|
1921
|
-
static get noIconTheme() {
|
|
1922
|
-
let themeData = FileIconThemeData._noIconTheme;
|
|
1923
|
-
if (!themeData) {
|
|
1924
|
-
themeData = FileIconThemeData._noIconTheme = ( (new FileIconThemeData('', '', null)));
|
|
1925
|
-
themeData.hasFileIcons = false;
|
|
1926
|
-
themeData.hasFolderIcons = false;
|
|
1927
|
-
themeData.hidesExplorerArrows = false;
|
|
1928
|
-
themeData.isLoaded = true;
|
|
1929
|
-
themeData.extensionData = undefined;
|
|
1930
|
-
themeData.watch = false;
|
|
1931
|
-
}
|
|
1932
|
-
return themeData;
|
|
1933
|
-
}
|
|
1934
|
-
static createUnloadedTheme(id) {
|
|
1935
|
-
const themeData = ( (new FileIconThemeData(id, '', '__' + id)));
|
|
1936
|
-
themeData.isLoaded = false;
|
|
1937
|
-
themeData.hasFileIcons = false;
|
|
1938
|
-
themeData.hasFolderIcons = false;
|
|
1939
|
-
themeData.hidesExplorerArrows = false;
|
|
1940
|
-
themeData.extensionData = undefined;
|
|
1941
|
-
themeData.watch = false;
|
|
1942
|
-
return themeData;
|
|
1943
|
-
}
|
|
1944
|
-
static fromStorageData(storageService) {
|
|
1945
|
-
const input = storageService.get(FileIconThemeData.STORAGE_KEY, 0 );
|
|
1946
|
-
if (!input) {
|
|
1947
|
-
return undefined;
|
|
1948
|
-
}
|
|
1949
|
-
try {
|
|
1950
|
-
const data = JSON.parse(input);
|
|
1951
|
-
const theme = ( (new FileIconThemeData('', '', null)));
|
|
1952
|
-
for (const key in data) {
|
|
1953
|
-
switch (key) {
|
|
1954
|
-
case 'id':
|
|
1955
|
-
case 'label':
|
|
1956
|
-
case 'description':
|
|
1957
|
-
case 'settingsId':
|
|
1958
|
-
case 'styleSheetContent':
|
|
1959
|
-
case 'hasFileIcons':
|
|
1960
|
-
case 'hidesExplorerArrows':
|
|
1961
|
-
case 'hasFolderIcons':
|
|
1962
|
-
case 'watch':
|
|
1963
|
-
theme[key] = data[key];
|
|
1964
|
-
break;
|
|
1965
|
-
case 'location':
|
|
1966
|
-
break;
|
|
1967
|
-
case 'extensionData':
|
|
1968
|
-
theme.extensionData = ExtensionData.fromJSONObject(data.extensionData);
|
|
1969
|
-
break;
|
|
1970
|
-
}
|
|
1971
|
-
}
|
|
1972
|
-
return theme;
|
|
1973
|
-
}
|
|
1974
|
-
catch (e) {
|
|
1975
|
-
return undefined;
|
|
1976
|
-
}
|
|
1977
|
-
}
|
|
1978
|
-
toStorage(storageService) {
|
|
1979
|
-
const data = JSON.stringify({
|
|
1980
|
-
id: this.id,
|
|
1981
|
-
label: this.label,
|
|
1982
|
-
description: this.description,
|
|
1983
|
-
settingsId: this.settingsId,
|
|
1984
|
-
styleSheetContent: this.styleSheetContent,
|
|
1985
|
-
hasFileIcons: this.hasFileIcons,
|
|
1986
|
-
hasFolderIcons: this.hasFolderIcons,
|
|
1987
|
-
hidesExplorerArrows: this.hidesExplorerArrows,
|
|
1988
|
-
extensionData: ExtensionData.toJSONObject(this.extensionData),
|
|
1989
|
-
watch: this.watch
|
|
1990
|
-
});
|
|
1991
|
-
storageService.store(FileIconThemeData.STORAGE_KEY, data, 0 , 1 );
|
|
1992
|
-
}
|
|
1993
|
-
}
|
|
1994
|
-
FileIconThemeData.STORAGE_KEY = 'iconThemeData';
|
|
1995
|
-
FileIconThemeData._noIconTheme = null;
|
|
1996
|
-
class FileIconThemeLoader {
|
|
1997
|
-
constructor(fileService, languageService) {
|
|
1998
|
-
this.fileService = fileService;
|
|
1999
|
-
this.languageService = languageService;
|
|
2000
|
-
}
|
|
2001
|
-
load(data) {
|
|
2002
|
-
if (!data.location) {
|
|
2003
|
-
return Promise.resolve(data.styleSheetContent);
|
|
2004
|
-
}
|
|
2005
|
-
return this.loadIconThemeDocument(data.location).then(iconThemeDocument => {
|
|
2006
|
-
const result = this.processIconThemeDocument(data.id, data.location, iconThemeDocument);
|
|
2007
|
-
data.styleSheetContent = result.content;
|
|
2008
|
-
data.hasFileIcons = result.hasFileIcons;
|
|
2009
|
-
data.hasFolderIcons = result.hasFolderIcons;
|
|
2010
|
-
data.hidesExplorerArrows = result.hidesExplorerArrows;
|
|
2011
|
-
data.isLoaded = true;
|
|
2012
|
-
return data.styleSheetContent;
|
|
2013
|
-
});
|
|
2014
|
-
}
|
|
2015
|
-
loadIconThemeDocument(location) {
|
|
2016
|
-
return this.fileService.readExtensionResource(location).then((content) => {
|
|
2017
|
-
const errors = [];
|
|
2018
|
-
const contentValue = parse$1(content, errors);
|
|
2019
|
-
if (errors.length > 0) {
|
|
2020
|
-
return Promise.reject(( (new Error( (localize(
|
|
2021
|
-
'error.cannotparseicontheme',
|
|
2022
|
-
"Problems parsing file icons file: {0}",
|
|
2023
|
-
( (errors.map(e => getParseErrorMessage(e.error)))).join(', ')
|
|
2024
|
-
))))));
|
|
2025
|
-
}
|
|
2026
|
-
else if (getNodeType(contentValue) !== 'object') {
|
|
2027
|
-
return Promise.reject(( (new Error( (localize(
|
|
2028
|
-
'error.invalidformat',
|
|
2029
|
-
"Invalid format for file icons theme file: Object expected."
|
|
2030
|
-
))))));
|
|
2031
|
-
}
|
|
2032
|
-
return Promise.resolve(contentValue);
|
|
2033
|
-
});
|
|
2034
|
-
}
|
|
2035
|
-
processIconThemeDocument(id, iconThemeDocumentLocation, iconThemeDocument) {
|
|
2036
|
-
const result = { content: '', hasFileIcons: false, hasFolderIcons: false, hidesExplorerArrows: !!iconThemeDocument.hidesExplorerArrows };
|
|
2037
|
-
let hasSpecificFileIcons = false;
|
|
2038
|
-
if (!iconThemeDocument.iconDefinitions) {
|
|
2039
|
-
return result;
|
|
2040
|
-
}
|
|
2041
|
-
const selectorByDefinitionId = {};
|
|
2042
|
-
const coveredLanguages = {};
|
|
2043
|
-
const iconThemeDocumentLocationDirname = dirname(iconThemeDocumentLocation);
|
|
2044
|
-
function resolvePath(path) {
|
|
2045
|
-
return joinPath(iconThemeDocumentLocationDirname, path);
|
|
2046
|
-
}
|
|
2047
|
-
function collectSelectors(associations, baseThemeClassName) {
|
|
2048
|
-
function addSelector(selector, defId) {
|
|
2049
|
-
if (defId) {
|
|
2050
|
-
let list = selectorByDefinitionId[defId];
|
|
2051
|
-
if (!list) {
|
|
2052
|
-
list = selectorByDefinitionId[defId] = [];
|
|
2053
|
-
}
|
|
2054
|
-
list.push(selector);
|
|
2055
|
-
}
|
|
2056
|
-
}
|
|
2057
|
-
if (associations) {
|
|
2058
|
-
let qualifier = '.show-file-icons';
|
|
2059
|
-
if (baseThemeClassName) {
|
|
2060
|
-
qualifier = baseThemeClassName + ' ' + qualifier;
|
|
2061
|
-
}
|
|
2062
|
-
const expanded = '.monaco-tl-twistie.collapsible:not(.collapsed) + .monaco-tl-contents';
|
|
2063
|
-
if (associations.folder) {
|
|
2064
|
-
addSelector(`${qualifier} .folder-icon::before`, associations.folder);
|
|
2065
|
-
result.hasFolderIcons = true;
|
|
2066
|
-
}
|
|
2067
|
-
if (associations.folderExpanded) {
|
|
2068
|
-
addSelector(`${qualifier} ${expanded} .folder-icon::before`, associations.folderExpanded);
|
|
2069
|
-
result.hasFolderIcons = true;
|
|
2070
|
-
}
|
|
2071
|
-
const rootFolder = associations.rootFolder || associations.folder;
|
|
2072
|
-
const rootFolderExpanded = associations.rootFolderExpanded || associations.folderExpanded;
|
|
2073
|
-
if (rootFolder) {
|
|
2074
|
-
addSelector(`${qualifier} .rootfolder-icon::before`, rootFolder);
|
|
2075
|
-
result.hasFolderIcons = true;
|
|
2076
|
-
}
|
|
2077
|
-
if (rootFolderExpanded) {
|
|
2078
|
-
addSelector(`${qualifier} ${expanded} .rootfolder-icon::before`, rootFolderExpanded);
|
|
2079
|
-
result.hasFolderIcons = true;
|
|
2080
|
-
}
|
|
2081
|
-
if (associations.file) {
|
|
2082
|
-
addSelector(`${qualifier} .file-icon::before`, associations.file);
|
|
2083
|
-
result.hasFileIcons = true;
|
|
2084
|
-
}
|
|
2085
|
-
const folderNames = associations.folderNames;
|
|
2086
|
-
if (folderNames) {
|
|
2087
|
-
for (const key in folderNames) {
|
|
2088
|
-
const selectors = [];
|
|
2089
|
-
const name = handleParentFolder(key.toLowerCase(), selectors);
|
|
2090
|
-
selectors.push(`.${escapeCSS(name)}-name-folder-icon`);
|
|
2091
|
-
addSelector(`${qualifier} ${selectors.join('')}.folder-icon::before`, folderNames[key]);
|
|
2092
|
-
result.hasFolderIcons = true;
|
|
2093
|
-
}
|
|
2094
|
-
}
|
|
2095
|
-
const folderNamesExpanded = associations.folderNamesExpanded;
|
|
2096
|
-
if (folderNamesExpanded) {
|
|
2097
|
-
for (const key in folderNamesExpanded) {
|
|
2098
|
-
const selectors = [];
|
|
2099
|
-
const name = handleParentFolder(key.toLowerCase(), selectors);
|
|
2100
|
-
selectors.push(`.${escapeCSS(name)}-name-folder-icon`);
|
|
2101
|
-
addSelector(`${qualifier} ${expanded} ${selectors.join('')}.folder-icon::before`, folderNamesExpanded[key]);
|
|
2102
|
-
result.hasFolderIcons = true;
|
|
2103
|
-
}
|
|
2104
|
-
}
|
|
2105
|
-
const languageIds = associations.languageIds;
|
|
2106
|
-
if (languageIds) {
|
|
2107
|
-
if (!languageIds.jsonc && languageIds.json) {
|
|
2108
|
-
languageIds.jsonc = languageIds.json;
|
|
2109
|
-
}
|
|
2110
|
-
for (const languageId in languageIds) {
|
|
2111
|
-
addSelector(`${qualifier} .${escapeCSS(languageId)}-lang-file-icon.file-icon::before`, languageIds[languageId]);
|
|
2112
|
-
result.hasFileIcons = true;
|
|
2113
|
-
hasSpecificFileIcons = true;
|
|
2114
|
-
coveredLanguages[languageId] = true;
|
|
2115
|
-
}
|
|
2116
|
-
}
|
|
2117
|
-
const fileExtensions = associations.fileExtensions;
|
|
2118
|
-
if (fileExtensions) {
|
|
2119
|
-
for (const key in fileExtensions) {
|
|
2120
|
-
const selectors = [];
|
|
2121
|
-
const name = handleParentFolder(key.toLowerCase(), selectors);
|
|
2122
|
-
const segments = name.split('.');
|
|
2123
|
-
if (segments.length) {
|
|
2124
|
-
for (let i = 0; i < segments.length; i++) {
|
|
2125
|
-
selectors.push(`.${escapeCSS(segments.slice(i).join('.'))}-ext-file-icon`);
|
|
2126
|
-
}
|
|
2127
|
-
selectors.push('.ext-file-icon');
|
|
2128
|
-
}
|
|
2129
|
-
addSelector(`${qualifier} ${selectors.join('')}.file-icon::before`, fileExtensions[key]);
|
|
2130
|
-
result.hasFileIcons = true;
|
|
2131
|
-
hasSpecificFileIcons = true;
|
|
2132
|
-
}
|
|
2133
|
-
}
|
|
2134
|
-
const fileNames = associations.fileNames;
|
|
2135
|
-
if (fileNames) {
|
|
2136
|
-
for (const key in fileNames) {
|
|
2137
|
-
const selectors = [];
|
|
2138
|
-
const fileName = handleParentFolder(key.toLowerCase(), selectors);
|
|
2139
|
-
selectors.push(`.${escapeCSS(fileName)}-name-file-icon`);
|
|
2140
|
-
selectors.push('.name-file-icon');
|
|
2141
|
-
const segments = fileName.split('.');
|
|
2142
|
-
if (segments.length) {
|
|
2143
|
-
for (let i = 1; i < segments.length; i++) {
|
|
2144
|
-
selectors.push(`.${escapeCSS(segments.slice(i).join('.'))}-ext-file-icon`);
|
|
2145
|
-
}
|
|
2146
|
-
selectors.push('.ext-file-icon');
|
|
2147
|
-
}
|
|
2148
|
-
addSelector(`${qualifier} ${selectors.join('')}.file-icon::before`, fileNames[key]);
|
|
2149
|
-
result.hasFileIcons = true;
|
|
2150
|
-
hasSpecificFileIcons = true;
|
|
2151
|
-
}
|
|
2152
|
-
}
|
|
2153
|
-
}
|
|
2154
|
-
}
|
|
2155
|
-
collectSelectors(iconThemeDocument);
|
|
2156
|
-
collectSelectors(iconThemeDocument.light, '.vs');
|
|
2157
|
-
collectSelectors(iconThemeDocument.highContrast, '.hc-black');
|
|
2158
|
-
collectSelectors(iconThemeDocument.highContrast, '.hc-light');
|
|
2159
|
-
if (!result.hasFileIcons && !result.hasFolderIcons) {
|
|
2160
|
-
return result;
|
|
2161
|
-
}
|
|
2162
|
-
const showLanguageModeIcons = iconThemeDocument.showLanguageModeIcons === true || (hasSpecificFileIcons && iconThemeDocument.showLanguageModeIcons !== false);
|
|
2163
|
-
const cssRules = [];
|
|
2164
|
-
const fonts = iconThemeDocument.fonts;
|
|
2165
|
-
const fontSizes = ( (new Map()));
|
|
2166
|
-
if (Array.isArray(fonts)) {
|
|
2167
|
-
const defaultFontSize = fonts[0].size || '150%';
|
|
2168
|
-
fonts.forEach(font => {
|
|
2169
|
-
const src = ( (font.src.map(l => `${asCSSUrl(resolvePath(l.path))} format('${l.format}')`))).join(', ');
|
|
2170
|
-
cssRules.push(`@font-face { src: ${src}; font-family: '${font.id}'; font-weight: ${font.weight}; font-style: ${font.style}; font-display: block; }`);
|
|
2171
|
-
if (font.size !== undefined && font.size !== defaultFontSize) {
|
|
2172
|
-
fontSizes.set(font.id, font.size);
|
|
2173
|
-
}
|
|
2174
|
-
});
|
|
2175
|
-
cssRules.push(`.show-file-icons .file-icon::before, .show-file-icons .folder-icon::before, .show-file-icons .rootfolder-icon::before { font-family: '${fonts[0].id}'; font-size: ${defaultFontSize}; }`);
|
|
2176
|
-
}
|
|
2177
|
-
for (const defId in selectorByDefinitionId) {
|
|
2178
|
-
const selectors = selectorByDefinitionId[defId];
|
|
2179
|
-
const definition = iconThemeDocument.iconDefinitions[defId];
|
|
2180
|
-
if (definition) {
|
|
2181
|
-
if (definition.iconPath) {
|
|
2182
|
-
cssRules.push(`${selectors.join(', ')} { content: ' '; background-image: ${asCSSUrl(resolvePath(definition.iconPath))}; }`);
|
|
2183
|
-
}
|
|
2184
|
-
else if (definition.fontCharacter || definition.fontColor) {
|
|
2185
|
-
const body = [];
|
|
2186
|
-
if (definition.fontColor) {
|
|
2187
|
-
body.push(`color: ${definition.fontColor};`);
|
|
2188
|
-
}
|
|
2189
|
-
if (definition.fontCharacter) {
|
|
2190
|
-
body.push(`content: '${definition.fontCharacter}';`);
|
|
2191
|
-
}
|
|
2192
|
-
const fontSize = definition.fontSize ?? (definition.fontId ? fontSizes.get(definition.fontId) : undefined);
|
|
2193
|
-
if (fontSize) {
|
|
2194
|
-
body.push(`font-size: ${fontSize};`);
|
|
2195
|
-
}
|
|
2196
|
-
if (definition.fontId) {
|
|
2197
|
-
body.push(`font-family: ${definition.fontId};`);
|
|
2198
|
-
}
|
|
2199
|
-
if (showLanguageModeIcons) {
|
|
2200
|
-
body.push(`background-image: unset;`);
|
|
2201
|
-
}
|
|
2202
|
-
cssRules.push(`${selectors.join(', ')} { ${body.join(' ')} }`);
|
|
2203
|
-
}
|
|
2204
|
-
}
|
|
2205
|
-
}
|
|
2206
|
-
if (showLanguageModeIcons) {
|
|
2207
|
-
for (const languageId of this.languageService.getRegisteredLanguageIds()) {
|
|
2208
|
-
if (!coveredLanguages[languageId]) {
|
|
2209
|
-
const icon = this.languageService.getIcon(languageId);
|
|
2210
|
-
if (icon) {
|
|
2211
|
-
const selector = `.show-file-icons .${escapeCSS(languageId)}-lang-file-icon.file-icon::before`;
|
|
2212
|
-
cssRules.push(`${selector} { content: ' '; background-image: ${asCSSUrl(icon.dark)}; }`);
|
|
2213
|
-
cssRules.push(`.vs ${selector} { content: ' '; background-image: ${asCSSUrl(icon.light)}; }`);
|
|
2214
|
-
}
|
|
2215
|
-
}
|
|
2216
|
-
}
|
|
2217
|
-
}
|
|
2218
|
-
result.content = cssRules.join('\n');
|
|
2219
|
-
return result;
|
|
2220
|
-
}
|
|
2221
|
-
}
|
|
2222
|
-
function handleParentFolder(key, selectors) {
|
|
2223
|
-
const lastIndexOfSlash = key.lastIndexOf('/');
|
|
2224
|
-
if (lastIndexOfSlash >= 0) {
|
|
2225
|
-
const parentFolder = key.substring(0, lastIndexOfSlash);
|
|
2226
|
-
selectors.push(`.${escapeCSS(parentFolder)}-name-dir-icon`);
|
|
2227
|
-
return key.substring(lastIndexOfSlash + 1);
|
|
2228
|
-
}
|
|
2229
|
-
return key;
|
|
2230
|
-
}
|
|
2231
|
-
function escapeCSS(str) {
|
|
2232
|
-
str = str.replace(/[\11\12\14\15\40]/g, '/');
|
|
2233
|
-
return window.CSS.escape(str);
|
|
2234
|
-
}
|
|
2235
|
-
const textMateScopes = [
|
|
2236
|
-
'comment',
|
|
2237
|
-
'comment.block',
|
|
2238
|
-
'comment.block.documentation',
|
|
2239
|
-
'comment.line',
|
|
2240
|
-
'constant',
|
|
2241
|
-
'constant.character',
|
|
2242
|
-
'constant.character.escape',
|
|
2243
|
-
'constant.numeric',
|
|
2244
|
-
'constant.numeric.integer',
|
|
2245
|
-
'constant.numeric.float',
|
|
2246
|
-
'constant.numeric.hex',
|
|
2247
|
-
'constant.numeric.octal',
|
|
2248
|
-
'constant.other',
|
|
2249
|
-
'constant.regexp',
|
|
2250
|
-
'constant.rgb-value',
|
|
2251
|
-
'emphasis',
|
|
2252
|
-
'entity',
|
|
2253
|
-
'entity.name',
|
|
2254
|
-
'entity.name.class',
|
|
2255
|
-
'entity.name.function',
|
|
2256
|
-
'entity.name.method',
|
|
2257
|
-
'entity.name.section',
|
|
2258
|
-
'entity.name.selector',
|
|
2259
|
-
'entity.name.tag',
|
|
2260
|
-
'entity.name.type',
|
|
2261
|
-
'entity.other',
|
|
2262
|
-
'entity.other.attribute-name',
|
|
2263
|
-
'entity.other.inherited-class',
|
|
2264
|
-
'invalid',
|
|
2265
|
-
'invalid.deprecated',
|
|
2266
|
-
'invalid.illegal',
|
|
2267
|
-
'keyword',
|
|
2268
|
-
'keyword.control',
|
|
2269
|
-
'keyword.operator',
|
|
2270
|
-
'keyword.operator.new',
|
|
2271
|
-
'keyword.operator.assignment',
|
|
2272
|
-
'keyword.operator.arithmetic',
|
|
2273
|
-
'keyword.operator.logical',
|
|
2274
|
-
'keyword.other',
|
|
2275
|
-
'markup',
|
|
2276
|
-
'markup.bold',
|
|
2277
|
-
'markup.changed',
|
|
2278
|
-
'markup.deleted',
|
|
2279
|
-
'markup.heading',
|
|
2280
|
-
'markup.inline.raw',
|
|
2281
|
-
'markup.inserted',
|
|
2282
|
-
'markup.italic',
|
|
2283
|
-
'markup.list',
|
|
2284
|
-
'markup.list.numbered',
|
|
2285
|
-
'markup.list.unnumbered',
|
|
2286
|
-
'markup.other',
|
|
2287
|
-
'markup.quote',
|
|
2288
|
-
'markup.raw',
|
|
2289
|
-
'markup.underline',
|
|
2290
|
-
'markup.underline.link',
|
|
2291
|
-
'meta',
|
|
2292
|
-
'meta.block',
|
|
2293
|
-
'meta.cast',
|
|
2294
|
-
'meta.class',
|
|
2295
|
-
'meta.function',
|
|
2296
|
-
'meta.function-call',
|
|
2297
|
-
'meta.preprocessor',
|
|
2298
|
-
'meta.return-type',
|
|
2299
|
-
'meta.selector',
|
|
2300
|
-
'meta.tag',
|
|
2301
|
-
'meta.type.annotation',
|
|
2302
|
-
'meta.type',
|
|
2303
|
-
'punctuation.definition.string.begin',
|
|
2304
|
-
'punctuation.definition.string.end',
|
|
2305
|
-
'punctuation.separator',
|
|
2306
|
-
'punctuation.separator.continuation',
|
|
2307
|
-
'punctuation.terminator',
|
|
2308
|
-
'storage',
|
|
2309
|
-
'storage.modifier',
|
|
2310
|
-
'storage.type',
|
|
2311
|
-
'string',
|
|
2312
|
-
'string.interpolated',
|
|
2313
|
-
'string.other',
|
|
2314
|
-
'string.quoted',
|
|
2315
|
-
'string.quoted.double',
|
|
2316
|
-
'string.quoted.other',
|
|
2317
|
-
'string.quoted.single',
|
|
2318
|
-
'string.quoted.triple',
|
|
2319
|
-
'string.regexp',
|
|
2320
|
-
'string.unquoted',
|
|
2321
|
-
'strong',
|
|
2322
|
-
'support',
|
|
2323
|
-
'support.class',
|
|
2324
|
-
'support.constant',
|
|
2325
|
-
'support.function',
|
|
2326
|
-
'support.other',
|
|
2327
|
-
'support.type',
|
|
2328
|
-
'support.type.property-name',
|
|
2329
|
-
'support.variable',
|
|
2330
|
-
'variable',
|
|
2331
|
-
'variable.language',
|
|
2332
|
-
'variable.name',
|
|
2333
|
-
'variable.other',
|
|
2334
|
-
'variable.other.readwrite',
|
|
2335
|
-
'variable.parameter'
|
|
2336
|
-
];
|
|
2337
|
-
const textmateColorsSchemaId = 'vscode://schemas/textmate-colors';
|
|
2338
|
-
const textmateColorGroupSchemaId = `${textmateColorsSchemaId}#/definitions/colorGroup`;
|
|
2339
|
-
const textmateColorSchema = {
|
|
2340
|
-
type: 'array',
|
|
2341
|
-
definitions: {
|
|
2342
|
-
colorGroup: {
|
|
2343
|
-
default: '#FF0000',
|
|
2344
|
-
anyOf: [
|
|
2345
|
-
{
|
|
2346
|
-
type: 'string',
|
|
2347
|
-
format: 'color-hex'
|
|
2348
|
-
},
|
|
2349
|
-
{
|
|
2350
|
-
$ref: '#/definitions/settings'
|
|
2351
|
-
}
|
|
2352
|
-
]
|
|
2353
|
-
},
|
|
2354
|
-
settings: {
|
|
2355
|
-
type: 'object',
|
|
2356
|
-
description: ( (localize('schema.token.settings', 'Colors and styles for the token.'))),
|
|
2357
|
-
properties: {
|
|
2358
|
-
foreground: {
|
|
2359
|
-
type: 'string',
|
|
2360
|
-
description: ( (localize('schema.token.foreground', 'Foreground color for the token.'))),
|
|
2361
|
-
format: 'color-hex',
|
|
2362
|
-
default: '#ff0000'
|
|
2363
|
-
},
|
|
2364
|
-
background: {
|
|
2365
|
-
type: 'string',
|
|
2366
|
-
deprecationMessage: ( (localize(
|
|
2367
|
-
'schema.token.background.warning',
|
|
2368
|
-
'Token background colors are currently not supported.'
|
|
2369
|
-
)))
|
|
2370
|
-
},
|
|
2371
|
-
fontStyle: {
|
|
2372
|
-
type: 'string',
|
|
2373
|
-
description: ( (localize(
|
|
2374
|
-
'schema.token.fontStyle',
|
|
2375
|
-
'Font style of the rule: \'italic\', \'bold\', \'underline\', \'strikethrough\' or a combination. The empty string unsets inherited settings.'
|
|
2376
|
-
))),
|
|
2377
|
-
pattern: '^(\\s*\\b(italic|bold|underline|strikethrough))*\\s*$',
|
|
2378
|
-
patternErrorMessage: ( (localize(
|
|
2379
|
-
'schema.fontStyle.error',
|
|
2380
|
-
'Font style must be \'italic\', \'bold\', \'underline\', \'strikethrough\' or a combination or the empty string.'
|
|
2381
|
-
))),
|
|
2382
|
-
defaultSnippets: [
|
|
2383
|
-
{ label: ( (localize('schema.token.fontStyle.none', 'None (clear inherited style)'))), bodyText: '""' },
|
|
2384
|
-
{ body: 'italic' },
|
|
2385
|
-
{ body: 'bold' },
|
|
2386
|
-
{ body: 'underline' },
|
|
2387
|
-
{ body: 'strikethrough' },
|
|
2388
|
-
{ body: 'italic bold' },
|
|
2389
|
-
{ body: 'italic underline' },
|
|
2390
|
-
{ body: 'italic strikethrough' },
|
|
2391
|
-
{ body: 'bold underline' },
|
|
2392
|
-
{ body: 'bold strikethrough' },
|
|
2393
|
-
{ body: 'underline strikethrough' },
|
|
2394
|
-
{ body: 'italic bold underline' },
|
|
2395
|
-
{ body: 'italic bold strikethrough' },
|
|
2396
|
-
{ body: 'italic underline strikethrough' },
|
|
2397
|
-
{ body: 'bold underline strikethrough' },
|
|
2398
|
-
{ body: 'italic bold underline strikethrough' }
|
|
2399
|
-
]
|
|
2400
|
-
}
|
|
2401
|
-
},
|
|
2402
|
-
additionalProperties: false,
|
|
2403
|
-
defaultSnippets: [{ body: { foreground: '${1:#FF0000}', fontStyle: '${2:bold}' } }]
|
|
2404
|
-
}
|
|
2405
|
-
},
|
|
2406
|
-
items: {
|
|
2407
|
-
type: 'object',
|
|
2408
|
-
defaultSnippets: [{ body: { scope: '${1:keyword.operator}', settings: { foreground: '${2:#FF0000}' } } }],
|
|
2409
|
-
properties: {
|
|
2410
|
-
name: {
|
|
2411
|
-
type: 'string',
|
|
2412
|
-
description: ( (localize('schema.properties.name', 'Description of the rule.')))
|
|
2413
|
-
},
|
|
2414
|
-
scope: {
|
|
2415
|
-
description: ( (localize(
|
|
2416
|
-
'schema.properties.scope',
|
|
2417
|
-
'Scope selector against which this rule matches.'
|
|
2418
|
-
))),
|
|
2419
|
-
anyOf: [
|
|
2420
|
-
{
|
|
2421
|
-
enum: textMateScopes
|
|
2422
|
-
},
|
|
2423
|
-
{
|
|
2424
|
-
type: 'string'
|
|
2425
|
-
},
|
|
2426
|
-
{
|
|
2427
|
-
type: 'array',
|
|
2428
|
-
items: {
|
|
2429
|
-
enum: textMateScopes
|
|
2430
|
-
}
|
|
2431
|
-
},
|
|
2432
|
-
{
|
|
2433
|
-
type: 'array',
|
|
2434
|
-
items: {
|
|
2435
|
-
type: 'string'
|
|
2436
|
-
}
|
|
2437
|
-
}
|
|
2438
|
-
]
|
|
2439
|
-
},
|
|
2440
|
-
settings: {
|
|
2441
|
-
$ref: '#/definitions/settings'
|
|
2442
|
-
}
|
|
2443
|
-
},
|
|
2444
|
-
required: [
|
|
2445
|
-
'settings'
|
|
2446
|
-
],
|
|
2447
|
-
additionalProperties: false
|
|
2448
|
-
}
|
|
2449
|
-
};
|
|
2450
|
-
const colorThemeSchemaId = 'vscode://schemas/color-theme';
|
|
2451
|
-
const colorThemeSchema = {
|
|
2452
|
-
type: 'object',
|
|
2453
|
-
allowComments: true,
|
|
2454
|
-
allowTrailingCommas: true,
|
|
2455
|
-
properties: {
|
|
2456
|
-
colors: {
|
|
2457
|
-
description: ( (localize('schema.workbenchColors', 'Colors in the workbench'))),
|
|
2458
|
-
$ref: workbenchColorsSchemaId,
|
|
2459
|
-
additionalProperties: false
|
|
2460
|
-
},
|
|
2461
|
-
tokenColors: {
|
|
2462
|
-
anyOf: [{
|
|
2463
|
-
type: 'string',
|
|
2464
|
-
description: ( (localize(
|
|
2465
|
-
'schema.tokenColors.path',
|
|
2466
|
-
'Path to a tmTheme file (relative to the current file).'
|
|
2467
|
-
)))
|
|
2468
|
-
},
|
|
2469
|
-
{
|
|
2470
|
-
description: ( (localize('schema.colors', 'Colors for syntax highlighting'))),
|
|
2471
|
-
$ref: textmateColorsSchemaId
|
|
2472
|
-
}
|
|
2473
|
-
]
|
|
2474
|
-
},
|
|
2475
|
-
semanticHighlighting: {
|
|
2476
|
-
type: 'boolean',
|
|
2477
|
-
description: ( (localize(
|
|
2478
|
-
'schema.supportsSemanticHighlighting',
|
|
2479
|
-
'Whether semantic highlighting should be enabled for this theme.'
|
|
2480
|
-
)))
|
|
2481
|
-
},
|
|
2482
|
-
semanticTokenColors: {
|
|
2483
|
-
type: 'object',
|
|
2484
|
-
description: ( (localize('schema.semanticTokenColors', 'Colors for semantic tokens'))),
|
|
2485
|
-
$ref: tokenStylingSchemaId
|
|
2486
|
-
}
|
|
2487
|
-
}
|
|
2488
|
-
};
|
|
2489
|
-
function registerColorThemeSchemas() {
|
|
2490
|
-
const schemaRegistry = ( (Registry.as(Extensions$1.JSONContribution)));
|
|
2491
|
-
schemaRegistry.registerSchema(colorThemeSchemaId, colorThemeSchema);
|
|
2492
|
-
schemaRegistry.registerSchema(textmateColorsSchemaId, textmateColorSchema);
|
|
2493
|
-
}
|
|
2494
|
-
function registerColorThemeExtensionPoint() {
|
|
2495
|
-
return (
|
|
2496
|
-
(ExtensionsRegistry.registerExtensionPoint({
|
|
2497
|
-
extensionPoint: 'themes',
|
|
2498
|
-
jsonSchema: {
|
|
2499
|
-
description: ( (localize(
|
|
2500
|
-
'vscode.extension.contributes.themes',
|
|
2501
|
-
'Contributes textmate color themes.'
|
|
2502
|
-
))),
|
|
2503
|
-
type: 'array',
|
|
2504
|
-
items: {
|
|
2505
|
-
type: 'object',
|
|
2506
|
-
defaultSnippets: [{ body: { label: '${1:label}', id: '${2:id}', uiTheme: VS_DARK_THEME, path: './themes/${3:id}.tmTheme.' } }],
|
|
2507
|
-
properties: {
|
|
2508
|
-
id: {
|
|
2509
|
-
description: ( (localize(
|
|
2510
|
-
'vscode.extension.contributes.themes.id',
|
|
2511
|
-
'Id of the color theme as used in the user settings.'
|
|
2512
|
-
))),
|
|
2513
|
-
type: 'string'
|
|
2514
|
-
},
|
|
2515
|
-
label: {
|
|
2516
|
-
description: ( (localize(
|
|
2517
|
-
'vscode.extension.contributes.themes.label',
|
|
2518
|
-
'Label of the color theme as shown in the UI.'
|
|
2519
|
-
))),
|
|
2520
|
-
type: 'string'
|
|
2521
|
-
},
|
|
2522
|
-
uiTheme: {
|
|
2523
|
-
description: ( (localize(
|
|
2524
|
-
'vscode.extension.contributes.themes.uiTheme',
|
|
2525
|
-
'Base theme defining the colors around the editor: \'vs\' is the light color theme, \'vs-dark\' is the dark color theme. \'hc-black\' is the dark high contrast theme, \'hc-light\' is the light high contrast theme.'
|
|
2526
|
-
))),
|
|
2527
|
-
enum: [VS_LIGHT_THEME, VS_DARK_THEME, VS_HC_THEME, VS_HC_LIGHT_THEME]
|
|
2528
|
-
},
|
|
2529
|
-
path: {
|
|
2530
|
-
description: ( (localize(
|
|
2531
|
-
'vscode.extension.contributes.themes.path',
|
|
2532
|
-
'Path of the tmTheme file. The path is relative to the extension folder and is typically \'./colorthemes/awesome-color-theme.json\'.'
|
|
2533
|
-
))),
|
|
2534
|
-
type: 'string'
|
|
2535
|
-
}
|
|
2536
|
-
},
|
|
2537
|
-
required: ['path', 'uiTheme']
|
|
2538
|
-
}
|
|
2539
|
-
}
|
|
2540
|
-
}))
|
|
2541
|
-
);
|
|
2542
|
-
}
|
|
2543
|
-
function registerFileIconThemeExtensionPoint() {
|
|
2544
|
-
return (
|
|
2545
|
-
(ExtensionsRegistry.registerExtensionPoint({
|
|
2546
|
-
extensionPoint: 'iconThemes',
|
|
2547
|
-
jsonSchema: {
|
|
2548
|
-
description: ( (localize('vscode.extension.contributes.iconThemes', 'Contributes file icon themes.'))),
|
|
2549
|
-
type: 'array',
|
|
2550
|
-
items: {
|
|
2551
|
-
type: 'object',
|
|
2552
|
-
defaultSnippets: [{ body: { id: '${1:id}', label: '${2:label}', path: './fileicons/${3:id}-icon-theme.json' } }],
|
|
2553
|
-
properties: {
|
|
2554
|
-
id: {
|
|
2555
|
-
description: ( (localize(
|
|
2556
|
-
'vscode.extension.contributes.iconThemes.id',
|
|
2557
|
-
'Id of the file icon theme as used in the user settings.'
|
|
2558
|
-
))),
|
|
2559
|
-
type: 'string'
|
|
2560
|
-
},
|
|
2561
|
-
label: {
|
|
2562
|
-
description: ( (localize(
|
|
2563
|
-
'vscode.extension.contributes.iconThemes.label',
|
|
2564
|
-
'Label of the file icon theme as shown in the UI.'
|
|
2565
|
-
))),
|
|
2566
|
-
type: 'string'
|
|
2567
|
-
},
|
|
2568
|
-
path: {
|
|
2569
|
-
description: ( (localize(
|
|
2570
|
-
'vscode.extension.contributes.iconThemes.path',
|
|
2571
|
-
'Path of the file icon theme definition file. The path is relative to the extension folder and is typically \'./fileicons/awesome-icon-theme.json\'.'
|
|
2572
|
-
))),
|
|
2573
|
-
type: 'string'
|
|
2574
|
-
}
|
|
2575
|
-
},
|
|
2576
|
-
required: ['path', 'id']
|
|
2577
|
-
}
|
|
2578
|
-
}
|
|
2579
|
-
}))
|
|
2580
|
-
);
|
|
2581
|
-
}
|
|
2582
|
-
function registerProductIconThemeExtensionPoint() {
|
|
2583
|
-
return (
|
|
2584
|
-
(ExtensionsRegistry.registerExtensionPoint({
|
|
2585
|
-
extensionPoint: 'productIconThemes',
|
|
2586
|
-
jsonSchema: {
|
|
2587
|
-
description: ( (localize(
|
|
2588
|
-
'vscode.extension.contributes.productIconThemes',
|
|
2589
|
-
'Contributes product icon themes.'
|
|
2590
|
-
))),
|
|
2591
|
-
type: 'array',
|
|
2592
|
-
items: {
|
|
2593
|
-
type: 'object',
|
|
2594
|
-
defaultSnippets: [{ body: { id: '${1:id}', label: '${2:label}', path: './producticons/${3:id}-product-icon-theme.json' } }],
|
|
2595
|
-
properties: {
|
|
2596
|
-
id: {
|
|
2597
|
-
description: ( (localize(
|
|
2598
|
-
'vscode.extension.contributes.productIconThemes.id',
|
|
2599
|
-
'Id of the product icon theme as used in the user settings.'
|
|
2600
|
-
))),
|
|
2601
|
-
type: 'string'
|
|
2602
|
-
},
|
|
2603
|
-
label: {
|
|
2604
|
-
description: ( (localize(
|
|
2605
|
-
'vscode.extension.contributes.productIconThemes.label',
|
|
2606
|
-
'Label of the product icon theme as shown in the UI.'
|
|
2607
|
-
))),
|
|
2608
|
-
type: 'string'
|
|
2609
|
-
},
|
|
2610
|
-
path: {
|
|
2611
|
-
description: ( (localize(
|
|
2612
|
-
'vscode.extension.contributes.productIconThemes.path',
|
|
2613
|
-
'Path of the product icon theme definition file. The path is relative to the extension folder and is typically \'./producticons/awesome-product-icon-theme.json\'.'
|
|
2614
|
-
))),
|
|
2615
|
-
type: 'string'
|
|
2616
|
-
}
|
|
2617
|
-
},
|
|
2618
|
-
required: ['path', 'id']
|
|
2619
|
-
}
|
|
2620
|
-
}
|
|
2621
|
-
}))
|
|
2622
|
-
);
|
|
2623
|
-
}
|
|
2624
|
-
class ThemeRegistry {
|
|
2625
|
-
constructor(themesExtPoint, create, idRequired = false, builtInTheme = undefined) {
|
|
2626
|
-
this.themesExtPoint = themesExtPoint;
|
|
2627
|
-
this.create = create;
|
|
2628
|
-
this.idRequired = idRequired;
|
|
2629
|
-
this.builtInTheme = builtInTheme;
|
|
2630
|
-
this.onDidChangeEmitter = ( (new Emitter()));
|
|
2631
|
-
this.onDidChange = this.onDidChangeEmitter.event;
|
|
2632
|
-
this.extensionThemes = [];
|
|
2633
|
-
this.initialize();
|
|
2634
|
-
}
|
|
2635
|
-
initialize() {
|
|
2636
|
-
this.themesExtPoint.setHandler((extensions, delta) => {
|
|
2637
|
-
const previousIds = {};
|
|
2638
|
-
const added = [];
|
|
2639
|
-
for (const theme of this.extensionThemes) {
|
|
2640
|
-
previousIds[theme.id] = theme;
|
|
2641
|
-
}
|
|
2642
|
-
this.extensionThemes.length = 0;
|
|
2643
|
-
for (const ext of extensions) {
|
|
2644
|
-
const extensionData = ExtensionData.fromName(ext.description.publisher, ext.description.name, ext.description.isBuiltin);
|
|
2645
|
-
this.onThemes(extensionData, ext.description.extensionLocation, ext.value, this.extensionThemes, ext.collector);
|
|
2646
|
-
}
|
|
2647
|
-
for (const theme of this.extensionThemes) {
|
|
2648
|
-
if (!previousIds[theme.id]) {
|
|
2649
|
-
added.push(theme);
|
|
2650
|
-
}
|
|
2651
|
-
else {
|
|
2652
|
-
delete previousIds[theme.id];
|
|
2653
|
-
}
|
|
2654
|
-
}
|
|
2655
|
-
const removed = ( (Object.values(previousIds)));
|
|
2656
|
-
this.onDidChangeEmitter.fire({ themes: this.extensionThemes, added, removed });
|
|
2657
|
-
});
|
|
2658
|
-
}
|
|
2659
|
-
onThemes(extensionData, extensionLocation, themeContributions, resultingThemes = [], log) {
|
|
2660
|
-
if (!Array.isArray(themeContributions)) {
|
|
2661
|
-
log?.error(( (localize(
|
|
2662
|
-
'reqarray',
|
|
2663
|
-
"Extension point `{0}` must be an array.",
|
|
2664
|
-
this.themesExtPoint.name
|
|
2665
|
-
))));
|
|
2666
|
-
return resultingThemes;
|
|
2667
|
-
}
|
|
2668
|
-
themeContributions.forEach(theme => {
|
|
2669
|
-
if (!theme.path || !isString(theme.path)) {
|
|
2670
|
-
log?.error(( (localize(
|
|
2671
|
-
'reqpath',
|
|
2672
|
-
"Expected string in `contributes.{0}.path`. Provided value: {1}",
|
|
2673
|
-
this.themesExtPoint.name,
|
|
2674
|
-
String(theme.path)
|
|
2675
|
-
))));
|
|
2676
|
-
return;
|
|
2677
|
-
}
|
|
2678
|
-
if (this.idRequired && (!theme.id || !isString(theme.id))) {
|
|
2679
|
-
log?.error(( (localize(
|
|
2680
|
-
'reqid',
|
|
2681
|
-
"Expected string in `contributes.{0}.id`. Provided value: {1}",
|
|
2682
|
-
this.themesExtPoint.name,
|
|
2683
|
-
String(theme.id)
|
|
2684
|
-
))));
|
|
2685
|
-
return;
|
|
2686
|
-
}
|
|
2687
|
-
const themeLocation = joinPath(extensionLocation, theme.path);
|
|
2688
|
-
if (!isEqualOrParent(themeLocation, extensionLocation)) {
|
|
2689
|
-
log?.warn(( (localize(
|
|
2690
|
-
'invalid.path.1',
|
|
2691
|
-
"Expected `contributes.{0}.path` ({1}) to be included inside extension's folder ({2}). This might make the extension non-portable.",
|
|
2692
|
-
this.themesExtPoint.name,
|
|
2693
|
-
themeLocation.path,
|
|
2694
|
-
extensionLocation.path
|
|
2695
|
-
))));
|
|
2696
|
-
}
|
|
2697
|
-
const themeData = this.create(theme, themeLocation, extensionData);
|
|
2698
|
-
resultingThemes.push(themeData);
|
|
2699
|
-
});
|
|
2700
|
-
return resultingThemes;
|
|
2701
|
-
}
|
|
2702
|
-
findThemeById(themeId, defaultId) {
|
|
2703
|
-
if (this.builtInTheme && this.builtInTheme.id === themeId) {
|
|
2704
|
-
return this.builtInTheme;
|
|
2705
|
-
}
|
|
2706
|
-
const allThemes = this.getThemes();
|
|
2707
|
-
let defaultTheme = undefined;
|
|
2708
|
-
for (const t of allThemes) {
|
|
2709
|
-
if (t.id === themeId) {
|
|
2710
|
-
return t;
|
|
2711
|
-
}
|
|
2712
|
-
if (t.id === defaultId) {
|
|
2713
|
-
defaultTheme = t;
|
|
2714
|
-
}
|
|
2715
|
-
}
|
|
2716
|
-
return defaultTheme;
|
|
2717
|
-
}
|
|
2718
|
-
findThemeBySettingsId(settingsId, defaultId) {
|
|
2719
|
-
if (this.builtInTheme && this.builtInTheme.settingsId === settingsId) {
|
|
2720
|
-
return this.builtInTheme;
|
|
2721
|
-
}
|
|
2722
|
-
const allThemes = this.getThemes();
|
|
2723
|
-
let defaultTheme = undefined;
|
|
2724
|
-
for (const t of allThemes) {
|
|
2725
|
-
if (t.settingsId === settingsId) {
|
|
2726
|
-
return t;
|
|
2727
|
-
}
|
|
2728
|
-
if (t.id === defaultId) {
|
|
2729
|
-
defaultTheme = t;
|
|
2730
|
-
}
|
|
2731
|
-
}
|
|
2732
|
-
return defaultTheme;
|
|
2733
|
-
}
|
|
2734
|
-
findThemeByExtensionLocation(extLocation) {
|
|
2735
|
-
if (extLocation) {
|
|
2736
|
-
return this.getThemes().filter(t => t.location && isEqualOrParent(t.location, extLocation));
|
|
2737
|
-
}
|
|
2738
|
-
return [];
|
|
2739
|
-
}
|
|
2740
|
-
getThemes() {
|
|
2741
|
-
return this.extensionThemes;
|
|
2742
|
-
}
|
|
2743
|
-
getMarketplaceThemes(manifest, extensionLocation, extensionData) {
|
|
2744
|
-
const themes = manifest?.contributes?.[this.themesExtPoint.name];
|
|
2745
|
-
if (Array.isArray(themes)) {
|
|
2746
|
-
return this.onThemes(extensionData, extensionLocation, themes);
|
|
2747
|
-
}
|
|
2748
|
-
return [];
|
|
2749
|
-
}
|
|
2750
|
-
}
|
|
2751
|
-
const DEFAULT_THEME_DARK_SETTING_VALUE = 'Default Dark+';
|
|
2752
|
-
const DEFAULT_THEME_LIGHT_SETTING_VALUE = 'Default Light+';
|
|
2753
|
-
const DEFAULT_THEME_HC_DARK_SETTING_VALUE = 'Default High Contrast';
|
|
2754
|
-
const DEFAULT_THEME_HC_LIGHT_SETTING_VALUE = 'Default High Contrast Light';
|
|
2755
|
-
const DEFAULT_FILE_ICON_THEME_SETTING_VALUE = 'vs-seti';
|
|
2756
|
-
const DEFAULT_PRODUCT_ICON_THEME_SETTING_VALUE = 'Default';
|
|
2757
|
-
const configurationRegistry = ( (Registry.as(Extensions.Configuration)));
|
|
2758
|
-
const colorThemeSettingEnum = [];
|
|
2759
|
-
const colorThemeSettingEnumItemLabels = [];
|
|
2760
|
-
const colorThemeSettingEnumDescriptions = [];
|
|
2761
|
-
const colorThemeSettingSchema = {
|
|
2762
|
-
type: 'string',
|
|
2763
|
-
description: ( (localize('colorTheme', "Specifies the color theme used in the workbench."))),
|
|
2764
|
-
default: isWeb ? DEFAULT_THEME_LIGHT_SETTING_VALUE : DEFAULT_THEME_DARK_SETTING_VALUE,
|
|
2765
|
-
enum: colorThemeSettingEnum,
|
|
2766
|
-
enumDescriptions: colorThemeSettingEnumDescriptions,
|
|
2767
|
-
enumItemLabels: colorThemeSettingEnumItemLabels,
|
|
2768
|
-
errorMessage: ( (localize('colorThemeError', "Theme is unknown or not installed."))),
|
|
2769
|
-
};
|
|
2770
|
-
const preferredDarkThemeSettingSchema = {
|
|
2771
|
-
type: 'string',
|
|
2772
|
-
markdownDescription: ( (localize(
|
|
2773
|
-
{ key: 'preferredDarkColorTheme', comment: ['`#{0}#` will become a link to an other setting. Do not remove backtick or #'] },
|
|
2774
|
-
'Specifies the preferred color theme for dark OS appearance when `#{0}#` is enabled.',
|
|
2775
|
-
ThemeSettings.DETECT_COLOR_SCHEME
|
|
2776
|
-
))),
|
|
2777
|
-
default: DEFAULT_THEME_DARK_SETTING_VALUE,
|
|
2778
|
-
enum: colorThemeSettingEnum,
|
|
2779
|
-
enumDescriptions: colorThemeSettingEnumDescriptions,
|
|
2780
|
-
enumItemLabels: colorThemeSettingEnumItemLabels,
|
|
2781
|
-
errorMessage: ( (localize('colorThemeError', "Theme is unknown or not installed."))),
|
|
2782
|
-
};
|
|
2783
|
-
const preferredLightThemeSettingSchema = {
|
|
2784
|
-
type: 'string',
|
|
2785
|
-
markdownDescription: ( (localize(
|
|
2786
|
-
{ key: 'preferredLightColorTheme', comment: ['`#{0}#` will become a link to an other setting. Do not remove backtick or #'] },
|
|
2787
|
-
'Specifies the preferred color theme for light OS appearance when `#{0}#` is enabled.',
|
|
2788
|
-
ThemeSettings.DETECT_COLOR_SCHEME
|
|
2789
|
-
))),
|
|
2790
|
-
default: DEFAULT_THEME_LIGHT_SETTING_VALUE,
|
|
2791
|
-
enum: colorThemeSettingEnum,
|
|
2792
|
-
enumDescriptions: colorThemeSettingEnumDescriptions,
|
|
2793
|
-
enumItemLabels: colorThemeSettingEnumItemLabels,
|
|
2794
|
-
errorMessage: ( (localize('colorThemeError', "Theme is unknown or not installed."))),
|
|
2795
|
-
};
|
|
2796
|
-
const preferredHCDarkThemeSettingSchema = {
|
|
2797
|
-
type: 'string',
|
|
2798
|
-
markdownDescription: ( (localize(
|
|
2799
|
-
{ key: 'preferredHCDarkColorTheme', comment: ['`#{0}#` will become a link to an other setting. Do not remove backtick or #'] },
|
|
2800
|
-
'Specifies the preferred color theme used in high contrast dark mode when `#{0}#` is enabled.',
|
|
2801
|
-
ThemeSettings.DETECT_HC
|
|
2802
|
-
))),
|
|
2803
|
-
default: DEFAULT_THEME_HC_DARK_SETTING_VALUE,
|
|
2804
|
-
enum: colorThemeSettingEnum,
|
|
2805
|
-
enumDescriptions: colorThemeSettingEnumDescriptions,
|
|
2806
|
-
enumItemLabels: colorThemeSettingEnumItemLabels,
|
|
2807
|
-
errorMessage: ( (localize('colorThemeError', "Theme is unknown or not installed."))),
|
|
2808
|
-
};
|
|
2809
|
-
const preferredHCLightThemeSettingSchema = {
|
|
2810
|
-
type: 'string',
|
|
2811
|
-
markdownDescription: ( (localize(
|
|
2812
|
-
{ key: 'preferredHCLightColorTheme', comment: ['`#{0}#` will become a link to an other setting. Do not remove backtick or #'] },
|
|
2813
|
-
'Specifies the preferred color theme used in high contrast light mode when `#{0}#` is enabled.',
|
|
2814
|
-
ThemeSettings.DETECT_HC
|
|
2815
|
-
))),
|
|
2816
|
-
default: DEFAULT_THEME_HC_LIGHT_SETTING_VALUE,
|
|
2817
|
-
enum: colorThemeSettingEnum,
|
|
2818
|
-
enumDescriptions: colorThemeSettingEnumDescriptions,
|
|
2819
|
-
enumItemLabels: colorThemeSettingEnumItemLabels,
|
|
2820
|
-
errorMessage: ( (localize('colorThemeError', "Theme is unknown or not installed."))),
|
|
2821
|
-
};
|
|
2822
|
-
const detectColorSchemeSettingSchema = {
|
|
2823
|
-
type: 'boolean',
|
|
2824
|
-
markdownDescription: ( (localize(
|
|
2825
|
-
'detectColorScheme',
|
|
2826
|
-
'If set, automatically switch to the preferred color theme based on the OS appearance. If the OS appearance is dark, the theme specified at `#{0}#` is used, for light `#{1}#`.',
|
|
2827
|
-
ThemeSettings.PREFERRED_DARK_THEME,
|
|
2828
|
-
ThemeSettings.PREFERRED_LIGHT_THEME
|
|
2829
|
-
))),
|
|
2830
|
-
default: false
|
|
2831
|
-
};
|
|
2832
|
-
const colorCustomizationsSchema = {
|
|
2833
|
-
type: 'object',
|
|
2834
|
-
description: ( (localize(
|
|
2835
|
-
'workbenchColors',
|
|
2836
|
-
"Overrides colors from the currently selected color theme."
|
|
2837
|
-
))),
|
|
2838
|
-
allOf: [{ $ref: workbenchColorsSchemaId }],
|
|
2839
|
-
default: {},
|
|
2840
|
-
defaultSnippets: [{
|
|
2841
|
-
body: {}
|
|
2842
|
-
}]
|
|
2843
|
-
};
|
|
2844
|
-
const fileIconThemeSettingSchema = {
|
|
2845
|
-
type: ['string', 'null'],
|
|
2846
|
-
default: DEFAULT_FILE_ICON_THEME_SETTING_VALUE,
|
|
2847
|
-
description: ( (localize(
|
|
2848
|
-
'iconTheme',
|
|
2849
|
-
"Specifies the file icon theme used in the workbench or 'null' to not show any file icons."
|
|
2850
|
-
))),
|
|
2851
|
-
enum: [null],
|
|
2852
|
-
enumItemLabels: [( (localize('noIconThemeLabel', 'None')))],
|
|
2853
|
-
enumDescriptions: [( (localize('noIconThemeDesc', 'No file icons')))],
|
|
2854
|
-
errorMessage: ( (localize('iconThemeError', "File icon theme is unknown or not installed.")))
|
|
2855
|
-
};
|
|
2856
|
-
const productIconThemeSettingSchema = {
|
|
2857
|
-
type: ['string', 'null'],
|
|
2858
|
-
default: DEFAULT_PRODUCT_ICON_THEME_SETTING_VALUE,
|
|
2859
|
-
description: ( (localize('productIconTheme', "Specifies the product icon theme used."))),
|
|
2860
|
-
enum: [DEFAULT_PRODUCT_ICON_THEME_SETTING_VALUE],
|
|
2861
|
-
enumItemLabels: [( (localize('defaultProductIconThemeLabel', 'Default')))],
|
|
2862
|
-
enumDescriptions: [( (localize('defaultProductIconThemeDesc', 'Default')))],
|
|
2863
|
-
errorMessage: ( (localize('productIconThemeError', "Product icon theme is unknown or not installed.")))
|
|
2864
|
-
};
|
|
2865
|
-
const detectHCSchemeSettingSchema = {
|
|
2866
|
-
type: 'boolean',
|
|
2867
|
-
default: true,
|
|
2868
|
-
markdownDescription: ( (localize(
|
|
2869
|
-
'autoDetectHighContrast',
|
|
2870
|
-
"If enabled, will automatically change to high contrast theme if the OS is using a high contrast theme. The high contrast theme to use is specified by `#{0}#` and `#{1}#`.",
|
|
2871
|
-
ThemeSettings.PREFERRED_HC_DARK_THEME,
|
|
2872
|
-
ThemeSettings.PREFERRED_HC_LIGHT_THEME
|
|
2873
|
-
))),
|
|
2874
|
-
scope: 1
|
|
2875
|
-
};
|
|
2876
|
-
const themeSettingsConfiguration = {
|
|
2877
|
-
id: 'workbench',
|
|
2878
|
-
order: 7.1,
|
|
2879
|
-
type: 'object',
|
|
2880
|
-
properties: {
|
|
2881
|
-
[ThemeSettings.COLOR_THEME]: colorThemeSettingSchema,
|
|
2882
|
-
[ThemeSettings.PREFERRED_DARK_THEME]: preferredDarkThemeSettingSchema,
|
|
2883
|
-
[ThemeSettings.PREFERRED_LIGHT_THEME]: preferredLightThemeSettingSchema,
|
|
2884
|
-
[ThemeSettings.PREFERRED_HC_DARK_THEME]: preferredHCDarkThemeSettingSchema,
|
|
2885
|
-
[ThemeSettings.PREFERRED_HC_LIGHT_THEME]: preferredHCLightThemeSettingSchema,
|
|
2886
|
-
[ThemeSettings.FILE_ICON_THEME]: fileIconThemeSettingSchema,
|
|
2887
|
-
[ThemeSettings.COLOR_CUSTOMIZATIONS]: colorCustomizationsSchema,
|
|
2888
|
-
[ThemeSettings.PRODUCT_ICON_THEME]: productIconThemeSettingSchema
|
|
2889
|
-
}
|
|
2890
|
-
};
|
|
2891
|
-
configurationRegistry.registerConfiguration(themeSettingsConfiguration);
|
|
2892
|
-
const themeSettingsWindowConfiguration = {
|
|
2893
|
-
id: 'window',
|
|
2894
|
-
order: 8.1,
|
|
2895
|
-
type: 'object',
|
|
2896
|
-
properties: {
|
|
2897
|
-
[ThemeSettings.DETECT_HC]: detectHCSchemeSettingSchema,
|
|
2898
|
-
[ThemeSettings.DETECT_COLOR_SCHEME]: detectColorSchemeSettingSchema,
|
|
2899
|
-
}
|
|
2900
|
-
};
|
|
2901
|
-
configurationRegistry.registerConfiguration(themeSettingsWindowConfiguration);
|
|
2902
|
-
function tokenGroupSettings(description) {
|
|
2903
|
-
return {
|
|
2904
|
-
description,
|
|
2905
|
-
$ref: textmateColorGroupSchemaId
|
|
2906
|
-
};
|
|
2907
|
-
}
|
|
2908
|
-
const themeSpecificSettingKey = '^\\[[^\\]]*(\\]\\s*\\[[^\\]]*)*\\]$';
|
|
2909
|
-
const tokenColorSchema = {
|
|
2910
|
-
type: 'object',
|
|
2911
|
-
properties: {
|
|
2912
|
-
comments: tokenGroupSettings(( (localize('editorColors.comments', "Sets the colors and styles for comments")))),
|
|
2913
|
-
strings: tokenGroupSettings(( (localize('editorColors.strings', "Sets the colors and styles for strings literals.")))),
|
|
2914
|
-
keywords: tokenGroupSettings(( (localize('editorColors.keywords', "Sets the colors and styles for keywords.")))),
|
|
2915
|
-
numbers: tokenGroupSettings(( (localize('editorColors.numbers', "Sets the colors and styles for number literals.")))),
|
|
2916
|
-
types: tokenGroupSettings(( (localize(
|
|
2917
|
-
'editorColors.types',
|
|
2918
|
-
"Sets the colors and styles for type declarations and references."
|
|
2919
|
-
)))),
|
|
2920
|
-
functions: tokenGroupSettings(( (localize(
|
|
2921
|
-
'editorColors.functions',
|
|
2922
|
-
"Sets the colors and styles for functions declarations and references."
|
|
2923
|
-
)))),
|
|
2924
|
-
variables: tokenGroupSettings(( (localize(
|
|
2925
|
-
'editorColors.variables',
|
|
2926
|
-
"Sets the colors and styles for variables declarations and references."
|
|
2927
|
-
)))),
|
|
2928
|
-
textMateRules: {
|
|
2929
|
-
description: ( (localize(
|
|
2930
|
-
'editorColors.textMateRules',
|
|
2931
|
-
'Sets colors and styles using textmate theming rules (advanced).'
|
|
2932
|
-
))),
|
|
2933
|
-
$ref: textmateColorsSchemaId
|
|
2934
|
-
},
|
|
2935
|
-
semanticHighlighting: {
|
|
2936
|
-
description: ( (localize(
|
|
2937
|
-
'editorColors.semanticHighlighting',
|
|
2938
|
-
'Whether semantic highlighting should be enabled for this theme.'
|
|
2939
|
-
))),
|
|
2940
|
-
deprecationMessage: ( (localize(
|
|
2941
|
-
'editorColors.semanticHighlighting.deprecationMessage',
|
|
2942
|
-
'Use `enabled` in `editor.semanticTokenColorCustomizations` setting instead.'
|
|
2943
|
-
))),
|
|
2944
|
-
markdownDeprecationMessage: ( (localize(
|
|
2945
|
-
'editorColors.semanticHighlighting.deprecationMessageMarkdown',
|
|
2946
|
-
'Use `enabled` in `#editor.semanticTokenColorCustomizations#` setting instead.'
|
|
2947
|
-
))),
|
|
2948
|
-
type: 'boolean'
|
|
2949
|
-
}
|
|
2950
|
-
},
|
|
2951
|
-
additionalProperties: false
|
|
2952
|
-
};
|
|
2953
|
-
const tokenColorCustomizationSchema = {
|
|
2954
|
-
description: ( (localize(
|
|
2955
|
-
'editorColors',
|
|
2956
|
-
"Overrides editor syntax colors and font style from the currently selected color theme."
|
|
2957
|
-
))),
|
|
2958
|
-
default: {},
|
|
2959
|
-
allOf: [{ ...tokenColorSchema, patternProperties: { '^\\[': {} } }]
|
|
2960
|
-
};
|
|
2961
|
-
const semanticTokenColorSchema = {
|
|
2962
|
-
type: 'object',
|
|
2963
|
-
properties: {
|
|
2964
|
-
enabled: {
|
|
2965
|
-
type: 'boolean',
|
|
2966
|
-
description: ( (localize(
|
|
2967
|
-
'editorColors.semanticHighlighting.enabled',
|
|
2968
|
-
'Whether semantic highlighting is enabled or disabled for this theme'
|
|
2969
|
-
))),
|
|
2970
|
-
suggestSortText: '0_enabled'
|
|
2971
|
-
},
|
|
2972
|
-
rules: {
|
|
2973
|
-
$ref: tokenStylingSchemaId,
|
|
2974
|
-
description: ( (localize(
|
|
2975
|
-
'editorColors.semanticHighlighting.rules',
|
|
2976
|
-
'Semantic token styling rules for this theme.'
|
|
2977
|
-
))),
|
|
2978
|
-
suggestSortText: '0_rules'
|
|
2979
|
-
}
|
|
2980
|
-
},
|
|
2981
|
-
additionalProperties: false
|
|
2982
|
-
};
|
|
2983
|
-
const semanticTokenColorCustomizationSchema = {
|
|
2984
|
-
description: ( (localize(
|
|
2985
|
-
'semanticTokenColors',
|
|
2986
|
-
"Overrides editor semantic token color and styles from the currently selected color theme."
|
|
2987
|
-
))),
|
|
2988
|
-
default: {},
|
|
2989
|
-
allOf: [{ ...semanticTokenColorSchema, patternProperties: { '^\\[': {} } }]
|
|
2990
|
-
};
|
|
2991
|
-
const tokenColorCustomizationConfiguration = {
|
|
2992
|
-
id: 'editor',
|
|
2993
|
-
order: 7.2,
|
|
2994
|
-
type: 'object',
|
|
2995
|
-
properties: {
|
|
2996
|
-
[ThemeSettings.TOKEN_COLOR_CUSTOMIZATIONS]: tokenColorCustomizationSchema,
|
|
2997
|
-
[ThemeSettings.SEMANTIC_TOKEN_COLOR_CUSTOMIZATIONS]: semanticTokenColorCustomizationSchema
|
|
2998
|
-
}
|
|
2999
|
-
};
|
|
3000
|
-
configurationRegistry.registerConfiguration(tokenColorCustomizationConfiguration);
|
|
3001
|
-
function updateColorThemeConfigurationSchemas(themes) {
|
|
3002
|
-
themes.sort((a, b) => a.label.localeCompare(b.label));
|
|
3003
|
-
colorThemeSettingEnum.splice(0, colorThemeSettingEnum.length, ...( (themes.map(t => t.settingsId))));
|
|
3004
|
-
colorThemeSettingEnumDescriptions.splice(0, colorThemeSettingEnumDescriptions.length, ...( (themes.map(t => t.description || ''))));
|
|
3005
|
-
colorThemeSettingEnumItemLabels.splice(0, colorThemeSettingEnumItemLabels.length, ...( (themes.map(t => t.label || ''))));
|
|
3006
|
-
const themeSpecificWorkbenchColors = { properties: {} };
|
|
3007
|
-
const themeSpecificTokenColors = { properties: {} };
|
|
3008
|
-
const themeSpecificSemanticTokenColors = { properties: {} };
|
|
3009
|
-
const workbenchColors = { $ref: workbenchColorsSchemaId, additionalProperties: false };
|
|
3010
|
-
const tokenColors = { properties: tokenColorSchema.properties, additionalProperties: false };
|
|
3011
|
-
for (const t of themes) {
|
|
3012
|
-
const themeId = `[${t.settingsId}]`;
|
|
3013
|
-
themeSpecificWorkbenchColors.properties[themeId] = workbenchColors;
|
|
3014
|
-
themeSpecificTokenColors.properties[themeId] = tokenColors;
|
|
3015
|
-
themeSpecificSemanticTokenColors.properties[themeId] = semanticTokenColorSchema;
|
|
3016
|
-
}
|
|
3017
|
-
themeSpecificWorkbenchColors.patternProperties = { [themeSpecificSettingKey]: workbenchColors };
|
|
3018
|
-
themeSpecificTokenColors.patternProperties = { [themeSpecificSettingKey]: tokenColors };
|
|
3019
|
-
themeSpecificSemanticTokenColors.patternProperties = { [themeSpecificSettingKey]: semanticTokenColorSchema };
|
|
3020
|
-
colorCustomizationsSchema.allOf[1] = themeSpecificWorkbenchColors;
|
|
3021
|
-
tokenColorCustomizationSchema.allOf[1] = themeSpecificTokenColors;
|
|
3022
|
-
semanticTokenColorCustomizationSchema.allOf[1] = themeSpecificSemanticTokenColors;
|
|
3023
|
-
configurationRegistry.notifyConfigurationSchemaUpdated(themeSettingsConfiguration, tokenColorCustomizationConfiguration);
|
|
3024
|
-
}
|
|
3025
|
-
function updateFileIconThemeConfigurationSchemas(themes) {
|
|
3026
|
-
fileIconThemeSettingSchema.enum.splice(1, Number.MAX_VALUE, ...( (themes.map(t => t.settingsId))));
|
|
3027
|
-
fileIconThemeSettingSchema.enumItemLabels.splice(1, Number.MAX_VALUE, ...( (themes.map(t => t.label))));
|
|
3028
|
-
fileIconThemeSettingSchema.enumDescriptions.splice(1, Number.MAX_VALUE, ...( (themes.map(t => t.description || ''))));
|
|
3029
|
-
configurationRegistry.notifyConfigurationSchemaUpdated(themeSettingsConfiguration);
|
|
3030
|
-
}
|
|
3031
|
-
function updateProductIconThemeConfigurationSchemas(themes) {
|
|
3032
|
-
productIconThemeSettingSchema.enum.splice(1, Number.MAX_VALUE, ...( (themes.map(t => t.settingsId))));
|
|
3033
|
-
productIconThemeSettingSchema.enumItemLabels.splice(1, Number.MAX_VALUE, ...( (themes.map(t => t.label))));
|
|
3034
|
-
productIconThemeSettingSchema.enumDescriptions.splice(1, Number.MAX_VALUE, ...( (themes.map(t => t.description || ''))));
|
|
3035
|
-
configurationRegistry.notifyConfigurationSchemaUpdated(themeSettingsConfiguration);
|
|
3036
|
-
}
|
|
3037
|
-
class ThemeConfiguration {
|
|
3038
|
-
constructor(configurationService) {
|
|
3039
|
-
this.configurationService = configurationService;
|
|
3040
|
-
}
|
|
3041
|
-
get colorTheme() {
|
|
3042
|
-
return this.configurationService.getValue(ThemeSettings.COLOR_THEME);
|
|
3043
|
-
}
|
|
3044
|
-
get fileIconTheme() {
|
|
3045
|
-
return this.configurationService.getValue(ThemeSettings.FILE_ICON_THEME);
|
|
3046
|
-
}
|
|
3047
|
-
get productIconTheme() {
|
|
3048
|
-
return this.configurationService.getValue(ThemeSettings.PRODUCT_ICON_THEME);
|
|
3049
|
-
}
|
|
3050
|
-
get colorCustomizations() {
|
|
3051
|
-
return this.configurationService.getValue(ThemeSettings.COLOR_CUSTOMIZATIONS) || {};
|
|
3052
|
-
}
|
|
3053
|
-
get tokenColorCustomizations() {
|
|
3054
|
-
return this.configurationService.getValue(ThemeSettings.TOKEN_COLOR_CUSTOMIZATIONS) || {};
|
|
3055
|
-
}
|
|
3056
|
-
get semanticTokenColorCustomizations() {
|
|
3057
|
-
return this.configurationService.getValue(ThemeSettings.SEMANTIC_TOKEN_COLOR_CUSTOMIZATIONS);
|
|
3058
|
-
}
|
|
3059
|
-
async setColorTheme(theme, settingsTarget) {
|
|
3060
|
-
await this.writeConfiguration(ThemeSettings.COLOR_THEME, theme.settingsId, settingsTarget);
|
|
3061
|
-
return theme;
|
|
3062
|
-
}
|
|
3063
|
-
async setFileIconTheme(theme, settingsTarget) {
|
|
3064
|
-
await this.writeConfiguration(ThemeSettings.FILE_ICON_THEME, theme.settingsId, settingsTarget);
|
|
3065
|
-
return theme;
|
|
3066
|
-
}
|
|
3067
|
-
async setProductIconTheme(theme, settingsTarget) {
|
|
3068
|
-
await this.writeConfiguration(ThemeSettings.PRODUCT_ICON_THEME, theme.settingsId, settingsTarget);
|
|
3069
|
-
return theme;
|
|
3070
|
-
}
|
|
3071
|
-
isDefaultColorTheme() {
|
|
3072
|
-
const settings = this.configurationService.inspect(ThemeSettings.COLOR_THEME);
|
|
3073
|
-
return settings && settings.default?.value === settings.value;
|
|
3074
|
-
}
|
|
3075
|
-
findAutoConfigurationTarget(key) {
|
|
3076
|
-
const settings = this.configurationService.inspect(key);
|
|
3077
|
-
if (!isUndefined(settings.workspaceFolderValue)) {
|
|
3078
|
-
return 6 ;
|
|
3079
|
-
}
|
|
3080
|
-
else if (!isUndefined(settings.workspaceValue)) {
|
|
3081
|
-
return 5 ;
|
|
3082
|
-
}
|
|
3083
|
-
else if (!isUndefined(settings.userRemote)) {
|
|
3084
|
-
return 4 ;
|
|
3085
|
-
}
|
|
3086
|
-
return 2 ;
|
|
3087
|
-
}
|
|
3088
|
-
async writeConfiguration(key, value, settingsTarget) {
|
|
3089
|
-
if (settingsTarget === undefined || settingsTarget === 'preview') {
|
|
3090
|
-
return;
|
|
3091
|
-
}
|
|
3092
|
-
const settings = this.configurationService.inspect(key);
|
|
3093
|
-
if (settingsTarget === 'auto') {
|
|
3094
|
-
return this.configurationService.updateValue(key, value);
|
|
3095
|
-
}
|
|
3096
|
-
if (settingsTarget === 2 ) {
|
|
3097
|
-
if (value === settings.userValue) {
|
|
3098
|
-
return Promise.resolve(undefined);
|
|
3099
|
-
}
|
|
3100
|
-
else if (value === settings.defaultValue) {
|
|
3101
|
-
if (isUndefined(settings.userValue)) {
|
|
3102
|
-
return Promise.resolve(undefined);
|
|
3103
|
-
}
|
|
3104
|
-
value = undefined;
|
|
3105
|
-
}
|
|
3106
|
-
}
|
|
3107
|
-
else if (settingsTarget === 5 || settingsTarget === 6 || settingsTarget === 4 ) {
|
|
3108
|
-
if (value === settings.value) {
|
|
3109
|
-
return Promise.resolve(undefined);
|
|
3110
|
-
}
|
|
3111
|
-
}
|
|
3112
|
-
return this.configurationService.updateValue(key, value, settingsTarget);
|
|
3113
|
-
}
|
|
3114
|
-
}
|
|
3115
|
-
const DEFAULT_PRODUCT_ICON_THEME_ID = '';
|
|
3116
|
-
class ProductIconThemeData {
|
|
3117
|
-
constructor(id, label, settingsId) {
|
|
3118
|
-
this.iconThemeDocument = { iconDefinitions: ( (new Map())) };
|
|
3119
|
-
this.id = id;
|
|
3120
|
-
this.label = label;
|
|
3121
|
-
this.settingsId = settingsId;
|
|
3122
|
-
this.isLoaded = false;
|
|
3123
|
-
}
|
|
3124
|
-
getIcon(iconContribution) {
|
|
3125
|
-
return _resolveIconDefinition(iconContribution, this.iconThemeDocument);
|
|
3126
|
-
}
|
|
3127
|
-
ensureLoaded(fileService, logService) {
|
|
3128
|
-
return !this.isLoaded ? this.load(fileService, logService) : Promise.resolve(this.styleSheetContent);
|
|
3129
|
-
}
|
|
3130
|
-
reload(fileService, logService) {
|
|
3131
|
-
return this.load(fileService, logService);
|
|
3132
|
-
}
|
|
3133
|
-
async load(fileService, logService) {
|
|
3134
|
-
const location = this.location;
|
|
3135
|
-
if (!location) {
|
|
3136
|
-
return Promise.resolve(this.styleSheetContent);
|
|
3137
|
-
}
|
|
3138
|
-
const warnings = [];
|
|
3139
|
-
this.iconThemeDocument = await _loadProductIconThemeDocument(fileService, location, warnings);
|
|
3140
|
-
this.isLoaded = true;
|
|
3141
|
-
if (warnings.length) {
|
|
3142
|
-
logService.error(( (localize(
|
|
3143
|
-
'error.parseicondefs',
|
|
3144
|
-
"Problems processing product icons definitions in {0}:\n{1}",
|
|
3145
|
-
(location.toString()),
|
|
3146
|
-
warnings.join('\n')
|
|
3147
|
-
))));
|
|
3148
|
-
}
|
|
3149
|
-
return this.styleSheetContent;
|
|
3150
|
-
}
|
|
3151
|
-
static fromExtensionTheme(iconTheme, iconThemeLocation, extensionData) {
|
|
3152
|
-
const id = extensionData.extensionId + '-' + iconTheme.id;
|
|
3153
|
-
const label = iconTheme.label || basename(iconTheme.path);
|
|
3154
|
-
const settingsId = iconTheme.id;
|
|
3155
|
-
const themeData = ( (new ProductIconThemeData(id, label, settingsId)));
|
|
3156
|
-
themeData.description = iconTheme.description;
|
|
3157
|
-
themeData.location = iconThemeLocation;
|
|
3158
|
-
themeData.extensionData = extensionData;
|
|
3159
|
-
themeData.watch = iconTheme._watch;
|
|
3160
|
-
themeData.isLoaded = false;
|
|
3161
|
-
return themeData;
|
|
3162
|
-
}
|
|
3163
|
-
static createUnloadedTheme(id) {
|
|
3164
|
-
const themeData = ( (new ProductIconThemeData(id, '', '__' + id)));
|
|
3165
|
-
themeData.isLoaded = false;
|
|
3166
|
-
themeData.extensionData = undefined;
|
|
3167
|
-
themeData.watch = false;
|
|
3168
|
-
return themeData;
|
|
3169
|
-
}
|
|
3170
|
-
static get defaultTheme() {
|
|
3171
|
-
let themeData = ProductIconThemeData._defaultProductIconTheme;
|
|
3172
|
-
if (!themeData) {
|
|
3173
|
-
themeData = ProductIconThemeData._defaultProductIconTheme = ( (new ProductIconThemeData(
|
|
3174
|
-
DEFAULT_PRODUCT_ICON_THEME_ID,
|
|
3175
|
-
(localize('defaultTheme', 'Default')),
|
|
3176
|
-
DEFAULT_PRODUCT_ICON_THEME_SETTING_VALUE
|
|
3177
|
-
)));
|
|
3178
|
-
themeData.isLoaded = true;
|
|
3179
|
-
themeData.extensionData = undefined;
|
|
3180
|
-
themeData.watch = false;
|
|
3181
|
-
}
|
|
3182
|
-
return themeData;
|
|
3183
|
-
}
|
|
3184
|
-
static fromStorageData(storageService) {
|
|
3185
|
-
const input = storageService.get(ProductIconThemeData.STORAGE_KEY, 0 );
|
|
3186
|
-
if (!input) {
|
|
3187
|
-
return undefined;
|
|
3188
|
-
}
|
|
3189
|
-
try {
|
|
3190
|
-
const data = JSON.parse(input);
|
|
3191
|
-
const theme = ( (new ProductIconThemeData('', '', '')));
|
|
3192
|
-
for (const key in data) {
|
|
3193
|
-
switch (key) {
|
|
3194
|
-
case 'id':
|
|
3195
|
-
case 'label':
|
|
3196
|
-
case 'description':
|
|
3197
|
-
case 'settingsId':
|
|
3198
|
-
case 'styleSheetContent':
|
|
3199
|
-
case 'watch':
|
|
3200
|
-
theme[key] = data[key];
|
|
3201
|
-
break;
|
|
3202
|
-
case 'location':
|
|
3203
|
-
break;
|
|
3204
|
-
case 'extensionData':
|
|
3205
|
-
theme.extensionData = ExtensionData.fromJSONObject(data.extensionData);
|
|
3206
|
-
break;
|
|
3207
|
-
}
|
|
3208
|
-
}
|
|
3209
|
-
const { iconDefinitions, iconFontDefinitions } = data;
|
|
3210
|
-
if (Array.isArray(iconDefinitions) && isObject(iconFontDefinitions)) {
|
|
3211
|
-
const restoredIconDefinitions = ( (new Map()));
|
|
3212
|
-
for (const entry of iconDefinitions) {
|
|
3213
|
-
const { id, fontCharacter, fontId } = entry;
|
|
3214
|
-
if (isString(id) && isString(fontCharacter)) {
|
|
3215
|
-
if (isString(fontId)) {
|
|
3216
|
-
const iconFontDefinition = IconFontDefinition.fromJSONObject(iconFontDefinitions[fontId]);
|
|
3217
|
-
if (iconFontDefinition) {
|
|
3218
|
-
restoredIconDefinitions.set(id, { fontCharacter, font: { id: fontId, definition: iconFontDefinition } });
|
|
3219
|
-
}
|
|
3220
|
-
}
|
|
3221
|
-
else {
|
|
3222
|
-
restoredIconDefinitions.set(id, { fontCharacter });
|
|
3223
|
-
}
|
|
3224
|
-
}
|
|
3225
|
-
}
|
|
3226
|
-
theme.iconThemeDocument = { iconDefinitions: restoredIconDefinitions };
|
|
3227
|
-
}
|
|
3228
|
-
return theme;
|
|
3229
|
-
}
|
|
3230
|
-
catch (e) {
|
|
3231
|
-
return undefined;
|
|
3232
|
-
}
|
|
3233
|
-
}
|
|
3234
|
-
toStorage(storageService) {
|
|
3235
|
-
const iconDefinitions = [];
|
|
3236
|
-
const iconFontDefinitions = {};
|
|
3237
|
-
for (const entry of this.iconThemeDocument.iconDefinitions.entries()) {
|
|
3238
|
-
const font = entry[1].font;
|
|
3239
|
-
iconDefinitions.push({ id: entry[0], fontCharacter: entry[1].fontCharacter, fontId: font?.id });
|
|
3240
|
-
if (font && iconFontDefinitions[font.id] === undefined) {
|
|
3241
|
-
iconFontDefinitions[font.id] = IconFontDefinition.toJSONObject(font.definition);
|
|
3242
|
-
}
|
|
3243
|
-
}
|
|
3244
|
-
const data = JSON.stringify({
|
|
3245
|
-
id: this.id,
|
|
3246
|
-
label: this.label,
|
|
3247
|
-
description: this.description,
|
|
3248
|
-
settingsId: this.settingsId,
|
|
3249
|
-
styleSheetContent: this.styleSheetContent,
|
|
3250
|
-
watch: this.watch,
|
|
3251
|
-
extensionData: ExtensionData.toJSONObject(this.extensionData),
|
|
3252
|
-
iconDefinitions,
|
|
3253
|
-
iconFontDefinitions
|
|
3254
|
-
});
|
|
3255
|
-
storageService.store(ProductIconThemeData.STORAGE_KEY, data, 0 , 1 );
|
|
3256
|
-
}
|
|
3257
|
-
}
|
|
3258
|
-
ProductIconThemeData.STORAGE_KEY = 'productIconThemeData';
|
|
3259
|
-
ProductIconThemeData._defaultProductIconTheme = null;
|
|
3260
|
-
function _loadProductIconThemeDocument(fileService, location, warnings) {
|
|
3261
|
-
return fileService.readExtensionResource(location).then((content) => {
|
|
3262
|
-
const parseErrors = [];
|
|
3263
|
-
const contentValue = parse$1(content, parseErrors);
|
|
3264
|
-
if (parseErrors.length > 0) {
|
|
3265
|
-
return Promise.reject(( (new Error( (localize(
|
|
3266
|
-
'error.cannotparseicontheme',
|
|
3267
|
-
"Problems parsing product icons file: {0}",
|
|
3268
|
-
( (parseErrors.map(e => getParseErrorMessage(e.error)))).join(', ')
|
|
3269
|
-
))))));
|
|
3270
|
-
}
|
|
3271
|
-
else if (getNodeType(contentValue) !== 'object') {
|
|
3272
|
-
return Promise.reject(( (new Error( (localize(
|
|
3273
|
-
'error.invalidformat',
|
|
3274
|
-
"Invalid format for product icons theme file: Object expected."
|
|
3275
|
-
))))));
|
|
3276
|
-
}
|
|
3277
|
-
else if (!contentValue.iconDefinitions || !Array.isArray(contentValue.fonts) || !contentValue.fonts.length) {
|
|
3278
|
-
return Promise.reject(( (new Error( (localize(
|
|
3279
|
-
'error.missingProperties',
|
|
3280
|
-
"Invalid format for product icons theme file: Must contain iconDefinitions and fonts."
|
|
3281
|
-
))))));
|
|
3282
|
-
}
|
|
3283
|
-
const iconThemeDocumentLocationDirname = dirname(location);
|
|
3284
|
-
const sanitizedFonts = ( (new Map()));
|
|
3285
|
-
for (const font of contentValue.fonts) {
|
|
3286
|
-
if (isString(font.id) && font.id.match(fontIdRegex)) {
|
|
3287
|
-
const fontId = font.id;
|
|
3288
|
-
let fontWeight = undefined;
|
|
3289
|
-
if (isString(font.weight) && font.weight.match(fontWeightRegex)) {
|
|
3290
|
-
fontWeight = font.weight;
|
|
3291
|
-
}
|
|
3292
|
-
else {
|
|
3293
|
-
warnings.push(( (localize(
|
|
3294
|
-
'error.fontWeight',
|
|
3295
|
-
'Invalid font weight in font \'{0}\'. Ignoring setting.',
|
|
3296
|
-
font.id
|
|
3297
|
-
))));
|
|
3298
|
-
}
|
|
3299
|
-
let fontStyle = undefined;
|
|
3300
|
-
if (isString(font.style) && font.style.match(fontStyleRegex)) {
|
|
3301
|
-
fontStyle = font.style;
|
|
3302
|
-
}
|
|
3303
|
-
else {
|
|
3304
|
-
warnings.push(( (localize(
|
|
3305
|
-
'error.fontStyle',
|
|
3306
|
-
'Invalid font style in font \'{0}\'. Ignoring setting.',
|
|
3307
|
-
font.id
|
|
3308
|
-
))));
|
|
3309
|
-
}
|
|
3310
|
-
const sanitizedSrc = [];
|
|
3311
|
-
if (Array.isArray(font.src)) {
|
|
3312
|
-
for (const s of font.src) {
|
|
3313
|
-
if (isString(s.path) && isString(s.format) && s.format.match(fontFormatRegex)) {
|
|
3314
|
-
const iconFontLocation = joinPath(iconThemeDocumentLocationDirname, s.path);
|
|
3315
|
-
sanitizedSrc.push({ location: iconFontLocation, format: s.format });
|
|
3316
|
-
}
|
|
3317
|
-
else {
|
|
3318
|
-
warnings.push(( (localize(
|
|
3319
|
-
'error.fontSrc',
|
|
3320
|
-
'Invalid font source in font \'{0}\'. Ignoring source.',
|
|
3321
|
-
font.id
|
|
3322
|
-
))));
|
|
3323
|
-
}
|
|
3324
|
-
}
|
|
3325
|
-
}
|
|
3326
|
-
if (sanitizedSrc.length) {
|
|
3327
|
-
sanitizedFonts.set(fontId, { weight: fontWeight, style: fontStyle, src: sanitizedSrc });
|
|
3328
|
-
}
|
|
3329
|
-
else {
|
|
3330
|
-
warnings.push(( (localize(
|
|
3331
|
-
'error.noFontSrc',
|
|
3332
|
-
'No valid font source in font \'{0}\'. Ignoring font definition.',
|
|
3333
|
-
font.id
|
|
3334
|
-
))));
|
|
3335
|
-
}
|
|
3336
|
-
}
|
|
3337
|
-
else {
|
|
3338
|
-
warnings.push(( (localize(
|
|
3339
|
-
'error.fontId',
|
|
3340
|
-
'Missing or invalid font id \'{0}\'. Skipping font definition.',
|
|
3341
|
-
font.id
|
|
3342
|
-
))));
|
|
3343
|
-
}
|
|
3344
|
-
}
|
|
3345
|
-
const iconDefinitions = ( (new Map()));
|
|
3346
|
-
const primaryFontId = contentValue.fonts[0].id;
|
|
3347
|
-
for (const iconId in contentValue.iconDefinitions) {
|
|
3348
|
-
const definition = contentValue.iconDefinitions[iconId];
|
|
3349
|
-
if (isString(definition.fontCharacter)) {
|
|
3350
|
-
const fontId = definition.fontId ?? primaryFontId;
|
|
3351
|
-
const fontDefinition = sanitizedFonts.get(fontId);
|
|
3352
|
-
if (fontDefinition) {
|
|
3353
|
-
const font = { id: `pi-${fontId}`, definition: fontDefinition };
|
|
3354
|
-
iconDefinitions.set(iconId, { fontCharacter: definition.fontCharacter, font });
|
|
3355
|
-
}
|
|
3356
|
-
else {
|
|
3357
|
-
warnings.push(( (localize(
|
|
3358
|
-
'error.icon.font',
|
|
3359
|
-
'Skipping icon definition \'{0}\'. Unknown font.',
|
|
3360
|
-
iconId
|
|
3361
|
-
))));
|
|
3362
|
-
}
|
|
3363
|
-
}
|
|
3364
|
-
else {
|
|
3365
|
-
warnings.push(( (localize(
|
|
3366
|
-
'error.icon.fontCharacter',
|
|
3367
|
-
'Skipping icon definition \'{0}\'. Unknown fontCharacter.',
|
|
3368
|
-
iconId
|
|
3369
|
-
))));
|
|
3370
|
-
}
|
|
3371
|
-
}
|
|
3372
|
-
return { iconDefinitions };
|
|
3373
|
-
});
|
|
3374
|
-
}
|
|
3375
|
-
const iconRegistry = getIconRegistry();
|
|
3376
|
-
function _resolveIconDefinition(iconContribution, iconThemeDocument) {
|
|
3377
|
-
const iconDefinitions = iconThemeDocument.iconDefinitions;
|
|
3378
|
-
let definition = iconDefinitions.get(iconContribution.id);
|
|
3379
|
-
let defaults = iconContribution.defaults;
|
|
3380
|
-
while (!definition && ThemeIcon.isThemeIcon(defaults)) {
|
|
3381
|
-
const ic = iconRegistry.getIcon(defaults.id);
|
|
3382
|
-
if (ic) {
|
|
3383
|
-
definition = iconDefinitions.get(ic.id);
|
|
3384
|
-
defaults = ic.defaults;
|
|
3385
|
-
}
|
|
3386
|
-
else {
|
|
3387
|
-
return undefined;
|
|
3388
|
-
}
|
|
3389
|
-
}
|
|
3390
|
-
if (definition) {
|
|
3391
|
-
return definition;
|
|
3392
|
-
}
|
|
3393
|
-
if (!ThemeIcon.isThemeIcon(defaults)) {
|
|
3394
|
-
return defaults;
|
|
3395
|
-
}
|
|
3396
|
-
return undefined;
|
|
3397
|
-
}
|
|
3398
|
-
const DEFAULT_COLOR_THEME_ID = 'vs-dark vscode-theme-defaults-themes-dark_plus-json';
|
|
3399
|
-
const DEFAULT_LIGHT_COLOR_THEME_ID = 'vs vscode-theme-defaults-themes-light_plus-json';
|
|
3400
|
-
const PERSISTED_OS_COLOR_SCHEME = 'osColorScheme';
|
|
3401
|
-
const PERSISTED_OS_COLOR_SCHEME_SCOPE = -1 ;
|
|
3402
|
-
const defaultThemeExtensionId = 'vscode-theme-defaults';
|
|
3403
|
-
const DEFAULT_FILE_ICON_THEME_ID = 'vscode.vscode-theme-seti-vs-seti';
|
|
3404
|
-
const fileIconsEnabledClass = 'file-icons-enabled';
|
|
3405
|
-
const colorThemeRulesClassName = 'contributedColorTheme';
|
|
3406
|
-
const fileIconThemeRulesClassName = 'contributedFileIconTheme';
|
|
3407
|
-
const productIconThemeRulesClassName = 'contributedProductIconTheme';
|
|
3408
|
-
const themingRegistry = ( (Registry.as(Extensions$3.ThemingContribution)));
|
|
3409
|
-
function validateThemeId(theme) {
|
|
3410
|
-
switch (theme) {
|
|
3411
|
-
case VS_LIGHT_THEME: return `vs ${defaultThemeExtensionId}-themes-light_vs-json`;
|
|
3412
|
-
case VS_DARK_THEME: return `vs-dark ${defaultThemeExtensionId}-themes-dark_vs-json`;
|
|
3413
|
-
case VS_HC_THEME: return `hc-black ${defaultThemeExtensionId}-themes-hc_black-json`;
|
|
3414
|
-
case VS_HC_LIGHT_THEME: return `hc-light ${defaultThemeExtensionId}-themes-hc_light-json`;
|
|
3415
|
-
}
|
|
3416
|
-
return theme;
|
|
3417
|
-
}
|
|
3418
|
-
const colorThemesExtPoint = registerColorThemeExtensionPoint();
|
|
3419
|
-
const fileIconThemesExtPoint = registerFileIconThemeExtensionPoint();
|
|
3420
|
-
const productIconThemesExtPoint = registerProductIconThemeExtensionPoint();
|
|
3421
|
-
let WorkbenchThemeService = class WorkbenchThemeService {
|
|
3422
|
-
constructor(extensionService, storageService, configurationService, telemetryService, environmentService, fileService, extensionResourceLoaderService, layoutService, logService, hostColorService, userDataInitializationService, languageService) {
|
|
3423
|
-
this.storageService = storageService;
|
|
3424
|
-
this.configurationService = configurationService;
|
|
3425
|
-
this.telemetryService = telemetryService;
|
|
3426
|
-
this.environmentService = environmentService;
|
|
3427
|
-
this.extensionResourceLoaderService = extensionResourceLoaderService;
|
|
3428
|
-
this.logService = logService;
|
|
3429
|
-
this.hostColorService = hostColorService;
|
|
3430
|
-
this.themeExtensionsActivated = ( (new Map()));
|
|
3431
|
-
this.container = layoutService.container;
|
|
3432
|
-
this.settings = ( (new ThemeConfiguration(configurationService)));
|
|
3433
|
-
this.colorThemeRegistry = ( (new ThemeRegistry(colorThemesExtPoint, ColorThemeData.fromExtensionTheme)));
|
|
3434
|
-
this.colorThemeWatcher = ( (new ThemeFileWatcher(fileService, environmentService, this.reloadCurrentColorTheme.bind(this))));
|
|
3435
|
-
this.onColorThemeChange = ( (new Emitter({ leakWarningThreshold: 400 })));
|
|
3436
|
-
this.currentColorTheme = ColorThemeData.createUnloadedTheme('');
|
|
3437
|
-
this.colorThemeSequencer = ( (new Sequencer()));
|
|
3438
|
-
this.fileIconThemeWatcher = ( (new ThemeFileWatcher(
|
|
3439
|
-
fileService,
|
|
3440
|
-
environmentService,
|
|
3441
|
-
this.reloadCurrentFileIconTheme.bind(this)
|
|
3442
|
-
)));
|
|
3443
|
-
this.fileIconThemeRegistry = ( (new ThemeRegistry(
|
|
3444
|
-
fileIconThemesExtPoint,
|
|
3445
|
-
FileIconThemeData.fromExtensionTheme,
|
|
3446
|
-
true,
|
|
3447
|
-
FileIconThemeData.noIconTheme
|
|
3448
|
-
)));
|
|
3449
|
-
this.fileIconThemeLoader = ( (new FileIconThemeLoader(extensionResourceLoaderService, languageService)));
|
|
3450
|
-
this.onFileIconThemeChange = ( (new Emitter({ leakWarningThreshold: 400 })));
|
|
3451
|
-
this.currentFileIconTheme = FileIconThemeData.createUnloadedTheme('');
|
|
3452
|
-
this.fileIconThemeSequencer = ( (new Sequencer()));
|
|
3453
|
-
this.productIconThemeWatcher = ( (new ThemeFileWatcher(
|
|
3454
|
-
fileService,
|
|
3455
|
-
environmentService,
|
|
3456
|
-
this.reloadCurrentProductIconTheme.bind(this)
|
|
3457
|
-
)));
|
|
3458
|
-
this.productIconThemeRegistry = ( (new ThemeRegistry(
|
|
3459
|
-
productIconThemesExtPoint,
|
|
3460
|
-
ProductIconThemeData.fromExtensionTheme,
|
|
3461
|
-
true,
|
|
3462
|
-
ProductIconThemeData.defaultTheme
|
|
3463
|
-
)));
|
|
3464
|
-
this.onProductIconThemeChange = ( (new Emitter()));
|
|
3465
|
-
this.currentProductIconTheme = ProductIconThemeData.createUnloadedTheme('');
|
|
3466
|
-
this.productIconThemeSequencer = ( (new Sequencer()));
|
|
3467
|
-
let themeData = ColorThemeData.fromStorageData(this.storageService);
|
|
3468
|
-
if (themeData && this.settings.colorTheme !== themeData.settingsId && this.settings.isDefaultColorTheme()) {
|
|
3469
|
-
themeData = undefined;
|
|
3470
|
-
}
|
|
3471
|
-
const preferredColorScheme = this.getPreferredColorScheme();
|
|
3472
|
-
if (preferredColorScheme && themeData?.type !== preferredColorScheme && this.storageService.get(PERSISTED_OS_COLOR_SCHEME, PERSISTED_OS_COLOR_SCHEME_SCOPE) !== preferredColorScheme) {
|
|
3473
|
-
themeData = ColorThemeData.createUnloadedThemeForThemeType(preferredColorScheme);
|
|
3474
|
-
}
|
|
3475
|
-
if (!themeData) {
|
|
3476
|
-
const initialColorTheme = environmentService.options?.initialColorTheme;
|
|
3477
|
-
if (initialColorTheme) {
|
|
3478
|
-
themeData = ColorThemeData.createUnloadedThemeForThemeType(initialColorTheme.themeType, initialColorTheme.colors);
|
|
3479
|
-
}
|
|
3480
|
-
}
|
|
3481
|
-
if (!themeData) {
|
|
3482
|
-
themeData = ColorThemeData.createUnloadedThemeForThemeType(isWeb ? ColorScheme.LIGHT : ColorScheme.DARK);
|
|
3483
|
-
}
|
|
3484
|
-
themeData.setCustomizations(this.settings);
|
|
3485
|
-
this.applyTheme(themeData, undefined, true);
|
|
3486
|
-
const fileIconData = FileIconThemeData.fromStorageData(this.storageService);
|
|
3487
|
-
if (fileIconData) {
|
|
3488
|
-
this.applyAndSetFileIconTheme(fileIconData, true);
|
|
3489
|
-
}
|
|
3490
|
-
const productIconData = ProductIconThemeData.fromStorageData(this.storageService);
|
|
3491
|
-
if (productIconData) {
|
|
3492
|
-
this.applyAndSetProductIconTheme(productIconData, true);
|
|
3493
|
-
}
|
|
3494
|
-
Promise.all([extensionService.whenInstalledExtensionsRegistered(), userDataInitializationService.whenInitializationFinished()]).then(_ => {
|
|
3495
|
-
this.installConfigurationListener();
|
|
3496
|
-
this.installPreferredSchemeListener();
|
|
3497
|
-
this.installRegistryListeners();
|
|
3498
|
-
this.initialize().catch(onUnexpectedError);
|
|
3499
|
-
});
|
|
3500
|
-
const codiconStyleSheet = createStyleSheet();
|
|
3501
|
-
codiconStyleSheet.id = 'codiconStyles';
|
|
3502
|
-
const iconsStyleSheet = getIconsStyleSheet(this);
|
|
3503
|
-
function updateAll() {
|
|
3504
|
-
codiconStyleSheet.textContent = iconsStyleSheet.getCSS();
|
|
3505
|
-
}
|
|
3506
|
-
const delayer = ( (new RunOnceScheduler(updateAll, 0)));
|
|
3507
|
-
iconsStyleSheet.onDidChange(() => delayer.schedule());
|
|
3508
|
-
delayer.schedule();
|
|
3509
|
-
}
|
|
3510
|
-
initialize() {
|
|
3511
|
-
const extDevLocs = this.environmentService.extensionDevelopmentLocationURI;
|
|
3512
|
-
const extDevLoc = extDevLocs && extDevLocs.length === 1 ? extDevLocs[0] : undefined;
|
|
3513
|
-
const initializeColorTheme = async () => {
|
|
3514
|
-
const devThemes = this.colorThemeRegistry.findThemeByExtensionLocation(extDevLoc);
|
|
3515
|
-
if (devThemes.length) {
|
|
3516
|
-
return this.setColorTheme(devThemes[0].id, 8 );
|
|
3517
|
-
}
|
|
3518
|
-
const fallbackTheme = this.currentColorTheme.type === ColorScheme.LIGHT ? DEFAULT_LIGHT_COLOR_THEME_ID : DEFAULT_COLOR_THEME_ID;
|
|
3519
|
-
const theme = this.colorThemeRegistry.findThemeBySettingsId(this.settings.colorTheme, fallbackTheme);
|
|
3520
|
-
const preferredColorScheme = this.getPreferredColorScheme();
|
|
3521
|
-
const prevScheme = this.storageService.get(PERSISTED_OS_COLOR_SCHEME, PERSISTED_OS_COLOR_SCHEME_SCOPE);
|
|
3522
|
-
if (preferredColorScheme !== prevScheme) {
|
|
3523
|
-
this.storageService.store(PERSISTED_OS_COLOR_SCHEME, preferredColorScheme, PERSISTED_OS_COLOR_SCHEME_SCOPE, 0 );
|
|
3524
|
-
if (preferredColorScheme && theme?.type !== preferredColorScheme) {
|
|
3525
|
-
return this.applyPreferredColorTheme(preferredColorScheme);
|
|
3526
|
-
}
|
|
3527
|
-
}
|
|
3528
|
-
return this.setColorTheme(theme && theme.id, undefined);
|
|
3529
|
-
};
|
|
3530
|
-
const initializeFileIconTheme = async () => {
|
|
3531
|
-
const devThemes = this.fileIconThemeRegistry.findThemeByExtensionLocation(extDevLoc);
|
|
3532
|
-
if (devThemes.length) {
|
|
3533
|
-
return this.setFileIconTheme(devThemes[0].id, 8 );
|
|
3534
|
-
}
|
|
3535
|
-
const theme = this.fileIconThemeRegistry.findThemeBySettingsId(this.settings.fileIconTheme);
|
|
3536
|
-
return this.setFileIconTheme(theme ? theme.id : DEFAULT_FILE_ICON_THEME_ID, undefined);
|
|
3537
|
-
};
|
|
3538
|
-
const initializeProductIconTheme = async () => {
|
|
3539
|
-
const devThemes = this.productIconThemeRegistry.findThemeByExtensionLocation(extDevLoc);
|
|
3540
|
-
if (devThemes.length) {
|
|
3541
|
-
return this.setProductIconTheme(devThemes[0].id, 8 );
|
|
3542
|
-
}
|
|
3543
|
-
const theme = this.productIconThemeRegistry.findThemeBySettingsId(this.settings.productIconTheme);
|
|
3544
|
-
return this.setProductIconTheme(theme ? theme.id : DEFAULT_PRODUCT_ICON_THEME_ID, undefined);
|
|
3545
|
-
};
|
|
3546
|
-
return Promise.all([initializeColorTheme(), initializeFileIconTheme(), initializeProductIconTheme()]);
|
|
3547
|
-
}
|
|
3548
|
-
installConfigurationListener() {
|
|
3549
|
-
this.configurationService.onDidChangeConfiguration(e => {
|
|
3550
|
-
let lazyPreferredColorScheme = null;
|
|
3551
|
-
const getPreferredColorScheme = () => {
|
|
3552
|
-
if (lazyPreferredColorScheme === null) {
|
|
3553
|
-
lazyPreferredColorScheme = this.getPreferredColorScheme();
|
|
3554
|
-
}
|
|
3555
|
-
return lazyPreferredColorScheme;
|
|
3556
|
-
};
|
|
3557
|
-
if (e.affectsConfiguration(ThemeSettings.COLOR_THEME)) {
|
|
3558
|
-
this.restoreColorTheme();
|
|
3559
|
-
}
|
|
3560
|
-
if (e.affectsConfiguration(ThemeSettings.DETECT_COLOR_SCHEME) || e.affectsConfiguration(ThemeSettings.DETECT_HC)) {
|
|
3561
|
-
this.handlePreferredSchemeUpdated();
|
|
3562
|
-
}
|
|
3563
|
-
if (e.affectsConfiguration(ThemeSettings.PREFERRED_DARK_THEME) && getPreferredColorScheme() === ColorScheme.DARK) {
|
|
3564
|
-
this.applyPreferredColorTheme(ColorScheme.DARK);
|
|
3565
|
-
}
|
|
3566
|
-
if (e.affectsConfiguration(ThemeSettings.PREFERRED_LIGHT_THEME) && getPreferredColorScheme() === ColorScheme.LIGHT) {
|
|
3567
|
-
this.applyPreferredColorTheme(ColorScheme.LIGHT);
|
|
3568
|
-
}
|
|
3569
|
-
if (e.affectsConfiguration(ThemeSettings.PREFERRED_HC_DARK_THEME) && getPreferredColorScheme() === ColorScheme.HIGH_CONTRAST_DARK) {
|
|
3570
|
-
this.applyPreferredColorTheme(ColorScheme.HIGH_CONTRAST_DARK);
|
|
3571
|
-
}
|
|
3572
|
-
if (e.affectsConfiguration(ThemeSettings.PREFERRED_HC_LIGHT_THEME) && getPreferredColorScheme() === ColorScheme.HIGH_CONTRAST_LIGHT) {
|
|
3573
|
-
this.applyPreferredColorTheme(ColorScheme.HIGH_CONTRAST_LIGHT);
|
|
3574
|
-
}
|
|
3575
|
-
if (e.affectsConfiguration(ThemeSettings.FILE_ICON_THEME)) {
|
|
3576
|
-
this.restoreFileIconTheme();
|
|
3577
|
-
}
|
|
3578
|
-
if (e.affectsConfiguration(ThemeSettings.PRODUCT_ICON_THEME)) {
|
|
3579
|
-
this.restoreProductIconTheme();
|
|
3580
|
-
}
|
|
3581
|
-
if (this.currentColorTheme) {
|
|
3582
|
-
let hasColorChanges = false;
|
|
3583
|
-
if (e.affectsConfiguration(ThemeSettings.COLOR_CUSTOMIZATIONS)) {
|
|
3584
|
-
this.currentColorTheme.setCustomColors(this.settings.colorCustomizations);
|
|
3585
|
-
hasColorChanges = true;
|
|
3586
|
-
}
|
|
3587
|
-
if (e.affectsConfiguration(ThemeSettings.TOKEN_COLOR_CUSTOMIZATIONS)) {
|
|
3588
|
-
this.currentColorTheme.setCustomTokenColors(this.settings.tokenColorCustomizations);
|
|
3589
|
-
hasColorChanges = true;
|
|
3590
|
-
}
|
|
3591
|
-
if (e.affectsConfiguration(ThemeSettings.SEMANTIC_TOKEN_COLOR_CUSTOMIZATIONS)) {
|
|
3592
|
-
this.currentColorTheme.setCustomSemanticTokenColors(this.settings.semanticTokenColorCustomizations);
|
|
3593
|
-
hasColorChanges = true;
|
|
3594
|
-
}
|
|
3595
|
-
if (hasColorChanges) {
|
|
3596
|
-
this.updateDynamicCSSRules(this.currentColorTheme);
|
|
3597
|
-
this.onColorThemeChange.fire(this.currentColorTheme);
|
|
3598
|
-
}
|
|
3599
|
-
}
|
|
3600
|
-
});
|
|
3601
|
-
}
|
|
3602
|
-
installRegistryListeners() {
|
|
3603
|
-
let prevColorId = undefined;
|
|
3604
|
-
this.colorThemeRegistry.onDidChange(async (event) => {
|
|
3605
|
-
updateColorThemeConfigurationSchemas(event.themes);
|
|
3606
|
-
if (await this.restoreColorTheme()) {
|
|
3607
|
-
if (this.currentColorTheme.id === DEFAULT_COLOR_THEME_ID && !isUndefined(prevColorId) && (await this.colorThemeRegistry.findThemeById(prevColorId))) {
|
|
3608
|
-
await this.setColorTheme(prevColorId, 'auto');
|
|
3609
|
-
prevColorId = undefined;
|
|
3610
|
-
}
|
|
3611
|
-
else if (event.added.some(t => t.settingsId === this.currentColorTheme.settingsId)) {
|
|
3612
|
-
await this.reloadCurrentColorTheme();
|
|
3613
|
-
}
|
|
3614
|
-
}
|
|
3615
|
-
else if (event.removed.some(t => t.settingsId === this.currentColorTheme.settingsId)) {
|
|
3616
|
-
prevColorId = this.currentColorTheme.id;
|
|
3617
|
-
await this.setColorTheme(DEFAULT_COLOR_THEME_ID, 'auto');
|
|
3618
|
-
}
|
|
3619
|
-
});
|
|
3620
|
-
let prevFileIconId = undefined;
|
|
3621
|
-
this.fileIconThemeRegistry.onDidChange(async (event) => {
|
|
3622
|
-
updateFileIconThemeConfigurationSchemas(event.themes);
|
|
3623
|
-
if (await this.restoreFileIconTheme()) {
|
|
3624
|
-
if (this.currentFileIconTheme.id === DEFAULT_FILE_ICON_THEME_ID && !isUndefined(prevFileIconId) && this.fileIconThemeRegistry.findThemeById(prevFileIconId)) {
|
|
3625
|
-
await this.setFileIconTheme(prevFileIconId, 'auto');
|
|
3626
|
-
prevFileIconId = undefined;
|
|
3627
|
-
}
|
|
3628
|
-
else if (event.added.some(t => t.settingsId === this.currentFileIconTheme.settingsId)) {
|
|
3629
|
-
await this.reloadCurrentFileIconTheme();
|
|
3630
|
-
}
|
|
3631
|
-
}
|
|
3632
|
-
else if (event.removed.some(t => t.settingsId === this.currentFileIconTheme.settingsId)) {
|
|
3633
|
-
prevFileIconId = this.currentFileIconTheme.id;
|
|
3634
|
-
await this.setFileIconTheme(DEFAULT_FILE_ICON_THEME_ID, 'auto');
|
|
3635
|
-
}
|
|
3636
|
-
});
|
|
3637
|
-
let prevProductIconId = undefined;
|
|
3638
|
-
this.productIconThemeRegistry.onDidChange(async (event) => {
|
|
3639
|
-
updateProductIconThemeConfigurationSchemas(event.themes);
|
|
3640
|
-
if (await this.restoreProductIconTheme()) {
|
|
3641
|
-
if (this.currentProductIconTheme.id === DEFAULT_PRODUCT_ICON_THEME_ID && !isUndefined(prevProductIconId) && this.productIconThemeRegistry.findThemeById(prevProductIconId)) {
|
|
3642
|
-
await this.setProductIconTheme(prevProductIconId, 'auto');
|
|
3643
|
-
prevProductIconId = undefined;
|
|
3644
|
-
}
|
|
3645
|
-
else if (event.added.some(t => t.settingsId === this.currentProductIconTheme.settingsId)) {
|
|
3646
|
-
await this.reloadCurrentProductIconTheme();
|
|
3647
|
-
}
|
|
3648
|
-
}
|
|
3649
|
-
else if (event.removed.some(t => t.settingsId === this.currentProductIconTheme.settingsId)) {
|
|
3650
|
-
prevProductIconId = this.currentProductIconTheme.id;
|
|
3651
|
-
await this.setProductIconTheme(DEFAULT_PRODUCT_ICON_THEME_ID, 'auto');
|
|
3652
|
-
}
|
|
3653
|
-
});
|
|
3654
|
-
return Promise.all([this.getColorThemes(), this.getFileIconThemes(), this.getProductIconThemes()]).then(([ct, fit, pit]) => {
|
|
3655
|
-
updateColorThemeConfigurationSchemas(ct);
|
|
3656
|
-
updateFileIconThemeConfigurationSchemas(fit);
|
|
3657
|
-
updateProductIconThemeConfigurationSchemas(pit);
|
|
3658
|
-
});
|
|
3659
|
-
}
|
|
3660
|
-
installPreferredSchemeListener() {
|
|
3661
|
-
this.hostColorService.onDidChangeColorScheme(() => this.handlePreferredSchemeUpdated());
|
|
3662
|
-
}
|
|
3663
|
-
async handlePreferredSchemeUpdated() {
|
|
3664
|
-
const scheme = this.getPreferredColorScheme();
|
|
3665
|
-
const prevScheme = this.storageService.get(PERSISTED_OS_COLOR_SCHEME, PERSISTED_OS_COLOR_SCHEME_SCOPE);
|
|
3666
|
-
if (scheme !== prevScheme) {
|
|
3667
|
-
this.storageService.store(PERSISTED_OS_COLOR_SCHEME, scheme, PERSISTED_OS_COLOR_SCHEME_SCOPE, 1 );
|
|
3668
|
-
if (scheme) {
|
|
3669
|
-
if (!prevScheme) {
|
|
3670
|
-
this.themeSettingIdBeforeSchemeSwitch = this.settings.colorTheme;
|
|
3671
|
-
}
|
|
3672
|
-
return this.applyPreferredColorTheme(scheme);
|
|
3673
|
-
}
|
|
3674
|
-
else if (prevScheme && this.themeSettingIdBeforeSchemeSwitch) {
|
|
3675
|
-
const theme = this.colorThemeRegistry.findThemeBySettingsId(this.themeSettingIdBeforeSchemeSwitch, undefined);
|
|
3676
|
-
if (theme) {
|
|
3677
|
-
this.setColorTheme(theme.id, 'auto');
|
|
3678
|
-
}
|
|
3679
|
-
}
|
|
3680
|
-
}
|
|
3681
|
-
return undefined;
|
|
3682
|
-
}
|
|
3683
|
-
getPreferredColorScheme() {
|
|
3684
|
-
if (this.configurationService.getValue(ThemeSettings.DETECT_HC) && this.hostColorService.highContrast) {
|
|
3685
|
-
return this.hostColorService.dark ? ColorScheme.HIGH_CONTRAST_DARK : ColorScheme.HIGH_CONTRAST_LIGHT;
|
|
3686
|
-
}
|
|
3687
|
-
if (this.configurationService.getValue(ThemeSettings.DETECT_COLOR_SCHEME)) {
|
|
3688
|
-
return this.hostColorService.dark ? ColorScheme.DARK : ColorScheme.LIGHT;
|
|
3689
|
-
}
|
|
3690
|
-
return undefined;
|
|
3691
|
-
}
|
|
3692
|
-
async applyPreferredColorTheme(type) {
|
|
3693
|
-
let settingId;
|
|
3694
|
-
switch (type) {
|
|
3695
|
-
case ColorScheme.LIGHT:
|
|
3696
|
-
settingId = ThemeSettings.PREFERRED_LIGHT_THEME;
|
|
3697
|
-
break;
|
|
3698
|
-
case ColorScheme.HIGH_CONTRAST_DARK:
|
|
3699
|
-
settingId = ThemeSettings.PREFERRED_HC_DARK_THEME;
|
|
3700
|
-
break;
|
|
3701
|
-
case ColorScheme.HIGH_CONTRAST_LIGHT:
|
|
3702
|
-
settingId = ThemeSettings.PREFERRED_HC_LIGHT_THEME;
|
|
3703
|
-
break;
|
|
3704
|
-
default:
|
|
3705
|
-
settingId = ThemeSettings.PREFERRED_DARK_THEME;
|
|
3706
|
-
}
|
|
3707
|
-
const themeSettingId = this.configurationService.getValue(settingId);
|
|
3708
|
-
if (themeSettingId && typeof themeSettingId === 'string') {
|
|
3709
|
-
const theme = this.colorThemeRegistry.findThemeBySettingsId(themeSettingId, undefined);
|
|
3710
|
-
if (theme) {
|
|
3711
|
-
const configurationTarget = this.settings.findAutoConfigurationTarget(settingId);
|
|
3712
|
-
return this.setColorTheme(theme.id, configurationTarget);
|
|
3713
|
-
}
|
|
3714
|
-
}
|
|
3715
|
-
return null;
|
|
3716
|
-
}
|
|
3717
|
-
getColorTheme() {
|
|
3718
|
-
return this.currentColorTheme;
|
|
3719
|
-
}
|
|
3720
|
-
async getColorThemes() {
|
|
3721
|
-
return this.colorThemeRegistry.getThemes();
|
|
3722
|
-
}
|
|
3723
|
-
async getMarketplaceColorThemes(publisher, name, version) {
|
|
3724
|
-
const extensionLocation = this.extensionResourceLoaderService.getExtensionGalleryResourceURL({ publisher, name, version }, 'extension');
|
|
3725
|
-
if (extensionLocation) {
|
|
3726
|
-
try {
|
|
3727
|
-
const manifestContent = await this.extensionResourceLoaderService.readExtensionResource(joinPath(extensionLocation, 'package.json'));
|
|
3728
|
-
return this.colorThemeRegistry.getMarketplaceThemes(JSON.parse(manifestContent), extensionLocation, ExtensionData.fromName(publisher, name));
|
|
3729
|
-
}
|
|
3730
|
-
catch (e) {
|
|
3731
|
-
this.logService.error('Problem loading themes from marketplace', e);
|
|
3732
|
-
}
|
|
3733
|
-
}
|
|
3734
|
-
return [];
|
|
3735
|
-
}
|
|
3736
|
-
get onDidColorThemeChange() {
|
|
3737
|
-
return this.onColorThemeChange.event;
|
|
3738
|
-
}
|
|
3739
|
-
setColorTheme(themeIdOrTheme, settingsTarget) {
|
|
3740
|
-
return this.colorThemeSequencer.queue(async () => {
|
|
3741
|
-
return this.internalSetColorTheme(themeIdOrTheme, settingsTarget);
|
|
3742
|
-
});
|
|
3743
|
-
}
|
|
3744
|
-
async internalSetColorTheme(themeIdOrTheme, settingsTarget) {
|
|
3745
|
-
if (!themeIdOrTheme) {
|
|
3746
|
-
return null;
|
|
3747
|
-
}
|
|
3748
|
-
const themeId = isString(themeIdOrTheme) ? validateThemeId(themeIdOrTheme) : themeIdOrTheme.id;
|
|
3749
|
-
if (this.currentColorTheme.isLoaded && themeId === this.currentColorTheme.id) {
|
|
3750
|
-
if (settingsTarget !== 'preview') {
|
|
3751
|
-
this.currentColorTheme.toStorage(this.storageService);
|
|
3752
|
-
}
|
|
3753
|
-
return this.settings.setColorTheme(this.currentColorTheme, settingsTarget);
|
|
3754
|
-
}
|
|
3755
|
-
let themeData = this.colorThemeRegistry.findThemeById(themeId);
|
|
3756
|
-
if (!themeData) {
|
|
3757
|
-
if (themeIdOrTheme instanceof ColorThemeData) {
|
|
3758
|
-
themeData = themeIdOrTheme;
|
|
3759
|
-
}
|
|
3760
|
-
else {
|
|
3761
|
-
return null;
|
|
3762
|
-
}
|
|
3763
|
-
}
|
|
3764
|
-
try {
|
|
3765
|
-
await themeData.ensureLoaded(this.extensionResourceLoaderService);
|
|
3766
|
-
themeData.setCustomizations(this.settings);
|
|
3767
|
-
return this.applyTheme(themeData, settingsTarget);
|
|
3768
|
-
}
|
|
3769
|
-
catch (error) {
|
|
3770
|
-
throw new Error(localize('error.cannotloadtheme', "Unable to load {0}: {1}", themeData.location?.toString(), error.message));
|
|
3771
|
-
}
|
|
3772
|
-
}
|
|
3773
|
-
reloadCurrentColorTheme() {
|
|
3774
|
-
return this.colorThemeSequencer.queue(async () => {
|
|
3775
|
-
try {
|
|
3776
|
-
const theme = this.colorThemeRegistry.findThemeBySettingsId(this.currentColorTheme.settingsId) || this.currentColorTheme;
|
|
3777
|
-
await theme.reload(this.extensionResourceLoaderService);
|
|
3778
|
-
theme.setCustomizations(this.settings);
|
|
3779
|
-
await this.applyTheme(theme, undefined, false);
|
|
3780
|
-
}
|
|
3781
|
-
catch (error) {
|
|
3782
|
-
this.logService.info('Unable to reload {0}: {1}', this.currentColorTheme.location?.toString());
|
|
3783
|
-
}
|
|
3784
|
-
});
|
|
3785
|
-
}
|
|
3786
|
-
async restoreColorTheme() {
|
|
3787
|
-
return this.colorThemeSequencer.queue(async () => {
|
|
3788
|
-
const settingId = this.settings.colorTheme;
|
|
3789
|
-
const theme = this.colorThemeRegistry.findThemeBySettingsId(settingId);
|
|
3790
|
-
if (theme) {
|
|
3791
|
-
if (settingId !== this.currentColorTheme.settingsId) {
|
|
3792
|
-
await this.internalSetColorTheme(theme.id, undefined);
|
|
3793
|
-
}
|
|
3794
|
-
else if (theme !== this.currentColorTheme) {
|
|
3795
|
-
await theme.ensureLoaded(this.extensionResourceLoaderService);
|
|
3796
|
-
theme.setCustomizations(this.settings);
|
|
3797
|
-
await this.applyTheme(theme, undefined, true);
|
|
3798
|
-
}
|
|
3799
|
-
return true;
|
|
3800
|
-
}
|
|
3801
|
-
return false;
|
|
3802
|
-
});
|
|
3803
|
-
}
|
|
3804
|
-
updateDynamicCSSRules(themeData) {
|
|
3805
|
-
const cssRules = ( (new Set()));
|
|
3806
|
-
const ruleCollector = {
|
|
3807
|
-
addRule: (rule) => {
|
|
3808
|
-
if (!cssRules.has(rule)) {
|
|
3809
|
-
cssRules.add(rule);
|
|
3810
|
-
}
|
|
3811
|
-
}
|
|
3812
|
-
};
|
|
3813
|
-
ruleCollector.addRule(`.monaco-workbench { forced-color-adjust: none; }`);
|
|
3814
|
-
themingRegistry.getThemingParticipants().forEach(p => p(themeData, ruleCollector, this.environmentService));
|
|
3815
|
-
const colorVariables = [];
|
|
3816
|
-
for (const item of getColorRegistry().getColors()) {
|
|
3817
|
-
const color = themeData.getColor(item.id, true);
|
|
3818
|
-
if (color) {
|
|
3819
|
-
colorVariables.push(`${asCssVariableName(item.id)}: ${( ( color.toString()))};`);
|
|
3820
|
-
}
|
|
3821
|
-
}
|
|
3822
|
-
ruleCollector.addRule(`.monaco-workbench { ${colorVariables.join('\n')} }`);
|
|
3823
|
-
_applyRules([...cssRules].join('\n'), colorThemeRulesClassName);
|
|
3824
|
-
}
|
|
3825
|
-
applyTheme(newTheme, settingsTarget, silent = false) {
|
|
3826
|
-
this.updateDynamicCSSRules(newTheme);
|
|
3827
|
-
if (this.currentColorTheme.id) {
|
|
3828
|
-
this.container.classList.remove(...this.currentColorTheme.classNames);
|
|
3829
|
-
}
|
|
3830
|
-
else {
|
|
3831
|
-
this.container.classList.remove(VS_DARK_THEME, VS_LIGHT_THEME, VS_HC_THEME, VS_HC_LIGHT_THEME);
|
|
3832
|
-
}
|
|
3833
|
-
this.container.classList.add(...newTheme.classNames);
|
|
3834
|
-
this.currentColorTheme.clearCaches();
|
|
3835
|
-
this.currentColorTheme = newTheme;
|
|
3836
|
-
if (!this.colorThemingParticipantChangeListener) {
|
|
3837
|
-
this.colorThemingParticipantChangeListener = themingRegistry.onThemingParticipantAdded(_ => this.updateDynamicCSSRules(this.currentColorTheme));
|
|
3838
|
-
}
|
|
3839
|
-
this.colorThemeWatcher.update(newTheme);
|
|
3840
|
-
this.sendTelemetry(newTheme.id, newTheme.extensionData, 'color');
|
|
3841
|
-
if (silent) {
|
|
3842
|
-
return Promise.resolve(null);
|
|
3843
|
-
}
|
|
3844
|
-
this.onColorThemeChange.fire(this.currentColorTheme);
|
|
3845
|
-
if (newTheme.isLoaded && settingsTarget !== 'preview') {
|
|
3846
|
-
newTheme.toStorage(this.storageService);
|
|
3847
|
-
}
|
|
3848
|
-
return this.settings.setColorTheme(this.currentColorTheme, settingsTarget);
|
|
3849
|
-
}
|
|
3850
|
-
sendTelemetry(themeId, themeData, themeType) {
|
|
3851
|
-
if (themeData) {
|
|
3852
|
-
const key = themeType + themeData.extensionId;
|
|
3853
|
-
if (!this.themeExtensionsActivated.get(key)) {
|
|
3854
|
-
this.telemetryService.publicLog2('activatePlugin', {
|
|
3855
|
-
id: themeData.extensionId,
|
|
3856
|
-
name: themeData.extensionName,
|
|
3857
|
-
isBuiltin: themeData.extensionIsBuiltin,
|
|
3858
|
-
publisherDisplayName: themeData.extensionPublisher,
|
|
3859
|
-
themeId: themeId
|
|
3860
|
-
});
|
|
3861
|
-
this.themeExtensionsActivated.set(key, true);
|
|
3862
|
-
}
|
|
3863
|
-
}
|
|
3864
|
-
}
|
|
3865
|
-
async getFileIconThemes() {
|
|
3866
|
-
return this.fileIconThemeRegistry.getThemes();
|
|
3867
|
-
}
|
|
3868
|
-
getFileIconTheme() {
|
|
3869
|
-
return this.currentFileIconTheme;
|
|
3870
|
-
}
|
|
3871
|
-
get onDidFileIconThemeChange() {
|
|
3872
|
-
return this.onFileIconThemeChange.event;
|
|
3873
|
-
}
|
|
3874
|
-
async setFileIconTheme(iconThemeOrId, settingsTarget) {
|
|
3875
|
-
return this.fileIconThemeSequencer.queue(async () => {
|
|
3876
|
-
return this.internalSetFileIconTheme(iconThemeOrId, settingsTarget);
|
|
3877
|
-
});
|
|
3878
|
-
}
|
|
3879
|
-
async internalSetFileIconTheme(iconThemeOrId, settingsTarget) {
|
|
3880
|
-
if (iconThemeOrId === undefined) {
|
|
3881
|
-
iconThemeOrId = '';
|
|
3882
|
-
}
|
|
3883
|
-
const themeId = isString(iconThemeOrId) ? iconThemeOrId : iconThemeOrId.id;
|
|
3884
|
-
if (themeId !== this.currentFileIconTheme.id || !this.currentFileIconTheme.isLoaded) {
|
|
3885
|
-
let newThemeData = this.fileIconThemeRegistry.findThemeById(themeId);
|
|
3886
|
-
if (!newThemeData && iconThemeOrId instanceof FileIconThemeData) {
|
|
3887
|
-
newThemeData = iconThemeOrId;
|
|
3888
|
-
}
|
|
3889
|
-
if (!newThemeData) {
|
|
3890
|
-
newThemeData = FileIconThemeData.noIconTheme;
|
|
3891
|
-
}
|
|
3892
|
-
await newThemeData.ensureLoaded(this.fileIconThemeLoader);
|
|
3893
|
-
this.applyAndSetFileIconTheme(newThemeData);
|
|
3894
|
-
}
|
|
3895
|
-
const themeData = this.currentFileIconTheme;
|
|
3896
|
-
if (themeData.isLoaded && settingsTarget !== 'preview' && (!themeData.location || !getRemoteAuthority(themeData.location))) {
|
|
3897
|
-
themeData.toStorage(this.storageService);
|
|
3898
|
-
}
|
|
3899
|
-
await this.settings.setFileIconTheme(this.currentFileIconTheme, settingsTarget);
|
|
3900
|
-
return themeData;
|
|
3901
|
-
}
|
|
3902
|
-
async getMarketplaceFileIconThemes(publisher, name, version) {
|
|
3903
|
-
const extensionLocation = this.extensionResourceLoaderService.getExtensionGalleryResourceURL({ publisher, name, version }, 'extension');
|
|
3904
|
-
if (extensionLocation) {
|
|
3905
|
-
try {
|
|
3906
|
-
const manifestContent = await this.extensionResourceLoaderService.readExtensionResource(joinPath(extensionLocation, 'package.json'));
|
|
3907
|
-
return this.fileIconThemeRegistry.getMarketplaceThemes(JSON.parse(manifestContent), extensionLocation, ExtensionData.fromName(publisher, name));
|
|
3908
|
-
}
|
|
3909
|
-
catch (e) {
|
|
3910
|
-
this.logService.error('Problem loading themes from marketplace', e);
|
|
3911
|
-
}
|
|
3912
|
-
}
|
|
3913
|
-
return [];
|
|
3914
|
-
}
|
|
3915
|
-
async reloadCurrentFileIconTheme() {
|
|
3916
|
-
return this.fileIconThemeSequencer.queue(async () => {
|
|
3917
|
-
await this.currentFileIconTheme.reload(this.fileIconThemeLoader);
|
|
3918
|
-
this.applyAndSetFileIconTheme(this.currentFileIconTheme);
|
|
3919
|
-
});
|
|
3920
|
-
}
|
|
3921
|
-
async restoreFileIconTheme() {
|
|
3922
|
-
return this.fileIconThemeSequencer.queue(async () => {
|
|
3923
|
-
const settingId = this.settings.fileIconTheme;
|
|
3924
|
-
const theme = this.fileIconThemeRegistry.findThemeBySettingsId(settingId);
|
|
3925
|
-
if (theme) {
|
|
3926
|
-
if (settingId !== this.currentFileIconTheme.settingsId) {
|
|
3927
|
-
await this.internalSetFileIconTheme(theme.id, undefined);
|
|
3928
|
-
}
|
|
3929
|
-
else if (theme !== this.currentFileIconTheme) {
|
|
3930
|
-
await theme.ensureLoaded(this.fileIconThemeLoader);
|
|
3931
|
-
this.applyAndSetFileIconTheme(theme, true);
|
|
3932
|
-
}
|
|
3933
|
-
return true;
|
|
3934
|
-
}
|
|
3935
|
-
return false;
|
|
3936
|
-
});
|
|
3937
|
-
}
|
|
3938
|
-
applyAndSetFileIconTheme(iconThemeData, silent = false) {
|
|
3939
|
-
this.currentFileIconTheme = iconThemeData;
|
|
3940
|
-
_applyRules(iconThemeData.styleSheetContent, fileIconThemeRulesClassName);
|
|
3941
|
-
if (iconThemeData.id) {
|
|
3942
|
-
this.container.classList.add(fileIconsEnabledClass);
|
|
3943
|
-
}
|
|
3944
|
-
else {
|
|
3945
|
-
this.container.classList.remove(fileIconsEnabledClass);
|
|
3946
|
-
}
|
|
3947
|
-
this.fileIconThemeWatcher.update(iconThemeData);
|
|
3948
|
-
if (iconThemeData.id) {
|
|
3949
|
-
this.sendTelemetry(iconThemeData.id, iconThemeData.extensionData, 'fileIcon');
|
|
3950
|
-
}
|
|
3951
|
-
if (!silent) {
|
|
3952
|
-
this.onFileIconThemeChange.fire(this.currentFileIconTheme);
|
|
3953
|
-
}
|
|
3954
|
-
}
|
|
3955
|
-
async getProductIconThemes() {
|
|
3956
|
-
return this.productIconThemeRegistry.getThemes();
|
|
3957
|
-
}
|
|
3958
|
-
getProductIconTheme() {
|
|
3959
|
-
return this.currentProductIconTheme;
|
|
3960
|
-
}
|
|
3961
|
-
get onDidProductIconThemeChange() {
|
|
3962
|
-
return this.onProductIconThemeChange.event;
|
|
3963
|
-
}
|
|
3964
|
-
async setProductIconTheme(iconThemeOrId, settingsTarget) {
|
|
3965
|
-
return this.productIconThemeSequencer.queue(async () => {
|
|
3966
|
-
return this.internalSetProductIconTheme(iconThemeOrId, settingsTarget);
|
|
3967
|
-
});
|
|
3968
|
-
}
|
|
3969
|
-
async internalSetProductIconTheme(iconThemeOrId, settingsTarget) {
|
|
3970
|
-
if (iconThemeOrId === undefined) {
|
|
3971
|
-
iconThemeOrId = '';
|
|
3972
|
-
}
|
|
3973
|
-
const themeId = isString(iconThemeOrId) ? iconThemeOrId : iconThemeOrId.id;
|
|
3974
|
-
if (themeId !== this.currentProductIconTheme.id || !this.currentProductIconTheme.isLoaded) {
|
|
3975
|
-
let newThemeData = this.productIconThemeRegistry.findThemeById(themeId);
|
|
3976
|
-
if (!newThemeData && iconThemeOrId instanceof ProductIconThemeData) {
|
|
3977
|
-
newThemeData = iconThemeOrId;
|
|
3978
|
-
}
|
|
3979
|
-
if (!newThemeData) {
|
|
3980
|
-
newThemeData = ProductIconThemeData.defaultTheme;
|
|
3981
|
-
}
|
|
3982
|
-
await newThemeData.ensureLoaded(this.extensionResourceLoaderService, this.logService);
|
|
3983
|
-
this.applyAndSetProductIconTheme(newThemeData);
|
|
3984
|
-
}
|
|
3985
|
-
const themeData = this.currentProductIconTheme;
|
|
3986
|
-
if (themeData.isLoaded && settingsTarget !== 'preview' && (!themeData.location || !getRemoteAuthority(themeData.location))) {
|
|
3987
|
-
themeData.toStorage(this.storageService);
|
|
3988
|
-
}
|
|
3989
|
-
await this.settings.setProductIconTheme(this.currentProductIconTheme, settingsTarget);
|
|
3990
|
-
return themeData;
|
|
3991
|
-
}
|
|
3992
|
-
async getMarketplaceProductIconThemes(publisher, name, version) {
|
|
3993
|
-
const extensionLocation = this.extensionResourceLoaderService.getExtensionGalleryResourceURL({ publisher, name, version }, 'extension');
|
|
3994
|
-
if (extensionLocation) {
|
|
3995
|
-
try {
|
|
3996
|
-
const manifestContent = await this.extensionResourceLoaderService.readExtensionResource(joinPath(extensionLocation, 'package.json'));
|
|
3997
|
-
return this.productIconThemeRegistry.getMarketplaceThemes(JSON.parse(manifestContent), extensionLocation, ExtensionData.fromName(publisher, name));
|
|
3998
|
-
}
|
|
3999
|
-
catch (e) {
|
|
4000
|
-
this.logService.error('Problem loading themes from marketplace', e);
|
|
4001
|
-
}
|
|
4002
|
-
}
|
|
4003
|
-
return [];
|
|
4004
|
-
}
|
|
4005
|
-
async reloadCurrentProductIconTheme() {
|
|
4006
|
-
return this.productIconThemeSequencer.queue(async () => {
|
|
4007
|
-
await this.currentProductIconTheme.reload(this.extensionResourceLoaderService, this.logService);
|
|
4008
|
-
this.applyAndSetProductIconTheme(this.currentProductIconTheme);
|
|
4009
|
-
});
|
|
4010
|
-
}
|
|
4011
|
-
async restoreProductIconTheme() {
|
|
4012
|
-
return this.productIconThemeSequencer.queue(async () => {
|
|
4013
|
-
const settingId = this.settings.productIconTheme;
|
|
4014
|
-
const theme = this.productIconThemeRegistry.findThemeBySettingsId(settingId);
|
|
4015
|
-
if (theme) {
|
|
4016
|
-
if (settingId !== this.currentProductIconTheme.settingsId) {
|
|
4017
|
-
await this.internalSetProductIconTheme(theme.id, undefined);
|
|
4018
|
-
}
|
|
4019
|
-
else if (theme !== this.currentProductIconTheme) {
|
|
4020
|
-
await theme.ensureLoaded(this.extensionResourceLoaderService, this.logService);
|
|
4021
|
-
this.applyAndSetProductIconTheme(theme, true);
|
|
4022
|
-
}
|
|
4023
|
-
return true;
|
|
4024
|
-
}
|
|
4025
|
-
return false;
|
|
4026
|
-
});
|
|
4027
|
-
}
|
|
4028
|
-
applyAndSetProductIconTheme(iconThemeData, silent = false) {
|
|
4029
|
-
this.currentProductIconTheme = iconThemeData;
|
|
4030
|
-
_applyRules(iconThemeData.styleSheetContent, productIconThemeRulesClassName);
|
|
4031
|
-
this.productIconThemeWatcher.update(iconThemeData);
|
|
4032
|
-
if (iconThemeData.id) {
|
|
4033
|
-
this.sendTelemetry(iconThemeData.id, iconThemeData.extensionData, 'productIcon');
|
|
4034
|
-
}
|
|
4035
|
-
if (!silent) {
|
|
4036
|
-
this.onProductIconThemeChange.fire(this.currentProductIconTheme);
|
|
4037
|
-
}
|
|
4038
|
-
}
|
|
4039
|
-
};
|
|
4040
|
-
WorkbenchThemeService = ( (__decorate([
|
|
4041
|
-
( (__param(0, IExtensionService))),
|
|
4042
|
-
( (__param(1, IStorageService))),
|
|
4043
|
-
( (__param(2, IConfigurationService))),
|
|
4044
|
-
( (__param(3, ITelemetryService))),
|
|
4045
|
-
( (__param(4, IBrowserWorkbenchEnvironmentService))),
|
|
4046
|
-
( (__param(5, IFileService))),
|
|
4047
|
-
( (__param(6, IExtensionResourceLoaderService))),
|
|
4048
|
-
( (__param(7, IWorkbenchLayoutService))),
|
|
4049
|
-
( (__param(8, ILogService))),
|
|
4050
|
-
( (__param(9, IHostColorSchemeService))),
|
|
4051
|
-
( (__param(10, IUserDataInitializationService))),
|
|
4052
|
-
( (__param(11, ILanguageService)))
|
|
4053
|
-
], WorkbenchThemeService)));
|
|
4054
|
-
class ThemeFileWatcher {
|
|
4055
|
-
constructor(fileService, environmentService, onUpdate) {
|
|
4056
|
-
this.fileService = fileService;
|
|
4057
|
-
this.environmentService = environmentService;
|
|
4058
|
-
this.onUpdate = onUpdate;
|
|
4059
|
-
}
|
|
4060
|
-
update(theme) {
|
|
4061
|
-
if (!isEqual(theme.location, this.watchedLocation)) {
|
|
4062
|
-
this.dispose();
|
|
4063
|
-
if (theme.location && (theme.watch || this.environmentService.isExtensionDevelopment)) {
|
|
4064
|
-
this.watchedLocation = theme.location;
|
|
4065
|
-
this.watcherDisposable = this.fileService.watch(theme.location);
|
|
4066
|
-
this.fileService.onDidFilesChange(e => {
|
|
4067
|
-
if (this.watchedLocation && e.contains(this.watchedLocation, 0 )) {
|
|
4068
|
-
this.onUpdate();
|
|
4069
|
-
}
|
|
4070
|
-
});
|
|
4071
|
-
}
|
|
4072
|
-
}
|
|
4073
|
-
}
|
|
4074
|
-
dispose() {
|
|
4075
|
-
this.watcherDisposable = dispose(this.watcherDisposable);
|
|
4076
|
-
this.fileChangeListener = dispose(this.fileChangeListener);
|
|
4077
|
-
this.watchedLocation = undefined;
|
|
4078
|
-
}
|
|
4079
|
-
}
|
|
4080
|
-
function _applyRules(styleSheetContent, rulesClassName) {
|
|
4081
|
-
const themeStyles = document.head.getElementsByClassName(rulesClassName);
|
|
4082
|
-
if (themeStyles.length === 0) {
|
|
4083
|
-
const elStyle = document.createElement('style');
|
|
4084
|
-
elStyle.type = 'text/css';
|
|
4085
|
-
elStyle.className = rulesClassName;
|
|
4086
|
-
elStyle.textContent = styleSheetContent;
|
|
4087
|
-
document.head.appendChild(elStyle);
|
|
4088
|
-
}
|
|
4089
|
-
else {
|
|
4090
|
-
themeStyles[0].textContent = styleSheetContent;
|
|
4091
|
-
}
|
|
4092
|
-
}
|
|
4093
|
-
registerColorThemeSchemas();
|
|
4094
|
-
registerFileIconThemeSchemas();
|
|
4095
|
-
registerProductIconThemeSchemas();
|
|
4096
|
-
class StandaloneWorkbenchThemeService extends WorkbenchThemeService {
|
|
4097
|
-
registerEditorContainer() {
|
|
4098
|
-
return {
|
|
4099
|
-
dispose() { }
|
|
4100
|
-
};
|
|
4101
|
-
}
|
|
4102
|
-
setTheme(themeName) {
|
|
4103
|
-
void this.getColorThemes().then(themes => {
|
|
4104
|
-
setTimeout(() => {
|
|
4105
|
-
void this.setColorTheme(themes.find(theme => theme.settingsId === themeName) ?? themeName, 8 );
|
|
4106
|
-
});
|
|
4107
|
-
});
|
|
4108
|
-
}
|
|
4109
|
-
}
|
|
4110
|
-
function getServiceOverride() {
|
|
4111
|
-
return {
|
|
4112
|
-
...getServiceOverride$1(),
|
|
4113
|
-
[( IThemeService.toString())]: new SyncDescriptor(StandaloneWorkbenchThemeService)
|
|
4114
|
-
};
|
|
4115
|
-
}
|
|
4116
|
-
export { getServiceOverride as default };
|