@codingame/monaco-vscode-api 32.0.0 → 32.0.1
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/package.json +8 -8
- package/services.js +3 -3
- package/vscode/src/vs/base/common/paging.js +66 -2
- package/vscode/src/vs/platform/extensionManagement/common/unsupportedExtensionsMigration.d.ts +14 -0
- package/vscode/src/vs/platform/extensionManagement/common/unsupportedExtensionsMigration.js +145 -0
- package/vscode/src/vs/platform/extensionRecommendations/common/extensionRecommendations.d.ts +19 -0
- package/vscode/src/vs/platform/extensionRecommendations/common/extensionRecommendations.js +25 -0
- package/vscode/src/vs/platform/extensionRecommendations/common/extensionRecommendations.service.d.ts +1 -1
- package/vscode/src/vs/platform/product/common/product.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatScreenshotContext.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.js +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorContextKeys.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionDescription.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +43 -43
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditorInput.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/common/actions/chatContextKeys.js +86 -86
- package/vscode/src/vs/workbench/contrib/chat/common/attachments/chatVariableEntries.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatModes.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/customizationHarnessService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/editing/chatEditingService.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/languageModelStats.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/languageModels.js +23 -23
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatModel.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatProgressTypes/chatToolInvocation.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookSchema.js +18 -18
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookTypes.js +20 -20
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptFileAttributes.js +79 -79
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/promptTypes.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/askQuestionsTool.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/manageTodoListTool.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/reviewPlanTool.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactRulesTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactsTool.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +22 -22
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsService.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/widget/input/modelPickerWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.js +11 -11
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/dictation/editorDictation.js +4 -4
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorAccessibilityHelp.js +5 -5
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorHelper.js +3 -3
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.js +10 -10
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/inspectEditorTokens/inspectEditorTokens.js +2 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/largeFileOptimizations.js +3 -3
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess.js +6 -6
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/saveParticipants.js +4 -4
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleMinimap.js +2 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleMultiCursorModifier.js +3 -3
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleRenderControlCharacter.js +2 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleRenderWhitespace.js +12 -12
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleWordWrap.js +5 -5
- package/vscode/src/vs/workbench/contrib/codeEditor/common/languageConfigurationExtensionPoint.js +65 -65
- package/vscode/src/vs/workbench/contrib/comments/browser/commentColors.js +7 -7
- package/vscode/src/vs/workbench/contrib/comments/browser/commentGlyphWidget.js +7 -7
- package/vscode/src/vs/workbench/contrib/comments/browser/commentNode.js +2 -2
- package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +3 -3
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +3 -3
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadHeader.js +3 -3
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsAccessibility.js +12 -12
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +7 -7
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsModel.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +9 -9
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +14 -14
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsViewActions.js +16 -16
- package/vscode/src/vs/workbench/contrib/comments/browser/reactionsAction.js +7 -7
- package/vscode/src/vs/workbench/contrib/comments/common/commentContextKeys.js +12 -12
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorDiffInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInput.js +3 -3
- package/vscode/src/vs/workbench/contrib/debug/browser/baseDebugView.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +29 -29
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointWidget.js +14 -14
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.js +75 -75
- package/vscode/src/vs/workbench/contrib/debug/browser/callStackEditorContribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/debug/browser/debugActionViewItems.js +6 -6
- package/vscode/src/vs/workbench/contrib/debug/browser/debugColors.js +12 -12
- package/vscode/src/vs/workbench/contrib/debug/browser/debugCommands.js +38 -38
- package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorContribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/debug/browser/debugHover.js +3 -3
- package/vscode/src/vs/workbench/contrib/debug/browser/debugIcons.js +57 -57
- package/vscode/src/vs/workbench/contrib/debug/browser/debugSessionPicker.js +3 -3
- package/vscode/src/vs/workbench/contrib/debug/browser/exceptionWidget.js +4 -4
- package/vscode/src/vs/workbench/contrib/debug/browser/linkDetector.js +2 -2
- package/vscode/src/vs/workbench/contrib/debug/browser/repl.js +18 -18
- package/vscode/src/vs/workbench/contrib/debug/browser/replViewer.js +5 -5
- package/vscode/src/vs/workbench/contrib/debug/browser/variablesView.js +9 -9
- package/vscode/src/vs/workbench/contrib/debug/common/abstractDebugAdapter.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/common/debug.js +65 -65
- package/vscode/src/vs/workbench/contrib/debug/common/debugModel.js +6 -6
- package/vscode/src/vs/workbench/contrib/debug/common/debugSource.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/common/disassemblyViewInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/debug/common/loadedScriptsPicker.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/common/replModel.js +1 -1
- package/vscode/src/vs/workbench/contrib/dropOrPasteInto/browser/commands.js +2 -2
- package/vscode/src/vs/workbench/contrib/dropOrPasteInto/browser/configurationSchema.js +4 -4
- package/vscode/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.d.ts +76 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.js +470 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/configBasedRecommendations.d.ts +25 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/configBasedRecommendations.js +83 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/exeBasedRecommendations.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/exeBasedRecommendations.js +66 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionEditor.d.ts +83 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionEditor.js +1353 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionEnablementWorkspaceTrustTransitionParticipant.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionEnablementWorkspaceTrustTransitionParticipant.js +49 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionFeaturesTab.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionFeaturesTab.js +728 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionRecommendationNotificationService.d.ts +63 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionRecommendationNotificationService.js +522 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionRecommendations.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionRecommendations.js +18 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionRecommendationsService.d.ts +71 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionRecommendationsService.js +263 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensions.contribution.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensions.contribution.js +2227 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.js +179 -179
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActivationProgress.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActivationProgress.js +40 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsCompletionItemsProvider.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsCompletionItemsProvider.js +77 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsDependencyChecker.d.ts +16 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsDependencyChecker.js +93 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsIcons.js +25 -25
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsQuickAccess.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsQuickAccess.js +100 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewer.js +7 -7
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.d.ts +151 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.js +1031 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViews.d.ts +235 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViews.js +1600 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWidgets.js +30 -30
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.d.ts +314 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.js +3449 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/fileBasedRecommendations.d.ts +44 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/fileBasedRecommendations.js +368 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/keymapRecommendations.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/keymapRecommendations.js +30 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/languageRecommendations.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/languageRecommendations.js +30 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/media/extensionEditor.css +910 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/media/extensionManagement.css +12 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/media/extensionsViewlet.css +229 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/media/loading-dark.svg +31 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/media/loading-hc.svg +31 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/media/loading.svg +31 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/media/runtimeExtensionsEditor.css +86 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/remoteRecommendations.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/remoteRecommendations.js +38 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/unsupportedExtensionsMigrationContribution.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/unsupportedExtensionsMigrationContribution.js +41 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/webRecommendations.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/webRecommendations.js +38 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/workspaceRecommendations.d.ts +33 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/workspaceRecommendations.js +179 -0
- package/vscode/src/vs/workbench/contrib/extensions/common/extensionQuery.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/extensions/common/extensionQuery.js +90 -0
- package/vscode/src/vs/workbench/contrib/extensions/common/extensions.js +1 -1
- package/vscode/src/vs/workbench/contrib/extensions/common/extensions.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/extensions/common/extensionsFileTemplate.js +5 -5
- package/vscode/src/vs/workbench/contrib/extensions/common/extensionsInput.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/extensions/common/extensionsInput.js +50 -0
- package/vscode/src/vs/workbench/contrib/extensions/common/extensionsUtils.js +3 -3
- package/vscode/src/vs/workbench/contrib/extensions/common/runtimeExtensionsInput.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/extensions/common/runtimeExtensionsInput.js +47 -0
- package/vscode/src/vs/workbench/contrib/extensions/common/searchExtensionsTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/configuration.js +4 -4
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/externalUriOpenerService.js +3 -3
- package/vscode/src/vs/workbench/contrib/files/browser/editors/binaryFileEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditor.js +8 -8
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.js +18 -18
- package/vscode/src/vs/workbench/contrib/files/browser/explorerViewlet.js +14 -14
- package/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.js +39 -39
- package/vscode/src/vs/workbench/contrib/files/browser/fileActions.js +84 -84
- package/vscode/src/vs/workbench/contrib/files/browser/fileCommands._save.js +4 -4
- package/vscode/src/vs/workbench/contrib/files/browser/fileCommands.js +2 -2
- package/vscode/src/vs/workbench/contrib/files/browser/fileConstants.js +6 -6
- package/vscode/src/vs/workbench/contrib/files/browser/fileImportExport.js +28 -28
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution._configuration.js +50 -50
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution._editorPane.js +2 -2
- package/vscode/src/vs/workbench/contrib/files/browser/views/emptyView.js +1 -1
- package/vscode/src/vs/workbench/contrib/files/browser/views/explorerDecorationsProvider.js +4 -4
- package/vscode/src/vs/workbench/contrib/files/browser/views/explorerView.js +7 -7
- package/vscode/src/vs/workbench/contrib/files/browser/views/explorerViewer.js +17 -17
- package/vscode/src/vs/workbench/contrib/files/browser/views/openEditorsView.js +7 -7
- package/vscode/src/vs/workbench/contrib/files/browser/workspaceWatcher.js +4 -4
- package/vscode/src/vs/workbench/contrib/files/common/dirtyFilesIndicator.js +1 -1
- package/vscode/src/vs/workbench/contrib/files/common/files.js +16 -16
- package/vscode/src/vs/workbench/contrib/folding/browser/folding.contribution.js +3 -3
- package/vscode/src/vs/workbench/contrib/format/browser/formatActionsMultiple.js +20 -20
- package/vscode/src/vs/workbench/contrib/format/browser/formatActionsNone.js +4 -4
- package/vscode/src/vs/workbench/contrib/format/browser/formatModified.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlayHints/browser/inlayHintsAccessibilty.js +4 -4
- package/vscode/src/vs/workbench/contrib/list/browser/listResizeColumnAction.js +2 -2
- package/vscode/src/vs/workbench/contrib/list/browser/tableColumnResizeQuickPick.js +5 -5
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpCommandsAddConfiguration.js +66 -66
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerActions.js +40 -40
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpConfiguration.js +42 -42
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServer.js +16 -16
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpTypes.js +4 -4
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +4 -4
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +23 -23
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/mergeEditor/common/mergeEditor.js +8 -8
- package/vscode/src/vs/workbench/contrib/meteredConnection/browser/meteredConnection.contribution.js +8 -8
- package/vscode/src/vs/workbench/contrib/meteredConnection/browser/meteredConnectionStatus.js +4 -4
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/icons.contribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/multiDiffEditorInput.js +3 -3
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/scmMultiDiffSourceResolver.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.js +17 -17
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/coreActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/foldingController.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityProvider.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +24 -24
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookIcons.js +29 -29
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellExecutionIcon.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellRunToolbar.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellOutput.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/foldedCellHint.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/markupCell.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy.js +14 -14
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelView.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookViewZones.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/preferences/browser/keybindingWidgets.js +3 -3
- package/vscode/src/vs/workbench/contrib/preferences/browser/preferencesIcons.js +13 -13
- package/vscode/src/vs/workbench/contrib/preferences/browser/preferencesWidgets.js +10 -10
- package/vscode/src/vs/workbench/contrib/preferences/browser/settingsLayout.js +60 -60
- package/vscode/src/vs/workbench/contrib/preferences/common/preferences.js +3 -3
- package/vscode/src/vs/workbench/contrib/preferences/common/settingsEditorColorRegistry.js +21 -21
- package/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.js +15 -15
- package/vscode/src/vs/workbench/contrib/remote/browser/remoteIcons.js +17 -17
- package/vscode/src/vs/workbench/contrib/remote/browser/tunnelView.js +59 -59
- package/vscode/src/vs/workbench/contrib/scm/browser/scmHistory.js +11 -11
- package/vscode/src/vs/workbench/contrib/scm/browser/scmHistoryChatContext.js +6 -6
- package/vscode/src/vs/workbench/contrib/scm/common/quickDiff.js +14 -14
- package/vscode/src/vs/workbench/contrib/search/browser/anythingQuickAccess.js +9 -9
- package/vscode/src/vs/workbench/contrib/search/browser/patternInputWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsBase.js +1 -1
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsTopBar.js +9 -9
- package/vscode/src/vs/workbench/contrib/search/browser/searchChatContext.js +5 -5
- package/vscode/src/vs/workbench/contrib/search/browser/searchFindInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/search/browser/searchIcons.js +20 -20
- package/vscode/src/vs/workbench/contrib/search/browser/searchMessage.js +2 -2
- package/vscode/src/vs/workbench/contrib/search/browser/searchResultsView.js +14 -14
- package/vscode/src/vs/workbench/contrib/search/browser/searchView.js +55 -55
- package/vscode/src/vs/workbench/contrib/search/browser/searchWidget.js +11 -11
- package/vscode/src/vs/workbench/contrib/search/browser/symbolsQuickAccess.js +2 -2
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorInput.js +4 -4
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorSerialization.js +5 -5
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetCompletionProvider.js +3 -3
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetsFile.js +3 -3
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetsService.js +9 -9
- package/vscode/src/vs/workbench/contrib/speech/common/speechService.js +29 -29
- package/vscode/src/vs/workbench/contrib/tasks/common/constants.js +1 -1
- package/vscode/src/vs/workbench/contrib/tasks/common/taskDefinitionRegistry.js +6 -6
- package/vscode/src/vs/workbench/contrib/tasks/common/taskService.js +6 -6
- package/vscode/src/vs/workbench/contrib/tasks/common/tasks.js +4 -4
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalEditorInput.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalIcons.js +13 -13
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalMenus.js +40 -40
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationStyles.js +15 -15
- package/vscode/src/vs/workbench/contrib/terminal/common/terminal.js +10 -10
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalColorRegistry.js +23 -23
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalContextKey.js +17 -17
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalStrings.js +26 -26
- package/vscode/src/vs/workbench/contrib/terminalContrib/accessibility/common/terminalAccessibilityConfiguration.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/autoReplies/common/terminalAutoRepliesConfiguration.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.js +9 -9
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration.js +72 -72
- package/vscode/src/vs/workbench/contrib/terminalContrib/commandGuide/common/terminalCommandGuideConfiguration.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/history/common/terminal.history.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/inlineHint/common/terminalInitialHintConfiguration.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/notification/common/terminalNotificationConfiguration.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/common/terminalStickyScrollConfiguration.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/suggest/common/terminalSuggestConfiguration.js +30 -30
- package/vscode/src/vs/workbench/contrib/terminalContrib/typeAhead/common/terminalTypeAheadConfiguration.js +5 -5
- package/vscode/src/vs/workbench/contrib/terminalContrib/zoom/common/terminal.zoom.js +2 -2
- package/vscode/src/vs/workbench/contrib/testing/common/constants.js +11 -11
- package/vscode/src/vs/workbench/contrib/testing/common/testResult.js +2 -2
- package/vscode/src/vs/workbench/contrib/testing/common/testTypes.js +3 -3
- package/vscode/src/vs/workbench/contrib/url/browser/trustedDomains.js +6 -6
- package/vscode/src/vs/workbench/contrib/webview/browser/webview.contribution.js +3 -3
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewFindAccessibilityHelp.js +30 -30
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/welcomeOnboarding/common/onboardingTypes.js +14 -14
- package/vscode/src/vs/workbench/contrib/workspace/common/workspace.js +2 -2
- package/vscode/src/vs/workbench/services/accounts/browser/defaultAccount.d.ts +35 -0
- package/vscode/src/vs/workbench/services/accounts/browser/defaultAccount.js +876 -0
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationService.js +11 -11
- package/vscode/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.js +5 -5
- package/vscode/src/vs/workbench/services/chat/common/chatEntitlementService.js +16 -16
- package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverSchema.js +16 -16
- package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverUtils.js +1 -1
- package/vscode/src/vs/workbench/services/configurationResolver/common/variableResolver.js +16 -16
- package/vscode/src/vs/workbench/services/editor/common/editorResolverService.js +2 -2
- package/vscode/src/vs/workbench/services/extensionManagement/common/extensionsIcons.js +3 -3
- package/vscode/src/vs/workbench/services/extensionRecommendations/common/workspaceExtensionsConfig.js +6 -6
- package/vscode/src/vs/workbench/services/extensions/browser/extensionUrlHandler.js +10 -10
- package/vscode/src/vs/workbench/services/extensions/common/extensionsRegistry.js +88 -88
- package/vscode/src/vs/workbench/services/filesConfiguration/common/filesConfigurationService.js +5 -5
- package/vscode/src/vs/workbench/services/language/common/languageService.js +24 -24
- package/vscode/src/vs/workbench/services/log/common/logConstants.js +1 -1
- package/vscode/src/vs/workbench/services/policies/common/accountPolicyService.js +1 -1
- package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorInput.js +2 -2
- package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorModel.js +7 -7
- package/vscode/src/vs/workbench/services/preferences/common/preferencesEditorInput.js +4 -4
- package/vscode/src/vs/workbench/services/preferences/common/preferencesModels.js +2 -2
- package/vscode/src/vs/workbench/services/preferences/common/preferencesValidation.js +30 -30
- package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.js +8 -8
- package/vscode/src/vs/workbench/services/remote/common/tunnelModel.js +6 -6
- package/vscode/src/vs/workbench/services/search/common/queryBuilder.js +1 -1
- package/vscode/src/vs/workbench/services/textMate/common/TMGrammars.js +9 -9
- package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModel.js +3 -3
- package/vscode/src/vs/workbench/services/themes/common/colorExtensionPoint.js +18 -18
- package/vscode/src/vs/workbench/services/themes/common/colorThemeData.js +8 -8
- package/vscode/src/vs/workbench/services/themes/common/iconExtensionPoint.js +13 -13
- package/vscode/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.js +24 -24
- package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfile.js +3 -3
- package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfileIcons.js +1 -1
- package/vscode/src/vs/workbench/services/userDataSync/common/userDataSync.js +13 -13
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopy.js +16 -16
|
@@ -0,0 +1,1600 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
3
|
+
import { localize } from '../../../../nls.js';
|
|
4
|
+
import { Disposable, DisposableStore, toDisposable } from '../../../../base/common/lifecycle.js';
|
|
5
|
+
import { Emitter, Event } from '../../../../base/common/event.js';
|
|
6
|
+
import { isCancellationError, getErrorMessage, CancellationError } from '../../../../base/common/errors.js';
|
|
7
|
+
import { PagedModel, DelayedPagedModel } from '../../../../base/common/paging.js';
|
|
8
|
+
import { SortOrder, SortBy, ExtensionGalleryError, ExtensionGalleryErrorCode } from '../../../../platform/extensionManagement/common/extensionManagement.js';
|
|
9
|
+
import { EnablementState } from '../../../services/extensionManagement/common/extensionManagement.js';
|
|
10
|
+
import { IExtensionManagementServerService, IWorkbenchExtensionManagementService, IWorkbenchExtensionEnablementService } from '../../../services/extensionManagement/common/extensionManagement.service.js';
|
|
11
|
+
import { IExtensionRecommendationsService } from '../../../services/extensionRecommendations/common/extensionRecommendations.service.js';
|
|
12
|
+
import { areSameExtensions, getExtensionDependencies } from '../../../../platform/extensionManagement/common/extensionManagementUtil.js';
|
|
13
|
+
import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.service.js';
|
|
14
|
+
import { IContextMenuService } from '../../../../platform/contextview/browser/contextView.service.js';
|
|
15
|
+
import { append, $ } from '../../../../base/browser/dom.js';
|
|
16
|
+
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
|
|
17
|
+
import { ExtensionResultsListFocused, ExtensionState } from '../common/extensions.js';
|
|
18
|
+
import { IExtensionsWorkbenchService } from '../common/extensions.service.js';
|
|
19
|
+
import { Query } from '../common/extensionQuery.js';
|
|
20
|
+
import { toExtension } from '../../../services/extensions/common/extensions.js';
|
|
21
|
+
import { IExtensionService } from '../../../services/extensions/common/extensions.service.js';
|
|
22
|
+
import { IThemeService } from '../../../../platform/theme/common/themeService.service.js';
|
|
23
|
+
import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.service.js';
|
|
24
|
+
import { CountBadge } from '../../../../base/browser/ui/countBadge/countBadge.js';
|
|
25
|
+
import { IConfigurationService } from '../../../../platform/configuration/common/configuration.service.js';
|
|
26
|
+
import '../../../../platform/notification/common/notification.js';
|
|
27
|
+
import { INotificationService } from '../../../../platform/notification/common/notification.service.js';
|
|
28
|
+
import { ViewPane, ViewPaneShowActions } from '../../../browser/parts/views/viewPane.js';
|
|
29
|
+
import { IWorkspaceContextService } from '../../../../platform/workspace/common/workspace.service.js';
|
|
30
|
+
import { coalesce, distinct, range } from '../../../../base/common/arrays.js';
|
|
31
|
+
import { alert } from '../../../../base/browser/ui/aria/aria.js';
|
|
32
|
+
import { CancellationToken, CancellationTokenSource } from '../../../../base/common/cancellation.js';
|
|
33
|
+
import { ActionRunner } from '../../../../base/common/actions.js';
|
|
34
|
+
import { ExtensionIdentifierMap, isLanguagePackExtension, ExtensionIdentifier } from '../../../../platform/extensions/common/extensions.js';
|
|
35
|
+
import { createCancelablePromise, ThrottledDelayer } from '../../../../base/common/async.js';
|
|
36
|
+
import { IProductService } from '../../../../platform/product/common/productService.service.js';
|
|
37
|
+
import { SeverityIcon } from '../../../../base/browser/ui/severityIcon/severityIcon.js';
|
|
38
|
+
import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.service.js';
|
|
39
|
+
import { IViewDescriptorService } from '../../../common/views.service.js';
|
|
40
|
+
import { IOpenerService } from '../../../../platform/opener/common/opener.service.js';
|
|
41
|
+
import { StorageScope, StorageTarget } from '../../../../platform/storage/common/storage.js';
|
|
42
|
+
import { IStorageService } from '../../../../platform/storage/common/storage.service.js';
|
|
43
|
+
import { IExtensionManifestPropertiesService } from '../../../services/extensions/common/extensionManifestPropertiesService.service.js';
|
|
44
|
+
import { isVirtualWorkspace } from '../../../../platform/workspace/common/virtualWorkspace.js';
|
|
45
|
+
import { IWorkspaceTrustManagementService } from '../../../../platform/workspace/common/workspaceTrust.service.js';
|
|
46
|
+
import { ILogService } from '../../../../platform/log/common/log.service.js';
|
|
47
|
+
import { isOfflineError } from '../../../../base/parts/request/common/request.js';
|
|
48
|
+
import { defaultCountBadgeStyles } from '../../../../platform/theme/browser/defaultStyles.js';
|
|
49
|
+
import { Registry } from '../../../../platform/registry/common/platform.js';
|
|
50
|
+
import { Extensions } from '../../../services/extensionManagement/common/extensionFeatures.js';
|
|
51
|
+
import { IExtensionFeaturesManagementService } from '../../../services/extensionManagement/common/extensionFeatures.service.js';
|
|
52
|
+
import { isString } from '../../../../base/common/types.js';
|
|
53
|
+
import { IUriIdentityService } from '../../../../platform/uriIdentity/common/uriIdentity.service.js';
|
|
54
|
+
import { IHoverService } from '../../../../platform/hover/browser/hover.service.js';
|
|
55
|
+
import { ExtensionsList } from './extensionsViewer.js';
|
|
56
|
+
import Severity$1 from '../../../../base/common/severity.js';
|
|
57
|
+
|
|
58
|
+
var ExtensionsListView_1;
|
|
59
|
+
const NONE_CATEGORY = "none";
|
|
60
|
+
class ExtensionsViewState extends Disposable {
|
|
61
|
+
constructor() {
|
|
62
|
+
super(...arguments);
|
|
63
|
+
this._onFocus = this._register(( new Emitter()));
|
|
64
|
+
this.onFocus = this._onFocus.event;
|
|
65
|
+
this._onBlur = this._register(( new Emitter()));
|
|
66
|
+
this.onBlur = this._onBlur.event;
|
|
67
|
+
this.currentlyFocusedItems = [];
|
|
68
|
+
this.filters = {};
|
|
69
|
+
}
|
|
70
|
+
onFocusChange(extensions) {
|
|
71
|
+
this.currentlyFocusedItems.forEach(extension => this._onBlur.fire(extension));
|
|
72
|
+
this.currentlyFocusedItems = extensions;
|
|
73
|
+
this.currentlyFocusedItems.forEach(extension => this._onFocus.fire(extension));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
var LocalSortBy;
|
|
77
|
+
(function(LocalSortBy) {
|
|
78
|
+
LocalSortBy["UpdateDate"] = "UpdateDate";
|
|
79
|
+
})(LocalSortBy || (LocalSortBy = {}));
|
|
80
|
+
function isLocalSortBy(value) {
|
|
81
|
+
switch (value) {
|
|
82
|
+
case LocalSortBy.UpdateDate:
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
class AbstractExtensionsListView extends ViewPane {}
|
|
87
|
+
let ExtensionsListView = class ExtensionsListView extends AbstractExtensionsListView {
|
|
88
|
+
static {
|
|
89
|
+
ExtensionsListView_1 = this;
|
|
90
|
+
}
|
|
91
|
+
static {
|
|
92
|
+
this.RECENT_UPDATE_DURATION = 7 * 24 * 60 * 60 * 1000;
|
|
93
|
+
}
|
|
94
|
+
constructor(
|
|
95
|
+
options,
|
|
96
|
+
viewletViewOptions,
|
|
97
|
+
notificationService,
|
|
98
|
+
keybindingService,
|
|
99
|
+
contextMenuService,
|
|
100
|
+
instantiationService,
|
|
101
|
+
themeService,
|
|
102
|
+
extensionService,
|
|
103
|
+
extensionsWorkbenchService,
|
|
104
|
+
extensionRecommendationsService,
|
|
105
|
+
telemetryService,
|
|
106
|
+
hoverService,
|
|
107
|
+
configurationService,
|
|
108
|
+
contextService,
|
|
109
|
+
extensionManagementServerService,
|
|
110
|
+
extensionManifestPropertiesService,
|
|
111
|
+
extensionManagementService,
|
|
112
|
+
workspaceService,
|
|
113
|
+
productService,
|
|
114
|
+
contextKeyService,
|
|
115
|
+
viewDescriptorService,
|
|
116
|
+
openerService,
|
|
117
|
+
storageService,
|
|
118
|
+
workspaceTrustManagementService,
|
|
119
|
+
extensionEnablementService,
|
|
120
|
+
extensionFeaturesManagementService,
|
|
121
|
+
uriIdentityService,
|
|
122
|
+
logService
|
|
123
|
+
) {
|
|
124
|
+
super({
|
|
125
|
+
...viewletViewOptions,
|
|
126
|
+
showActions: ViewPaneShowActions.Always,
|
|
127
|
+
maximumBodySize: options.flexibleHeight ? (storageService.getNumber(`${viewletViewOptions.id}.size`, StorageScope.PROFILE, 0) ? undefined : 0) : undefined
|
|
128
|
+
}, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, hoverService);
|
|
129
|
+
this.options = options;
|
|
130
|
+
this.notificationService = notificationService;
|
|
131
|
+
this.extensionService = extensionService;
|
|
132
|
+
this.extensionsWorkbenchService = extensionsWorkbenchService;
|
|
133
|
+
this.extensionRecommendationsService = extensionRecommendationsService;
|
|
134
|
+
this.telemetryService = telemetryService;
|
|
135
|
+
this.contextService = contextService;
|
|
136
|
+
this.extensionManagementServerService = extensionManagementServerService;
|
|
137
|
+
this.extensionManifestPropertiesService = extensionManifestPropertiesService;
|
|
138
|
+
this.extensionManagementService = extensionManagementService;
|
|
139
|
+
this.workspaceService = workspaceService;
|
|
140
|
+
this.productService = productService;
|
|
141
|
+
this.storageService = storageService;
|
|
142
|
+
this.workspaceTrustManagementService = workspaceTrustManagementService;
|
|
143
|
+
this.extensionEnablementService = extensionEnablementService;
|
|
144
|
+
this.extensionFeaturesManagementService = extensionFeaturesManagementService;
|
|
145
|
+
this.uriIdentityService = uriIdentityService;
|
|
146
|
+
this.logService = logService;
|
|
147
|
+
this.list = null;
|
|
148
|
+
this.queryRequest = null;
|
|
149
|
+
this.contextMenuActionRunner = this._register(( new ActionRunner()));
|
|
150
|
+
if (this.options.onDidChangeTitle) {
|
|
151
|
+
this._register(this.options.onDidChangeTitle(title => this.updateTitle(title)));
|
|
152
|
+
}
|
|
153
|
+
this._register(this.contextMenuActionRunner.onDidRun((
|
|
154
|
+
{
|
|
155
|
+
error
|
|
156
|
+
}
|
|
157
|
+
) => error && this.notificationService.error(error)));
|
|
158
|
+
this.registerActions();
|
|
159
|
+
}
|
|
160
|
+
registerActions() {}
|
|
161
|
+
renderHeader(container) {
|
|
162
|
+
container.classList.add("extension-view-header");
|
|
163
|
+
super.renderHeader(container);
|
|
164
|
+
if (!this.options.hideBadge) {
|
|
165
|
+
this.badge = this._register(( new CountBadge(append(container, $(".count-badge-wrapper")), {}, defaultCountBadgeStyles)));
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
renderBody(container) {
|
|
169
|
+
super.renderBody(container);
|
|
170
|
+
const messageContainer = append(container, $(".message-container"));
|
|
171
|
+
const messageSeverityIcon = append(messageContainer, $(""));
|
|
172
|
+
const messageBox = append(messageContainer, $(".message"));
|
|
173
|
+
const extensionsList = append(container, $(".extensions-list"));
|
|
174
|
+
this.extensionsViewState = this._register(( new ExtensionsViewState()));
|
|
175
|
+
this.list = this._register(
|
|
176
|
+
this.instantiationService.createInstance(ExtensionsList, extensionsList, this.id, {}, this.extensionsViewState)
|
|
177
|
+
).list;
|
|
178
|
+
ExtensionResultsListFocused.bindTo(this.list.contextKeyService);
|
|
179
|
+
this._register(
|
|
180
|
+
this.list.onDidChangeFocus(e => this.extensionsViewState?.onFocusChange(coalesce(e.elements)), this)
|
|
181
|
+
);
|
|
182
|
+
this.bodyTemplate = {
|
|
183
|
+
extensionsList,
|
|
184
|
+
messageBox,
|
|
185
|
+
messageContainer,
|
|
186
|
+
messageSeverityIcon
|
|
187
|
+
};
|
|
188
|
+
if (this.queryResult) {
|
|
189
|
+
this.setModel(this.queryResult.model);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
layoutBody(height, width) {
|
|
193
|
+
super.layoutBody(height, width);
|
|
194
|
+
if (this.bodyTemplate) {
|
|
195
|
+
this.bodyTemplate.extensionsList.style.height = height + "px";
|
|
196
|
+
}
|
|
197
|
+
this.list?.layout(height, width);
|
|
198
|
+
}
|
|
199
|
+
async show(query, refresh) {
|
|
200
|
+
if (this.queryRequest) {
|
|
201
|
+
if (!refresh && this.queryRequest.query === query) {
|
|
202
|
+
return this.queryRequest.request;
|
|
203
|
+
}
|
|
204
|
+
this.queryRequest.request.cancel();
|
|
205
|
+
this.queryRequest = null;
|
|
206
|
+
}
|
|
207
|
+
if (this.queryResult) {
|
|
208
|
+
this.queryResult.disposables.dispose();
|
|
209
|
+
this.queryResult = undefined;
|
|
210
|
+
if (this.extensionsViewState) {
|
|
211
|
+
this.extensionsViewState.filters = {};
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
const parsedQuery = Query.parse(query);
|
|
215
|
+
const options = {
|
|
216
|
+
sortOrder: SortOrder.Default
|
|
217
|
+
};
|
|
218
|
+
switch (parsedQuery.sortBy) {
|
|
219
|
+
case "installs":
|
|
220
|
+
options.sortBy = SortBy.InstallCount;
|
|
221
|
+
break;
|
|
222
|
+
case "rating":
|
|
223
|
+
options.sortBy = SortBy.WeightedRating;
|
|
224
|
+
break;
|
|
225
|
+
case "name":
|
|
226
|
+
options.sortBy = SortBy.Title;
|
|
227
|
+
break;
|
|
228
|
+
case "publishedDate":
|
|
229
|
+
options.sortBy = SortBy.PublishedDate;
|
|
230
|
+
break;
|
|
231
|
+
case "updateDate":
|
|
232
|
+
options.sortBy = LocalSortBy.UpdateDate;
|
|
233
|
+
break;
|
|
234
|
+
}
|
|
235
|
+
const request = createCancelablePromise(async token => {
|
|
236
|
+
try {
|
|
237
|
+
this.queryResult = await this.query(parsedQuery, options, token);
|
|
238
|
+
const model = this.queryResult.model;
|
|
239
|
+
this.setModel(model, this.queryResult.message);
|
|
240
|
+
if (this.queryResult.onDidChangeModel) {
|
|
241
|
+
this.queryResult.disposables.add(this.queryResult.onDidChangeModel(model => {
|
|
242
|
+
if (this.queryResult) {
|
|
243
|
+
this.queryResult.model = model;
|
|
244
|
+
this.updateModel(model);
|
|
245
|
+
}
|
|
246
|
+
}));
|
|
247
|
+
}
|
|
248
|
+
return model;
|
|
249
|
+
} catch (e) {
|
|
250
|
+
const model = ( new PagedModel([]));
|
|
251
|
+
if (!isCancellationError(e)) {
|
|
252
|
+
this.logService.error(e);
|
|
253
|
+
this.setModel(model, this.getMessage(e));
|
|
254
|
+
}
|
|
255
|
+
return this.list ? this.list.model : model;
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
request.finally(() => this.queryRequest = null);
|
|
259
|
+
this.queryRequest = {
|
|
260
|
+
query,
|
|
261
|
+
request
|
|
262
|
+
};
|
|
263
|
+
return request;
|
|
264
|
+
}
|
|
265
|
+
count() {
|
|
266
|
+
return this.queryResult?.model.length ?? 0;
|
|
267
|
+
}
|
|
268
|
+
showEmptyModel() {
|
|
269
|
+
const emptyModel = ( new PagedModel([]));
|
|
270
|
+
this.setModel(emptyModel);
|
|
271
|
+
return Promise.resolve(emptyModel);
|
|
272
|
+
}
|
|
273
|
+
async query(query, options, token) {
|
|
274
|
+
const idRegex = /@id:(([a-z0-9A-Z][a-z0-9\-A-Z]*)\.([a-z0-9A-Z][a-z0-9\-A-Z]*))/g;
|
|
275
|
+
const ids = [];
|
|
276
|
+
let idMatch;
|
|
277
|
+
while ((idMatch = idRegex.exec(query.value)) !== null) {
|
|
278
|
+
const name = idMatch[1];
|
|
279
|
+
ids.push(name);
|
|
280
|
+
}
|
|
281
|
+
if (ids.length) {
|
|
282
|
+
const model = await this.queryByIds(ids, options, token);
|
|
283
|
+
return {
|
|
284
|
+
model,
|
|
285
|
+
disposables: ( new DisposableStore())
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
if (ExtensionsListView_1.isLocalExtensionsQuery(query.value, query.sortBy)) {
|
|
289
|
+
return this.queryLocal(query, options);
|
|
290
|
+
}
|
|
291
|
+
if (ExtensionsListView_1.isSearchPopularQuery(query.value)) {
|
|
292
|
+
query.value = query.value.replace("@popular", "");
|
|
293
|
+
options.sortBy = !options.sortBy ? SortBy.InstallCount : options.sortBy;
|
|
294
|
+
} else if (ExtensionsListView_1.isSearchRecentlyPublishedQuery(query.value)) {
|
|
295
|
+
query.value = query.value.replace("@recentlyPublished", "");
|
|
296
|
+
options.sortBy = !options.sortBy ? SortBy.PublishedDate : options.sortBy;
|
|
297
|
+
}
|
|
298
|
+
const galleryQueryOptions = {
|
|
299
|
+
...options,
|
|
300
|
+
sortBy: isLocalSortBy(options.sortBy) ? undefined : options.sortBy
|
|
301
|
+
};
|
|
302
|
+
return this.queryGallery(query, galleryQueryOptions, token);
|
|
303
|
+
}
|
|
304
|
+
async queryByIds(ids, options, token) {
|
|
305
|
+
const idsSet = ids.reduce((result, id) => {
|
|
306
|
+
result.add(id.toLowerCase());
|
|
307
|
+
return result;
|
|
308
|
+
}, ( new Set()));
|
|
309
|
+
const result = (await this.extensionsWorkbenchService.queryLocal(this.options.server)).filter(e => ( idsSet.has(e.identifier.id.toLowerCase())));
|
|
310
|
+
const galleryIds = result.length ? ids.filter(id => result.every(r => !areSameExtensions(r.identifier, {
|
|
311
|
+
id
|
|
312
|
+
}))) : ids;
|
|
313
|
+
if (galleryIds.length) {
|
|
314
|
+
const galleryResult = await this.extensionsWorkbenchService.getExtensions(( galleryIds.map(id => ({
|
|
315
|
+
id
|
|
316
|
+
}))), {
|
|
317
|
+
source: "queryById"
|
|
318
|
+
}, token);
|
|
319
|
+
result.push(...galleryResult);
|
|
320
|
+
}
|
|
321
|
+
return ( new PagedModel(result));
|
|
322
|
+
}
|
|
323
|
+
async queryLocal(query, options) {
|
|
324
|
+
const local = await this.extensionsWorkbenchService.queryLocal(this.options.server);
|
|
325
|
+
let {
|
|
326
|
+
extensions,
|
|
327
|
+
canIncludeInstalledExtensions,
|
|
328
|
+
description
|
|
329
|
+
} = await this.filterLocal(local, this.extensionService.extensions, query, options);
|
|
330
|
+
const disposables = ( new DisposableStore());
|
|
331
|
+
const onDidChangeModel = disposables.add(( new Emitter()));
|
|
332
|
+
if (canIncludeInstalledExtensions) {
|
|
333
|
+
let isDisposed = false;
|
|
334
|
+
disposables.add(toDisposable(() => isDisposed = true));
|
|
335
|
+
disposables.add(Event.debounce(Event.any(Event.filter(
|
|
336
|
+
this.extensionsWorkbenchService.onChange,
|
|
337
|
+
e => e?.state === ExtensionState.Installed
|
|
338
|
+
), this.extensionService.onDidChangeExtensions), () => undefined)(async () => {
|
|
339
|
+
const local = this.options.server ? this.extensionsWorkbenchService.installed.filter(e => e.server === this.options.server) : this.extensionsWorkbenchService.local;
|
|
340
|
+
const {
|
|
341
|
+
extensions: newExtensions
|
|
342
|
+
} = await this.filterLocal(local, this.extensionService.extensions, query, options);
|
|
343
|
+
if (!isDisposed) {
|
|
344
|
+
const mergedExtensions = this.mergeAddedExtensions(extensions, newExtensions);
|
|
345
|
+
if (mergedExtensions) {
|
|
346
|
+
extensions = mergedExtensions;
|
|
347
|
+
onDidChangeModel.fire(( new PagedModel(extensions)));
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}));
|
|
351
|
+
}
|
|
352
|
+
return {
|
|
353
|
+
model: ( new PagedModel(extensions)),
|
|
354
|
+
message: description ? {
|
|
355
|
+
text: description,
|
|
356
|
+
severity: Severity$1.Info
|
|
357
|
+
} : undefined,
|
|
358
|
+
onDidChangeModel: onDidChangeModel.event,
|
|
359
|
+
disposables
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
async filterLocal(local, runningExtensions, query, options) {
|
|
363
|
+
const value = query.value;
|
|
364
|
+
let extensions = [];
|
|
365
|
+
let description;
|
|
366
|
+
const includeBuiltin = /@builtin/i.test(value);
|
|
367
|
+
const canIncludeInstalledExtensions = !includeBuiltin;
|
|
368
|
+
if (/@installed/i.test(value)) {
|
|
369
|
+
extensions = this.filterInstalledExtensions(local, runningExtensions, query, options);
|
|
370
|
+
} else if (/@outdated/i.test(value)) {
|
|
371
|
+
extensions = this.filterOutdatedExtensions(local, query, options);
|
|
372
|
+
} else if (/@disabled/i.test(value)) {
|
|
373
|
+
extensions = this.filterDisabledExtensions(local, runningExtensions, query, options, includeBuiltin);
|
|
374
|
+
} else if (/@enabled/i.test(value)) {
|
|
375
|
+
extensions = this.filterEnabledExtensions(local, runningExtensions, query, options, includeBuiltin);
|
|
376
|
+
} else if (/@workspaceUnsupported/i.test(value)) {
|
|
377
|
+
extensions = this.filterWorkspaceUnsupportedExtensions(local, query, options);
|
|
378
|
+
} else if (/@deprecated/i.test(query.value)) {
|
|
379
|
+
extensions = await this.filterDeprecatedExtensions(local, query, options);
|
|
380
|
+
} else if (/@recentlyUpdated/i.test(query.value)) {
|
|
381
|
+
extensions = this.filterRecentlyUpdatedExtensions(local, query, options);
|
|
382
|
+
} else if (/@restartrequired/i.test(query.value)) {
|
|
383
|
+
extensions = this.filterRestartRequiredExtensions(local, query, options);
|
|
384
|
+
} else if (/@contribute:/i.test(query.value)) {
|
|
385
|
+
extensions = this.filterExtensionsByFeature(local, query);
|
|
386
|
+
} else if (includeBuiltin) {
|
|
387
|
+
extensions = this.filterBuiltinExtensions(local, query, options);
|
|
388
|
+
}
|
|
389
|
+
return {
|
|
390
|
+
extensions,
|
|
391
|
+
canIncludeInstalledExtensions,
|
|
392
|
+
description
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
filterBuiltinExtensions(local, query, options) {
|
|
396
|
+
let {
|
|
397
|
+
value,
|
|
398
|
+
includedCategories,
|
|
399
|
+
excludedCategories
|
|
400
|
+
} = this.parseCategories(query.value);
|
|
401
|
+
value = value.replaceAll(/@builtin/gi, "").replaceAll(/@sort:(\w+)(-\w*)?/g, "").trim().toLowerCase();
|
|
402
|
+
const result = local.filter(
|
|
403
|
+
e => e.isBuiltin && (e.name.toLowerCase().indexOf(value) > -1 || e.displayName.toLowerCase().indexOf(value) > -1) && this.filterExtensionByCategory(e, includedCategories, excludedCategories)
|
|
404
|
+
);
|
|
405
|
+
return this.sortExtensions(result, options);
|
|
406
|
+
}
|
|
407
|
+
filterExtensionByCategory(e, includedCategories, excludedCategories) {
|
|
408
|
+
if (!includedCategories.length && !excludedCategories.length) {
|
|
409
|
+
return true;
|
|
410
|
+
}
|
|
411
|
+
if (e.categories.length) {
|
|
412
|
+
if (excludedCategories.length && ( e.categories.some(category => excludedCategories.includes(category.toLowerCase())))) {
|
|
413
|
+
return false;
|
|
414
|
+
}
|
|
415
|
+
return ( e.categories.some(category => includedCategories.includes(category.toLowerCase())));
|
|
416
|
+
} else {
|
|
417
|
+
return includedCategories.includes(NONE_CATEGORY);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
parseCategories(value) {
|
|
421
|
+
const includedCategories = [];
|
|
422
|
+
const excludedCategories = [];
|
|
423
|
+
value = value.replace(
|
|
424
|
+
/\bcategory:("([^"]*)"|([^"]\S*))(\s+|\b|$)/g,
|
|
425
|
+
(_, quotedCategory, category) => {
|
|
426
|
+
const entry = (category || quotedCategory || "").toLowerCase();
|
|
427
|
+
if (entry.startsWith("-")) {
|
|
428
|
+
if (excludedCategories.indexOf(entry) === -1) {
|
|
429
|
+
excludedCategories.push(entry);
|
|
430
|
+
}
|
|
431
|
+
} else {
|
|
432
|
+
if (includedCategories.indexOf(entry) === -1) {
|
|
433
|
+
includedCategories.push(entry);
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
return "";
|
|
437
|
+
}
|
|
438
|
+
);
|
|
439
|
+
return {
|
|
440
|
+
value,
|
|
441
|
+
includedCategories,
|
|
442
|
+
excludedCategories
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
filterInstalledExtensions(local, runningExtensions, query, options) {
|
|
446
|
+
let {
|
|
447
|
+
value,
|
|
448
|
+
includedCategories,
|
|
449
|
+
excludedCategories
|
|
450
|
+
} = this.parseCategories(query.value);
|
|
451
|
+
value = value.replace(/@installed/g, "").replace(/@sort:(\w+)(-\w*)?/g, "").trim().toLowerCase();
|
|
452
|
+
const matchingText = e => (e.name.toLowerCase().indexOf(value) > -1 || e.displayName.toLowerCase().indexOf(value) > -1 || e.description.toLowerCase().indexOf(value) > -1) && this.filterExtensionByCategory(e, includedCategories, excludedCategories);
|
|
453
|
+
let result;
|
|
454
|
+
if (options.sortBy !== undefined) {
|
|
455
|
+
result = local.filter(e => !e.isBuiltin && matchingText(e));
|
|
456
|
+
result = this.sortExtensions(result, options);
|
|
457
|
+
} else {
|
|
458
|
+
result = local.filter(
|
|
459
|
+
e => (!e.isBuiltin || e.outdated || e.runtimeState !== undefined) && matchingText(e)
|
|
460
|
+
);
|
|
461
|
+
const runningExtensionsById = runningExtensions.reduce((result, e) => {
|
|
462
|
+
result.set(e.identifier.value, e);
|
|
463
|
+
return result;
|
|
464
|
+
}, ( new ExtensionIdentifierMap()));
|
|
465
|
+
const defaultSort = (e1, e2) => {
|
|
466
|
+
const running1 = runningExtensionsById.get(e1.identifier.id);
|
|
467
|
+
const isE1Running = !!running1 && this.extensionManagementServerService.getExtensionManagementServer(toExtension(running1)) === e1.server;
|
|
468
|
+
const running2 = runningExtensionsById.get(e2.identifier.id);
|
|
469
|
+
const isE2Running = running2 && this.extensionManagementServerService.getExtensionManagementServer(toExtension(running2)) === e2.server;
|
|
470
|
+
if ((isE1Running && isE2Running)) {
|
|
471
|
+
return e1.displayName.localeCompare(e2.displayName);
|
|
472
|
+
}
|
|
473
|
+
const isE1LanguagePackExtension = e1.local && isLanguagePackExtension(e1.local.manifest);
|
|
474
|
+
const isE2LanguagePackExtension = e2.local && isLanguagePackExtension(e2.local.manifest);
|
|
475
|
+
if (!isE1Running && !isE2Running) {
|
|
476
|
+
if (isE1LanguagePackExtension) {
|
|
477
|
+
return -1;
|
|
478
|
+
}
|
|
479
|
+
if (isE2LanguagePackExtension) {
|
|
480
|
+
return 1;
|
|
481
|
+
}
|
|
482
|
+
return e1.displayName.localeCompare(e2.displayName);
|
|
483
|
+
}
|
|
484
|
+
if ((isE1Running && isE2LanguagePackExtension) || (isE2Running && isE1LanguagePackExtension)) {
|
|
485
|
+
return e1.displayName.localeCompare(e2.displayName);
|
|
486
|
+
}
|
|
487
|
+
return isE1Running ? -1 : 1;
|
|
488
|
+
};
|
|
489
|
+
const incompatible = [];
|
|
490
|
+
const deprecated = [];
|
|
491
|
+
const outdated = [];
|
|
492
|
+
const actionRequired = [];
|
|
493
|
+
const noActionRequired = [];
|
|
494
|
+
for (const e of result) {
|
|
495
|
+
if (e.enablementState === EnablementState.DisabledByInvalidExtension) {
|
|
496
|
+
incompatible.push(e);
|
|
497
|
+
} else if (e.deprecationInfo) {
|
|
498
|
+
deprecated.push(e);
|
|
499
|
+
} else if (e.outdated && this.extensionEnablementService.isEnabledEnablementState(e.enablementState)) {
|
|
500
|
+
outdated.push(e);
|
|
501
|
+
} else if (e.runtimeState) {
|
|
502
|
+
actionRequired.push(e);
|
|
503
|
+
} else {
|
|
504
|
+
noActionRequired.push(e);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
result = [
|
|
508
|
+
...incompatible.sort(defaultSort),
|
|
509
|
+
...deprecated.sort(defaultSort),
|
|
510
|
+
...outdated.sort(defaultSort),
|
|
511
|
+
...actionRequired.sort(defaultSort),
|
|
512
|
+
...noActionRequired.sort(defaultSort)
|
|
513
|
+
];
|
|
514
|
+
}
|
|
515
|
+
return result;
|
|
516
|
+
}
|
|
517
|
+
filterOutdatedExtensions(local, query, options) {
|
|
518
|
+
let {
|
|
519
|
+
value,
|
|
520
|
+
includedCategories,
|
|
521
|
+
excludedCategories
|
|
522
|
+
} = this.parseCategories(query.value);
|
|
523
|
+
value = value.replace(/@outdated/g, "").replace(/@sort:(\w+)(-\w*)?/g, "").trim().toLowerCase();
|
|
524
|
+
const result = local.sort((e1, e2) => e1.displayName.localeCompare(e2.displayName)).filter(
|
|
525
|
+
extension => extension.outdated && (extension.name.toLowerCase().indexOf(value) > -1 || extension.displayName.toLowerCase().indexOf(value) > -1) && this.filterExtensionByCategory(extension, includedCategories, excludedCategories)
|
|
526
|
+
);
|
|
527
|
+
return this.sortExtensions(result, options);
|
|
528
|
+
}
|
|
529
|
+
filterDisabledExtensions(local, runningExtensions, query, options, includeBuiltin) {
|
|
530
|
+
let {
|
|
531
|
+
value,
|
|
532
|
+
includedCategories,
|
|
533
|
+
excludedCategories
|
|
534
|
+
} = this.parseCategories(query.value);
|
|
535
|
+
value = value.replaceAll(/@disabled|@builtin/gi, "").replaceAll(/@sort:(\w+)(-\w*)?/g, "").trim().toLowerCase();
|
|
536
|
+
if (includeBuiltin) {
|
|
537
|
+
local = local.filter(e => e.isBuiltin);
|
|
538
|
+
}
|
|
539
|
+
const result = local.sort((e1, e2) => e1.displayName.localeCompare(e2.displayName)).filter(e => runningExtensions.every(r => !areSameExtensions({
|
|
540
|
+
id: r.identifier.value,
|
|
541
|
+
uuid: r.uuid
|
|
542
|
+
}, e.identifier)) && (e.name.toLowerCase().indexOf(value) > -1 || e.displayName.toLowerCase().indexOf(value) > -1) && this.filterExtensionByCategory(e, includedCategories, excludedCategories));
|
|
543
|
+
return this.sortExtensions(result, options);
|
|
544
|
+
}
|
|
545
|
+
filterEnabledExtensions(local, runningExtensions, query, options, includeBuiltin) {
|
|
546
|
+
let {
|
|
547
|
+
value,
|
|
548
|
+
includedCategories,
|
|
549
|
+
excludedCategories
|
|
550
|
+
} = this.parseCategories(query.value);
|
|
551
|
+
value = value ? value.replaceAll(/@enabled|@builtin/gi, "").replaceAll(/@sort:(\w+)(-\w*)?/g, "").trim().toLowerCase() : "";
|
|
552
|
+
local = local.filter(e => e.isBuiltin === includeBuiltin);
|
|
553
|
+
const result = local.sort((e1, e2) => e1.displayName.localeCompare(e2.displayName)).filter(e => ( runningExtensions.some(r => areSameExtensions({
|
|
554
|
+
id: r.identifier.value,
|
|
555
|
+
uuid: r.uuid
|
|
556
|
+
}, e.identifier))) && (e.name.toLowerCase().indexOf(value) > -1 || e.displayName.toLowerCase().indexOf(value) > -1) && this.filterExtensionByCategory(e, includedCategories, excludedCategories));
|
|
557
|
+
return this.sortExtensions(result, options);
|
|
558
|
+
}
|
|
559
|
+
filterWorkspaceUnsupportedExtensions(local, query, options) {
|
|
560
|
+
const queryString = query.value;
|
|
561
|
+
const match = queryString.match(
|
|
562
|
+
/^\s*@workspaceUnsupported(?::(untrusted|virtual)(Partial)?)?(?:\s+([^\s]*))?/i
|
|
563
|
+
);
|
|
564
|
+
if (!match) {
|
|
565
|
+
return [];
|
|
566
|
+
}
|
|
567
|
+
const type = match[1]?.toLowerCase();
|
|
568
|
+
const partial = !!match[2];
|
|
569
|
+
const nameFilter = match[3]?.toLowerCase();
|
|
570
|
+
if (nameFilter) {
|
|
571
|
+
local = local.filter(
|
|
572
|
+
extension => extension.name.toLowerCase().indexOf(nameFilter) > -1 || extension.displayName.toLowerCase().indexOf(nameFilter) > -1
|
|
573
|
+
);
|
|
574
|
+
}
|
|
575
|
+
const hasVirtualSupportType = (extension, supportType) => {
|
|
576
|
+
return extension.local && this.extensionManifestPropertiesService.getExtensionVirtualWorkspaceSupportType(extension.local.manifest) === supportType;
|
|
577
|
+
};
|
|
578
|
+
const hasRestrictedSupportType = (extension, supportType) => {
|
|
579
|
+
if (!extension.local) {
|
|
580
|
+
return false;
|
|
581
|
+
}
|
|
582
|
+
const enablementState = this.extensionEnablementService.getEnablementState(extension.local);
|
|
583
|
+
if (enablementState !== EnablementState.EnabledGlobally && enablementState !== EnablementState.EnabledWorkspace && enablementState !== EnablementState.DisabledByTrustRequirement && enablementState !== EnablementState.DisabledByExtensionDependency) {
|
|
584
|
+
return false;
|
|
585
|
+
}
|
|
586
|
+
if (this.extensionManifestPropertiesService.getExtensionUntrustedWorkspaceSupportType(extension.local.manifest) === supportType) {
|
|
587
|
+
return true;
|
|
588
|
+
}
|
|
589
|
+
if (supportType === false) {
|
|
590
|
+
const dependencies = getExtensionDependencies(( local.map(ext => ext.local)), extension.local);
|
|
591
|
+
return ( dependencies.some(
|
|
592
|
+
ext => this.extensionManifestPropertiesService.getExtensionUntrustedWorkspaceSupportType(ext.manifest) === supportType
|
|
593
|
+
));
|
|
594
|
+
}
|
|
595
|
+
return false;
|
|
596
|
+
};
|
|
597
|
+
const inVirtualWorkspace = isVirtualWorkspace(this.workspaceService.getWorkspace());
|
|
598
|
+
const inRestrictedWorkspace = !this.workspaceTrustManagementService.isWorkspaceTrusted();
|
|
599
|
+
if (type === "virtual") {
|
|
600
|
+
local = local.filter(
|
|
601
|
+
extension => inVirtualWorkspace && hasVirtualSupportType(extension, partial ? "limited" : false) && !(inRestrictedWorkspace && hasRestrictedSupportType(extension, false))
|
|
602
|
+
);
|
|
603
|
+
} else if (type === "untrusted") {
|
|
604
|
+
local = local.filter(
|
|
605
|
+
extension => hasRestrictedSupportType(extension, partial ? "limited" : false) && !(inVirtualWorkspace && hasVirtualSupportType(extension, false))
|
|
606
|
+
);
|
|
607
|
+
} else {
|
|
608
|
+
local = local.filter(
|
|
609
|
+
extension => inVirtualWorkspace && !hasVirtualSupportType(extension, true) || inRestrictedWorkspace && !hasRestrictedSupportType(extension, true)
|
|
610
|
+
);
|
|
611
|
+
}
|
|
612
|
+
return this.sortExtensions(local, options);
|
|
613
|
+
}
|
|
614
|
+
async filterDeprecatedExtensions(local, query, options) {
|
|
615
|
+
const value = query.value.replace(/@deprecated/g, "").replace(/@sort:(\w+)(-\w*)?/g, "").trim().toLowerCase();
|
|
616
|
+
const extensionsControlManifest = await this.extensionManagementService.getExtensionsControlManifest();
|
|
617
|
+
const deprecatedExtensionIds = ( Object.keys(extensionsControlManifest.deprecated));
|
|
618
|
+
local = local.filter(
|
|
619
|
+
e => deprecatedExtensionIds.includes(e.identifier.id) && (!value || e.name.toLowerCase().indexOf(value) > -1 || e.displayName.toLowerCase().indexOf(value) > -1)
|
|
620
|
+
);
|
|
621
|
+
return this.sortExtensions(local, options);
|
|
622
|
+
}
|
|
623
|
+
filterRecentlyUpdatedExtensions(local, query, options) {
|
|
624
|
+
let {
|
|
625
|
+
value,
|
|
626
|
+
includedCategories,
|
|
627
|
+
excludedCategories
|
|
628
|
+
} = this.parseCategories(query.value);
|
|
629
|
+
const currentTime = Date.now();
|
|
630
|
+
local = local.filter(
|
|
631
|
+
e => !e.isBuiltin && !e.outdated && e.local?.updated && e.local?.installedTimestamp !== undefined && currentTime - e.local.installedTimestamp < ExtensionsListView_1.RECENT_UPDATE_DURATION
|
|
632
|
+
);
|
|
633
|
+
value = value.replace(/@recentlyUpdated/g, "").replace(/@sort:(\w+)(-\w*)?/g, "").trim().toLowerCase();
|
|
634
|
+
const result = local.filter(
|
|
635
|
+
e => (e.name.toLowerCase().indexOf(value) > -1 || e.displayName.toLowerCase().indexOf(value) > -1) && this.filterExtensionByCategory(e, includedCategories, excludedCategories)
|
|
636
|
+
);
|
|
637
|
+
options.sortBy = options.sortBy ?? LocalSortBy.UpdateDate;
|
|
638
|
+
return this.sortExtensions(result, options);
|
|
639
|
+
}
|
|
640
|
+
filterRestartRequiredExtensions(local, query, options) {
|
|
641
|
+
let {
|
|
642
|
+
value,
|
|
643
|
+
includedCategories,
|
|
644
|
+
excludedCategories
|
|
645
|
+
} = this.parseCategories(query.value);
|
|
646
|
+
local = local.filter(e => e.runtimeState !== undefined);
|
|
647
|
+
value = value.replace(/@restartrequired/gi, "").replace(/@sort:(\w+)(-\w*)?/g, "").trim().toLowerCase();
|
|
648
|
+
const result = local.filter(
|
|
649
|
+
e => (e.name.toLowerCase().indexOf(value) > -1 || e.displayName.toLowerCase().indexOf(value) > -1) && this.filterExtensionByCategory(e, includedCategories, excludedCategories)
|
|
650
|
+
);
|
|
651
|
+
return this.sortExtensions(result, options);
|
|
652
|
+
}
|
|
653
|
+
filterExtensionsByFeature(local, query) {
|
|
654
|
+
const value = query.value.replace(/@contribute:/g, "").trim();
|
|
655
|
+
const featureId = value.split(" ")[0];
|
|
656
|
+
const feature = ( Registry.as(Extensions.ExtensionFeaturesRegistry)).getExtensionFeature(featureId);
|
|
657
|
+
if (!feature) {
|
|
658
|
+
return [];
|
|
659
|
+
}
|
|
660
|
+
if (this.extensionsViewState) {
|
|
661
|
+
this.extensionsViewState.filters.featureId = featureId;
|
|
662
|
+
}
|
|
663
|
+
const renderer = feature.renderer ? this.instantiationService.createInstance(feature.renderer) : undefined;
|
|
664
|
+
try {
|
|
665
|
+
const result = [];
|
|
666
|
+
for (const e of local) {
|
|
667
|
+
if (!e.local) {
|
|
668
|
+
continue;
|
|
669
|
+
}
|
|
670
|
+
const accessData = this.extensionFeaturesManagementService.getAccessData(( new ExtensionIdentifier(e.identifier.id)), featureId);
|
|
671
|
+
const shouldRender = renderer?.shouldRender(e.local.manifest);
|
|
672
|
+
if (accessData || shouldRender) {
|
|
673
|
+
result.push([e, accessData?.accessTimes.length ?? 0]);
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
return ( result.sort(([, a], [, b]) => b - a).map(([e]) => e));
|
|
677
|
+
} finally {
|
|
678
|
+
renderer?.dispose();
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
mergeAddedExtensions(extensions, newExtensions) {
|
|
682
|
+
const oldExtensions = [...extensions];
|
|
683
|
+
const findPreviousExtensionIndex = from => {
|
|
684
|
+
let index = -1;
|
|
685
|
+
const previousExtensionInNew = newExtensions[from];
|
|
686
|
+
if (previousExtensionInNew) {
|
|
687
|
+
index = oldExtensions.findIndex(e => areSameExtensions(e.identifier, previousExtensionInNew.identifier));
|
|
688
|
+
if (index === -1) {
|
|
689
|
+
return findPreviousExtensionIndex(from - 1);
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
return index;
|
|
693
|
+
};
|
|
694
|
+
let hasChanged = false;
|
|
695
|
+
for (let index = 0; index < newExtensions.length; index++) {
|
|
696
|
+
const extension = newExtensions[index];
|
|
697
|
+
if (extensions.every(r => !areSameExtensions(r.identifier, extension.identifier))) {
|
|
698
|
+
hasChanged = true;
|
|
699
|
+
extensions.splice(findPreviousExtensionIndex(index - 1) + 1, 0, extension);
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
return hasChanged ? extensions : undefined;
|
|
703
|
+
}
|
|
704
|
+
async queryGallery(query, options, token) {
|
|
705
|
+
const hasUserDefinedSortOrder = options.sortBy !== undefined;
|
|
706
|
+
if (!hasUserDefinedSortOrder && !query.value.trim()) {
|
|
707
|
+
options.sortBy = SortBy.InstallCount;
|
|
708
|
+
}
|
|
709
|
+
if (this.isRecommendationsQuery(query)) {
|
|
710
|
+
const model = await this.queryRecommendations(query, options, token);
|
|
711
|
+
return {
|
|
712
|
+
model,
|
|
713
|
+
disposables: ( new DisposableStore())
|
|
714
|
+
};
|
|
715
|
+
}
|
|
716
|
+
const text = query.value;
|
|
717
|
+
if (!text) {
|
|
718
|
+
options.source = "viewlet";
|
|
719
|
+
const pager = await this.extensionsWorkbenchService.queryGallery(options, token);
|
|
720
|
+
return {
|
|
721
|
+
model: ( new PagedModel(pager)),
|
|
722
|
+
disposables: ( new DisposableStore())
|
|
723
|
+
};
|
|
724
|
+
}
|
|
725
|
+
if (/\bext:([^\s]+)\b/g.test(text)) {
|
|
726
|
+
options.text = text;
|
|
727
|
+
options.source = "file-extension-tags";
|
|
728
|
+
const pager = await this.extensionsWorkbenchService.queryGallery(options, token);
|
|
729
|
+
return {
|
|
730
|
+
model: ( new PagedModel(pager)),
|
|
731
|
+
disposables: ( new DisposableStore())
|
|
732
|
+
};
|
|
733
|
+
}
|
|
734
|
+
options.text = text.substring(0, 350);
|
|
735
|
+
options.source = "searchText";
|
|
736
|
+
if (hasUserDefinedSortOrder || /\b(category|tag):([^\s]+)\b/gi.test(text) || /\bfeatured(\s+|\b|$)/gi.test(text)) {
|
|
737
|
+
const pager = await this.extensionsWorkbenchService.queryGallery(options, token);
|
|
738
|
+
return {
|
|
739
|
+
model: ( new PagedModel(pager)),
|
|
740
|
+
disposables: ( new DisposableStore())
|
|
741
|
+
};
|
|
742
|
+
}
|
|
743
|
+
try {
|
|
744
|
+
const [pager, preferredExtensions] = await Promise.all([
|
|
745
|
+
this.extensionsWorkbenchService.queryGallery(options, token),
|
|
746
|
+
this.getPreferredExtensions(options.text.toLowerCase(), token).catch(() => [])
|
|
747
|
+
]);
|
|
748
|
+
const model = preferredExtensions.length ? ( new PreferredExtensionsPagedModel(preferredExtensions, pager)) : ( new PagedModel(pager));
|
|
749
|
+
return {
|
|
750
|
+
model,
|
|
751
|
+
disposables: ( new DisposableStore())
|
|
752
|
+
};
|
|
753
|
+
} catch (error) {
|
|
754
|
+
if (isCancellationError(error)) {
|
|
755
|
+
throw error;
|
|
756
|
+
}
|
|
757
|
+
if (!(error instanceof ExtensionGalleryError)) {
|
|
758
|
+
throw error;
|
|
759
|
+
}
|
|
760
|
+
const searchText = options.text.toLowerCase();
|
|
761
|
+
const localExtensions = this.extensionsWorkbenchService.local.filter(
|
|
762
|
+
e => !e.isBuiltin && (e.name.toLowerCase().indexOf(searchText) > -1 || e.displayName.toLowerCase().indexOf(searchText) > -1 || e.description.toLowerCase().indexOf(searchText) > -1)
|
|
763
|
+
);
|
|
764
|
+
if (localExtensions.length) {
|
|
765
|
+
const message = this.getMessage(error);
|
|
766
|
+
return {
|
|
767
|
+
model: ( new PagedModel(localExtensions)),
|
|
768
|
+
disposables: ( new DisposableStore()),
|
|
769
|
+
message: {
|
|
770
|
+
text: ( localize(9857, "{0} Showing local extensions.", message.text)),
|
|
771
|
+
severity: message.severity
|
|
772
|
+
}
|
|
773
|
+
};
|
|
774
|
+
}
|
|
775
|
+
throw error;
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
async getPreferredExtensions(searchText, token) {
|
|
779
|
+
const preferredExtensions = this.extensionsWorkbenchService.local.filter(
|
|
780
|
+
e => !e.isBuiltin && (e.name.toLowerCase().indexOf(searchText) > -1 || e.displayName.toLowerCase().indexOf(searchText) > -1 || e.description.toLowerCase().indexOf(searchText) > -1)
|
|
781
|
+
);
|
|
782
|
+
const preferredExtensionUUIDs = ( new Set());
|
|
783
|
+
if (preferredExtensions.length) {
|
|
784
|
+
const extesionsToFetch = [];
|
|
785
|
+
for (const extension of preferredExtensions) {
|
|
786
|
+
if (extension.identifier.uuid) {
|
|
787
|
+
preferredExtensionUUIDs.add(extension.identifier.uuid);
|
|
788
|
+
}
|
|
789
|
+
if (!extension.gallery && extension.identifier.uuid) {
|
|
790
|
+
extesionsToFetch.push(extension.identifier);
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
if (extesionsToFetch.length) {
|
|
794
|
+
this.extensionsWorkbenchService.getExtensions(extesionsToFetch, CancellationToken.None).catch(e => null );
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
const preferredResults = [];
|
|
798
|
+
try {
|
|
799
|
+
const manifest = await this.extensionManagementService.getExtensionsControlManifest();
|
|
800
|
+
if (Array.isArray(manifest.search)) {
|
|
801
|
+
for (const s of manifest.search) {
|
|
802
|
+
if (s.query && s.query.toLowerCase() === searchText && Array.isArray(s.preferredResults)) {
|
|
803
|
+
preferredResults.push(...s.preferredResults);
|
|
804
|
+
break;
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
if (preferredResults.length) {
|
|
809
|
+
const result = await this.extensionsWorkbenchService.getExtensions(( preferredResults.map(id => ({
|
|
810
|
+
id
|
|
811
|
+
}))), token);
|
|
812
|
+
for (const extension of result) {
|
|
813
|
+
if (extension.identifier.uuid && !( preferredExtensionUUIDs.has(extension.identifier.uuid))) {
|
|
814
|
+
preferredExtensions.push(extension);
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
} catch (e) {
|
|
819
|
+
this.logService.warn("Failed to get preferred results from the extensions control manifest.", e);
|
|
820
|
+
}
|
|
821
|
+
return preferredExtensions;
|
|
822
|
+
}
|
|
823
|
+
sortExtensions(extensions, options) {
|
|
824
|
+
switch (options.sortBy) {
|
|
825
|
+
case SortBy.InstallCount:
|
|
826
|
+
extensions = extensions.sort(
|
|
827
|
+
(e1, e2) => typeof e2.installCount === "number" && typeof e1.installCount === "number" ? e2.installCount - e1.installCount : NaN
|
|
828
|
+
);
|
|
829
|
+
break;
|
|
830
|
+
case LocalSortBy.UpdateDate:
|
|
831
|
+
extensions = extensions.sort(
|
|
832
|
+
(e1, e2) => typeof e2.local?.installedTimestamp === "number" && typeof e1.local?.installedTimestamp === "number" ? e2.local.installedTimestamp - e1.local.installedTimestamp : typeof e2.local?.installedTimestamp === "number" ? 1 : typeof e1.local?.installedTimestamp === "number" ? -1 : NaN
|
|
833
|
+
);
|
|
834
|
+
break;
|
|
835
|
+
case SortBy.AverageRating:
|
|
836
|
+
case SortBy.WeightedRating:
|
|
837
|
+
extensions = extensions.sort(
|
|
838
|
+
(e1, e2) => typeof e2.rating === "number" && typeof e1.rating === "number" ? e2.rating - e1.rating : NaN
|
|
839
|
+
);
|
|
840
|
+
break;
|
|
841
|
+
default:
|
|
842
|
+
extensions = extensions.sort((e1, e2) => e1.displayName.localeCompare(e2.displayName));
|
|
843
|
+
break;
|
|
844
|
+
}
|
|
845
|
+
if (options.sortOrder === SortOrder.Descending) {
|
|
846
|
+
extensions = extensions.reverse();
|
|
847
|
+
}
|
|
848
|
+
return extensions;
|
|
849
|
+
}
|
|
850
|
+
isRecommendationsQuery(query) {
|
|
851
|
+
return ExtensionsListView_1.isWorkspaceRecommendedExtensionsQuery(query.value) || ExtensionsListView_1.isKeymapsRecommendedExtensionsQuery(query.value) || ExtensionsListView_1.isLanguageRecommendedExtensionsQuery(query.value) || ExtensionsListView_1.isExeRecommendedExtensionsQuery(query.value) || ExtensionsListView_1.isRemoteRecommendedExtensionsQuery(query.value) || /@recommended:all/i.test(query.value) || ExtensionsListView_1.isSearchRecommendedExtensionsQuery(query.value) || ExtensionsListView_1.isRecommendedExtensionsQuery(query.value);
|
|
852
|
+
}
|
|
853
|
+
async queryRecommendations(query, options, token) {
|
|
854
|
+
if (ExtensionsListView_1.isWorkspaceRecommendedExtensionsQuery(query.value)) {
|
|
855
|
+
return this.getWorkspaceRecommendationsModel(query, options, token);
|
|
856
|
+
}
|
|
857
|
+
if (ExtensionsListView_1.isKeymapsRecommendedExtensionsQuery(query.value)) {
|
|
858
|
+
return this.getKeymapRecommendationsModel(query, options, token);
|
|
859
|
+
}
|
|
860
|
+
if (ExtensionsListView_1.isLanguageRecommendedExtensionsQuery(query.value)) {
|
|
861
|
+
return this.getLanguageRecommendationsModel(query, options, token);
|
|
862
|
+
}
|
|
863
|
+
if (ExtensionsListView_1.isExeRecommendedExtensionsQuery(query.value)) {
|
|
864
|
+
return this.getExeRecommendationsModel(query, options, token);
|
|
865
|
+
}
|
|
866
|
+
if (ExtensionsListView_1.isRemoteRecommendedExtensionsQuery(query.value)) {
|
|
867
|
+
return this.getRemoteRecommendationsModel(query, options, token);
|
|
868
|
+
}
|
|
869
|
+
if (/@recommended:all/i.test(query.value)) {
|
|
870
|
+
return this.getAllRecommendationsModel(options, token);
|
|
871
|
+
}
|
|
872
|
+
if (ExtensionsListView_1.isSearchRecommendedExtensionsQuery(query.value) || (ExtensionsListView_1.isRecommendedExtensionsQuery(query.value) && options.sortBy !== undefined)) {
|
|
873
|
+
return this.searchRecommendations(query, options, token);
|
|
874
|
+
}
|
|
875
|
+
if (ExtensionsListView_1.isRecommendedExtensionsQuery(query.value)) {
|
|
876
|
+
return this.getOtherRecommendationsModel(query, options, token);
|
|
877
|
+
}
|
|
878
|
+
return ( new PagedModel([]));
|
|
879
|
+
}
|
|
880
|
+
async getInstallableRecommendations(recommendations, options, token) {
|
|
881
|
+
const result = [];
|
|
882
|
+
if (recommendations.length) {
|
|
883
|
+
const galleryExtensions = [];
|
|
884
|
+
const resourceExtensions = [];
|
|
885
|
+
for (const recommendation of recommendations) {
|
|
886
|
+
if (typeof recommendation === "string") {
|
|
887
|
+
galleryExtensions.push(recommendation);
|
|
888
|
+
} else {
|
|
889
|
+
resourceExtensions.push(recommendation);
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
if (galleryExtensions.length) {
|
|
893
|
+
try {
|
|
894
|
+
const extensions = await this.extensionsWorkbenchService.getExtensions(( galleryExtensions.map(id => ({
|
|
895
|
+
id
|
|
896
|
+
}))), {
|
|
897
|
+
source: options.source
|
|
898
|
+
}, token);
|
|
899
|
+
for (const extension of extensions) {
|
|
900
|
+
if (extension.gallery && !extension.deprecationInfo && (await this.extensionManagementService.canInstall(extension.gallery)) === true) {
|
|
901
|
+
result.push(extension);
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
} catch (error) {
|
|
905
|
+
if (!resourceExtensions.length || !this.isOfflineError(error)) {
|
|
906
|
+
throw error;
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
if (resourceExtensions.length) {
|
|
911
|
+
const extensions = await this.extensionsWorkbenchService.getResourceExtensions(resourceExtensions, true);
|
|
912
|
+
for (const extension of extensions) {
|
|
913
|
+
if ((await this.extensionsWorkbenchService.canInstall(extension)) === true) {
|
|
914
|
+
result.push(extension);
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
return result;
|
|
920
|
+
}
|
|
921
|
+
async getWorkspaceRecommendations() {
|
|
922
|
+
const recommendations = await this.extensionRecommendationsService.getWorkspaceRecommendations();
|
|
923
|
+
const {
|
|
924
|
+
important
|
|
925
|
+
} = await this.extensionRecommendationsService.getConfigBasedRecommendations();
|
|
926
|
+
for (const configBasedRecommendation of important) {
|
|
927
|
+
if (!recommendations.find(extensionId => extensionId === configBasedRecommendation)) {
|
|
928
|
+
recommendations.push(configBasedRecommendation);
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
return recommendations;
|
|
932
|
+
}
|
|
933
|
+
async getWorkspaceRecommendationsModel(query, options, token) {
|
|
934
|
+
const recommendations = await this.getWorkspaceRecommendations();
|
|
935
|
+
const installableRecommendations = (await this.getInstallableRecommendations(recommendations, {
|
|
936
|
+
...options,
|
|
937
|
+
source: "recommendations-workspace"
|
|
938
|
+
}, token));
|
|
939
|
+
return ( new PagedModel(installableRecommendations));
|
|
940
|
+
}
|
|
941
|
+
async getKeymapRecommendationsModel(query, options, token) {
|
|
942
|
+
const value = query.value.replace(/@recommended:keymaps/g, "").trim().toLowerCase();
|
|
943
|
+
const recommendations = this.extensionRecommendationsService.getKeymapRecommendations();
|
|
944
|
+
const installableRecommendations = (await this.getInstallableRecommendations(recommendations, {
|
|
945
|
+
...options,
|
|
946
|
+
source: "recommendations-keymaps"
|
|
947
|
+
}, token)).filter(extension => extension.identifier.id.toLowerCase().indexOf(value) > -1);
|
|
948
|
+
return ( new PagedModel(installableRecommendations));
|
|
949
|
+
}
|
|
950
|
+
async getLanguageRecommendationsModel(query, options, token) {
|
|
951
|
+
const value = query.value.replace(/@recommended:languages/g, "").trim().toLowerCase();
|
|
952
|
+
const recommendations = this.extensionRecommendationsService.getLanguageRecommendations();
|
|
953
|
+
const installableRecommendations = (await this.getInstallableRecommendations(recommendations, {
|
|
954
|
+
...options,
|
|
955
|
+
source: "recommendations-languages"
|
|
956
|
+
}, token)).filter(extension => extension.identifier.id.toLowerCase().indexOf(value) > -1);
|
|
957
|
+
return ( new PagedModel(installableRecommendations));
|
|
958
|
+
}
|
|
959
|
+
async getRemoteRecommendationsModel(query, options, token) {
|
|
960
|
+
const value = query.value.replace(/@recommended:remotes/g, "").trim().toLowerCase();
|
|
961
|
+
const recommendations = this.extensionRecommendationsService.getRemoteRecommendations();
|
|
962
|
+
const installableRecommendations = (await this.getInstallableRecommendations(recommendations, {
|
|
963
|
+
...options,
|
|
964
|
+
source: "recommendations-remotes"
|
|
965
|
+
}, token)).filter(extension => extension.identifier.id.toLowerCase().indexOf(value) > -1);
|
|
966
|
+
return ( new PagedModel(installableRecommendations));
|
|
967
|
+
}
|
|
968
|
+
async getExeRecommendationsModel(query, options, token) {
|
|
969
|
+
const exe = query.value.replace(/@exe:/g, "").trim().toLowerCase();
|
|
970
|
+
const {
|
|
971
|
+
important,
|
|
972
|
+
others
|
|
973
|
+
} = await this.extensionRecommendationsService.getExeBasedRecommendations(exe.startsWith("\"") ? exe.substring(1, exe.length - 1) : exe);
|
|
974
|
+
const installableRecommendations = await this.getInstallableRecommendations([...important, ...others], {
|
|
975
|
+
...options,
|
|
976
|
+
source: "recommendations-exe"
|
|
977
|
+
}, token);
|
|
978
|
+
return ( new PagedModel(installableRecommendations));
|
|
979
|
+
}
|
|
980
|
+
async getOtherRecommendationsModel(query, options, token) {
|
|
981
|
+
const otherRecommendations = await this.getOtherRecommendations();
|
|
982
|
+
const installableRecommendations = await this.getInstallableRecommendations(otherRecommendations, {
|
|
983
|
+
...options,
|
|
984
|
+
source: "recommendations-other",
|
|
985
|
+
sortBy: undefined
|
|
986
|
+
}, token);
|
|
987
|
+
const result = coalesce(( otherRecommendations.map(
|
|
988
|
+
id => installableRecommendations.find(i => areSameExtensions(i.identifier, {
|
|
989
|
+
id
|
|
990
|
+
}))
|
|
991
|
+
)));
|
|
992
|
+
return ( new PagedModel(result));
|
|
993
|
+
}
|
|
994
|
+
async getOtherRecommendations() {
|
|
995
|
+
const local = ( (await this.extensionsWorkbenchService.queryLocal(this.options.server)).map(e => e.identifier.id.toLowerCase()));
|
|
996
|
+
const workspaceRecommendations = ( (await this.getWorkspaceRecommendations()).map(
|
|
997
|
+
extensionId => isString(extensionId) ? extensionId.toLowerCase() : extensionId
|
|
998
|
+
));
|
|
999
|
+
return distinct((await Promise.all([
|
|
1000
|
+
this.extensionRecommendationsService.getImportantRecommendations(), this.extensionRecommendationsService.getFileBasedRecommendations(), this.extensionRecommendationsService.getOtherRecommendations()])).flat().filter(
|
|
1001
|
+
extensionId => !local.includes(extensionId.toLowerCase()) && !workspaceRecommendations.includes(extensionId.toLowerCase())
|
|
1002
|
+
), extensionId => extensionId.toLowerCase());
|
|
1003
|
+
}
|
|
1004
|
+
async getAllRecommendationsModel(options, token) {
|
|
1005
|
+
const localExtensions = await this.extensionsWorkbenchService.queryLocal(this.options.server);
|
|
1006
|
+
const localExtensionIds = ( localExtensions.map(e => e.identifier.id.toLowerCase()));
|
|
1007
|
+
const allRecommendations = distinct((await Promise.all([
|
|
1008
|
+
this.getWorkspaceRecommendations(), this.extensionRecommendationsService.getImportantRecommendations(), this.extensionRecommendationsService.getFileBasedRecommendations(), this.extensionRecommendationsService.getOtherRecommendations()])).flat().filter(extensionId => {
|
|
1009
|
+
if (isString(extensionId)) {
|
|
1010
|
+
return !localExtensionIds.includes(extensionId.toLowerCase());
|
|
1011
|
+
}
|
|
1012
|
+
return !( localExtensions.some(
|
|
1013
|
+
localExtension => localExtension.local && this.uriIdentityService.extUri.isEqual(localExtension.local.location, extensionId)
|
|
1014
|
+
));
|
|
1015
|
+
}));
|
|
1016
|
+
const installableRecommendations = await this.getInstallableRecommendations(allRecommendations, {
|
|
1017
|
+
...options,
|
|
1018
|
+
source: "recommendations-all",
|
|
1019
|
+
sortBy: undefined
|
|
1020
|
+
}, token);
|
|
1021
|
+
const result = [];
|
|
1022
|
+
for (let i = 0; i < installableRecommendations.length && result.length < 8; i++) {
|
|
1023
|
+
const recommendation = allRecommendations[i];
|
|
1024
|
+
if (isString(recommendation)) {
|
|
1025
|
+
const extension = installableRecommendations.find(extension => areSameExtensions(extension.identifier, {
|
|
1026
|
+
id: recommendation
|
|
1027
|
+
}));
|
|
1028
|
+
if (extension) {
|
|
1029
|
+
result.push(extension);
|
|
1030
|
+
}
|
|
1031
|
+
} else {
|
|
1032
|
+
const extension = installableRecommendations.find(
|
|
1033
|
+
extension => extension.resourceExtension && this.uriIdentityService.extUri.isEqual(extension.resourceExtension.location, recommendation)
|
|
1034
|
+
);
|
|
1035
|
+
if (extension) {
|
|
1036
|
+
result.push(extension);
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
return ( new PagedModel(result));
|
|
1041
|
+
}
|
|
1042
|
+
async searchRecommendations(query, options, token) {
|
|
1043
|
+
const value = query.value.replace(/@recommended/g, "").trim().toLowerCase();
|
|
1044
|
+
const recommendations = distinct([
|
|
1045
|
+
...(await this.getWorkspaceRecommendations()),
|
|
1046
|
+
...(await this.getOtherRecommendations())
|
|
1047
|
+
]);
|
|
1048
|
+
const installableRecommendations = (await this.getInstallableRecommendations(recommendations, {
|
|
1049
|
+
...options,
|
|
1050
|
+
source: "recommendations",
|
|
1051
|
+
sortBy: undefined
|
|
1052
|
+
}, token)).filter(extension => extension.identifier.id.toLowerCase().indexOf(value) > -1);
|
|
1053
|
+
return ( new PagedModel(this.sortExtensions(installableRecommendations, options)));
|
|
1054
|
+
}
|
|
1055
|
+
setModel(model, message, donotResetScrollTop) {
|
|
1056
|
+
if (this.list) {
|
|
1057
|
+
this.list.model = ( new DelayedPagedModel(model));
|
|
1058
|
+
this.updateBody(message);
|
|
1059
|
+
if (!donotResetScrollTop) {
|
|
1060
|
+
this.list.scrollTop = 0;
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
if (this.badge) {
|
|
1064
|
+
this.badge.setCount(this.count());
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
updateModel(model) {
|
|
1068
|
+
if (this.list) {
|
|
1069
|
+
this.list.model = ( new DelayedPagedModel(model));
|
|
1070
|
+
this.updateBody();
|
|
1071
|
+
}
|
|
1072
|
+
if (this.badge) {
|
|
1073
|
+
this.badge.setCount(this.count());
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
updateBody(message) {
|
|
1077
|
+
if (this.bodyTemplate) {
|
|
1078
|
+
const count = this.count();
|
|
1079
|
+
this.bodyTemplate.extensionsList.classList.toggle("hidden", count === 0);
|
|
1080
|
+
this.bodyTemplate.messageContainer.classList.toggle("hidden", !message && count > 0);
|
|
1081
|
+
if (this.isBodyVisible()) {
|
|
1082
|
+
if (message) {
|
|
1083
|
+
this.bodyTemplate.messageSeverityIcon.className = SeverityIcon.className(message.severity);
|
|
1084
|
+
this.bodyTemplate.messageBox.textContent = message.text;
|
|
1085
|
+
} else if (this.count() === 0) {
|
|
1086
|
+
this.bodyTemplate.messageSeverityIcon.className = "";
|
|
1087
|
+
this.bodyTemplate.messageBox.textContent = ( localize(9858, "No extensions found."));
|
|
1088
|
+
}
|
|
1089
|
+
if (this.bodyTemplate.messageBox.textContent) {
|
|
1090
|
+
alert(this.bodyTemplate.messageBox.textContent);
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
this.updateSize();
|
|
1095
|
+
}
|
|
1096
|
+
getMessage(error) {
|
|
1097
|
+
if (this.isOfflineError(error)) {
|
|
1098
|
+
return {
|
|
1099
|
+
text: ( localize(
|
|
1100
|
+
9859,
|
|
1101
|
+
"Unable to search the Marketplace when offline, please check your network connection."
|
|
1102
|
+
)),
|
|
1103
|
+
severity: Severity$1.Warning
|
|
1104
|
+
};
|
|
1105
|
+
} else {
|
|
1106
|
+
return {
|
|
1107
|
+
text: ( localize(9860, "Error while fetching extensions. {0}", getErrorMessage(error))),
|
|
1108
|
+
severity: Severity$1.Error
|
|
1109
|
+
};
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
isOfflineError(error) {
|
|
1113
|
+
if (error instanceof ExtensionGalleryError) {
|
|
1114
|
+
return error.code === ExtensionGalleryErrorCode.Offline;
|
|
1115
|
+
}
|
|
1116
|
+
return isOfflineError(error);
|
|
1117
|
+
}
|
|
1118
|
+
updateSize() {
|
|
1119
|
+
if (this.options.flexibleHeight) {
|
|
1120
|
+
this.maximumBodySize = this.list?.model.length ? Number.POSITIVE_INFINITY : 0;
|
|
1121
|
+
this.storageService.store(
|
|
1122
|
+
`${this.id}.size`,
|
|
1123
|
+
this.list?.model.length || 0,
|
|
1124
|
+
StorageScope.PROFILE,
|
|
1125
|
+
StorageTarget.MACHINE
|
|
1126
|
+
);
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
dispose() {
|
|
1130
|
+
super.dispose();
|
|
1131
|
+
if (this.queryRequest) {
|
|
1132
|
+
this.queryRequest.request.cancel();
|
|
1133
|
+
this.queryRequest = null;
|
|
1134
|
+
}
|
|
1135
|
+
if (this.queryResult) {
|
|
1136
|
+
this.queryResult.disposables.dispose();
|
|
1137
|
+
this.queryResult = undefined;
|
|
1138
|
+
}
|
|
1139
|
+
this.list = null;
|
|
1140
|
+
}
|
|
1141
|
+
static isLocalExtensionsQuery(query, sortBy) {
|
|
1142
|
+
return this.isInstalledExtensionsQuery(query) || this.isSearchInstalledExtensionsQuery(query) || this.isOutdatedExtensionsQuery(query) || this.isEnabledExtensionsQuery(query) || this.isDisabledExtensionsQuery(query) || this.isBuiltInExtensionsQuery(query) || this.isSearchBuiltInExtensionsQuery(query) || this.isBuiltInGroupExtensionsQuery(query) || this.isSearchDeprecatedExtensionsQuery(query) || this.isSearchWorkspaceUnsupportedExtensionsQuery(query) || this.isSearchRecentlyUpdatedQuery(query) || this.isRestartRequiredQuery(query) || this.isSearchExtensionUpdatesQuery(query) || this.isSortInstalledExtensionsQuery(query, sortBy) || this.isFeatureExtensionsQuery(query);
|
|
1143
|
+
}
|
|
1144
|
+
static isSearchBuiltInExtensionsQuery(query) {
|
|
1145
|
+
return /@builtin\s.+|.+\s@builtin/i.test(query);
|
|
1146
|
+
}
|
|
1147
|
+
static isBuiltInExtensionsQuery(query) {
|
|
1148
|
+
return /^@builtin$/i.test(query.trim());
|
|
1149
|
+
}
|
|
1150
|
+
static isBuiltInGroupExtensionsQuery(query) {
|
|
1151
|
+
return /^@builtin:.+$/i.test(query.trim());
|
|
1152
|
+
}
|
|
1153
|
+
static isSearchWorkspaceUnsupportedExtensionsQuery(query) {
|
|
1154
|
+
return /^\s*@workspaceUnsupported(:(untrusted|virtual)(Partial)?)?(\s|$)/i.test(query);
|
|
1155
|
+
}
|
|
1156
|
+
static isInstalledExtensionsQuery(query) {
|
|
1157
|
+
return /@installed$/i.test(query) && !/@mcp/i.test(query) && !/@agentPlugins/i.test(query);
|
|
1158
|
+
}
|
|
1159
|
+
static isSearchInstalledExtensionsQuery(query) {
|
|
1160
|
+
return (/@installed\s./i.test(query) && !/@mcp/i.test(query) && !/@agentPlugins/i.test(query)) || this.isFeatureExtensionsQuery(query);
|
|
1161
|
+
}
|
|
1162
|
+
static isOutdatedExtensionsQuery(query) {
|
|
1163
|
+
return /@outdated/i.test(query);
|
|
1164
|
+
}
|
|
1165
|
+
static isEnabledExtensionsQuery(query) {
|
|
1166
|
+
return /@enabled/i.test(query) && !/@builtin/i.test(query);
|
|
1167
|
+
}
|
|
1168
|
+
static isDisabledExtensionsQuery(query) {
|
|
1169
|
+
return /@disabled/i.test(query) && !/@builtin/i.test(query);
|
|
1170
|
+
}
|
|
1171
|
+
static isSearchDeprecatedExtensionsQuery(query) {
|
|
1172
|
+
return /@deprecated\s?.*/i.test(query);
|
|
1173
|
+
}
|
|
1174
|
+
static isRecommendedExtensionsQuery(query) {
|
|
1175
|
+
return /^@recommended$/i.test(query.trim());
|
|
1176
|
+
}
|
|
1177
|
+
static isSearchRecommendedExtensionsQuery(query) {
|
|
1178
|
+
return /@recommended\s.+/i.test(query);
|
|
1179
|
+
}
|
|
1180
|
+
static isWorkspaceRecommendedExtensionsQuery(query) {
|
|
1181
|
+
return /@recommended:workspace/i.test(query);
|
|
1182
|
+
}
|
|
1183
|
+
static isExeRecommendedExtensionsQuery(query) {
|
|
1184
|
+
return /@exe:.+/i.test(query);
|
|
1185
|
+
}
|
|
1186
|
+
static isRemoteRecommendedExtensionsQuery(query) {
|
|
1187
|
+
return /@recommended:remotes/i.test(query);
|
|
1188
|
+
}
|
|
1189
|
+
static isKeymapsRecommendedExtensionsQuery(query) {
|
|
1190
|
+
return /@recommended:keymaps/i.test(query);
|
|
1191
|
+
}
|
|
1192
|
+
static isLanguageRecommendedExtensionsQuery(query) {
|
|
1193
|
+
return /@recommended:languages/i.test(query);
|
|
1194
|
+
}
|
|
1195
|
+
static isSortInstalledExtensionsQuery(query, sortBy) {
|
|
1196
|
+
return (sortBy !== undefined && sortBy !== "" && query === "") || (!sortBy && /^@sort:\S*$/i.test(query));
|
|
1197
|
+
}
|
|
1198
|
+
static isSearchPopularQuery(query) {
|
|
1199
|
+
return /@popular/i.test(query);
|
|
1200
|
+
}
|
|
1201
|
+
static isSearchRecentlyPublishedQuery(query) {
|
|
1202
|
+
return /@recentlyPublished/i.test(query);
|
|
1203
|
+
}
|
|
1204
|
+
static isSearchRecentlyUpdatedQuery(query) {
|
|
1205
|
+
return /@recentlyUpdated/i.test(query);
|
|
1206
|
+
}
|
|
1207
|
+
static isRestartRequiredQuery(query) {
|
|
1208
|
+
return /@restartrequired/i.test(query);
|
|
1209
|
+
}
|
|
1210
|
+
static isSearchExtensionUpdatesQuery(query) {
|
|
1211
|
+
return /@updates/i.test(query);
|
|
1212
|
+
}
|
|
1213
|
+
static isSortUpdateDateQuery(query) {
|
|
1214
|
+
return /@sort:updateDate/i.test(query);
|
|
1215
|
+
}
|
|
1216
|
+
static isFeatureExtensionsQuery(query) {
|
|
1217
|
+
return /@contribute:/i.test(query);
|
|
1218
|
+
}
|
|
1219
|
+
focus() {
|
|
1220
|
+
super.focus();
|
|
1221
|
+
if (!this.list) {
|
|
1222
|
+
return;
|
|
1223
|
+
}
|
|
1224
|
+
if (!(this.list.getFocus().length || this.list.getSelection().length)) {
|
|
1225
|
+
this.list.focusNext();
|
|
1226
|
+
}
|
|
1227
|
+
this.list.domFocus();
|
|
1228
|
+
}
|
|
1229
|
+
};
|
|
1230
|
+
ExtensionsListView = ExtensionsListView_1 = ( __decorate([( __param(2, INotificationService)), ( __param(3, IKeybindingService)), ( __param(4, IContextMenuService)), ( __param(5, IInstantiationService)), ( __param(6, IThemeService)), ( __param(7, IExtensionService)), ( __param(8, IExtensionsWorkbenchService)), ( __param(9, IExtensionRecommendationsService)), ( __param(10, ITelemetryService)), ( __param(11, IHoverService)), ( __param(12, IConfigurationService)), ( __param(13, IWorkspaceContextService)), ( __param(14, IExtensionManagementServerService)), ( __param(15, IExtensionManifestPropertiesService)), ( __param(16, IWorkbenchExtensionManagementService)), ( __param(17, IWorkspaceContextService)), ( __param(18, IProductService)), ( __param(19, IContextKeyService)), ( __param(20, IViewDescriptorService)), ( __param(21, IOpenerService)), ( __param(22, IStorageService)), ( __param(23, IWorkspaceTrustManagementService)), ( __param(24, IWorkbenchExtensionEnablementService)), ( __param(25, IExtensionFeaturesManagementService)), ( __param(26, IUriIdentityService)), ( __param(27, ILogService))], ExtensionsListView));
|
|
1231
|
+
class DefaultPopularExtensionsView extends ExtensionsListView {
|
|
1232
|
+
async show() {
|
|
1233
|
+
const query = this.extensionManagementServerService.webExtensionManagementServer && !this.extensionManagementServerService.localExtensionManagementServer && !this.extensionManagementServerService.remoteExtensionManagementServer ? "@web" : "";
|
|
1234
|
+
return super.show(query);
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
class ServerInstalledExtensionsView extends ExtensionsListView {
|
|
1238
|
+
async show(query) {
|
|
1239
|
+
query = query ? query : "@installed";
|
|
1240
|
+
if (!ExtensionsListView.isLocalExtensionsQuery(query) || ExtensionsListView.isSortInstalledExtensionsQuery(query)) {
|
|
1241
|
+
query = query += " @installed";
|
|
1242
|
+
}
|
|
1243
|
+
return super.show(query.trim());
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
class EnabledExtensionsView extends ExtensionsListView {
|
|
1247
|
+
async show(query) {
|
|
1248
|
+
query = query || "@enabled";
|
|
1249
|
+
return ExtensionsListView.isEnabledExtensionsQuery(query) ? super.show(query) : ExtensionsListView.isSortInstalledExtensionsQuery(query) ? super.show("@enabled " + query) : this.showEmptyModel();
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
class DisabledExtensionsView extends ExtensionsListView {
|
|
1253
|
+
async show(query) {
|
|
1254
|
+
query = query || "@disabled";
|
|
1255
|
+
return ExtensionsListView.isDisabledExtensionsQuery(query) ? super.show(query) : ExtensionsListView.isSortInstalledExtensionsQuery(query) ? super.show("@disabled " + query) : this.showEmptyModel();
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
class OutdatedExtensionsView extends ExtensionsListView {
|
|
1259
|
+
async show(query) {
|
|
1260
|
+
query = query ? query : "@outdated";
|
|
1261
|
+
if (ExtensionsListView.isSearchExtensionUpdatesQuery(query)) {
|
|
1262
|
+
query = query.replace("@updates", "@outdated");
|
|
1263
|
+
}
|
|
1264
|
+
return super.show(query.trim());
|
|
1265
|
+
}
|
|
1266
|
+
updateSize() {
|
|
1267
|
+
super.updateSize();
|
|
1268
|
+
this.setExpanded(this.count() > 0);
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
class RecentlyUpdatedExtensionsView extends ExtensionsListView {
|
|
1272
|
+
async show(query) {
|
|
1273
|
+
query = query ? query : "@recentlyUpdated";
|
|
1274
|
+
if (ExtensionsListView.isSearchExtensionUpdatesQuery(query)) {
|
|
1275
|
+
query = query.replace("@updates", "@recentlyUpdated");
|
|
1276
|
+
}
|
|
1277
|
+
return super.show(query.trim());
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
let StaticQueryExtensionsView = class StaticQueryExtensionsView extends ExtensionsListView {
|
|
1281
|
+
constructor(
|
|
1282
|
+
options,
|
|
1283
|
+
viewletViewOptions,
|
|
1284
|
+
notificationService,
|
|
1285
|
+
keybindingService,
|
|
1286
|
+
contextMenuService,
|
|
1287
|
+
instantiationService,
|
|
1288
|
+
themeService,
|
|
1289
|
+
extensionService,
|
|
1290
|
+
extensionsWorkbenchService,
|
|
1291
|
+
extensionRecommendationsService,
|
|
1292
|
+
telemetryService,
|
|
1293
|
+
hoverService,
|
|
1294
|
+
configurationService,
|
|
1295
|
+
contextService,
|
|
1296
|
+
extensionManagementServerService,
|
|
1297
|
+
extensionManifestPropertiesService,
|
|
1298
|
+
extensionManagementService,
|
|
1299
|
+
workspaceService,
|
|
1300
|
+
productService,
|
|
1301
|
+
contextKeyService,
|
|
1302
|
+
viewDescriptorService,
|
|
1303
|
+
openerService,
|
|
1304
|
+
storageService,
|
|
1305
|
+
workspaceTrustManagementService,
|
|
1306
|
+
extensionEnablementService,
|
|
1307
|
+
extensionFeaturesManagementService,
|
|
1308
|
+
uriIdentityService,
|
|
1309
|
+
logService
|
|
1310
|
+
) {
|
|
1311
|
+
super(
|
|
1312
|
+
options,
|
|
1313
|
+
viewletViewOptions,
|
|
1314
|
+
notificationService,
|
|
1315
|
+
keybindingService,
|
|
1316
|
+
contextMenuService,
|
|
1317
|
+
instantiationService,
|
|
1318
|
+
themeService,
|
|
1319
|
+
extensionService,
|
|
1320
|
+
extensionsWorkbenchService,
|
|
1321
|
+
extensionRecommendationsService,
|
|
1322
|
+
telemetryService,
|
|
1323
|
+
hoverService,
|
|
1324
|
+
configurationService,
|
|
1325
|
+
contextService,
|
|
1326
|
+
extensionManagementServerService,
|
|
1327
|
+
extensionManifestPropertiesService,
|
|
1328
|
+
extensionManagementService,
|
|
1329
|
+
workspaceService,
|
|
1330
|
+
productService,
|
|
1331
|
+
contextKeyService,
|
|
1332
|
+
viewDescriptorService,
|
|
1333
|
+
openerService,
|
|
1334
|
+
storageService,
|
|
1335
|
+
workspaceTrustManagementService,
|
|
1336
|
+
extensionEnablementService,
|
|
1337
|
+
extensionFeaturesManagementService,
|
|
1338
|
+
uriIdentityService,
|
|
1339
|
+
logService
|
|
1340
|
+
);
|
|
1341
|
+
this.options = options;
|
|
1342
|
+
}
|
|
1343
|
+
show() {
|
|
1344
|
+
return super.show(this.options.query);
|
|
1345
|
+
}
|
|
1346
|
+
};
|
|
1347
|
+
StaticQueryExtensionsView = ( __decorate([( __param(2, INotificationService)), ( __param(3, IKeybindingService)), ( __param(4, IContextMenuService)), ( __param(5, IInstantiationService)), ( __param(6, IThemeService)), ( __param(7, IExtensionService)), ( __param(8, IExtensionsWorkbenchService)), ( __param(9, IExtensionRecommendationsService)), ( __param(10, ITelemetryService)), ( __param(11, IHoverService)), ( __param(12, IConfigurationService)), ( __param(13, IWorkspaceContextService)), ( __param(14, IExtensionManagementServerService)), ( __param(15, IExtensionManifestPropertiesService)), ( __param(16, IWorkbenchExtensionManagementService)), ( __param(17, IWorkspaceContextService)), ( __param(18, IProductService)), ( __param(19, IContextKeyService)), ( __param(20, IViewDescriptorService)), ( __param(21, IOpenerService)), ( __param(22, IStorageService)), ( __param(23, IWorkspaceTrustManagementService)), ( __param(24, IWorkbenchExtensionEnablementService)), ( __param(25, IExtensionFeaturesManagementService)), ( __param(26, IUriIdentityService)), ( __param(27, ILogService))], StaticQueryExtensionsView));
|
|
1348
|
+
function toSpecificWorkspaceUnsupportedQuery(query, qualifier) {
|
|
1349
|
+
if (!query) {
|
|
1350
|
+
return "@workspaceUnsupported:" + qualifier;
|
|
1351
|
+
}
|
|
1352
|
+
const match = query.match(( new RegExp(`@workspaceUnsupported(:${qualifier})?(\\s|$)`, "i")));
|
|
1353
|
+
if (match) {
|
|
1354
|
+
if (!match[1]) {
|
|
1355
|
+
return query.replace(/@workspaceUnsupported/gi, "@workspaceUnsupported:" + qualifier);
|
|
1356
|
+
}
|
|
1357
|
+
return query;
|
|
1358
|
+
}
|
|
1359
|
+
return undefined;
|
|
1360
|
+
}
|
|
1361
|
+
class UntrustedWorkspaceUnsupportedExtensionsView extends ExtensionsListView {
|
|
1362
|
+
async show(query) {
|
|
1363
|
+
const updatedQuery = toSpecificWorkspaceUnsupportedQuery(query, "untrusted");
|
|
1364
|
+
return updatedQuery ? super.show(updatedQuery) : this.showEmptyModel();
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
class UntrustedWorkspacePartiallySupportedExtensionsView extends ExtensionsListView {
|
|
1368
|
+
async show(query) {
|
|
1369
|
+
const updatedQuery = toSpecificWorkspaceUnsupportedQuery(query, "untrustedPartial");
|
|
1370
|
+
return updatedQuery ? super.show(updatedQuery) : this.showEmptyModel();
|
|
1371
|
+
}
|
|
1372
|
+
}
|
|
1373
|
+
class VirtualWorkspaceUnsupportedExtensionsView extends ExtensionsListView {
|
|
1374
|
+
async show(query) {
|
|
1375
|
+
const updatedQuery = toSpecificWorkspaceUnsupportedQuery(query, "virtual");
|
|
1376
|
+
return updatedQuery ? super.show(updatedQuery) : this.showEmptyModel();
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
class VirtualWorkspacePartiallySupportedExtensionsView extends ExtensionsListView {
|
|
1380
|
+
async show(query) {
|
|
1381
|
+
const updatedQuery = toSpecificWorkspaceUnsupportedQuery(query, "virtualPartial");
|
|
1382
|
+
return updatedQuery ? super.show(updatedQuery) : this.showEmptyModel();
|
|
1383
|
+
}
|
|
1384
|
+
}
|
|
1385
|
+
class DeprecatedExtensionsView extends ExtensionsListView {
|
|
1386
|
+
async show(query) {
|
|
1387
|
+
return ExtensionsListView.isSearchDeprecatedExtensionsQuery(query) ? super.show(query) : this.showEmptyModel();
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1390
|
+
class SearchMarketplaceExtensionsView extends ExtensionsListView {
|
|
1391
|
+
constructor() {
|
|
1392
|
+
super(...arguments);
|
|
1393
|
+
this.reportSearchFinishedDelayer = this._register(( new ThrottledDelayer(2000)));
|
|
1394
|
+
this.searchWaitPromise = Promise.resolve();
|
|
1395
|
+
}
|
|
1396
|
+
async show(query) {
|
|
1397
|
+
const queryPromise = super.show(query);
|
|
1398
|
+
this.reportSearchFinishedDelayer.trigger(() => this.reportSearchFinished());
|
|
1399
|
+
this.searchWaitPromise = queryPromise.then(null, null);
|
|
1400
|
+
return queryPromise;
|
|
1401
|
+
}
|
|
1402
|
+
async reportSearchFinished() {
|
|
1403
|
+
await this.searchWaitPromise;
|
|
1404
|
+
this.telemetryService.publicLog2("extensionsView:MarketplaceSearchFinished");
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
class DefaultRecommendedExtensionsView extends ExtensionsListView {
|
|
1408
|
+
constructor() {
|
|
1409
|
+
super(...arguments);
|
|
1410
|
+
this.recommendedExtensionsQuery = "@recommended:all";
|
|
1411
|
+
}
|
|
1412
|
+
renderBody(container) {
|
|
1413
|
+
super.renderBody(container);
|
|
1414
|
+
this._register(this.extensionRecommendationsService.onDidChangeRecommendations(() => {
|
|
1415
|
+
this.show("");
|
|
1416
|
+
}));
|
|
1417
|
+
}
|
|
1418
|
+
async show(query) {
|
|
1419
|
+
if (query && query.trim() !== this.recommendedExtensionsQuery) {
|
|
1420
|
+
return this.showEmptyModel();
|
|
1421
|
+
}
|
|
1422
|
+
const model = await super.show(this.recommendedExtensionsQuery);
|
|
1423
|
+
if (!( this.extensionsWorkbenchService.local.some(e => !e.isBuiltin))) {
|
|
1424
|
+
this.setExpanded(model.length > 0);
|
|
1425
|
+
}
|
|
1426
|
+
return model;
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
class RecommendedExtensionsView extends ExtensionsListView {
|
|
1430
|
+
constructor() {
|
|
1431
|
+
super(...arguments);
|
|
1432
|
+
this.recommendedExtensionsQuery = "@recommended";
|
|
1433
|
+
}
|
|
1434
|
+
renderBody(container) {
|
|
1435
|
+
super.renderBody(container);
|
|
1436
|
+
this._register(this.extensionRecommendationsService.onDidChangeRecommendations(() => {
|
|
1437
|
+
this.show("");
|
|
1438
|
+
}));
|
|
1439
|
+
}
|
|
1440
|
+
async show(query) {
|
|
1441
|
+
return (query && query.trim() !== this.recommendedExtensionsQuery) ? this.showEmptyModel() : super.show(this.recommendedExtensionsQuery);
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
class WorkspaceRecommendedExtensionsView extends ExtensionsListView {
|
|
1445
|
+
constructor() {
|
|
1446
|
+
super(...arguments);
|
|
1447
|
+
this.recommendedExtensionsQuery = "@recommended:workspace";
|
|
1448
|
+
}
|
|
1449
|
+
renderBody(container) {
|
|
1450
|
+
super.renderBody(container);
|
|
1451
|
+
this._register(
|
|
1452
|
+
this.extensionRecommendationsService.onDidChangeRecommendations(() => this.show(this.recommendedExtensionsQuery))
|
|
1453
|
+
);
|
|
1454
|
+
this._register(
|
|
1455
|
+
this.contextService.onDidChangeWorkbenchState(() => this.show(this.recommendedExtensionsQuery))
|
|
1456
|
+
);
|
|
1457
|
+
}
|
|
1458
|
+
async show(query) {
|
|
1459
|
+
const shouldShowEmptyView = query && query.trim() !== "@recommended" && query.trim() !== "@recommended:workspace";
|
|
1460
|
+
const model = await (shouldShowEmptyView ? this.showEmptyModel() : super.show(this.recommendedExtensionsQuery));
|
|
1461
|
+
this.setExpanded(model.length > 0);
|
|
1462
|
+
return model;
|
|
1463
|
+
}
|
|
1464
|
+
async getInstallableWorkspaceRecommendations() {
|
|
1465
|
+
const installed = (await this.extensionsWorkbenchService.queryLocal()).filter(l => l.enablementState !== EnablementState.DisabledByExtensionKind);
|
|
1466
|
+
const recommendations = (await this.getWorkspaceRecommendations()).filter(
|
|
1467
|
+
recommendation => installed.every(local => isString(recommendation) ? !areSameExtensions({
|
|
1468
|
+
id: recommendation
|
|
1469
|
+
}, local.identifier) : !this.uriIdentityService.extUri.isEqual(recommendation, local.local?.location))
|
|
1470
|
+
);
|
|
1471
|
+
return this.getInstallableRecommendations(recommendations, {
|
|
1472
|
+
source: "install-all-workspace-recommendations"
|
|
1473
|
+
}, CancellationToken.None);
|
|
1474
|
+
}
|
|
1475
|
+
async installWorkspaceRecommendations() {
|
|
1476
|
+
const installableRecommendations = await this.getInstallableWorkspaceRecommendations();
|
|
1477
|
+
if (installableRecommendations.length) {
|
|
1478
|
+
const galleryExtensions = [];
|
|
1479
|
+
const resourceExtensions = [];
|
|
1480
|
+
for (const recommendation of installableRecommendations) {
|
|
1481
|
+
if (recommendation.gallery) {
|
|
1482
|
+
galleryExtensions.push({
|
|
1483
|
+
extension: recommendation.gallery,
|
|
1484
|
+
options: {}
|
|
1485
|
+
});
|
|
1486
|
+
} else {
|
|
1487
|
+
resourceExtensions.push(recommendation);
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
await Promise.all([
|
|
1491
|
+
this.extensionManagementService.installGalleryExtensions(galleryExtensions),
|
|
1492
|
+
...( resourceExtensions.map(extension => this.extensionsWorkbenchService.install(extension)))
|
|
1493
|
+
]);
|
|
1494
|
+
} else {
|
|
1495
|
+
this.notificationService.notify({
|
|
1496
|
+
severity: Severity$1.Info,
|
|
1497
|
+
message: ( localize(9861, "There are no extensions to install."))
|
|
1498
|
+
});
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
class PreferredExtensionsPagedModel {
|
|
1503
|
+
get onDidIncrementLength() {
|
|
1504
|
+
return Event.None;
|
|
1505
|
+
}
|
|
1506
|
+
constructor(preferredExtensions, pager) {
|
|
1507
|
+
this.preferredExtensions = preferredExtensions;
|
|
1508
|
+
this.pager = pager;
|
|
1509
|
+
this.resolved = ( new Map());
|
|
1510
|
+
this.preferredGalleryExtensions = ( new Set());
|
|
1511
|
+
this.resolvedGalleryExtensionsFromQuery = [];
|
|
1512
|
+
for (let i = 0; i < this.preferredExtensions.length; i++) {
|
|
1513
|
+
this.resolved.set(i, this.preferredExtensions[i]);
|
|
1514
|
+
}
|
|
1515
|
+
for (const e of preferredExtensions) {
|
|
1516
|
+
if (e.identifier.uuid) {
|
|
1517
|
+
this.preferredGalleryExtensions.add(e.identifier.uuid);
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
this.length = (preferredExtensions.length - this.preferredGalleryExtensions.size) + this.pager.total;
|
|
1521
|
+
const totalPages = Math.ceil(this.pager.total / this.pager.pageSize);
|
|
1522
|
+
this.populateResolvedExtensions(0, this.pager.firstPage);
|
|
1523
|
+
this.pages = ( range(totalPages - 1).map(() => ({
|
|
1524
|
+
promise: null,
|
|
1525
|
+
cts: null,
|
|
1526
|
+
promiseIndexes: ( new Set())
|
|
1527
|
+
})));
|
|
1528
|
+
}
|
|
1529
|
+
isResolved(index) {
|
|
1530
|
+
return ( this.resolved.has(index));
|
|
1531
|
+
}
|
|
1532
|
+
get(index) {
|
|
1533
|
+
return this.resolved.get(index);
|
|
1534
|
+
}
|
|
1535
|
+
async resolve(index, cancellationToken) {
|
|
1536
|
+
if (cancellationToken.isCancellationRequested) {
|
|
1537
|
+
throw ( new CancellationError());
|
|
1538
|
+
}
|
|
1539
|
+
if (this.isResolved(index)) {
|
|
1540
|
+
return this.get(index);
|
|
1541
|
+
}
|
|
1542
|
+
const indexInPagedModel = index - this.preferredExtensions.length + this.resolvedGalleryExtensionsFromQuery.length;
|
|
1543
|
+
const pageIndex = Math.floor(indexInPagedModel / this.pager.pageSize);
|
|
1544
|
+
const page = this.pages[pageIndex];
|
|
1545
|
+
if (!page.promise) {
|
|
1546
|
+
page.cts = ( new CancellationTokenSource());
|
|
1547
|
+
page.promise = this.pager.getPage(pageIndex, page.cts.token).then(extensions => this.populateResolvedExtensions(pageIndex, extensions)).catch(e => {
|
|
1548
|
+
page.promise = null;
|
|
1549
|
+
throw e;
|
|
1550
|
+
}).finally(() => page.cts = null);
|
|
1551
|
+
}
|
|
1552
|
+
const listener = cancellationToken.onCancellationRequested(() => {
|
|
1553
|
+
if (!page.cts) {
|
|
1554
|
+
return;
|
|
1555
|
+
}
|
|
1556
|
+
page.promiseIndexes.delete(index);
|
|
1557
|
+
if (page.promiseIndexes.size === 0) {
|
|
1558
|
+
page.cts.cancel();
|
|
1559
|
+
}
|
|
1560
|
+
});
|
|
1561
|
+
page.promiseIndexes.add(index);
|
|
1562
|
+
try {
|
|
1563
|
+
await page.promise;
|
|
1564
|
+
} finally {
|
|
1565
|
+
listener.dispose();
|
|
1566
|
+
}
|
|
1567
|
+
return this.get(index);
|
|
1568
|
+
}
|
|
1569
|
+
populateResolvedExtensions(pageIndex, extensions) {
|
|
1570
|
+
let adjustIndexOfNextPagesBy = 0;
|
|
1571
|
+
const pageStartIndex = pageIndex * this.pager.pageSize;
|
|
1572
|
+
for (let i = 0; i < extensions.length; i++) {
|
|
1573
|
+
const e = extensions[i];
|
|
1574
|
+
if (e.gallery?.identifier.uuid && ( this.preferredGalleryExtensions.has(e.gallery.identifier.uuid))) {
|
|
1575
|
+
this.resolvedGalleryExtensionsFromQuery.push(e);
|
|
1576
|
+
adjustIndexOfNextPagesBy++;
|
|
1577
|
+
} else {
|
|
1578
|
+
this.resolved.set(
|
|
1579
|
+
this.preferredExtensions.length - this.resolvedGalleryExtensionsFromQuery.length + pageStartIndex + i,
|
|
1580
|
+
e
|
|
1581
|
+
);
|
|
1582
|
+
}
|
|
1583
|
+
}
|
|
1584
|
+
if (pageIndex !== 0 && adjustIndexOfNextPagesBy) {
|
|
1585
|
+
const nextPageStartIndex = (pageIndex + 1) * this.pager.pageSize;
|
|
1586
|
+
const indices = [...( this.resolved.keys())].sort();
|
|
1587
|
+
for (const index of indices) {
|
|
1588
|
+
if (index >= nextPageStartIndex) {
|
|
1589
|
+
const e = this.resolved.get(index);
|
|
1590
|
+
if (e) {
|
|
1591
|
+
this.resolved.delete(index);
|
|
1592
|
+
this.resolved.set(index - adjustIndexOfNextPagesBy, e);
|
|
1593
|
+
}
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1600
|
+
export { AbstractExtensionsListView, DefaultPopularExtensionsView, DefaultRecommendedExtensionsView, DeprecatedExtensionsView, DisabledExtensionsView, EnabledExtensionsView, ExtensionsListView, NONE_CATEGORY, OutdatedExtensionsView, PreferredExtensionsPagedModel, RecentlyUpdatedExtensionsView, RecommendedExtensionsView, SearchMarketplaceExtensionsView, ServerInstalledExtensionsView, StaticQueryExtensionsView, UntrustedWorkspacePartiallySupportedExtensionsView, UntrustedWorkspaceUnsupportedExtensionsView, VirtualWorkspacePartiallySupportedExtensionsView, VirtualWorkspaceUnsupportedExtensionsView, WorkspaceRecommendedExtensionsView };
|