monaco-editor-core 0.56.0-dev-20251124 → 0.56.0-dev-20251217
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/esm/nls.keys.json +1 -1
- package/esm/nls.messages.cs.js +2 -2
- package/esm/nls.messages.de.js +2 -2
- package/esm/nls.messages.es.js +2 -2
- package/esm/nls.messages.fr.js +2 -2
- package/esm/nls.messages.it.js +2 -2
- package/esm/nls.messages.ja.js +2 -2
- package/esm/nls.messages.js +1 -1
- package/esm/nls.messages.json +1 -1
- package/esm/nls.messages.ko.js +2 -2
- package/esm/nls.messages.pl.js +2 -2
- package/esm/nls.messages.pt-br.js +2 -2
- package/esm/nls.messages.ru.js +2 -2
- package/esm/nls.messages.tr.js +2 -2
- package/esm/nls.messages.zh-cn.js +2 -2
- package/esm/nls.messages.zh-tw.js +2 -2
- package/esm/nls.metadata.json +34 -2
- package/esm/vs/base/browser/dom.js +1 -4
- package/esm/vs/base/browser/dom.js.map +1 -1
- package/esm/vs/base/browser/markdownRenderer.js +25 -11
- package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
- package/esm/vs/base/browser/ui/button/button.js +15 -8
- package/esm/vs/base/browser/ui/button/button.js.map +1 -1
- package/esm/vs/base/browser/ui/codicons/codicon/codicon-modifiers.css +3 -8
- package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/esm/vs/base/browser/ui/list/list.css +1 -0
- package/esm/vs/base/browser/ui/toolbar/toolbar.js +3 -0
- package/esm/vs/base/browser/ui/toolbar/toolbar.js.map +1 -1
- package/esm/vs/base/common/async.js +11 -0
- package/esm/vs/base/common/async.js.map +1 -1
- package/esm/vs/base/common/codiconsLibrary.js +11 -2
- package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
- package/esm/vs/base/common/defaultAccount.js +6 -0
- package/esm/vs/base/common/defaultAccount.js.map +1 -0
- package/esm/vs/base/common/equals.js +73 -24
- package/esm/vs/base/common/equals.js.map +1 -1
- package/esm/vs/base/common/event.js +14 -4
- package/esm/vs/base/common/event.js.map +1 -1
- package/esm/vs/base/common/iterator.js.map +1 -1
- package/esm/vs/base/common/keybindings.js +0 -8
- package/esm/vs/base/common/keybindings.js.map +1 -1
- package/esm/vs/base/common/lifecycle.js +2 -2
- package/esm/vs/base/common/lifecycle.js.map +1 -1
- package/esm/vs/base/common/marshallingIds.js.map +1 -1
- package/esm/vs/base/common/observableInternal/index.js +1 -1
- package/esm/vs/base/common/observableInternal/index.js.map +1 -1
- package/esm/vs/base/common/observableInternal/observables/observableFromEvent.js +1 -1
- package/esm/vs/base/common/observableInternal/observables/observableFromEvent.js.map +1 -1
- package/esm/vs/base/common/observableInternal/reactions/autorunImpl.js +16 -0
- package/esm/vs/base/common/observableInternal/reactions/autorunImpl.js.map +1 -1
- package/esm/vs/base/common/observableInternal/utils/utils.js +11 -0
- package/esm/vs/base/common/observableInternal/utils/utils.js.map +1 -1
- package/esm/vs/base/common/product.js.map +1 -1
- package/esm/vs/base/common/strings.js +3 -1
- package/esm/vs/base/common/strings.js.map +1 -1
- package/esm/vs/editor/browser/controller/dragScrolling.js +2 -1
- package/esm/vs/editor/browser/controller/dragScrolling.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js +73 -2
- package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js +7 -51
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/screenReaderUtils.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +7 -20
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.js +14 -44
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextRegistry.js +19 -0
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextRegistry.js.map +1 -0
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextState.js +14 -1
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextState.js.map +1 -1
- package/esm/vs/editor/browser/controller/mouseHandler.js +5 -2
- package/esm/vs/editor/browser/controller/mouseHandler.js.map +1 -1
- package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
- package/esm/vs/editor/browser/observableCodeEditor.js +32 -15
- package/esm/vs/editor/browser/observableCodeEditor.js.map +1 -1
- package/esm/vs/editor/browser/view.js +11 -2
- package/esm/vs/editor/browser/view.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js +5 -2
- package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js.map +1 -1
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +10 -0
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
- package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js.map +1 -1
- package/esm/vs/editor/browser/widget/multiDiffEditor/style.css +48 -0
- package/esm/vs/editor/common/config/fontInfo.js +1 -1
- package/esm/vs/editor/common/config/fontInfo.js.map +1 -1
- package/esm/vs/editor/common/core/edits/edit.js +19 -0
- package/esm/vs/editor/common/core/edits/edit.js.map +1 -1
- package/esm/vs/editor/common/core/edits/stringEdit.js +13 -0
- package/esm/vs/editor/common/core/edits/stringEdit.js.map +1 -1
- package/esm/vs/editor/common/core/edits/textEdit.js.map +1 -1
- package/esm/vs/editor/common/core/text/positionToOffsetImpl.js +24 -10
- package/esm/vs/editor/common/core/text/positionToOffsetImpl.js.map +1 -1
- package/esm/vs/editor/common/cursor/cursorMoveCommands.js +4 -4
- package/esm/vs/editor/common/cursor/cursorMoveCommands.js.map +1 -1
- package/esm/vs/editor/common/cursor/cursorWordOperations.js +6 -3
- package/esm/vs/editor/common/cursor/cursorWordOperations.js.map +1 -1
- package/esm/vs/editor/common/languages/defaultDocumentColorsComputer.js +2 -2
- package/esm/vs/editor/common/languages/defaultDocumentColorsComputer.js.map +1 -1
- package/esm/vs/editor/common/languages/nullTokenize.js +1 -1
- package/esm/vs/editor/common/languages/nullTokenize.js.map +1 -1
- package/esm/vs/editor/common/languages/supports/tokenization.js +3 -0
- package/esm/vs/editor/common/languages/supports/tokenization.js.map +1 -1
- package/esm/vs/editor/common/languages.js +2 -1
- package/esm/vs/editor/common/languages.js.map +1 -1
- package/esm/vs/editor/common/model/decorationProvider.js +21 -1
- package/esm/vs/editor/common/model/decorationProvider.js.map +1 -1
- package/esm/vs/editor/common/model/textModel.js +49 -30
- package/esm/vs/editor/common/model/textModel.js.map +1 -1
- package/esm/vs/editor/common/model/tokens/abstractSyntaxTokenBackend.js +6 -3
- package/esm/vs/editor/common/model/tokens/abstractSyntaxTokenBackend.js.map +1 -1
- package/esm/vs/editor/common/model/tokens/annotations.js +177 -0
- package/esm/vs/editor/common/model/tokens/annotations.js.map +1 -0
- package/esm/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.js +131 -0
- package/esm/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.js.map +1 -0
- package/esm/vs/editor/common/model/tokens/tokenizationTextModelPart.js +9 -0
- package/esm/vs/editor/common/model/tokens/tokenizationTextModelPart.js.map +1 -1
- package/esm/vs/editor/common/model/tokens/tokenizerSyntaxTokenBackend.js +9 -0
- package/esm/vs/editor/common/model/tokens/tokenizerSyntaxTokenBackend.js.map +1 -1
- package/esm/vs/editor/common/textModelEditSource.js +2 -0
- package/esm/vs/editor/common/textModelEditSource.js.map +1 -1
- package/esm/vs/editor/common/textModelEvents.js.map +1 -1
- package/esm/vs/editor/common/viewLayout/lineDecorations.js.map +1 -1
- package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +1 -1
- package/esm/vs/editor/common/viewLayout/viewLineRenderer.js.map +1 -1
- package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +54 -36
- package/esm/vs/editor/contrib/clipboard/browser/clipboard.js.map +1 -1
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +14 -1
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js.map +1 -1
- package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.css +1 -1
- package/esm/vs/editor/contrib/hover/browser/hover.css +1 -1
- package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +1 -1
- package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js.map +1 -1
- package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js +1 -0
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commandIds.js +2 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commandIds.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +33 -4
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +13 -12
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +7 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +5 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js +2 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/InlineSuggestAlternativeAction.js +8 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/InlineSuggestAlternativeAction.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/editKind.js +198 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/editKind.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionIsVisible.js +40 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionIsVisible.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +128 -65
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js +69 -13
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js +159 -94
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js +124 -50
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js +393 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/telemetry.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/utils.js +20 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/utils.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +59 -42
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +29 -8
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +78 -46
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditWithChanges.js +9 -4
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditWithChanges.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js +11 -4
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js +81 -41
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewInterface.js +48 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewInterface.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js +18 -15
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCollapsedView.js +3 -4
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCollapsedView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCustomView.js +6 -7
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCustomView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsDeletionView.js +4 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsDeletionView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js +4 -3
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsLineReplacementView.js +8 -8
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsLineReplacementView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.js +9 -7
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js +203 -41
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/jumpToView.js +189 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/jumpToView.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js +85 -102
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistancePreviewEditor.js +75 -32
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistancePreviewEditor.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistnaceWidgetPlacement.js +121 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistnaceWidgetPlacement.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/originalEditorInlineDiffView.js +2 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/originalEditorInlineDiffView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +22 -20
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js +15 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/view.css +39 -6
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js +10 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js.map +1 -1
- package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
- package/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
- package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +32 -32
- package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js.map +1 -1
- package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
- package/esm/vs/editor/contrib/links/browser/links.js +10 -10
- package/esm/vs/editor/contrib/message/browser/messageController.js +1 -1
- package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
- package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
- package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +11 -11
- package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
- package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
- package/esm/vs/editor/contrib/rename/browser/rename.js +19 -11
- package/esm/vs/editor/contrib/rename/browser/rename.js.map +1 -1
- package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
- package/esm/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.js +3 -2
- package/esm/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.js.map +1 -1
- package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
- package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +4 -4
- package/esm/vs/editor/contrib/snippet/browser/snippetParser.js +33 -0
- package/esm/vs/editor/contrib/snippet/browser/snippetParser.js.map +1 -1
- package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js +12 -4
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js.map +1 -1
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js +1 -0
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggest.js +9 -8
- package/esm/vs/editor/contrib/suggest/browser/suggest.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggestController.js +39 -28
- package/esm/vs/editor/contrib/suggest/browser/suggestController.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js +1 -0
- package/esm/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +22 -18
- package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +28 -6
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
- package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +1 -1
- package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
- package/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
- package/esm/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +24 -24
- package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
- package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
- package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -3
- package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +19 -2
- package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js.map +1 -1
- package/esm/vs/editor/editor.api.d.ts +37 -2
- package/esm/vs/editor/standalone/browser/standaloneLanguages.js +2 -2
- package/esm/vs/editor/standalone/browser/standaloneLanguages.js.map +1 -1
- package/esm/vs/editor/standalone/browser/standaloneServices.js +11 -1
- package/esm/vs/editor/standalone/browser/standaloneServices.js.map +1 -1
- package/esm/vs/editor/standalone/common/monarch/monarchLexer.js +1 -1
- package/esm/vs/editor/standalone/common/monarch/monarchLexer.js.map +1 -1
- package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +62 -62
- package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
- package/esm/vs/platform/actionWidget/browser/actionList.js +4 -4
- package/esm/vs/platform/actionWidget/browser/actionWidget.css +11 -8
- package/esm/vs/platform/actionWidget/browser/actionWidget.js +7 -7
- package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +5 -5
- package/esm/vs/platform/actions/browser/toolbar.js +2 -2
- package/esm/vs/platform/actions/common/actions.js +11 -4
- package/esm/vs/platform/actions/common/actions.js.map +1 -1
- package/esm/vs/platform/actions/common/menuService.js +2 -2
- package/esm/vs/platform/configuration/common/configurationRegistry.js +10 -10
- package/esm/vs/platform/contextkey/browser/contextKeyService.js +1 -1
- package/esm/vs/platform/contextkey/common/contextkey.js +9 -9
- package/esm/vs/platform/contextkey/common/contextkeys.js +9 -9
- package/esm/vs/platform/contextkey/common/scanner.js +5 -5
- package/esm/vs/platform/{product/common/productService.js → defaultAccount/common/defaultAccount.js} +2 -2
- package/esm/vs/platform/defaultAccount/common/defaultAccount.js.map +1 -0
- package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
- package/esm/vs/platform/hover/browser/hoverWidget.js +1 -1
- package/esm/vs/platform/hover/browser/updatableHoverWidget.js +1 -1
- package/esm/vs/platform/instantiation/common/instantiation.js.map +1 -1
- package/esm/vs/platform/instantiation/common/instantiationService.js +1 -8
- package/esm/vs/platform/instantiation/common/instantiationService.js.map +1 -1
- package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +4 -4
- package/esm/vs/platform/list/browser/listService.js +27 -27
- package/esm/vs/platform/log/common/log.js +1 -1
- package/esm/vs/platform/log/common/log.js.map +1 -1
- package/esm/vs/platform/markers/common/markerService.js +6 -6
- package/esm/vs/platform/markers/common/markerService.js.map +1 -1
- package/esm/vs/platform/markers/common/markers.js +6 -6
- package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +8 -8
- package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
- package/esm/vs/platform/quickinput/browser/media/quickInput.css +7 -3
- package/esm/vs/platform/quickinput/browser/quickInput.js +19 -11
- package/esm/vs/platform/quickinput/browser/quickInput.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
- package/esm/vs/platform/quickinput/browser/quickInputController.js +6 -6
- package/esm/vs/platform/quickinput/browser/quickInputList.js +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
- package/esm/vs/platform/theme/common/colorUtils.js +2 -2
- package/esm/vs/platform/theme/common/colors/baseColors.js +18 -17
- package/esm/vs/platform/theme/common/colors/baseColors.js.map +1 -1
- package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -8
- package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
- package/esm/vs/platform/theme/common/colors/inputColors.js +47 -47
- package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
- package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
- package/esm/vs/platform/theme/common/colors/minimapColors.js +13 -13
- package/esm/vs/platform/theme/common/colors/minimapColors.js.map +1 -1
- package/esm/vs/platform/theme/common/colors/miscColors.js +16 -16
- package/esm/vs/platform/theme/common/colors/quickpickColors.js +9 -9
- package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
- package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
- package/esm/vs/platform/undoRedo/common/undoRedoService.js +21 -21
- package/esm/vs/platform/undoRedo/common/undoRedoService.js.map +1 -1
- package/esm/vs/platform/window/common/window.js +1 -1
- package/esm/vs/platform/window/common/window.js.map +1 -1
- package/esm/vs/platform/workspace/common/workspace.js +1 -1
- package/monaco.d.ts +37 -2
- package/package.json +2 -2
- package/version.txt +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineEdit.js +0 -16
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineEdit.js.map +0 -1
- package/esm/vs/platform/product/common/productService.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/platform/log/common/log.ts","vs/platform/log/common/log.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OA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IAAI,CAAC,OAAe,EAAE,GAAG,IAAe,IAAU,CAAC;IACnD,KAAK,CAAC,OAAuB,EAAE,GAAG,IAAe,IAAU,CAAC;IAC5D,OAAO,KAAW,CAAC;CACnB;AAED,MAAM,OAAO,iBAAkB,SAAQ,qBAAqB;IAC3D;QACC,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;IAC9C,CAAC;IACkB,cAAc,CAAC,QAAa,EAAE,QAAkB,EAAE,OAAwB;QAC5F,OAAO,IAAI,UAAU,EAAE,CAAC;IACzB,CAAC;CACD;AAED,MAAM,UAAU,gBAAgB,CAAC,QAAkB;IAClD,QAAQ,QAAQ,EAAE,CAAC;QAClB,KAAK,QAAQ,CAAC,KAAK,CAAC,CAAC,OAAO,OAAO,CAAC;QACpC,KAAK,QAAQ,CAAC,KAAK,CAAC,CAAC,OAAO,OAAO,CAAC;QACpC,KAAK,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,MAAM,CAAC;QAClC,KAAK,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,MAAM,CAAC;QACrC,KAAK,QAAQ,CAAC,KAAK,CAAC,CAAC,OAAO,OAAO,CAAC;QACpC,KAAK,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,KAAK,CAAC;IACjC,CAAC;AACF,CAAC;AAED,WAAW;AACX,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,aAAa,CAAS,UAAU,EAAE,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC","file":"log.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["\nimport { Emitter, Event } from '../../../base/common/event.js';\nimport { hash } from '../../../base/common/hash.js';\nimport { Disposable, IDisposable } from '../../../base/common/lifecycle.js';\nimport { ResourceMap } from '../../../base/common/map.js';\nimport { joinPath } from '../../../base/common/resources.js';\nimport { Mutable, isString } from '../../../base/common/types.js';\nimport { URI } from '../../../base/common/uri.js';\nimport { RawContextKey } from '../../contextkey/common/contextkey.js';\nimport { createDecorator } from '../../instantiation/common/instantiation.js';\n\nexport const ILogService = createDecorator<ILogService>('logService');\nexport const ILoggerService = createDecorator<ILoggerService>('loggerService');\n\nexport enum LogLevel {\n\tOff,\n\tTrace,\n\tDebug,\n\tInfo,\n\tWarning,\n\tError\n}\n\nexport const DEFAULT_LOG_LEVEL: LogLevel = LogLevel.Info;\n\nexport interface ILogger extends IDisposable {\n\treadonly onDidChangeLogLevel: Event<LogLevel>;\n\tgetLevel(): LogLevel;\n\tsetLevel(level: LogLevel): void;\n\n\ttrace(message: string, ...args: unknown[]): void;\n\tdebug(message: string, ...args: unknown[]): void;\n\tinfo(message: string, ...args: unknown[]): void;\n\twarn(message: string, ...args: unknown[]): void;\n\terror(message: string | Error, ...args: unknown[]): void;\n}\n\nexport function canLog(loggerLevel: LogLevel, messageLevel: LogLevel): boolean {\n\treturn loggerLevel !== LogLevel.Off && loggerLevel <= messageLevel;\n}\n\nexport type LoggerGroup = {\n\treadonly id: string;\n\treadonly name: string;\n};\n\nexport interface ILogService extends ILogger {\n\treadonly _serviceBrand: undefined;\n}\n\nexport interface ILoggerOptions {\n\n\t/**\n\t * Id of the logger.\n\t */\n\tid?: string;\n\n\t/**\n\t * Name of the logger.\n\t */\n\tname?: string;\n\n\t/**\n\t * When to log. Set to `always` to log always.\n\t */\n\tlogLevel?: 'always' | LogLevel;\n\n\t/**\n\t * Whether the log should be hidden from the user.\n\t */\n\thidden?: boolean;\n\n\t/**\n\t * Condition which must be true to show this logger\n\t */\n\twhen?: string;\n\n\t/**\n\t * Id of the extension that created this logger.\n\t */\n\textensionId?: string;\n\n\t/**\n\t * Group of the logger.\n\t */\n\tgroup?: LoggerGroup;\n}\n\nexport interface ILoggerResource {\n\treadonly resource: URI;\n\treadonly id: string;\n\treadonly name?: string;\n\treadonly logLevel?: LogLevel;\n\treadonly hidden?: boolean;\n\treadonly when?: string;\n\treadonly extensionId?: string;\n\treadonly group?: LoggerGroup;\n}\n\nexport interface ILoggerService {\n\n\treadonly _serviceBrand: undefined;\n\n\t/**\n\t * Creates a logger for the given resource, or gets one if it already exists.\n\t *\n\t * This will also register the logger with the logger service.\n\t */\n\tcreateLogger(resource: URI, options?: ILoggerOptions): ILogger;\n\n\t/**\n\t * Creates a logger with the given id in the logs folder, or gets one if it already exists.\n\t *\n\t * This will also register the logger with the logger service.\n\t */\n\tcreateLogger(id: string, options?: Omit<ILoggerOptions, 'id'>): ILogger;\n}\n\nexport abstract class AbstractLogger extends Disposable implements ILogger {\n\n\tprivate level: LogLevel = DEFAULT_LOG_LEVEL;\n\tprivate readonly _onDidChangeLogLevel: Emitter<LogLevel> = this._register(new Emitter<LogLevel>());\n\tget onDidChangeLogLevel(): Event<LogLevel> { return this._onDidChangeLogLevel.event; }\n\n\tsetLevel(level: LogLevel): void {\n\t\tif (this.level !== level) {\n\t\t\tthis.level = level;\n\t\t\tthis._onDidChangeLogLevel.fire(this.level);\n\t\t}\n\t}\n\n\tgetLevel(): LogLevel {\n\t\treturn this.level;\n\t}\n\n\tprotected checkLogLevel(level: LogLevel): boolean {\n\t\treturn canLog(this.level, level);\n\t}\n\n\tprotected canLog(level: LogLevel): boolean {\n\t\tif (this._store.isDisposed) {\n\t\t\treturn false;\n\t\t}\n\t\treturn this.checkLogLevel(level);\n\t}\n\n\tabstract trace(message: string, ...args: unknown[]): void;\n\tabstract debug(message: string, ...args: unknown[]): void;\n\tabstract info(message: string, ...args: unknown[]): void;\n\tabstract warn(message: string, ...args: unknown[]): void;\n\tabstract error(message: string | Error, ...args: unknown[]): void;\n}\n\nexport class ConsoleLogger extends AbstractLogger implements ILogger {\n\n\tconstructor(logLevel: LogLevel = DEFAULT_LOG_LEVEL, private readonly useColors: boolean = true) {\n\t\tsuper();\n\t\tthis.setLevel(logLevel);\n\t}\n\n\ttrace(message: string, ...args: unknown[]): void {\n\t\tif (this.canLog(LogLevel.Trace)) {\n\t\t\tif (this.useColors) {\n\t\t\t\tconsole.log('%cTRACE', 'color: #888', message, ...args);\n\t\t\t} else {\n\t\t\t\tconsole.log(message, ...args);\n\t\t\t}\n\t\t}\n\t}\n\n\tdebug(message: string, ...args: unknown[]): void {\n\t\tif (this.canLog(LogLevel.Debug)) {\n\t\t\tif (this.useColors) {\n\t\t\t\tconsole.log('%cDEBUG', 'background: #eee; color: #888', message, ...args);\n\t\t\t} else {\n\t\t\t\tconsole.log(message, ...args);\n\t\t\t}\n\t\t}\n\t}\n\n\tinfo(message: string, ...args: unknown[]): void {\n\t\tif (this.canLog(LogLevel.Info)) {\n\t\t\tif (this.useColors) {\n\t\t\t\tconsole.log('%c INFO', 'color: #33f', message, ...args);\n\t\t\t} else {\n\t\t\t\tconsole.log(message, ...args);\n\t\t\t}\n\t\t}\n\t}\n\n\twarn(message: string | Error, ...args: unknown[]): void {\n\t\tif (this.canLog(LogLevel.Warning)) {\n\t\t\tif (this.useColors) {\n\t\t\t\tconsole.warn('%c WARN', 'color: #993', message, ...args);\n\t\t\t} else {\n\t\t\t\tconsole.log(message, ...args);\n\t\t\t}\n\t\t}\n\t}\n\n\terror(message: string, ...args: unknown[]): void {\n\t\tif (this.canLog(LogLevel.Error)) {\n\t\t\tif (this.useColors) {\n\t\t\t\tconsole.error('%c ERR', 'color: #f33', message, ...args);\n\t\t\t} else {\n\t\t\t\tconsole.error(message, ...args);\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport class MultiplexLogger extends AbstractLogger implements ILogger {\n\n\tconstructor(private readonly loggers: ReadonlyArray<ILogger>) {\n\t\tsuper();\n\t\tif (loggers.length) {\n\t\t\tthis.setLevel(loggers[0].getLevel());\n\t\t}\n\t}\n\n\toverride setLevel(level: LogLevel): void {\n\t\tfor (const logger of this.loggers) {\n\t\t\tlogger.setLevel(level);\n\t\t}\n\t\tsuper.setLevel(level);\n\t}\n\n\ttrace(message: string, ...args: unknown[]): void {\n\t\tfor (const logger of this.loggers) {\n\t\t\tlogger.trace(message, ...args);\n\t\t}\n\t}\n\n\tdebug(message: string, ...args: unknown[]): void {\n\t\tfor (const logger of this.loggers) {\n\t\t\tlogger.debug(message, ...args);\n\t\t}\n\t}\n\n\tinfo(message: string, ...args: unknown[]): void {\n\t\tfor (const logger of this.loggers) {\n\t\t\tlogger.info(message, ...args);\n\t\t}\n\t}\n\n\twarn(message: string, ...args: unknown[]): void {\n\t\tfor (const logger of this.loggers) {\n\t\t\tlogger.warn(message, ...args);\n\t\t}\n\t}\n\n\terror(message: string | Error, ...args: unknown[]): void {\n\t\tfor (const logger of this.loggers) {\n\t\t\tlogger.error(message, ...args);\n\t\t}\n\t}\n\n\toverride dispose(): void {\n\t\tfor (const logger of this.loggers) {\n\t\t\tlogger.dispose();\n\t\t}\n\t\tsuper.dispose();\n\t}\n}\n\ntype LoggerEntry = { logger: ILogger | undefined; info: Mutable<ILoggerResource> };\n\nexport abstract class AbstractLoggerService extends Disposable implements ILoggerService {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate readonly _loggers = new ResourceMap<LoggerEntry>();\n\n\tprivate _onDidChangeLoggers = this._register(new Emitter<{ added: ILoggerResource[]; removed: ILoggerResource[] }>);\n\n\tprivate _onDidChangeVisibility = this._register(new Emitter<[URI, boolean]>);\n\n\tconstructor(\n\t\tprotected logLevel: LogLevel,\n\t\tprivate readonly logsHome: URI,\n\t\tloggerResources?: Iterable<ILoggerResource>,\n\t) {\n\t\tsuper();\n\t\tif (loggerResources) {\n\t\t\tfor (const loggerResource of loggerResources) {\n\t\t\t\tthis._loggers.set(loggerResource.resource, { logger: undefined, info: loggerResource });\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate getLoggerEntry(resourceOrId: URI | string): LoggerEntry | undefined {\n\t\tif (isString(resourceOrId)) {\n\t\t\treturn [...this._loggers.values()].find(logger => logger.info.id === resourceOrId);\n\t\t}\n\t\treturn this._loggers.get(resourceOrId);\n\t}\n\n\tcreateLogger(idOrResource: URI | string, options?: ILoggerOptions): ILogger {\n\t\tconst resource = this.toResource(idOrResource);\n\t\tconst id = isString(idOrResource) ? idOrResource : (options?.id ?? hash(resource.toString()).toString(16));\n\t\tlet logger = this._loggers.get(resource)?.logger;\n\t\tconst logLevel = options?.logLevel === 'always' ? LogLevel.Trace : options?.logLevel;\n\t\tif (!logger) {\n\t\t\tlogger = this.doCreateLogger(resource, logLevel ?? this.getLogLevel(resource) ?? this.logLevel, { ...options, id });\n\t\t}\n\t\tconst loggerEntry: LoggerEntry = {\n\t\t\tlogger,\n\t\t\tinfo: {\n\t\t\t\tresource,\n\t\t\t\tid,\n\t\t\t\tlogLevel,\n\t\t\t\tname: options?.name,\n\t\t\t\thidden: options?.hidden,\n\t\t\t\tgroup: options?.group,\n\t\t\t\textensionId: options?.extensionId,\n\t\t\t\twhen: options?.when\n\t\t\t}\n\t\t};\n\t\tthis.registerLogger(loggerEntry.info);\n\t\t// TODO: @sandy081 Remove this once registerLogger can take ILogger\n\t\tthis._loggers.set(resource, loggerEntry);\n\t\treturn logger;\n\t}\n\n\tprotected toResource(idOrResource: string | URI): URI {\n\t\treturn isString(idOrResource) ? joinPath(this.logsHome, `${idOrResource}.log`) : idOrResource;\n\t}\n\n\tsetVisibility(resourceOrId: URI | string, visibility: boolean): void {\n\t\tconst logger = this.getLoggerEntry(resourceOrId);\n\t\tif (logger && visibility !== !logger.info.hidden) {\n\t\t\tlogger.info.hidden = !visibility;\n\t\t\tthis._loggers.set(logger.info.resource, logger);\n\t\t\tthis._onDidChangeVisibility.fire([logger.info.resource, visibility]);\n\t\t}\n\t}\n\n\tgetLogLevel(resource?: URI): LogLevel {\n\t\tlet logLevel;\n\t\tif (resource) {\n\t\t\tlogLevel = this._loggers.get(resource)?.info.logLevel;\n\t\t}\n\t\treturn logLevel ?? this.logLevel;\n\t}\n\n\tregisterLogger(resource: ILoggerResource): void {\n\t\tconst existing = this._loggers.get(resource.resource);\n\t\tif (existing) {\n\t\t\tif (existing.info.hidden !== resource.hidden) {\n\t\t\t\tthis.setVisibility(resource.resource, !resource.hidden);\n\t\t\t}\n\t\t} else {\n\t\t\tthis._loggers.set(resource.resource, { info: resource, logger: undefined });\n\t\t\tthis._onDidChangeLoggers.fire({ added: [resource], removed: [] });\n\t\t}\n\t}\n\n\toverride dispose(): void {\n\t\tthis._loggers.forEach(logger => logger.logger?.dispose());\n\t\tthis._loggers.clear();\n\t\tsuper.dispose();\n\t}\n\n\tprotected abstract doCreateLogger(resource: URI, logLevel: LogLevel, options?: ILoggerOptions): ILogger;\n}\n\nexport class NullLogger implements ILogger {\n\treadonly onDidChangeLogLevel: Event<LogLevel> = new Emitter<LogLevel>().event;\n\tsetLevel(level: LogLevel): void { }\n\tgetLevel(): LogLevel { return LogLevel.Info; }\n\ttrace(message: string, ...args: unknown[]): void { }\n\tdebug(message: string, ...args: unknown[]): void { }\n\tinfo(message: string, ...args: unknown[]): void { }\n\twarn(message: string, ...args: unknown[]): void { }\n\terror(message: string | Error, ...args: unknown[]): void { }\n\tdispose(): void { }\n}\n\nexport class NullLoggerService extends AbstractLoggerService {\n\tconstructor() {\n\t\tsuper(LogLevel.Off, URI.parse('log:///log'));\n\t}\n\tprotected override doCreateLogger(resource: URI, logLevel: LogLevel, options?: ILoggerOptions): ILogger {\n\t\treturn new NullLogger();\n\t}\n}\n\nexport function LogLevelToString(logLevel: LogLevel): string {\n\tswitch (logLevel) {\n\t\tcase LogLevel.Trace: return 'trace';\n\t\tcase LogLevel.Debug: return 'debug';\n\t\tcase LogLevel.Info: return 'info';\n\t\tcase LogLevel.Warning: return 'warn';\n\t\tcase LogLevel.Error: return 'error';\n\t\tcase LogLevel.Off: return 'off';\n\t}\n}\n\n// Contexts\nexport const CONTEXT_LOG_LEVEL = new RawContextKey<string>('logLevel', LogLevelToString(LogLevel.Info));\n","\nimport { Emitter, Event } from '../../../base/common/event.js';\nimport { hash } from '../../../base/common/hash.js';\nimport { Disposable, IDisposable } from '../../../base/common/lifecycle.js';\nimport { ResourceMap } from '../../../base/common/map.js';\nimport { joinPath } from '../../../base/common/resources.js';\nimport { Mutable, isString } from '../../../base/common/types.js';\nimport { URI } from '../../../base/common/uri.js';\nimport { RawContextKey } from '../../contextkey/common/contextkey.js';\nimport { createDecorator } from '../../instantiation/common/instantiation.js';\n\nexport const ILogService = createDecorator<ILogService>('logService');\nexport const ILoggerService = createDecorator<ILoggerService>('loggerService');\n\nexport enum LogLevel {\n\tOff,\n\tTrace,\n\tDebug,\n\tInfo,\n\tWarning,\n\tError\n}\n\nexport const DEFAULT_LOG_LEVEL: LogLevel = LogLevel.Info;\n\nexport interface ILogger extends IDisposable {\n\treadonly onDidChangeLogLevel: Event<LogLevel>;\n\tgetLevel(): LogLevel;\n\tsetLevel(level: LogLevel): void;\n\n\ttrace(message: string, ...args: unknown[]): void;\n\tdebug(message: string, ...args: unknown[]): void;\n\tinfo(message: string, ...args: unknown[]): void;\n\twarn(message: string, ...args: unknown[]): void;\n\terror(message: string | Error, ...args: unknown[]): void;\n}\n\nexport function canLog(loggerLevel: LogLevel, messageLevel: LogLevel): boolean {\n\treturn loggerLevel !== LogLevel.Off && loggerLevel <= messageLevel;\n}\n\nexport type LoggerGroup = {\n\treadonly id: string;\n\treadonly name: string;\n};\n\nexport interface ILogService extends ILogger {\n\treadonly _serviceBrand: undefined;\n}\n\nexport interface ILoggerOptions {\n\n\t/**\n\t * Id of the logger.\n\t */\n\tid?: string;\n\n\t/**\n\t * Name of the logger.\n\t */\n\tname?: string;\n\n\t/**\n\t * When to log. Set to `always` to log always.\n\t */\n\tlogLevel?: 'always' | LogLevel;\n\n\t/**\n\t * Whether the log should be hidden from the user.\n\t */\n\thidden?: boolean;\n\n\t/**\n\t * Condition which must be true to show this logger\n\t */\n\twhen?: string;\n\n\t/**\n\t * Id of the extension that created this logger.\n\t */\n\textensionId?: string;\n\n\t/**\n\t * Group of the logger.\n\t */\n\tgroup?: LoggerGroup;\n}\n\nexport interface ILoggerResource {\n\treadonly resource: URI;\n\treadonly id: string;\n\treadonly name?: string;\n\treadonly logLevel?: LogLevel;\n\treadonly hidden?: boolean;\n\treadonly when?: string;\n\treadonly extensionId?: string;\n\treadonly group?: LoggerGroup;\n}\n\nexport interface ILoggerService {\n\n\treadonly _serviceBrand: undefined;\n\n\t/**\n\t * Creates a logger for the given resource, or gets one if it already exists.\n\t *\n\t * This will also register the logger with the logger service.\n\t */\n\tcreateLogger(resource: URI, options?: ILoggerOptions): ILogger;\n\n\t/**\n\t * Creates a logger with the given id in the logs folder, or gets one if it already exists.\n\t *\n\t * This will also register the logger with the logger service.\n\t */\n\tcreateLogger(id: string, options?: Omit<ILoggerOptions, 'id'>): ILogger;\n}\n\nexport abstract class AbstractLogger extends Disposable implements ILogger {\n\n\tprivate level: LogLevel = DEFAULT_LOG_LEVEL;\n\tprivate readonly _onDidChangeLogLevel: Emitter<LogLevel> = this._register(new Emitter<LogLevel>());\n\tget onDidChangeLogLevel(): Event<LogLevel> { return this._onDidChangeLogLevel.event; }\n\n\tsetLevel(level: LogLevel): void {\n\t\tif (this.level !== level) {\n\t\t\tthis.level = level;\n\t\t\tthis._onDidChangeLogLevel.fire(this.level);\n\t\t}\n\t}\n\n\tgetLevel(): LogLevel {\n\t\treturn this.level;\n\t}\n\n\tprotected checkLogLevel(level: LogLevel): boolean {\n\t\treturn canLog(this.level, level);\n\t}\n\n\tprotected canLog(level: LogLevel): boolean {\n\t\tif (this._store.isDisposed) {\n\t\t\treturn false;\n\t\t}\n\t\treturn this.checkLogLevel(level);\n\t}\n\n\tabstract trace(message: string, ...args: unknown[]): void;\n\tabstract debug(message: string, ...args: unknown[]): void;\n\tabstract info(message: string, ...args: unknown[]): void;\n\tabstract warn(message: string, ...args: unknown[]): void;\n\tabstract error(message: string | Error, ...args: unknown[]): void;\n}\n\nexport class ConsoleLogger extends AbstractLogger implements ILogger {\n\n\tconstructor(logLevel: LogLevel = DEFAULT_LOG_LEVEL, private readonly useColors: boolean = true) {\n\t\tsuper();\n\t\tthis.setLevel(logLevel);\n\t}\n\n\ttrace(message: string, ...args: unknown[]): void {\n\t\tif (this.canLog(LogLevel.Trace)) {\n\t\t\tif (this.useColors) {\n\t\t\t\tconsole.log('%cTRACE', 'color: #888', message, ...args);\n\t\t\t} else {\n\t\t\t\tconsole.log(message, ...args);\n\t\t\t}\n\t\t}\n\t}\n\n\tdebug(message: string, ...args: unknown[]): void {\n\t\tif (this.canLog(LogLevel.Debug)) {\n\t\t\tif (this.useColors) {\n\t\t\t\tconsole.log('%cDEBUG', 'background: #eee; color: #888', message, ...args);\n\t\t\t} else {\n\t\t\t\tconsole.log(message, ...args);\n\t\t\t}\n\t\t}\n\t}\n\n\tinfo(message: string, ...args: unknown[]): void {\n\t\tif (this.canLog(LogLevel.Info)) {\n\t\t\tif (this.useColors) {\n\t\t\t\tconsole.log('%c INFO', 'color: #33f', message, ...args);\n\t\t\t} else {\n\t\t\t\tconsole.log(message, ...args);\n\t\t\t}\n\t\t}\n\t}\n\n\twarn(message: string | Error, ...args: unknown[]): void {\n\t\tif (this.canLog(LogLevel.Warning)) {\n\t\t\tif (this.useColors) {\n\t\t\t\tconsole.warn('%c WARN', 'color: #993', message, ...args);\n\t\t\t} else {\n\t\t\t\tconsole.log(message, ...args);\n\t\t\t}\n\t\t}\n\t}\n\n\terror(message: string, ...args: unknown[]): void {\n\t\tif (this.canLog(LogLevel.Error)) {\n\t\t\tif (this.useColors) {\n\t\t\t\tconsole.error('%c ERR', 'color: #f33', message, ...args);\n\t\t\t} else {\n\t\t\t\tconsole.error(message, ...args);\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport class MultiplexLogger extends AbstractLogger implements ILogger {\n\n\tconstructor(private readonly loggers: ReadonlyArray<ILogger>) {\n\t\tsuper();\n\t\tif (loggers.length) {\n\t\t\tthis.setLevel(loggers[0].getLevel());\n\t\t}\n\t}\n\n\toverride setLevel(level: LogLevel): void {\n\t\tfor (const logger of this.loggers) {\n\t\t\tlogger.setLevel(level);\n\t\t}\n\t\tsuper.setLevel(level);\n\t}\n\n\ttrace(message: string, ...args: unknown[]): void {\n\t\tfor (const logger of this.loggers) {\n\t\t\tlogger.trace(message, ...args);\n\t\t}\n\t}\n\n\tdebug(message: string, ...args: unknown[]): void {\n\t\tfor (const logger of this.loggers) {\n\t\t\tlogger.debug(message, ...args);\n\t\t}\n\t}\n\n\tinfo(message: string, ...args: unknown[]): void {\n\t\tfor (const logger of this.loggers) {\n\t\t\tlogger.info(message, ...args);\n\t\t}\n\t}\n\n\twarn(message: string, ...args: unknown[]): void {\n\t\tfor (const logger of this.loggers) {\n\t\t\tlogger.warn(message, ...args);\n\t\t}\n\t}\n\n\terror(message: string | Error, ...args: unknown[]): void {\n\t\tfor (const logger of this.loggers) {\n\t\t\tlogger.error(message, ...args);\n\t\t}\n\t}\n\n\toverride dispose(): void {\n\t\tfor (const logger of this.loggers) {\n\t\t\tlogger.dispose();\n\t\t}\n\t\tsuper.dispose();\n\t}\n}\n\ntype LoggerEntry = { logger: ILogger | undefined; info: Mutable<ILoggerResource> };\n\nexport abstract class AbstractLoggerService extends Disposable implements ILoggerService {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate readonly _loggers = new ResourceMap<LoggerEntry>();\n\n\tprivate _onDidChangeLoggers = this._register(new Emitter<{ added: ILoggerResource[]; removed: ILoggerResource[] }>);\n\n\tprivate _onDidChangeVisibility = this._register(new Emitter<[URI, boolean]>);\n\n\tconstructor(\n\t\tprotected logLevel: LogLevel,\n\t\tprivate readonly logsHome: URI,\n\t\tloggerResources?: Iterable<ILoggerResource>,\n\t) {\n\t\tsuper();\n\t\tif (loggerResources) {\n\t\t\tfor (const loggerResource of loggerResources) {\n\t\t\t\tthis._loggers.set(loggerResource.resource, { logger: undefined, info: loggerResource });\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate getLoggerEntry(resourceOrId: URI | string): LoggerEntry | undefined {\n\t\tif (isString(resourceOrId)) {\n\t\t\treturn [...this._loggers.values()].find(logger => logger.info.id === resourceOrId);\n\t\t}\n\t\treturn this._loggers.get(resourceOrId);\n\t}\n\n\tcreateLogger(idOrResource: URI | string, options?: ILoggerOptions): ILogger {\n\t\tconst resource = this.toResource(idOrResource);\n\t\tconst id = isString(idOrResource) ? idOrResource : (options?.id ?? hash(resource.toString()).toString(16));\n\t\tlet logger = this._loggers.get(resource)?.logger;\n\t\tconst logLevel = options?.logLevel === 'always' ? LogLevel.Trace : options?.logLevel;\n\t\tif (!logger) {\n\t\t\tlogger = this.doCreateLogger(resource, logLevel ?? this.getLogLevel(resource) ?? this.logLevel, { ...options, id });\n\t\t}\n\t\tconst loggerEntry: LoggerEntry = {\n\t\t\tlogger,\n\t\t\tinfo: {\n\t\t\t\tresource,\n\t\t\t\tid,\n\t\t\t\tlogLevel,\n\t\t\t\tname: options?.name,\n\t\t\t\thidden: options?.hidden,\n\t\t\t\tgroup: options?.group,\n\t\t\t\textensionId: options?.extensionId,\n\t\t\t\twhen: options?.when\n\t\t\t}\n\t\t};\n\t\tthis.registerLogger(loggerEntry.info);\n\t\t// TODO: @sandy081 Remove this once registerLogger can take ILogger\n\t\tthis._loggers.set(resource, loggerEntry);\n\t\treturn logger;\n\t}\n\n\tprotected toResource(idOrResource: string | URI): URI {\n\t\treturn isString(idOrResource) ? joinPath(this.logsHome, `${idOrResource}.log`) : idOrResource;\n\t}\n\n\tsetVisibility(resourceOrId: URI | string, visibility: boolean): void {\n\t\tconst logger = this.getLoggerEntry(resourceOrId);\n\t\tif (logger && visibility !== !logger.info.hidden) {\n\t\t\tlogger.info.hidden = !visibility;\n\t\t\tthis._loggers.set(logger.info.resource, logger);\n\t\t\tthis._onDidChangeVisibility.fire([logger.info.resource, visibility]);\n\t\t}\n\t}\n\n\tgetLogLevel(resource?: URI): LogLevel {\n\t\tlet logLevel;\n\t\tif (resource) {\n\t\t\tlogLevel = this._loggers.get(resource)?.info.logLevel;\n\t\t}\n\t\treturn logLevel ?? this.logLevel;\n\t}\n\n\tregisterLogger(resource: ILoggerResource): void {\n\t\tconst existing = this._loggers.get(resource.resource);\n\t\tif (existing) {\n\t\t\tif (existing.info.hidden !== resource.hidden) {\n\t\t\t\tthis.setVisibility(resource.resource, !resource.hidden);\n\t\t\t}\n\t\t} else {\n\t\t\tthis._loggers.set(resource.resource, { info: resource, logger: undefined });\n\t\t\tthis._onDidChangeLoggers.fire({ added: [resource], removed: [] });\n\t\t}\n\t}\n\n\toverride dispose(): void {\n\t\tthis._loggers.forEach(logger => logger.logger?.dispose());\n\t\tthis._loggers.clear();\n\t\tsuper.dispose();\n\t}\n\n\tprotected abstract doCreateLogger(resource: URI, logLevel: LogLevel, options?: ILoggerOptions): ILogger;\n}\n\nexport class NullLogger implements ILogger {\n\treadonly onDidChangeLogLevel: Event<LogLevel> = new Emitter<LogLevel>().event;\n\tsetLevel(level: LogLevel): void { }\n\tgetLevel(): LogLevel { return LogLevel.Info; }\n\ttrace(message: string, ...args: unknown[]): void { }\n\tdebug(message: string, ...args: unknown[]): void { }\n\tinfo(message: string, ...args: unknown[]): void { }\n\twarn(message: string, ...args: unknown[]): void { }\n\terror(message: string | Error, ...args: unknown[]): void { }\n\tdispose(): void { }\n}\n\nexport class NullLoggerService extends AbstractLoggerService {\n\tconstructor() {\n\t\tsuper(LogLevel.Off, URI.parse('log:///log'));\n\t}\n\tprotected override doCreateLogger(resource: URI, logLevel: LogLevel, options?: ILoggerOptions): ILogger {\n\t\treturn new NullLogger();\n\t}\n}\n\nexport function LogLevelToString(logLevel: LogLevel): string {\n\tswitch (logLevel) {\n\t\tcase LogLevel.Trace: return 'trace';\n\t\tcase LogLevel.Debug: return 'debug';\n\t\tcase LogLevel.Info: return 'info';\n\t\tcase LogLevel.Warning: return 'warn';\n\t\tcase LogLevel.Error: return 'error';\n\t\tcase LogLevel.Off: return 'off';\n\t}\n}\n\n// Contexts\nexport const CONTEXT_LOG_LEVEL = new RawContextKey<string>('logLevel', LogLevelToString(LogLevel.Info));\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out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,CAAC;IACpD,KAAK,CAAC,OAAe,EAAE,GAAG,IAAe,IAAU,CAAC;IACpD,IAAI,CAAC,OAAe,EAAE,GAAG,IAAe,IAAU,CAAC;IACnD,IAAI,CAAC,OAAe,EAAE,GAAG,IAAe,IAAU,CAAC;IACnD,KAAK,CAAC,OAAuB,EAAE,GAAG,IAAe,IAAU,CAAC;IAC5D,OAAO,KAAW,CAAC;CACnB;AAED,MAAM,OAAO,iBAAkB,SAAQ,qBAAqB;IAC3D;QACC,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;IAC9C,CAAC;IACkB,cAAc,CAAC,QAAa,EAAE,QAAkB,EAAE,OAAwB;QAC5F,OAAO,IAAI,UAAU,EAAE,CAAC;IACzB,CAAC;CACD;AAED,MAAM,UAAU,gBAAgB,CAAC,QAAkB;IAClD,QAAQ,QAAQ,EAAE,CAAC;QAClB,KAAK,QAAQ,CAAC,KAAK,CAAC,CAAC,OAAO,OAAO,CAAC;QACpC,KAAK,QAAQ,CAAC,KAAK,CAAC,CAAC,OAAO,OAAO,CAAC;QACpC,KAAK,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,MAAM,CAAC;QAClC,KAAK,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,MAAM,CAAC;QACrC,KAAK,QAAQ,CAAC,KAAK,CAAC,CAAC,OAAO,OAAO,CAAC;QACpC,KAAK,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,KAAK,CAAC;IACjC,CAAC;AACF,CAAC;AAED,WAAW;AACX,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,aAAa,CAAS,UAAU,EAAE,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC","file":"log.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["\nimport { Emitter, Event } from '../../../base/common/event.js';\nimport { hash } from '../../../base/common/hash.js';\nimport { Disposable, IDisposable } from '../../../base/common/lifecycle.js';\nimport { ResourceMap } from '../../../base/common/map.js';\nimport { joinPath } from '../../../base/common/resources.js';\nimport { Mutable, isString } from '../../../base/common/types.js';\nimport { URI } from '../../../base/common/uri.js';\nimport { RawContextKey } from '../../contextkey/common/contextkey.js';\nimport { createDecorator } from '../../instantiation/common/instantiation.js';\n\nexport const ILogService = createDecorator<ILogService>('logService');\nexport const ILoggerService = createDecorator<ILoggerService>('loggerService');\n\nexport enum LogLevel {\n\tOff,\n\tTrace,\n\tDebug,\n\tInfo,\n\tWarning,\n\tError\n}\n\nexport const DEFAULT_LOG_LEVEL: LogLevel = LogLevel.Info;\n\nexport interface ILogger extends IDisposable {\n\treadonly onDidChangeLogLevel: Event<LogLevel>;\n\tgetLevel(): LogLevel;\n\tsetLevel(level: LogLevel): void;\n\n\ttrace(message: string, ...args: unknown[]): void;\n\tdebug(message: string, ...args: unknown[]): void;\n\tinfo(message: string, ...args: unknown[]): void;\n\twarn(message: string, ...args: unknown[]): void;\n\terror(message: string | Error, ...args: unknown[]): void;\n}\n\nexport function canLog(loggerLevel: LogLevel, messageLevel: LogLevel): boolean {\n\treturn loggerLevel !== LogLevel.Off && loggerLevel <= messageLevel;\n}\n\nexport type LoggerGroup = {\n\treadonly id: string;\n\treadonly name: string;\n};\n\nexport interface ILogService extends ILogger {\n\treadonly _serviceBrand: undefined;\n}\n\nexport interface ILoggerOptions {\n\n\t/**\n\t * Id of the logger.\n\t */\n\tid?: string;\n\n\t/**\n\t * Name of the logger.\n\t */\n\tname?: string;\n\n\t/**\n\t * When to log. Set to `always` to log always.\n\t */\n\tlogLevel?: 'always' | LogLevel;\n\n\t/**\n\t * Whether the log should be hidden from the user.\n\t */\n\thidden?: boolean;\n\n\t/**\n\t * Condition which must be true to show this logger\n\t */\n\twhen?: string;\n\n\t/**\n\t * Id of the extension that created this logger.\n\t */\n\textensionId?: string;\n\n\t/**\n\t * Group of the logger.\n\t */\n\tgroup?: LoggerGroup;\n}\n\nexport interface ILoggerResource {\n\treadonly resource: URI;\n\treadonly id: string;\n\treadonly name?: string;\n\treadonly logLevel?: LogLevel;\n\treadonly hidden?: boolean;\n\treadonly when?: string;\n\treadonly extensionId?: string;\n\treadonly group?: LoggerGroup;\n}\n\nexport interface ILoggerService {\n\n\treadonly _serviceBrand: undefined;\n\n\t/**\n\t * Creates a logger for the given resource, or gets one if it already exists.\n\t *\n\t * This will also register the logger with the logger service.\n\t */\n\tcreateLogger(resource: URI, options?: ILoggerOptions): ILogger;\n\n\t/**\n\t * Creates a logger with the given id in the logs folder, or gets one if it already exists.\n\t *\n\t * This will also register the logger with the logger service.\n\t */\n\tcreateLogger(id: string, options?: Omit<ILoggerOptions, 'id'>): ILogger;\n}\n\nexport abstract class AbstractLogger extends Disposable implements ILogger {\n\n\tprivate level: LogLevel = DEFAULT_LOG_LEVEL;\n\tprivate readonly _onDidChangeLogLevel: Emitter<LogLevel> = this._register(new Emitter<LogLevel>());\n\tget onDidChangeLogLevel(): Event<LogLevel> { return this._onDidChangeLogLevel.event; }\n\n\tsetLevel(level: LogLevel): void {\n\t\tif (this.level !== level) {\n\t\t\tthis.level = level;\n\t\t\tthis._onDidChangeLogLevel.fire(this.level);\n\t\t}\n\t}\n\n\tgetLevel(): LogLevel {\n\t\treturn this.level;\n\t}\n\n\tprotected checkLogLevel(level: LogLevel): boolean {\n\t\treturn canLog(this.level, level);\n\t}\n\n\tprotected canLog(level: LogLevel): boolean {\n\t\tif (this._store.isDisposed) {\n\t\t\treturn false;\n\t\t}\n\t\treturn this.checkLogLevel(level);\n\t}\n\n\tabstract trace(message: string, ...args: unknown[]): void;\n\tabstract debug(message: string, ...args: unknown[]): void;\n\tabstract info(message: string, ...args: unknown[]): void;\n\tabstract warn(message: string, ...args: unknown[]): void;\n\tabstract error(message: string | Error, ...args: unknown[]): void;\n}\n\nexport class ConsoleLogger extends AbstractLogger implements ILogger {\n\n\tconstructor(logLevel: LogLevel = DEFAULT_LOG_LEVEL, private readonly useColors: boolean = true) {\n\t\tsuper();\n\t\tthis.setLevel(logLevel);\n\t}\n\n\ttrace(message: string, ...args: unknown[]): void {\n\t\tif (this.canLog(LogLevel.Trace)) {\n\t\t\tif (this.useColors) {\n\t\t\t\tconsole.log('%cTRACE', 'color: #888', message, ...args);\n\t\t\t} else {\n\t\t\t\tconsole.log(message, ...args);\n\t\t\t}\n\t\t}\n\t}\n\n\tdebug(message: string, ...args: unknown[]): void {\n\t\tif (this.canLog(LogLevel.Debug)) {\n\t\t\tif (this.useColors) {\n\t\t\t\tconsole.log('%cDEBUG', 'background: #eee; color: #888', message, ...args);\n\t\t\t} else {\n\t\t\t\tconsole.log(message, ...args);\n\t\t\t}\n\t\t}\n\t}\n\n\tinfo(message: string, ...args: unknown[]): void {\n\t\tif (this.canLog(LogLevel.Info)) {\n\t\t\tif (this.useColors) {\n\t\t\t\tconsole.log('%c INFO', 'color: #33f', message, ...args);\n\t\t\t} else {\n\t\t\t\tconsole.log(message, ...args);\n\t\t\t}\n\t\t}\n\t}\n\n\twarn(message: string | Error, ...args: unknown[]): void {\n\t\tif (this.canLog(LogLevel.Warning)) {\n\t\t\tif (this.useColors) {\n\t\t\t\tconsole.warn('%c WARN', 'color: #993', message, ...args);\n\t\t\t} else {\n\t\t\t\tconsole.log(message, ...args);\n\t\t\t}\n\t\t}\n\t}\n\n\terror(message: string, ...args: unknown[]): void {\n\t\tif (this.canLog(LogLevel.Error)) {\n\t\t\tif (this.useColors) {\n\t\t\t\tconsole.error('%c ERR', 'color: #f33', message, ...args);\n\t\t\t} else {\n\t\t\t\tconsole.error(message, ...args);\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport class MultiplexLogger extends AbstractLogger implements ILogger {\n\n\tconstructor(private readonly loggers: ReadonlyArray<ILogger>) {\n\t\tsuper();\n\t\tif (loggers.length) {\n\t\t\tthis.setLevel(loggers[0].getLevel());\n\t\t}\n\t}\n\n\toverride setLevel(level: LogLevel): void {\n\t\tfor (const logger of this.loggers) {\n\t\t\tlogger.setLevel(level);\n\t\t}\n\t\tsuper.setLevel(level);\n\t}\n\n\ttrace(message: string, ...args: unknown[]): void {\n\t\tfor (const logger of this.loggers) {\n\t\t\tlogger.trace(message, ...args);\n\t\t}\n\t}\n\n\tdebug(message: string, ...args: unknown[]): void {\n\t\tfor (const logger of this.loggers) {\n\t\t\tlogger.debug(message, ...args);\n\t\t}\n\t}\n\n\tinfo(message: string, ...args: unknown[]): void {\n\t\tfor (const logger of this.loggers) {\n\t\t\tlogger.info(message, ...args);\n\t\t}\n\t}\n\n\twarn(message: string, ...args: unknown[]): void {\n\t\tfor (const logger of this.loggers) {\n\t\t\tlogger.warn(message, ...args);\n\t\t}\n\t}\n\n\terror(message: string | Error, ...args: unknown[]): void {\n\t\tfor (const logger of this.loggers) {\n\t\t\tlogger.error(message, ...args);\n\t\t}\n\t}\n\n\toverride dispose(): void {\n\t\tfor (const logger of this.loggers) {\n\t\t\tlogger.dispose();\n\t\t}\n\t\tsuper.dispose();\n\t}\n}\n\ntype LoggerEntry = { logger: ILogger | undefined; info: Mutable<ILoggerResource> };\n\nexport abstract class AbstractLoggerService extends Disposable implements ILoggerService {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate readonly _loggers = new ResourceMap<LoggerEntry>();\n\n\tprivate _onDidChangeLoggers = this._register(new Emitter<{ added: ILoggerResource[]; removed: ILoggerResource[] }>);\n\n\tprivate _onDidChangeVisibility = this._register(new Emitter<[URI, boolean]>);\n\n\tconstructor(\n\t\tprotected logLevel: LogLevel,\n\t\tprivate readonly logsHome: URI,\n\t\tloggerResources?: Iterable<ILoggerResource>,\n\t) {\n\t\tsuper();\n\t\tif (loggerResources) {\n\t\t\tfor (const loggerResource of loggerResources) {\n\t\t\t\tthis._loggers.set(loggerResource.resource, { logger: undefined, info: loggerResource });\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate getLoggerEntry(resourceOrId: URI | string): LoggerEntry | undefined {\n\t\tif (isString(resourceOrId)) {\n\t\t\treturn [...this._loggers.values()].find(logger => logger.info.id === resourceOrId);\n\t\t}\n\t\treturn this._loggers.get(resourceOrId);\n\t}\n\n\tcreateLogger(idOrResource: URI | string, options?: ILoggerOptions): ILogger {\n\t\tconst resource = this.toResource(idOrResource);\n\t\tconst id = isString(idOrResource) ? idOrResource : (options?.id ?? hash(resource.toString()).toString(16));\n\t\tlet logger = this._loggers.get(resource)?.logger;\n\t\tconst logLevel = options?.logLevel === 'always' ? LogLevel.Trace : options?.logLevel;\n\t\tif (!logger) {\n\t\t\tlogger = this.doCreateLogger(resource, logLevel ?? this.getLogLevel(resource) ?? this.logLevel, { ...options, id });\n\t\t}\n\t\tconst loggerEntry: LoggerEntry = {\n\t\t\tlogger,\n\t\t\tinfo: {\n\t\t\t\tresource,\n\t\t\t\tid,\n\t\t\t\tlogLevel,\n\t\t\t\tname: options?.name,\n\t\t\t\thidden: options?.hidden,\n\t\t\t\tgroup: options?.group,\n\t\t\t\textensionId: options?.extensionId,\n\t\t\t\twhen: options?.when\n\t\t\t}\n\t\t};\n\t\tthis.registerLogger(loggerEntry.info);\n\t\t// TODO: @sandy081 Remove this once registerLogger can take ILogger\n\t\tthis._loggers.set(resource, loggerEntry);\n\t\treturn logger;\n\t}\n\n\tprotected toResource(idOrResource: string | URI): URI {\n\t\treturn isString(idOrResource) ? joinPath(this.logsHome, `${idOrResource.replace(/[\\\\/:\\*\\?\"<>\\|]/g, '')}.log`) : idOrResource;\n\t}\n\n\tsetVisibility(resourceOrId: URI | string, visibility: boolean): void {\n\t\tconst logger = this.getLoggerEntry(resourceOrId);\n\t\tif (logger && visibility !== !logger.info.hidden) {\n\t\t\tlogger.info.hidden = !visibility;\n\t\t\tthis._loggers.set(logger.info.resource, logger);\n\t\t\tthis._onDidChangeVisibility.fire([logger.info.resource, visibility]);\n\t\t}\n\t}\n\n\tgetLogLevel(resource?: URI): LogLevel {\n\t\tlet logLevel;\n\t\tif (resource) {\n\t\t\tlogLevel = this._loggers.get(resource)?.info.logLevel;\n\t\t}\n\t\treturn logLevel ?? this.logLevel;\n\t}\n\n\tregisterLogger(resource: ILoggerResource): void {\n\t\tconst existing = this._loggers.get(resource.resource);\n\t\tif (existing) {\n\t\t\tif (existing.info.hidden !== resource.hidden) {\n\t\t\t\tthis.setVisibility(resource.resource, !resource.hidden);\n\t\t\t}\n\t\t} else {\n\t\t\tthis._loggers.set(resource.resource, { info: resource, logger: undefined });\n\t\t\tthis._onDidChangeLoggers.fire({ added: [resource], removed: [] });\n\t\t}\n\t}\n\n\toverride dispose(): void {\n\t\tthis._loggers.forEach(logger => logger.logger?.dispose());\n\t\tthis._loggers.clear();\n\t\tsuper.dispose();\n\t}\n\n\tprotected abstract doCreateLogger(resource: URI, logLevel: LogLevel, options?: ILoggerOptions): ILogger;\n}\n\nexport class NullLogger implements ILogger {\n\treadonly onDidChangeLogLevel: Event<LogLevel> = new Emitter<LogLevel>().event;\n\tsetLevel(level: LogLevel): void { }\n\tgetLevel(): LogLevel { return LogLevel.Info; }\n\ttrace(message: string, ...args: unknown[]): void { }\n\tdebug(message: string, ...args: unknown[]): void { }\n\tinfo(message: string, ...args: unknown[]): void { }\n\twarn(message: string, ...args: unknown[]): void { }\n\terror(message: string | Error, ...args: unknown[]): void { }\n\tdispose(): void { }\n}\n\nexport class NullLoggerService extends AbstractLoggerService {\n\tconstructor() {\n\t\tsuper(LogLevel.Off, URI.parse('log:///log'));\n\t}\n\tprotected override doCreateLogger(resource: URI, logLevel: LogLevel, options?: ILoggerOptions): ILogger {\n\t\treturn new NullLogger();\n\t}\n}\n\nexport function LogLevelToString(logLevel: LogLevel): string {\n\tswitch (logLevel) {\n\t\tcase LogLevel.Trace: return 'trace';\n\t\tcase LogLevel.Debug: return 'debug';\n\t\tcase LogLevel.Info: return 'info';\n\t\tcase LogLevel.Warning: return 'warn';\n\t\tcase LogLevel.Error: return 'error';\n\t\tcase LogLevel.Off: return 'off';\n\t}\n}\n\n// Contexts\nexport const CONTEXT_LOG_LEVEL = new RawContextKey<string>('logLevel', LogLevelToString(LogLevel.Info));\n","\nimport { Emitter, Event } from '../../../base/common/event.js';\nimport { hash } from '../../../base/common/hash.js';\nimport { Disposable, IDisposable } from '../../../base/common/lifecycle.js';\nimport { ResourceMap } from '../../../base/common/map.js';\nimport { joinPath } from '../../../base/common/resources.js';\nimport { Mutable, isString } from '../../../base/common/types.js';\nimport { URI } from '../../../base/common/uri.js';\nimport { RawContextKey } from '../../contextkey/common/contextkey.js';\nimport { createDecorator } from '../../instantiation/common/instantiation.js';\n\nexport const ILogService = createDecorator<ILogService>('logService');\nexport const ILoggerService = createDecorator<ILoggerService>('loggerService');\n\nexport enum LogLevel {\n\tOff,\n\tTrace,\n\tDebug,\n\tInfo,\n\tWarning,\n\tError\n}\n\nexport const DEFAULT_LOG_LEVEL: LogLevel = LogLevel.Info;\n\nexport interface ILogger extends IDisposable {\n\treadonly onDidChangeLogLevel: Event<LogLevel>;\n\tgetLevel(): LogLevel;\n\tsetLevel(level: LogLevel): void;\n\n\ttrace(message: string, ...args: unknown[]): void;\n\tdebug(message: string, ...args: unknown[]): void;\n\tinfo(message: string, ...args: unknown[]): void;\n\twarn(message: string, ...args: unknown[]): void;\n\terror(message: string | Error, ...args: unknown[]): void;\n}\n\nexport function canLog(loggerLevel: LogLevel, messageLevel: LogLevel): boolean {\n\treturn loggerLevel !== LogLevel.Off && loggerLevel <= messageLevel;\n}\n\nexport type LoggerGroup = {\n\treadonly id: string;\n\treadonly name: string;\n};\n\nexport interface ILogService extends ILogger {\n\treadonly _serviceBrand: undefined;\n}\n\nexport interface ILoggerOptions {\n\n\t/**\n\t * Id of the logger.\n\t */\n\tid?: string;\n\n\t/**\n\t * Name of the logger.\n\t */\n\tname?: string;\n\n\t/**\n\t * When to log. Set to `always` to log always.\n\t */\n\tlogLevel?: 'always' | LogLevel;\n\n\t/**\n\t * Whether the log should be hidden from the user.\n\t */\n\thidden?: boolean;\n\n\t/**\n\t * Condition which must be true to show this logger\n\t */\n\twhen?: string;\n\n\t/**\n\t * Id of the extension that created this logger.\n\t */\n\textensionId?: string;\n\n\t/**\n\t * Group of the logger.\n\t */\n\tgroup?: LoggerGroup;\n}\n\nexport interface ILoggerResource {\n\treadonly resource: URI;\n\treadonly id: string;\n\treadonly name?: string;\n\treadonly logLevel?: LogLevel;\n\treadonly hidden?: boolean;\n\treadonly when?: string;\n\treadonly extensionId?: string;\n\treadonly group?: LoggerGroup;\n}\n\nexport interface ILoggerService {\n\n\treadonly _serviceBrand: undefined;\n\n\t/**\n\t * Creates a logger for the given resource, or gets one if it already exists.\n\t *\n\t * This will also register the logger with the logger service.\n\t */\n\tcreateLogger(resource: URI, options?: ILoggerOptions): ILogger;\n\n\t/**\n\t * Creates a logger with the given id in the logs folder, or gets one if it already exists.\n\t *\n\t * This will also register the logger with the logger service.\n\t */\n\tcreateLogger(id: string, options?: Omit<ILoggerOptions, 'id'>): ILogger;\n}\n\nexport abstract class AbstractLogger extends Disposable implements ILogger {\n\n\tprivate level: LogLevel = DEFAULT_LOG_LEVEL;\n\tprivate readonly _onDidChangeLogLevel: Emitter<LogLevel> = this._register(new Emitter<LogLevel>());\n\tget onDidChangeLogLevel(): Event<LogLevel> { return this._onDidChangeLogLevel.event; }\n\n\tsetLevel(level: LogLevel): void {\n\t\tif (this.level !== level) {\n\t\t\tthis.level = level;\n\t\t\tthis._onDidChangeLogLevel.fire(this.level);\n\t\t}\n\t}\n\n\tgetLevel(): LogLevel {\n\t\treturn this.level;\n\t}\n\n\tprotected checkLogLevel(level: LogLevel): boolean {\n\t\treturn canLog(this.level, level);\n\t}\n\n\tprotected canLog(level: LogLevel): boolean {\n\t\tif (this._store.isDisposed) {\n\t\t\treturn false;\n\t\t}\n\t\treturn this.checkLogLevel(level);\n\t}\n\n\tabstract trace(message: string, ...args: unknown[]): void;\n\tabstract debug(message: string, ...args: unknown[]): void;\n\tabstract info(message: string, ...args: unknown[]): void;\n\tabstract warn(message: string, ...args: unknown[]): void;\n\tabstract error(message: string | Error, ...args: unknown[]): void;\n}\n\nexport class ConsoleLogger extends AbstractLogger implements ILogger {\n\n\tconstructor(logLevel: LogLevel = DEFAULT_LOG_LEVEL, private readonly useColors: boolean = true) {\n\t\tsuper();\n\t\tthis.setLevel(logLevel);\n\t}\n\n\ttrace(message: string, ...args: unknown[]): void {\n\t\tif (this.canLog(LogLevel.Trace)) {\n\t\t\tif (this.useColors) {\n\t\t\t\tconsole.log('%cTRACE', 'color: #888', message, ...args);\n\t\t\t} else {\n\t\t\t\tconsole.log(message, ...args);\n\t\t\t}\n\t\t}\n\t}\n\n\tdebug(message: string, ...args: unknown[]): void {\n\t\tif (this.canLog(LogLevel.Debug)) {\n\t\t\tif (this.useColors) {\n\t\t\t\tconsole.log('%cDEBUG', 'background: #eee; color: #888', message, ...args);\n\t\t\t} else {\n\t\t\t\tconsole.log(message, ...args);\n\t\t\t}\n\t\t}\n\t}\n\n\tinfo(message: string, ...args: unknown[]): void {\n\t\tif (this.canLog(LogLevel.Info)) {\n\t\t\tif (this.useColors) {\n\t\t\t\tconsole.log('%c INFO', 'color: #33f', message, ...args);\n\t\t\t} else {\n\t\t\t\tconsole.log(message, ...args);\n\t\t\t}\n\t\t}\n\t}\n\n\twarn(message: string | Error, ...args: unknown[]): void {\n\t\tif (this.canLog(LogLevel.Warning)) {\n\t\t\tif (this.useColors) {\n\t\t\t\tconsole.warn('%c WARN', 'color: #993', message, ...args);\n\t\t\t} else {\n\t\t\t\tconsole.log(message, ...args);\n\t\t\t}\n\t\t}\n\t}\n\n\terror(message: string, ...args: unknown[]): void {\n\t\tif (this.canLog(LogLevel.Error)) {\n\t\t\tif (this.useColors) {\n\t\t\t\tconsole.error('%c ERR', 'color: #f33', message, ...args);\n\t\t\t} else {\n\t\t\t\tconsole.error(message, ...args);\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport class MultiplexLogger extends AbstractLogger implements ILogger {\n\n\tconstructor(private readonly loggers: ReadonlyArray<ILogger>) {\n\t\tsuper();\n\t\tif (loggers.length) {\n\t\t\tthis.setLevel(loggers[0].getLevel());\n\t\t}\n\t}\n\n\toverride setLevel(level: LogLevel): void {\n\t\tfor (const logger of this.loggers) {\n\t\t\tlogger.setLevel(level);\n\t\t}\n\t\tsuper.setLevel(level);\n\t}\n\n\ttrace(message: string, ...args: unknown[]): void {\n\t\tfor (const logger of this.loggers) {\n\t\t\tlogger.trace(message, ...args);\n\t\t}\n\t}\n\n\tdebug(message: string, ...args: unknown[]): void {\n\t\tfor (const logger of this.loggers) {\n\t\t\tlogger.debug(message, ...args);\n\t\t}\n\t}\n\n\tinfo(message: string, ...args: unknown[]): void {\n\t\tfor (const logger of this.loggers) {\n\t\t\tlogger.info(message, ...args);\n\t\t}\n\t}\n\n\twarn(message: string, ...args: unknown[]): void {\n\t\tfor (const logger of this.loggers) {\n\t\t\tlogger.warn(message, ...args);\n\t\t}\n\t}\n\n\terror(message: string | Error, ...args: unknown[]): void {\n\t\tfor (const logger of this.loggers) {\n\t\t\tlogger.error(message, ...args);\n\t\t}\n\t}\n\n\toverride dispose(): void {\n\t\tfor (const logger of this.loggers) {\n\t\t\tlogger.dispose();\n\t\t}\n\t\tsuper.dispose();\n\t}\n}\n\ntype LoggerEntry = { logger: ILogger | undefined; info: Mutable<ILoggerResource> };\n\nexport abstract class AbstractLoggerService extends Disposable implements ILoggerService {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate readonly _loggers = new ResourceMap<LoggerEntry>();\n\n\tprivate _onDidChangeLoggers = this._register(new Emitter<{ added: ILoggerResource[]; removed: ILoggerResource[] }>);\n\n\tprivate _onDidChangeVisibility = this._register(new Emitter<[URI, boolean]>);\n\n\tconstructor(\n\t\tprotected logLevel: LogLevel,\n\t\tprivate readonly logsHome: URI,\n\t\tloggerResources?: Iterable<ILoggerResource>,\n\t) {\n\t\tsuper();\n\t\tif (loggerResources) {\n\t\t\tfor (const loggerResource of loggerResources) {\n\t\t\t\tthis._loggers.set(loggerResource.resource, { logger: undefined, info: loggerResource });\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate getLoggerEntry(resourceOrId: URI | string): LoggerEntry | undefined {\n\t\tif (isString(resourceOrId)) {\n\t\t\treturn [...this._loggers.values()].find(logger => logger.info.id === resourceOrId);\n\t\t}\n\t\treturn this._loggers.get(resourceOrId);\n\t}\n\n\tcreateLogger(idOrResource: URI | string, options?: ILoggerOptions): ILogger {\n\t\tconst resource = this.toResource(idOrResource);\n\t\tconst id = isString(idOrResource) ? idOrResource : (options?.id ?? hash(resource.toString()).toString(16));\n\t\tlet logger = this._loggers.get(resource)?.logger;\n\t\tconst logLevel = options?.logLevel === 'always' ? LogLevel.Trace : options?.logLevel;\n\t\tif (!logger) {\n\t\t\tlogger = this.doCreateLogger(resource, logLevel ?? this.getLogLevel(resource) ?? this.logLevel, { ...options, id });\n\t\t}\n\t\tconst loggerEntry: LoggerEntry = {\n\t\t\tlogger,\n\t\t\tinfo: {\n\t\t\t\tresource,\n\t\t\t\tid,\n\t\t\t\tlogLevel,\n\t\t\t\tname: options?.name,\n\t\t\t\thidden: options?.hidden,\n\t\t\t\tgroup: options?.group,\n\t\t\t\textensionId: options?.extensionId,\n\t\t\t\twhen: options?.when\n\t\t\t}\n\t\t};\n\t\tthis.registerLogger(loggerEntry.info);\n\t\t// TODO: @sandy081 Remove this once registerLogger can take ILogger\n\t\tthis._loggers.set(resource, loggerEntry);\n\t\treturn logger;\n\t}\n\n\tprotected toResource(idOrResource: string | URI): URI {\n\t\treturn isString(idOrResource) ? joinPath(this.logsHome, `${idOrResource.replace(/[\\\\/:\\*\\?\"<>\\|]/g, '')}.log`) : idOrResource;\n\t}\n\n\tsetVisibility(resourceOrId: URI | string, visibility: boolean): void {\n\t\tconst logger = this.getLoggerEntry(resourceOrId);\n\t\tif (logger && visibility !== !logger.info.hidden) {\n\t\t\tlogger.info.hidden = !visibility;\n\t\t\tthis._loggers.set(logger.info.resource, logger);\n\t\t\tthis._onDidChangeVisibility.fire([logger.info.resource, visibility]);\n\t\t}\n\t}\n\n\tgetLogLevel(resource?: URI): LogLevel {\n\t\tlet logLevel;\n\t\tif (resource) {\n\t\t\tlogLevel = this._loggers.get(resource)?.info.logLevel;\n\t\t}\n\t\treturn logLevel ?? this.logLevel;\n\t}\n\n\tregisterLogger(resource: ILoggerResource): void {\n\t\tconst existing = this._loggers.get(resource.resource);\n\t\tif (existing) {\n\t\t\tif (existing.info.hidden !== resource.hidden) {\n\t\t\t\tthis.setVisibility(resource.resource, !resource.hidden);\n\t\t\t}\n\t\t} else {\n\t\t\tthis._loggers.set(resource.resource, { info: resource, logger: undefined });\n\t\t\tthis._onDidChangeLoggers.fire({ added: [resource], removed: [] });\n\t\t}\n\t}\n\n\toverride dispose(): void {\n\t\tthis._loggers.forEach(logger => logger.logger?.dispose());\n\t\tthis._loggers.clear();\n\t\tsuper.dispose();\n\t}\n\n\tprotected abstract doCreateLogger(resource: URI, logLevel: LogLevel, options?: ILoggerOptions): ILogger;\n}\n\nexport class NullLogger implements ILogger {\n\treadonly onDidChangeLogLevel: Event<LogLevel> = new Emitter<LogLevel>().event;\n\tsetLevel(level: LogLevel): void { }\n\tgetLevel(): LogLevel { return LogLevel.Info; }\n\ttrace(message: string, ...args: unknown[]): void { }\n\tdebug(message: string, ...args: unknown[]): void { }\n\tinfo(message: string, ...args: unknown[]): void { }\n\twarn(message: string, ...args: unknown[]): void { }\n\terror(message: string | Error, ...args: unknown[]): void { }\n\tdispose(): void { }\n}\n\nexport class NullLoggerService extends AbstractLoggerService {\n\tconstructor() {\n\t\tsuper(LogLevel.Off, URI.parse('log:///log'));\n\t}\n\tprotected override doCreateLogger(resource: URI, logLevel: LogLevel, options?: ILoggerOptions): ILogger {\n\t\treturn new NullLogger();\n\t}\n}\n\nexport function LogLevelToString(logLevel: LogLevel): string {\n\tswitch (logLevel) {\n\t\tcase LogLevel.Trace: return 'trace';\n\t\tcase LogLevel.Debug: return 'debug';\n\t\tcase LogLevel.Info: return 'info';\n\t\tcase LogLevel.Warning: return 'warn';\n\t\tcase LogLevel.Error: return 'error';\n\t\tcase LogLevel.Off: return 'off';\n\t}\n}\n\n// Contexts\nexport const CONTEXT_LOG_LEVEL = new RawContextKey<string>('logLevel', LogLevelToString(LogLevel.Info));\n"]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { isFalsyOrEmpty, isNonEmptyArray } from '../../../base/common/arrays.js';
|
|
6
|
-
import {
|
|
6
|
+
import { MicrotaskEmitter } from '../../../base/common/event.js';
|
|
7
7
|
import { Iterable } from '../../../base/common/iterator.js';
|
|
8
8
|
import { ResourceMap, ResourceSet } from '../../../base/common/map.js';
|
|
9
9
|
import { Schemas } from '../../../base/common/network.js';
|
|
@@ -128,8 +128,7 @@ class MarkerStats {
|
|
|
128
128
|
}
|
|
129
129
|
export class MarkerService {
|
|
130
130
|
constructor() {
|
|
131
|
-
this._onMarkerChanged = new
|
|
132
|
-
delay: 0,
|
|
131
|
+
this._onMarkerChanged = new MicrotaskEmitter({
|
|
133
132
|
merge: MarkerService._merge
|
|
134
133
|
});
|
|
135
134
|
this.onMarkerChanged = this._onMarkerChanged.event;
|
|
@@ -168,7 +167,7 @@ export class MarkerService {
|
|
|
168
167
|
}
|
|
169
168
|
}
|
|
170
169
|
static _toMarker(owner, resource, data) {
|
|
171
|
-
let { code, severity, message, source, startLineNumber, startColumn, endLineNumber, endColumn, relatedInformation, tags, origin } = data;
|
|
170
|
+
let { code, severity, message, source, startLineNumber, startColumn, endLineNumber, endColumn, relatedInformation, modelVersionId, tags, origin } = data;
|
|
172
171
|
if (!message) {
|
|
173
172
|
return undefined;
|
|
174
173
|
}
|
|
@@ -189,6 +188,7 @@ export class MarkerService {
|
|
|
189
188
|
endLineNumber,
|
|
190
189
|
endColumn,
|
|
191
190
|
relatedInformation,
|
|
191
|
+
modelVersionId,
|
|
192
192
|
tags,
|
|
193
193
|
origin
|
|
194
194
|
};
|
|
@@ -239,8 +239,8 @@ export class MarkerService {
|
|
|
239
239
|
*/
|
|
240
240
|
_createFilteredMarker(resource, reasons) {
|
|
241
241
|
const message = reasons.length === 1
|
|
242
|
-
? localize(
|
|
243
|
-
: localize(
|
|
242
|
+
? localize(1756, "Problems are paused because: \"{0}\"", reasons[0])
|
|
243
|
+
: localize(1757, "Problems are paused because: \"{0}\" and {1} more", reasons[0], reasons.length - 1);
|
|
244
244
|
return {
|
|
245
245
|
owner: 'markersFilter',
|
|
246
246
|
resource,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["vs/platform/markers/common/markerService.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAC1D,OAAO,EAAE,GAAG,EAAE,MAAM,6BAA6B,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAA6E,cAAc,EAAoB,MAAM,cAAc,CAAC;AAE3I,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC;IACzC,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,mBAAmB;IAC3B,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,kBAAkB;IAC1B,OAAO,CAAC,mBAAmB;IAC3B,OAAO,CAAC,cAAc;CACtB,CAAC,CAAC;AAEH,MAAM,iBAAiB;IAAvB;QAES,gBAAW,GAAG,IAAI,WAAW,EAAkB,CAAC;QAChD,aAAQ,GAAG,IAAI,GAAG,EAA0B,CAAC;IAkDtD,CAAC;IAhDA,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;oBACvG,IAAI,OAAO,EAAE,MAAM,EAAE,CAAC;wBACrB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;wBAChE,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;oBAE7B,CAAC;yBAAM,IAAI,aAAa,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,CAAC,EAAE,CAAC;wBACpD,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBACnB,CAAC;gBACF,CAAC;YACF,CAAC;YACD,OAAO,MAAM,CAAC;QACf,CAAC;IACF,CAAC;IAEO,MAAM,CAAC,OAAO,CAAC,MAAe,EAAE,UAAmB;QAC1D,OAAO,UAAU,KAAK,SAAS,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,MAAM,CAAC,QAAQ,CAAC;IACvF,CAAC;IAED,2BAA2B;IAEnB,MAAM,CAAC,MAAM,CAAC,GAAuB;QAC5C,MAAM,GAAG,GAAG,IAAI,WAAW,EAAW,CAAC;QACvC,KAAK,MAAM,KAAK,IAAI,GAAG,EAAE,CAAC;YACzB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;gBAC1B,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACrB,CAAC;QACF,CAAC;QACD,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IAC/B,CAAC;CACD","file":"markerService.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { isFalsyOrEmpty, isNonEmptyArray } from '../../../base/common/arrays.js';\nimport { DebounceEmitter } from '../../../base/common/event.js';\nimport { Iterable } from '../../../base/common/iterator.js';\nimport { IDisposable } from '../../../base/common/lifecycle.js';\nimport { ResourceMap, ResourceSet } from '../../../base/common/map.js';\nimport { Schemas } from '../../../base/common/network.js';\nimport { URI } from '../../../base/common/uri.js';\nimport { localize } from '../../../nls.js';\nimport { IMarker, IMarkerData, IMarkerReadOptions, IMarkerService, IResourceMarker, MarkerSeverity, MarkerStatistics } from './markers.js';\n\nexport const unsupportedSchemas = new Set([\n\tSchemas.inMemory,\n\tSchemas.vscodeSourceControl,\n\tSchemas.walkThrough,\n\tSchemas.walkThroughSnippet,\n\tSchemas.vscodeChatCodeBlock,\n\tSchemas.vscodeTerminal\n]);\n\nclass DoubleResourceMap<V> {\n\n\tprivate _byResource = new ResourceMap<Map<string, V>>();\n\tprivate _byOwner = new Map<string, ResourceMap<V>>();\n\n\tset(resource: URI, owner: string, value: V) {\n\t\tlet ownerMap = this._byResource.get(resource);\n\t\tif (!ownerMap) {\n\t\t\townerMap = new Map();\n\t\t\tthis._byResource.set(resource, ownerMap);\n\t\t}\n\t\townerMap.set(owner, value);\n\n\t\tlet resourceMap = this._byOwner.get(owner);\n\t\tif (!resourceMap) {\n\t\t\tresourceMap = new ResourceMap();\n\t\t\tthis._byOwner.set(owner, resourceMap);\n\t\t}\n\t\tresourceMap.set(resource, value);\n\t}\n\n\tget(resource: URI, owner: string): V | undefined {\n\t\tconst ownerMap = this._byResource.get(resource);\n\t\treturn ownerMap?.get(owner);\n\t}\n\n\tdelete(resource: URI, owner: string): boolean {\n\t\tlet removedA = false;\n\t\tlet removedB = false;\n\t\tconst ownerMap = this._byResource.get(resource);\n\t\tif (ownerMap) {\n\t\t\tremovedA = ownerMap.delete(owner);\n\t\t}\n\t\tconst resourceMap = this._byOwner.get(owner);\n\t\tif (resourceMap) {\n\t\t\tremovedB = resourceMap.delete(resource);\n\t\t}\n\t\tif (removedA !== removedB) {\n\t\t\tthrow new Error('illegal state');\n\t\t}\n\t\treturn removedA && removedB;\n\t}\n\n\tvalues(key?: URI | string): Iterable<V> {\n\t\tif (typeof key === 'string') {\n\t\t\treturn this._byOwner.get(key)?.values() ?? Iterable.empty();\n\t\t}\n\t\tif (URI.isUri(key)) {\n\t\t\treturn this._byResource.get(key)?.values() ?? Iterable.empty();\n\t\t}\n\n\t\treturn Iterable.map(Iterable.concat(...this._byOwner.values()), map => map[1]);\n\t}\n}\n\nclass MarkerStats implements MarkerStatistics {\n\n\terrors: number = 0;\n\tinfos: number = 0;\n\twarnings: number = 0;\n\tunknowns: number = 0;\n\n\tprivate readonly _data = new ResourceMap<MarkerStatistics>();\n\tprivate readonly _service: IMarkerService;\n\tprivate readonly _subscription: IDisposable;\n\n\tconstructor(service: IMarkerService) {\n\t\tthis._service = service;\n\t\tthis._subscription = service.onMarkerChanged(this._update, this);\n\t}\n\n\tdispose(): void {\n\t\tthis._subscription.dispose();\n\t}\n\n\tprivate _update(resources: readonly URI[]): void {\n\t\tfor (const resource of resources) {\n\t\t\tconst oldStats = this._data.get(resource);\n\t\t\tif (oldStats) {\n\t\t\t\tthis._substract(oldStats);\n\t\t\t}\n\t\t\tconst newStats = this._resourceStats(resource);\n\t\t\tthis._add(newStats);\n\t\t\tthis._data.set(resource, newStats);\n\t\t}\n\t}\n\n\tprivate _resourceStats(resource: URI): MarkerStatistics {\n\t\tconst result: MarkerStatistics = { errors: 0, warnings: 0, infos: 0, unknowns: 0 };\n\n\t\t// TODO this is a hack\n\t\tif (unsupportedSchemas.has(resource.scheme)) {\n\t\t\treturn result;\n\t\t}\n\n\t\tfor (const { severity } of this._service.read({ resource })) {\n\t\t\tif (severity === MarkerSeverity.Error) {\n\t\t\t\tresult.errors += 1;\n\t\t\t} else if (severity === MarkerSeverity.Warning) {\n\t\t\t\tresult.warnings += 1;\n\t\t\t} else if (severity === MarkerSeverity.Info) {\n\t\t\t\tresult.infos += 1;\n\t\t\t} else {\n\t\t\t\tresult.unknowns += 1;\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprivate _substract(op: MarkerStatistics) {\n\t\tthis.errors -= op.errors;\n\t\tthis.warnings -= op.warnings;\n\t\tthis.infos -= op.infos;\n\t\tthis.unknowns -= op.unknowns;\n\t}\n\n\tprivate _add(op: MarkerStatistics) {\n\t\tthis.errors += op.errors;\n\t\tthis.warnings += op.warnings;\n\t\tthis.infos += op.infos;\n\t\tthis.unknowns += op.unknowns;\n\t}\n}\n\nexport class MarkerService implements IMarkerService {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate readonly _onMarkerChanged = new DebounceEmitter<readonly URI[]>({\n\t\tdelay: 0,\n\t\tmerge: MarkerService._merge\n\t});\n\n\treadonly onMarkerChanged = this._onMarkerChanged.event;\n\n\tprivate readonly _data = new DoubleResourceMap<IMarker[]>();\n\tprivate readonly _stats = new MarkerStats(this);\n\tprivate readonly _filteredResources = new ResourceMap<string[]>();\n\n\tdispose(): void {\n\t\tthis._stats.dispose();\n\t\tthis._onMarkerChanged.dispose();\n\t}\n\n\tremove(owner: string, resources: URI[]): void {\n\t\tfor (const resource of resources || []) {\n\t\t\tthis.changeOne(owner, resource, []);\n\t\t}\n\t}\n\n\tchangeOne(owner: string, resource: URI, markerData: IMarkerData[]): void {\n\n\t\tif (isFalsyOrEmpty(markerData)) {\n\t\t\t// remove marker for this (owner,resource)-tuple\n\t\t\tconst removed = this._data.delete(resource, owner);\n\t\t\tif (removed) {\n\t\t\t\tthis._onMarkerChanged.fire([resource]);\n\t\t\t}\n\n\t\t} else {\n\t\t\t// insert marker for this (owner,resource)-tuple\n\t\t\tconst markers: IMarker[] = [];\n\t\t\tfor (const data of markerData) {\n\t\t\t\tconst marker = MarkerService._toMarker(owner, resource, data);\n\t\t\t\tif (marker) {\n\t\t\t\t\tmarkers.push(marker);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._data.set(resource, owner, markers);\n\t\t\tthis._onMarkerChanged.fire([resource]);\n\t\t}\n\t}\n\n\tprivate static _toMarker(owner: string, resource: URI, data: IMarkerData): IMarker | undefined {\n\t\tlet {\n\t\t\tcode, severity,\n\t\t\tmessage, source,\n\t\t\tstartLineNumber, startColumn, endLineNumber, endColumn,\n\t\t\trelatedInformation,\n\t\t\ttags, origin\n\t\t} = data;\n\n\t\tif (!message) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// santize data\n\t\tstartLineNumber = startLineNumber > 0 ? startLineNumber : 1;\n\t\tstartColumn = startColumn > 0 ? startColumn : 1;\n\t\tendLineNumber = endLineNumber >= startLineNumber ? endLineNumber : startLineNumber;\n\t\tendColumn = endColumn > 0 ? endColumn : startColumn;\n\n\t\treturn {\n\t\t\tresource,\n\t\t\towner,\n\t\t\tcode,\n\t\t\tseverity,\n\t\t\tmessage,\n\t\t\tsource,\n\t\t\tstartLineNumber,\n\t\t\tstartColumn,\n\t\t\tendLineNumber,\n\t\t\tendColumn,\n\t\t\trelatedInformation,\n\t\t\ttags,\n\t\t\torigin\n\t\t};\n\t}\n\n\tchangeAll(owner: string, data: IResourceMarker[]): void {\n\t\tconst changes: URI[] = [];\n\n\t\t// remove old marker\n\t\tconst existing = this._data.values(owner);\n\t\tif (existing) {\n\t\t\tfor (const data of existing) {\n\t\t\t\tconst first = Iterable.first(data);\n\t\t\t\tif (first) {\n\t\t\t\t\tchanges.push(first.resource);\n\t\t\t\t\tthis._data.delete(first.resource, owner);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// add new markers\n\t\tif (isNonEmptyArray(data)) {\n\n\t\t\t// group by resource\n\t\t\tconst groups = new ResourceMap<IMarker[]>();\n\t\t\tfor (const { resource, marker: markerData } of data) {\n\t\t\t\tconst marker = MarkerService._toMarker(owner, resource, markerData);\n\t\t\t\tif (!marker) {\n\t\t\t\t\t// filter bad markers\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst array = groups.get(resource);\n\t\t\t\tif (!array) {\n\t\t\t\t\tgroups.set(resource, [marker]);\n\t\t\t\t\tchanges.push(resource);\n\t\t\t\t} else {\n\t\t\t\t\tarray.push(marker);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// insert all\n\t\t\tfor (const [resource, value] of groups) {\n\t\t\t\tthis._data.set(resource, owner, value);\n\t\t\t}\n\t\t}\n\n\t\tif (changes.length > 0) {\n\t\t\tthis._onMarkerChanged.fire(changes);\n\t\t}\n\t}\n\n\t/**\n\t * Creates an information marker for filtered resources\n\t */\n\tprivate _createFilteredMarker(resource: URI, reasons: string[]): IMarker {\n\t\tconst message = reasons.length === 1\n\t\t\t? localize('filtered', \"Problems are paused because: \\\"{0}\\\"\", reasons[0])\n\t\t\t: localize('filtered.network', \"Problems are paused because: \\\"{0}\\\" and {1} more\", reasons[0], reasons.length - 1);\n\n\t\treturn {\n\t\t\towner: 'markersFilter',\n\t\t\tresource,\n\t\t\tseverity: MarkerSeverity.Info,\n\t\t\tmessage,\n\t\t\tstartLineNumber: 1,\n\t\t\tstartColumn: 1,\n\t\t\tendLineNumber: 1,\n\t\t\tendColumn: 1,\n\t\t};\n\t}\n\n\tread(filter: IMarkerReadOptions = Object.create(null)): IMarker[] {\n\n\t\tlet { owner, resource, severities, take } = filter;\n\n\t\tif (!take || take < 0) {\n\t\t\ttake = -1;\n\t\t}\n\n\t\tif (owner && resource) {\n\t\t\t// exactly one owner AND resource\n\t\t\tconst reasons = !filter.ignoreResourceFilters ? this._filteredResources.get(resource) : undefined;\n\t\t\tif (reasons?.length) {\n\t\t\t\tconst infoMarker = this._createFilteredMarker(resource, reasons);\n\t\t\t\treturn [infoMarker];\n\t\t\t}\n\n\t\t\tconst data = this._data.get(resource, owner);\n\t\t\tif (!data) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\tconst result: IMarker[] = [];\n\t\t\tfor (const marker of data) {\n\t\t\t\tif (take > 0 && result.length === take) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tconst reasons = !filter.ignoreResourceFilters ? this._filteredResources.get(resource) : undefined;\n\t\t\t\tif (reasons?.length) {\n\t\t\t\t\tresult.push(this._createFilteredMarker(resource, reasons));\n\n\t\t\t\t} else if (MarkerService._accept(marker, severities)) {\n\t\t\t\t\tresult.push(marker);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\n\t\t} else {\n\t\t\t// of one resource OR owner\n\t\t\tconst iterable = !owner && !resource\n\t\t\t\t? this._data.values()\n\t\t\t\t: this._data.values(resource ?? owner!);\n\n\t\t\tconst result: IMarker[] = [];\n\t\t\tconst filtered = new ResourceSet();\n\n\t\t\tfor (const markers of iterable) {\n\t\t\t\tfor (const data of markers) {\n\t\t\t\t\tif (filtered.has(data.resource)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (take > 0 && result.length === take) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconst reasons = !filter.ignoreResourceFilters ? this._filteredResources.get(data.resource) : undefined;\n\t\t\t\t\tif (reasons?.length) {\n\t\t\t\t\t\tresult.push(this._createFilteredMarker(data.resource, reasons));\n\t\t\t\t\t\tfiltered.add(data.resource);\n\n\t\t\t\t\t} else if (MarkerService._accept(data, severities)) {\n\t\t\t\t\t\tresult.push(data);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}\n\n\tprivate static _accept(marker: IMarker, severities?: number): boolean {\n\t\treturn severities === undefined || (severities & marker.severity) === marker.severity;\n\t}\n\n\t// --- event debounce logic\n\n\tprivate static _merge(all: (readonly URI[])[]): URI[] {\n\t\tconst set = new ResourceMap<boolean>();\n\t\tfor (const array of all) {\n\t\t\tfor (const item of array) {\n\t\t\t\tset.set(item, true);\n\t\t\t}\n\t\t}\n\t\treturn Array.from(set.keys());\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["vs/platform/markers/common/markerService.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,gCAAgC,CA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AC1D,OAAO,UAAU,KAAK,SAAS,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,MAAM,CAAC,QAAQ,CAAC;IACvF,CAAC;IAED,2BAA2B;IAEnB,MAAM,CAAC,MAAM,CAAC,GAAuB;QAC5C,MAAM,GAAG,GAAG,IAAI,WAAW,EAAW,CAAC;QACvC,KAAK,MAAM,KAAK,IAAI,GAAG,EAAE,CAAC;YACzB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;gBAC1B,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACrB,CAAC;QACF,CAAC;QACD,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IAC/B,CAAC;CACD","file":"markerService.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { isFalsyOrEmpty, isNonEmptyArray } from '../../../base/common/arrays.js';\nimport { MicrotaskEmitter } from '../../../base/common/event.js';\nimport { Iterable } from '../../../base/common/iterator.js';\nimport { IDisposable } from '../../../base/common/lifecycle.js';\nimport { ResourceMap, ResourceSet } from '../../../base/common/map.js';\nimport { Schemas } from '../../../base/common/network.js';\nimport { URI } from '../../../base/common/uri.js';\nimport { localize } from '../../../nls.js';\nimport { IMarker, IMarkerData, IMarkerReadOptions, IMarkerService, IResourceMarker, MarkerSeverity, MarkerStatistics } from './markers.js';\n\nexport const unsupportedSchemas = new Set([\n\tSchemas.inMemory,\n\tSchemas.vscodeSourceControl,\n\tSchemas.walkThrough,\n\tSchemas.walkThroughSnippet,\n\tSchemas.vscodeChatCodeBlock,\n\tSchemas.vscodeTerminal\n]);\n\nclass DoubleResourceMap<V> {\n\n\tprivate _byResource = new ResourceMap<Map<string, V>>();\n\tprivate _byOwner = new Map<string, ResourceMap<V>>();\n\n\tset(resource: URI, owner: string, value: V) {\n\t\tlet ownerMap = this._byResource.get(resource);\n\t\tif (!ownerMap) {\n\t\t\townerMap = new Map();\n\t\t\tthis._byResource.set(resource, ownerMap);\n\t\t}\n\t\townerMap.set(owner, value);\n\n\t\tlet resourceMap = this._byOwner.get(owner);\n\t\tif (!resourceMap) {\n\t\t\tresourceMap = new ResourceMap();\n\t\t\tthis._byOwner.set(owner, resourceMap);\n\t\t}\n\t\tresourceMap.set(resource, value);\n\t}\n\n\tget(resource: URI, owner: string): V | undefined {\n\t\tconst ownerMap = this._byResource.get(resource);\n\t\treturn ownerMap?.get(owner);\n\t}\n\n\tdelete(resource: URI, owner: string): boolean {\n\t\tlet removedA = false;\n\t\tlet removedB = false;\n\t\tconst ownerMap = this._byResource.get(resource);\n\t\tif (ownerMap) {\n\t\t\tremovedA = ownerMap.delete(owner);\n\t\t}\n\t\tconst resourceMap = this._byOwner.get(owner);\n\t\tif (resourceMap) {\n\t\t\tremovedB = resourceMap.delete(resource);\n\t\t}\n\t\tif (removedA !== removedB) {\n\t\t\tthrow new Error('illegal state');\n\t\t}\n\t\treturn removedA && removedB;\n\t}\n\n\tvalues(key?: URI | string): Iterable<V> {\n\t\tif (typeof key === 'string') {\n\t\t\treturn this._byOwner.get(key)?.values() ?? Iterable.empty();\n\t\t}\n\t\tif (URI.isUri(key)) {\n\t\t\treturn this._byResource.get(key)?.values() ?? Iterable.empty();\n\t\t}\n\n\t\treturn Iterable.map(Iterable.concat(...this._byOwner.values()), map => map[1]);\n\t}\n}\n\nclass MarkerStats implements MarkerStatistics {\n\n\terrors: number = 0;\n\tinfos: number = 0;\n\twarnings: number = 0;\n\tunknowns: number = 0;\n\n\tprivate readonly _data = new ResourceMap<MarkerStatistics>();\n\tprivate readonly _service: IMarkerService;\n\tprivate readonly _subscription: IDisposable;\n\n\tconstructor(service: IMarkerService) {\n\t\tthis._service = service;\n\t\tthis._subscription = service.onMarkerChanged(this._update, this);\n\t}\n\n\tdispose(): void {\n\t\tthis._subscription.dispose();\n\t}\n\n\tprivate _update(resources: readonly URI[]): void {\n\t\tfor (const resource of resources) {\n\t\t\tconst oldStats = this._data.get(resource);\n\t\t\tif (oldStats) {\n\t\t\t\tthis._substract(oldStats);\n\t\t\t}\n\t\t\tconst newStats = this._resourceStats(resource);\n\t\t\tthis._add(newStats);\n\t\t\tthis._data.set(resource, newStats);\n\t\t}\n\t}\n\n\tprivate _resourceStats(resource: URI): MarkerStatistics {\n\t\tconst result: MarkerStatistics = { errors: 0, warnings: 0, infos: 0, unknowns: 0 };\n\n\t\t// TODO this is a hack\n\t\tif (unsupportedSchemas.has(resource.scheme)) {\n\t\t\treturn result;\n\t\t}\n\n\t\tfor (const { severity } of this._service.read({ resource })) {\n\t\t\tif (severity === MarkerSeverity.Error) {\n\t\t\t\tresult.errors += 1;\n\t\t\t} else if (severity === MarkerSeverity.Warning) {\n\t\t\t\tresult.warnings += 1;\n\t\t\t} else if (severity === MarkerSeverity.Info) {\n\t\t\t\tresult.infos += 1;\n\t\t\t} else {\n\t\t\t\tresult.unknowns += 1;\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprivate _substract(op: MarkerStatistics) {\n\t\tthis.errors -= op.errors;\n\t\tthis.warnings -= op.warnings;\n\t\tthis.infos -= op.infos;\n\t\tthis.unknowns -= op.unknowns;\n\t}\n\n\tprivate _add(op: MarkerStatistics) {\n\t\tthis.errors += op.errors;\n\t\tthis.warnings += op.warnings;\n\t\tthis.infos += op.infos;\n\t\tthis.unknowns += op.unknowns;\n\t}\n}\n\nexport class MarkerService implements IMarkerService {\n\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate readonly _onMarkerChanged = new MicrotaskEmitter<readonly URI[]>({\n\t\tmerge: MarkerService._merge\n\t});\n\n\treadonly onMarkerChanged = this._onMarkerChanged.event;\n\n\tprivate readonly _data = new DoubleResourceMap<IMarker[]>();\n\tprivate readonly _stats = new MarkerStats(this);\n\tprivate readonly _filteredResources = new ResourceMap<string[]>();\n\n\tdispose(): void {\n\t\tthis._stats.dispose();\n\t\tthis._onMarkerChanged.dispose();\n\t}\n\n\tremove(owner: string, resources: URI[]): void {\n\t\tfor (const resource of resources || []) {\n\t\t\tthis.changeOne(owner, resource, []);\n\t\t}\n\t}\n\n\tchangeOne(owner: string, resource: URI, markerData: IMarkerData[]): void {\n\n\t\tif (isFalsyOrEmpty(markerData)) {\n\t\t\t// remove marker for this (owner,resource)-tuple\n\t\t\tconst removed = this._data.delete(resource, owner);\n\t\t\tif (removed) {\n\t\t\t\tthis._onMarkerChanged.fire([resource]);\n\t\t\t}\n\n\t\t} else {\n\t\t\t// insert marker for this (owner,resource)-tuple\n\t\t\tconst markers: IMarker[] = [];\n\t\t\tfor (const data of markerData) {\n\t\t\t\tconst marker = MarkerService._toMarker(owner, resource, data);\n\t\t\t\tif (marker) {\n\t\t\t\t\tmarkers.push(marker);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._data.set(resource, owner, markers);\n\t\t\tthis._onMarkerChanged.fire([resource]);\n\t\t}\n\t}\n\n\tprivate static _toMarker(owner: string, resource: URI, data: IMarkerData): IMarker | undefined {\n\t\tlet {\n\t\t\tcode, severity,\n\t\t\tmessage, source,\n\t\t\tstartLineNumber, startColumn, endLineNumber, endColumn,\n\t\t\trelatedInformation,\n\t\t\tmodelVersionId,\n\t\t\ttags, origin\n\t\t} = data;\n\n\t\tif (!message) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// santize data\n\t\tstartLineNumber = startLineNumber > 0 ? startLineNumber : 1;\n\t\tstartColumn = startColumn > 0 ? startColumn : 1;\n\t\tendLineNumber = endLineNumber >= startLineNumber ? endLineNumber : startLineNumber;\n\t\tendColumn = endColumn > 0 ? endColumn : startColumn;\n\n\t\treturn {\n\t\t\tresource,\n\t\t\towner,\n\t\t\tcode,\n\t\t\tseverity,\n\t\t\tmessage,\n\t\t\tsource,\n\t\t\tstartLineNumber,\n\t\t\tstartColumn,\n\t\t\tendLineNumber,\n\t\t\tendColumn,\n\t\t\trelatedInformation,\n\t\t\tmodelVersionId,\n\t\t\ttags,\n\t\t\torigin\n\t\t};\n\t}\n\n\tchangeAll(owner: string, data: IResourceMarker[]): void {\n\t\tconst changes: URI[] = [];\n\n\t\t// remove old marker\n\t\tconst existing = this._data.values(owner);\n\t\tif (existing) {\n\t\t\tfor (const data of existing) {\n\t\t\t\tconst first = Iterable.first(data);\n\t\t\t\tif (first) {\n\t\t\t\t\tchanges.push(first.resource);\n\t\t\t\t\tthis._data.delete(first.resource, owner);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// add new markers\n\t\tif (isNonEmptyArray(data)) {\n\n\t\t\t// group by resource\n\t\t\tconst groups = new ResourceMap<IMarker[]>();\n\t\t\tfor (const { resource, marker: markerData } of data) {\n\t\t\t\tconst marker = MarkerService._toMarker(owner, resource, markerData);\n\t\t\t\tif (!marker) {\n\t\t\t\t\t// filter bad markers\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst array = groups.get(resource);\n\t\t\t\tif (!array) {\n\t\t\t\t\tgroups.set(resource, [marker]);\n\t\t\t\t\tchanges.push(resource);\n\t\t\t\t} else {\n\t\t\t\t\tarray.push(marker);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// insert all\n\t\t\tfor (const [resource, value] of groups) {\n\t\t\t\tthis._data.set(resource, owner, value);\n\t\t\t}\n\t\t}\n\n\t\tif (changes.length > 0) {\n\t\t\tthis._onMarkerChanged.fire(changes);\n\t\t}\n\t}\n\n\t/**\n\t * Creates an information marker for filtered resources\n\t */\n\tprivate _createFilteredMarker(resource: URI, reasons: string[]): IMarker {\n\t\tconst message = reasons.length === 1\n\t\t\t? localize('filtered', \"Problems are paused because: \\\"{0}\\\"\", reasons[0])\n\t\t\t: localize('filtered.network', \"Problems are paused because: \\\"{0}\\\" and {1} more\", reasons[0], reasons.length - 1);\n\n\t\treturn {\n\t\t\towner: 'markersFilter',\n\t\t\tresource,\n\t\t\tseverity: MarkerSeverity.Info,\n\t\t\tmessage,\n\t\t\tstartLineNumber: 1,\n\t\t\tstartColumn: 1,\n\t\t\tendLineNumber: 1,\n\t\t\tendColumn: 1,\n\t\t};\n\t}\n\n\tread(filter: IMarkerReadOptions = Object.create(null)): IMarker[] {\n\n\t\tlet { owner, resource, severities, take } = filter;\n\n\t\tif (!take || take < 0) {\n\t\t\ttake = -1;\n\t\t}\n\n\t\tif (owner && resource) {\n\t\t\t// exactly one owner AND resource\n\t\t\tconst reasons = !filter.ignoreResourceFilters ? this._filteredResources.get(resource) : undefined;\n\t\t\tif (reasons?.length) {\n\t\t\t\tconst infoMarker = this._createFilteredMarker(resource, reasons);\n\t\t\t\treturn [infoMarker];\n\t\t\t}\n\n\t\t\tconst data = this._data.get(resource, owner);\n\t\t\tif (!data) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\tconst result: IMarker[] = [];\n\t\t\tfor (const marker of data) {\n\t\t\t\tif (take > 0 && result.length === take) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tconst reasons = !filter.ignoreResourceFilters ? this._filteredResources.get(resource) : undefined;\n\t\t\t\tif (reasons?.length) {\n\t\t\t\t\tresult.push(this._createFilteredMarker(resource, reasons));\n\n\t\t\t\t} else if (MarkerService._accept(marker, severities)) {\n\t\t\t\t\tresult.push(marker);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\n\t\t} else {\n\t\t\t// of one resource OR owner\n\t\t\tconst iterable = !owner && !resource\n\t\t\t\t? this._data.values()\n\t\t\t\t: this._data.values(resource ?? owner!);\n\n\t\t\tconst result: IMarker[] = [];\n\t\t\tconst filtered = new ResourceSet();\n\n\t\t\tfor (const markers of iterable) {\n\t\t\t\tfor (const data of markers) {\n\t\t\t\t\tif (filtered.has(data.resource)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (take > 0 && result.length === take) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconst reasons = !filter.ignoreResourceFilters ? this._filteredResources.get(data.resource) : undefined;\n\t\t\t\t\tif (reasons?.length) {\n\t\t\t\t\t\tresult.push(this._createFilteredMarker(data.resource, reasons));\n\t\t\t\t\t\tfiltered.add(data.resource);\n\n\t\t\t\t\t} else if (MarkerService._accept(data, severities)) {\n\t\t\t\t\t\tresult.push(data);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}\n\n\tprivate static _accept(marker: IMarker, severities?: number): boolean {\n\t\treturn severities === undefined || (severities & marker.severity) === marker.severity;\n\t}\n\n\t// --- event debounce logic\n\n\tprivate static _merge(all: (readonly URI[])[]): URI[] {\n\t\tconst set = new ResourceMap<boolean>();\n\t\tfor (const array of all) {\n\t\t\tfor (const item of array) {\n\t\t\t\tset.set(item, true);\n\t\t\t}\n\t\t}\n\t\treturn Array.from(set.keys());\n\t}\n}\n"]}
|
|
@@ -18,17 +18,17 @@ export var MarkerSeverity;
|
|
|
18
18
|
}
|
|
19
19
|
MarkerSeverity.compare = compare;
|
|
20
20
|
const _displayStrings = Object.create(null);
|
|
21
|
-
_displayStrings[MarkerSeverity.Error] = localize(
|
|
22
|
-
_displayStrings[MarkerSeverity.Warning] = localize(
|
|
23
|
-
_displayStrings[MarkerSeverity.Info] = localize(
|
|
21
|
+
_displayStrings[MarkerSeverity.Error] = localize(1750, "Error");
|
|
22
|
+
_displayStrings[MarkerSeverity.Warning] = localize(1751, "Warning");
|
|
23
|
+
_displayStrings[MarkerSeverity.Info] = localize(1752, "Info");
|
|
24
24
|
function toString(a) {
|
|
25
25
|
return _displayStrings[a] || '';
|
|
26
26
|
}
|
|
27
27
|
MarkerSeverity.toString = toString;
|
|
28
28
|
const _displayStringsPlural = Object.create(null);
|
|
29
|
-
_displayStringsPlural[MarkerSeverity.Error] = localize(
|
|
30
|
-
_displayStringsPlural[MarkerSeverity.Warning] = localize(
|
|
31
|
-
_displayStringsPlural[MarkerSeverity.Info] = localize(
|
|
29
|
+
_displayStringsPlural[MarkerSeverity.Error] = localize(1753, "Errors");
|
|
30
|
+
_displayStringsPlural[MarkerSeverity.Warning] = localize(1754, "Warnings");
|
|
31
|
+
_displayStringsPlural[MarkerSeverity.Info] = localize(1755, "Infos");
|
|
32
32
|
function toStringPlural(a) {
|
|
33
33
|
return _displayStringsPlural[a] || '';
|
|
34
34
|
}
|
|
@@ -170,22 +170,22 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
|
|
|
170
170
|
const isInHistory = !!this.commandsHistory.peek(commandPick.commandId);
|
|
171
171
|
// Separator: recently used
|
|
172
172
|
if (i === 0 && isInHistory) {
|
|
173
|
-
commandPicks.push({ type: 'separator', label: localize(
|
|
173
|
+
commandPicks.push({ type: 'separator', label: localize(1758, "recently used") });
|
|
174
174
|
addOtherSeparator = true;
|
|
175
175
|
}
|
|
176
176
|
if (addSuggestedSeparator && commandPick.tfIdfScore !== undefined) {
|
|
177
|
-
commandPicks.push({ type: 'separator', label: localize(
|
|
177
|
+
commandPicks.push({ type: 'separator', label: localize(1759, "similar commands") });
|
|
178
178
|
addSuggestedSeparator = false;
|
|
179
179
|
}
|
|
180
180
|
// Separator: commonly used
|
|
181
181
|
if (addCommonlyUsedSeparator && commandPick.tfIdfScore === undefined && !isInHistory && this.options.suggestedCommandIds?.has(commandPick.commandId)) {
|
|
182
|
-
commandPicks.push({ type: 'separator', label: localize(
|
|
182
|
+
commandPicks.push({ type: 'separator', label: localize(1760, "commonly used") });
|
|
183
183
|
addOtherSeparator = true;
|
|
184
184
|
addCommonlyUsedSeparator = false;
|
|
185
185
|
}
|
|
186
186
|
// Separator: other commands
|
|
187
187
|
if (addOtherSeparator && commandPick.tfIdfScore === undefined && !isInHistory && !this.options.suggestedCommandIds?.has(commandPick.commandId)) {
|
|
188
|
-
commandPicks.push({ type: 'separator', label: localize(
|
|
188
|
+
commandPicks.push({ type: 'separator', label: localize(1761, "other commands") });
|
|
189
189
|
addOtherSeparator = false;
|
|
190
190
|
}
|
|
191
191
|
// Command
|
|
@@ -205,7 +205,7 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
|
|
|
205
205
|
// Basically, if we haven't already added a separator, we add one before the additional picks so long
|
|
206
206
|
// as one hasn't been added to the start of the array.
|
|
207
207
|
if (addSuggestedSeparator && commandPicks[0]?.type !== 'separator') {
|
|
208
|
-
commandPicks.unshift({ type: 'separator', label: localize(
|
|
208
|
+
commandPicks.unshift({ type: 'separator', label: localize(1762, "similar commands") });
|
|
209
209
|
}
|
|
210
210
|
return commandPicks;
|
|
211
211
|
})()
|
|
@@ -217,7 +217,7 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
|
|
|
217
217
|
}
|
|
218
218
|
const keybinding = this.keybindingService.lookupKeybinding(commandPick.commandId);
|
|
219
219
|
const ariaLabel = keybinding ?
|
|
220
|
-
localize(
|
|
220
|
+
localize(1763, "{0}, {1}", commandPick.label, keybinding.getAriaLabel()) :
|
|
221
221
|
commandPick.label;
|
|
222
222
|
// Add remove button for recently used items (as the last button, to the right)
|
|
223
223
|
const existingButtons = commandPick.buttons || [];
|
|
@@ -225,7 +225,7 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
|
|
|
225
225
|
...existingButtons,
|
|
226
226
|
{
|
|
227
227
|
iconClass: ThemeIcon.asClassName(Codicon.close),
|
|
228
|
-
tooltip: localize(
|
|
228
|
+
tooltip: localize(1764, "Remove from Recently Used")
|
|
229
229
|
}
|
|
230
230
|
] : commandPick.buttons;
|
|
231
231
|
return {
|
|
@@ -250,7 +250,7 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
|
|
|
250
250
|
}
|
|
251
251
|
catch (error) {
|
|
252
252
|
if (!isCancellationError(error)) {
|
|
253
|
-
this.dialogService.error(localize(
|
|
253
|
+
this.dialogService.error(localize(1765, "Command '{0}' resulted in an error", commandPick.label), toErrorMessage(error));
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
256
|
},
|
|
@@ -62,7 +62,7 @@ let HelpQuickAccessProvider = class HelpQuickAccessProvider {
|
|
|
62
62
|
prefix,
|
|
63
63
|
label,
|
|
64
64
|
keybinding: helpEntry.commandId ? this.keybindingService.lookupKeybinding(helpEntry.commandId) : undefined,
|
|
65
|
-
ariaLabel: localize(
|
|
65
|
+
ariaLabel: localize(1766, "{0}, {1}", label, helpEntry.description),
|
|
66
66
|
description: helpEntry.description
|
|
67
67
|
};
|
|
68
68
|
});
|
|
@@ -346,10 +346,10 @@
|
|
|
346
346
|
color: inherit
|
|
347
347
|
}
|
|
348
348
|
|
|
349
|
-
.quick-input-list .monaco-list-row.focused .monaco-keybinding-key
|
|
349
|
+
.quick-input-list .monaco-list-row.focused .monaco-keybinding-key,
|
|
350
|
+
.quick-input-list .monaco-list-row:hover .monaco-keybinding-key {
|
|
350
351
|
background: none;
|
|
351
|
-
border-color:
|
|
352
|
-
opacity: 0.8;
|
|
352
|
+
border-color: var(--vscode-widget-shadow);
|
|
353
353
|
}
|
|
354
354
|
|
|
355
355
|
.quick-input-list .quick-input-list-separator-as-item {
|
|
@@ -395,6 +395,10 @@
|
|
|
395
395
|
display: none !important;
|
|
396
396
|
}
|
|
397
397
|
|
|
398
|
+
.quick-input-tree.quick-input-tree-flat .monaco-checkbox {
|
|
399
|
+
margin-left: 6px;
|
|
400
|
+
}
|
|
401
|
+
|
|
398
402
|
.quick-input-tree .quick-input-tree-entry {
|
|
399
403
|
box-sizing: border-box;
|
|
400
404
|
overflow: hidden;
|
|
@@ -31,22 +31,22 @@ import { IHoverService, WorkbenchHoverDelegate } from '../../hover/browser/hover
|
|
|
31
31
|
import { ContextKeyExpr, RawContextKey } from '../../contextkey/common/contextkey.js';
|
|
32
32
|
import { observableValue } from '../../../base/common/observable.js';
|
|
33
33
|
export const inQuickInputContextKeyValue = 'inQuickInput';
|
|
34
|
-
export const InQuickInputContextKey = new RawContextKey(inQuickInputContextKeyValue, false, localize(
|
|
34
|
+
export const InQuickInputContextKey = new RawContextKey(inQuickInputContextKeyValue, false, localize(1767, "Whether keyboard focus is inside the quick input control"));
|
|
35
35
|
export const inQuickInputContext = ContextKeyExpr.has(inQuickInputContextKeyValue);
|
|
36
36
|
export const quickInputAlignmentContextKeyValue = 'quickInputAlignment';
|
|
37
|
-
export const QuickInputAlignmentContextKey = new RawContextKey(quickInputAlignmentContextKeyValue, 'top', localize(
|
|
37
|
+
export const QuickInputAlignmentContextKey = new RawContextKey(quickInputAlignmentContextKeyValue, 'top', localize(1768, "The alignment of the quick input"));
|
|
38
38
|
export const quickInputTypeContextKeyValue = 'quickInputType';
|
|
39
|
-
export const QuickInputTypeContextKey = new RawContextKey(quickInputTypeContextKeyValue, undefined, localize(
|
|
39
|
+
export const QuickInputTypeContextKey = new RawContextKey(quickInputTypeContextKeyValue, undefined, localize(1769, "The type of the currently visible quick input"));
|
|
40
40
|
export const endOfQuickInputBoxContextKeyValue = 'cursorAtEndOfQuickInputBox';
|
|
41
|
-
export const EndOfQuickInputBoxContextKey = new RawContextKey(endOfQuickInputBoxContextKeyValue, false, localize(
|
|
41
|
+
export const EndOfQuickInputBoxContextKey = new RawContextKey(endOfQuickInputBoxContextKeyValue, false, localize(1770, "Whether the cursor in the quick input is at the end of the input box"));
|
|
42
42
|
export const endOfQuickInputBoxContext = ContextKeyExpr.has(endOfQuickInputBoxContextKeyValue);
|
|
43
43
|
export const backButton = {
|
|
44
44
|
iconClass: ThemeIcon.asClassName(Codicon.quickInputBack),
|
|
45
|
-
tooltip: localize(
|
|
45
|
+
tooltip: localize(1771, "Back"),
|
|
46
46
|
handle: -1 // TODO
|
|
47
47
|
};
|
|
48
48
|
export class QuickInput extends Disposable {
|
|
49
|
-
static { this.noPromptMessage = localize(
|
|
49
|
+
static { this.noPromptMessage = localize(1772, "Press 'Enter' to confirm your input or 'Escape' to cancel"); }
|
|
50
50
|
constructor(ui) {
|
|
51
51
|
super();
|
|
52
52
|
this.ui = ui;
|
|
@@ -282,7 +282,6 @@ export class QuickInput extends Disposable {
|
|
|
282
282
|
// Adjust count badge position based on number of toggles (each toggle is ~22px wide)
|
|
283
283
|
const toggleOffset = concreteToggles.length * 22;
|
|
284
284
|
this.ui.countContainer.style.right = toggleOffset > 0 ? `${4 + toggleOffset}px` : '4px';
|
|
285
|
-
this.ui.visibleCountContainer.style.right = toggleOffset > 0 ? `${4 + toggleOffset}px` : '4px';
|
|
286
285
|
}
|
|
287
286
|
this.ui.ignoreFocusOut = this.ignoreFocusOut;
|
|
288
287
|
this.ui.setEnabled(this.enabled);
|
|
@@ -322,7 +321,7 @@ export class QuickInput extends Disposable {
|
|
|
322
321
|
}
|
|
323
322
|
getSteps() {
|
|
324
323
|
if (this.step && this.totalSteps) {
|
|
325
|
-
return localize(
|
|
324
|
+
return localize(1773, "{0}/{1}", this.step, this.totalSteps);
|
|
326
325
|
}
|
|
327
326
|
if (this.step) {
|
|
328
327
|
return String(this.step);
|
|
@@ -352,7 +351,7 @@ export class QuickInput extends Disposable {
|
|
|
352
351
|
}
|
|
353
352
|
}
|
|
354
353
|
export class QuickPick extends QuickInput {
|
|
355
|
-
static { this.DEFAULT_ARIA_LABEL = localize(
|
|
354
|
+
static { this.DEFAULT_ARIA_LABEL = localize(1774, "Type to narrow down results."); }
|
|
356
355
|
constructor(ui) {
|
|
357
356
|
super(ui);
|
|
358
357
|
this._value = '';
|
|
@@ -384,6 +383,7 @@ export class QuickPick extends QuickInput {
|
|
|
384
383
|
this.valueSelectionUpdated = true;
|
|
385
384
|
this._ok = 'default';
|
|
386
385
|
this._customButton = false;
|
|
386
|
+
this._customButtonSecondary = false;
|
|
387
387
|
this._focusEventBufferer = new EventBufferer();
|
|
388
388
|
this.type = "quickPick" /* QuickInputType.QuickPick */;
|
|
389
389
|
this.filterValue = (value) => value;
|
|
@@ -578,6 +578,13 @@ export class QuickPick extends QuickInput {
|
|
|
578
578
|
this._customButtonHover = hover;
|
|
579
579
|
this.update();
|
|
580
580
|
}
|
|
581
|
+
get customButtonSecondary() {
|
|
582
|
+
return this._customButtonSecondary;
|
|
583
|
+
}
|
|
584
|
+
set customButtonSecondary(secondary) {
|
|
585
|
+
this._customButtonSecondary = secondary ?? false;
|
|
586
|
+
this.update();
|
|
587
|
+
}
|
|
581
588
|
get ok() {
|
|
582
589
|
return this._ok;
|
|
583
590
|
}
|
|
@@ -586,7 +593,7 @@ export class QuickPick extends QuickInput {
|
|
|
586
593
|
this.update();
|
|
587
594
|
}
|
|
588
595
|
get okLabel() {
|
|
589
|
-
return this._okLabel ?? localize(
|
|
596
|
+
return this._okLabel ?? localize(1775, "OK");
|
|
590
597
|
}
|
|
591
598
|
set okLabel(okLabel) {
|
|
592
599
|
this._okLabel = okLabel;
|
|
@@ -842,6 +849,7 @@ export class QuickPick extends QuickInput {
|
|
|
842
849
|
this.ui.ok.label = this.okLabel || '';
|
|
843
850
|
this.ui.customButton.label = this.customLabel || '';
|
|
844
851
|
this.ui.customButton.element.title = this.customHover || '';
|
|
852
|
+
this.ui.customButton.secondary = this.customButtonSecondary || false;
|
|
845
853
|
if (!visibilities.inputBox) {
|
|
846
854
|
// we need to move focus into the tree to detect keybindings
|
|
847
855
|
// properly when the input box is not visible (quick nav)
|
|
@@ -932,7 +940,7 @@ export class InputBox extends QuickInput {
|
|
|
932
940
|
set prompt(prompt) {
|
|
933
941
|
this._prompt = prompt;
|
|
934
942
|
this.noValidationMessage = prompt
|
|
935
|
-
? localize(
|
|
943
|
+
? localize(1776, "{0} (Press 'Enter' to confirm or 'Escape' to cancel)", prompt)
|
|
936
944
|
: QuickInput.noPromptMessage;
|
|
937
945
|
this.update();
|
|
938
946
|
}
|