monaco-editor-core 0.55.0-dev-20251007 → 0.55.0-dev-20251008

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.
Files changed (40) hide show
  1. package/esm/nls.messages.de.js +1 -1
  2. package/esm/nls.messages.es.js +1 -1
  3. package/esm/nls.messages.fr.js +1 -1
  4. package/esm/nls.messages.it.js +1 -1
  5. package/esm/nls.messages.ja.js +1 -1
  6. package/esm/nls.messages.ko.js +1 -1
  7. package/esm/nls.messages.ru.js +1 -1
  8. package/esm/nls.messages.zh-cn.js +1 -1
  9. package/esm/nls.messages.zh-tw.js +1 -1
  10. package/esm/vs/base/browser/ui/tree/abstractTree.js +2 -5
  11. package/esm/vs/base/browser/ui/tree/abstractTree.js.map +1 -1
  12. package/esm/vs/base/browser/ui/tree/asyncDataTree.js +6 -8
  13. package/esm/vs/base/browser/ui/tree/asyncDataTree.js.map +1 -1
  14. package/esm/vs/base/browser/ui/tree/dataTree.js.map +1 -1
  15. package/esm/vs/base/browser/ui/tree/indexTreeModel.js +1 -2
  16. package/esm/vs/base/browser/ui/tree/indexTreeModel.js.map +1 -1
  17. package/esm/vs/base/browser/ui/tree/objectTree.js.map +1 -1
  18. package/esm/vs/base/common/normalization.js +39 -0
  19. package/esm/vs/base/common/normalization.js.map +1 -0
  20. package/esm/vs/base/common/process.js +0 -1
  21. package/esm/vs/base/common/process.js.map +1 -1
  22. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +1 -0
  23. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
  24. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditWithChanges.js +2 -1
  25. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditWithChanges.js.map +1 -1
  26. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js +1 -1
  27. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js.map +1 -1
  28. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js +27 -1
  29. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js.map +1 -1
  30. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js +1 -1
  31. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js.map +1 -1
  32. package/esm/vs/platform/dataChannel/browser/forwardingTelemetryService.js +1 -2
  33. package/esm/vs/platform/dataChannel/browser/forwardingTelemetryService.js.map +1 -1
  34. package/esm/vs/platform/dnd/browser/dnd.js +1 -3
  35. package/esm/vs/platform/dnd/browser/dnd.js.map +1 -1
  36. package/esm/vs/platform/product/common/product.js +1 -2
  37. package/esm/vs/platform/product/common/product.js.map +1 -1
  38. package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +26 -2
  39. package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js.map +1 -1
  40. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.ts","vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,EAAE,cAAc,EAAE,MAAM,mDAAmD,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACxE,OAAO,EAAE,OAAO,EAAoC,MAAM,6CAA6C,CAAC;AACxG,OAAO,EAAE,qBAAqB,EAAE,MAAM,kEAAkE,CAAC;AAEzG,OAAO,EAAwB,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AAC5G,OAAO,EAAE,SAAS,EAAE,MAAM,gDAAgD,CAAC;AAC3E,OAAO,EAAE,KA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AAC,OAAO,SAAS,CAAC;YAAC,CAAC;YACjC,MAAM,gBAAgB,GAAG,KAAK,CAAC,gBAAgB,CAAC;YAChD,IAAI,CAAC,gBAAgB,EAAE,CAAC;gBAAC,OAAO,SAAS,CAAC;YAAC,CAAC;YAE5C,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,CAAC;gBAC1C,OAAO,SAAS,CAAC;YAClB,CAAC;YAED,MAAM,SAAS,GAAG,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,gBAAgB,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;YAE3E,OAAO,IAAI,kBAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC;QACjF,CAAC,CAAC,CAAC;QAWF,IAAI,CAAC,UAAU,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAErD,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,cAAc,CAAC,eAAe,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,mBAAmB,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;IAChL,CAAC;;AAnFW,8BAA8B;IA4ExC,WAAA,qBAAqB,CAAA;GA5EX,8BAA8B,CAoF1C","file":"inlineEditsViewProducer.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 { createHotClass } from '../../../../../../base/common/hotReloadHelpers.js';\nimport { Disposable } from '../../../../../../base/common/lifecycle.js';\nimport { derived, IObservable, ISettableObservable } from '../../../../../../base/common/observable.js';\nimport { IInstantiationService } from '../../../../../../platform/instantiation/common/instantiation.js';\nimport { ICodeEditor } from '../../../../../browser/editorBrowser.js';\nimport { ObservableCodeEditor, observableCodeEditor } from '../../../../../browser/observableCodeEditor.js';\nimport { LineRange } from '../../../../../common/core/ranges/lineRange.js';\nimport { Range } from '../../../../../common/core/range.js';\nimport { TextReplacement, TextEdit } from '../../../../../common/core/edits/textEdit.js';\nimport { TextModelText } from '../../../../../common/model/textModelText.js';\nimport { InlineCompletionsModel } from '../../model/inlineCompletionsModel.js';\nimport { InlineEdit } from '../../model/inlineEdit.js';\nimport { InlineEditWithChanges } from './inlineEditWithChanges.js';\nimport { GhostTextIndicator, InlineEditHost, InlineEditModel } from './inlineEditsModel.js';\nimport { InlineEditsView } from './inlineEditsView.js';\nimport { InlineEditTabAction } from './inlineEditsViewInterface.js';\n\nexport class InlineEditsViewAndDiffProducer extends Disposable { // TODO: This class is no longer a diff producer. Rename it or get rid of it\n\tpublic static readonly hot = createHotClass(InlineEditsViewAndDiffProducer);\n\n\tprivate readonly _editorObs: ObservableCodeEditor;\n\n\tprivate readonly _inlineEdit = derived<InlineEditWithChanges | undefined>(this, (reader) => {\n\t\tconst model = this._model.read(reader);\n\t\tif (!model) { return undefined; }\n\t\tconst inlineEdit = this._edit.read(reader);\n\t\tif (!inlineEdit) { return undefined; }\n\t\tconst textModel = this._editor.getModel();\n\t\tif (!textModel) { return undefined; }\n\n\t\tconst editOffset = model.inlineEditState.read(undefined)?.inlineCompletion.updatedEdit;\n\t\tif (!editOffset) { return undefined; }\n\n\t\tconst edits = editOffset.replacements.map(e => {\n\t\t\tconst innerEditRange = Range.fromPositions(\n\t\t\t\ttextModel.getPositionAt(e.replaceRange.start),\n\t\t\t\ttextModel.getPositionAt(e.replaceRange.endExclusive)\n\t\t\t);\n\t\t\treturn new TextReplacement(innerEditRange, e.newText);\n\t\t});\n\n\t\tconst diffEdits = new TextEdit(edits);\n\t\tconst text = new TextModelText(textModel);\n\n\t\treturn new InlineEditWithChanges(text, diffEdits, model.primaryPosition.read(undefined), inlineEdit.commands, inlineEdit.inlineCompletion);\n\t});\n\n\tprivate readonly _inlineEditModel = derived<InlineEditModel | undefined>(this, reader => {\n\t\tconst model = this._model.read(reader);\n\t\tif (!model) { return undefined; }\n\t\tconst edit = this._inlineEdit.read(reader);\n\t\tif (!edit) { return undefined; }\n\n\t\tconst tabAction = derived<InlineEditTabAction>(this, reader => {\n\t\t\t/** @description tabAction */\n\t\t\tif (this._editorObs.isFocused.read(reader)) {\n\t\t\t\tif (model.tabShouldJumpToInlineEdit.read(reader)) { return InlineEditTabAction.Jump; }\n\t\t\t\tif (model.tabShouldAcceptInlineEdit.read(reader)) { return InlineEditTabAction.Accept; }\n\t\t\t}\n\t\t\treturn InlineEditTabAction.Inactive;\n\t\t});\n\n\t\treturn new InlineEditModel(model, edit, tabAction);\n\t});\n\n\tprivate readonly _inlineEditHost = derived<InlineEditHost | undefined>(this, reader => {\n\t\tconst model = this._model.read(reader);\n\t\tif (!model) { return undefined; }\n\t\treturn new InlineEditHost(model);\n\t});\n\n\tprivate readonly _ghostTextIndicator = derived<GhostTextIndicator | undefined>(this, reader => {\n\t\tconst model = this._model.read(reader);\n\t\tif (!model) { return undefined; }\n\t\tconst state = model.inlineCompletionState.read(reader);\n\t\tif (!state) { return undefined; }\n\t\tconst inlineCompletion = state.inlineCompletion;\n\t\tif (!inlineCompletion) { return undefined; }\n\n\t\tif (!inlineCompletion.showInlineEditMenu) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst lineRange = LineRange.ofLength(state.primaryGhostText.lineNumber, 1);\n\n\t\treturn new GhostTextIndicator(this._editor, model, lineRange, inlineCompletion);\n\t});\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _edit: IObservable<InlineEdit | undefined>,\n\t\tprivate readonly _model: IObservable<InlineCompletionsModel | undefined>,\n\t\tprivate readonly _focusIsInMenu: ISettableObservable<boolean>,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t) {\n\t\tsuper();\n\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\n\t\tthis._register(instantiationService.createInstance(InlineEditsView, this._editor, this._inlineEditHost, this._inlineEditModel, this._ghostTextIndicator, this._focusIsInMenu));\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\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 { createHotClass } from '../../../../../../base/common/hotReloadHelpers.js';\nimport { Disposable } from '../../../../../../base/common/lifecycle.js';\nimport { derived, IObservable, ISettableObservable } from '../../../../../../base/common/observable.js';\nimport { IInstantiationService } from '../../../../../../platform/instantiation/common/instantiation.js';\nimport { ICodeEditor } from '../../../../../browser/editorBrowser.js';\nimport { ObservableCodeEditor, observableCodeEditor } from '../../../../../browser/observableCodeEditor.js';\nimport { LineRange } from '../../../../../common/core/ranges/lineRange.js';\nimport { Range } from '../../../../../common/core/range.js';\nimport { TextReplacement, TextEdit } from '../../../../../common/core/edits/textEdit.js';\nimport { TextModelText } from '../../../../../common/model/textModelText.js';\nimport { InlineCompletionsModel } from '../../model/inlineCompletionsModel.js';\nimport { InlineEdit } from '../../model/inlineEdit.js';\nimport { InlineEditWithChanges } from './inlineEditWithChanges.js';\nimport { GhostTextIndicator, InlineEditHost, InlineEditModel } from './inlineEditsModel.js';\nimport { InlineEditsView } from './inlineEditsView.js';\nimport { InlineEditTabAction } from './inlineEditsViewInterface.js';\n\nexport class InlineEditsViewAndDiffProducer extends Disposable { // TODO: This class is no longer a diff producer. Rename it or get rid of it\n\tpublic static readonly hot = createHotClass(InlineEditsViewAndDiffProducer);\n\n\tprivate readonly _editorObs: ObservableCodeEditor;\n\n\tprivate readonly _inlineEdit = derived<InlineEditWithChanges | undefined>(this, (reader) => {\n\t\tconst model = this._model.read(reader);\n\t\tif (!model) { return undefined; }\n\t\tconst inlineEdit = this._edit.read(reader);\n\t\tif (!inlineEdit) { return undefined; }\n\t\tconst textModel = this._editor.getModel();\n\t\tif (!textModel) { return undefined; }\n\n\t\tconst editOffset = model.inlineEditState.read(undefined)?.inlineCompletion.updatedEdit;\n\t\tif (!editOffset) { return undefined; }\n\n\t\tconst edits = editOffset.replacements.map(e => {\n\t\t\tconst innerEditRange = Range.fromPositions(\n\t\t\t\ttextModel.getPositionAt(e.replaceRange.start),\n\t\t\t\ttextModel.getPositionAt(e.replaceRange.endExclusive)\n\t\t\t);\n\t\t\treturn new TextReplacement(innerEditRange, e.newText);\n\t\t});\n\n\t\tconst diffEdits = new TextEdit(edits);\n\t\tconst text = new TextModelText(textModel);\n\n\t\treturn new InlineEditWithChanges(text, diffEdits, model.primaryPosition.read(undefined), inlineEdit.commands, inlineEdit.inlineCompletion);\n\t});\n\n\tprivate readonly _inlineEditModel = derived<InlineEditModel | undefined>(this, reader => {\n\t\tconst model = this._model.read(reader);\n\t\tif (!model) { return undefined; }\n\t\tconst edit = this._inlineEdit.read(reader);\n\t\tif (!edit) { return undefined; }\n\n\t\tconst tabAction = derived<InlineEditTabAction>(this, reader => {\n\t\t\t/** @description tabAction */\n\t\t\tif (this._editorObs.isFocused.read(reader)) {\n\t\t\t\tif (model.tabShouldJumpToInlineEdit.read(reader)) { return InlineEditTabAction.Jump; }\n\t\t\t\tif (model.tabShouldAcceptInlineEdit.read(reader)) { return InlineEditTabAction.Accept; }\n\t\t\t}\n\t\t\treturn InlineEditTabAction.Inactive;\n\t\t});\n\n\t\treturn new InlineEditModel(model, edit, tabAction);\n\t});\n\n\tprivate readonly _inlineEditHost = derived<InlineEditHost | undefined>(this, reader => {\n\t\tconst model = this._model.read(reader);\n\t\tif (!model) { return undefined; }\n\t\treturn new InlineEditHost(model);\n\t});\n\n\tprivate readonly _ghostTextIndicator = derived<GhostTextIndicator | undefined>(this, reader => {\n\t\tconst model = this._model.read(reader);\n\t\tif (!model) { return undefined; }\n\t\tconst state = model.inlineCompletionState.read(reader);\n\t\tif (!state) { return undefined; }\n\t\tconst inlineCompletion = state.inlineCompletion;\n\t\tif (!inlineCompletion) { return undefined; }\n\n\t\tif (!inlineCompletion.showInlineEditMenu) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst lineRange = LineRange.ofLength(state.primaryGhostText.lineNumber, 1);\n\n\t\treturn new GhostTextIndicator(this._editor, model, lineRange, inlineCompletion);\n\t});\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _edit: IObservable<InlineEdit | undefined>,\n\t\tprivate readonly _model: IObservable<InlineCompletionsModel | undefined>,\n\t\tprivate readonly _focusIsInMenu: ISettableObservable<boolean>,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t) {\n\t\tsuper();\n\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\n\t\tthis._register(instantiationService.createInstance(InlineEditsView, this._editor, this._inlineEditHost, this._inlineEditModel, this._ghostTextIndicator, this._focusIsInMenu));\n\t}\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.ts","vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,EAAE,cAAc,EAAE,MAAM,mDAAmD,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACxE,OAAO,EAAE,OAAO,EAAoC,MAAM,6CAA6C,CAAC;AACxG,OAAO,EAAE,qBAAqB,EAAE,MAAM,kEAAkE,CAAC;AAEzG,OAAO,EAAwB,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AAC5G,OAAO,EAAE,SAAS,EAAE,MAAM,gDAAgD,CAAC;AAC3E,OAAO,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,8CAA8C,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAG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AI,CAAC,gBAAgB,EAAE,CAAC;gBAAC,OAAO,SAAS,CAAC;YAAC,CAAC;YAE5C,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,CAAC;gBAC1C,OAAO,SAAS,CAAC;YAClB,CAAC;YAED,MAAM,SAAS,GAAG,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,gBAAgB,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;YAE3E,OAAO,IAAI,kBAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC;QACjF,CAAC,CAAC,CAAC;QAWF,IAAI,CAAC,UAAU,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAErD,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,cAAc,CAAC,eAAe,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,mBAAmB,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;IAChL,CAAC;;AAnFW,8BAA8B;IA4ExC,WAAA,qBAAqB,CAAA;GA5EX,8BAA8B,CAoF1C","file":"inlineEditsViewProducer.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 { createHotClass } from '../../../../../../base/common/hotReloadHelpers.js';\nimport { Disposable } from '../../../../../../base/common/lifecycle.js';\nimport { derived, IObservable, ISettableObservable } from '../../../../../../base/common/observable.js';\nimport { IInstantiationService } from '../../../../../../platform/instantiation/common/instantiation.js';\nimport { ICodeEditor } from '../../../../../browser/editorBrowser.js';\nimport { ObservableCodeEditor, observableCodeEditor } from '../../../../../browser/observableCodeEditor.js';\nimport { LineRange } from '../../../../../common/core/ranges/lineRange.js';\nimport { Range } from '../../../../../common/core/range.js';\nimport { TextReplacement, TextEdit } from '../../../../../common/core/edits/textEdit.js';\nimport { TextModelText } from '../../../../../common/model/textModelText.js';\nimport { InlineCompletionsModel } from '../../model/inlineCompletionsModel.js';\nimport { InlineEdit } from '../../model/inlineEdit.js';\nimport { InlineEditWithChanges } from './inlineEditWithChanges.js';\nimport { GhostTextIndicator, InlineEditHost, InlineEditModel } from './inlineEditsModel.js';\nimport { InlineEditsView } from './inlineEditsView.js';\nimport { InlineEditTabAction } from './inlineEditsViewInterface.js';\n\nexport class InlineEditsViewAndDiffProducer extends Disposable { // TODO: This class is no longer a diff producer. Rename it or get rid of it\n\tpublic static readonly hot = createHotClass(InlineEditsViewAndDiffProducer);\n\n\tprivate readonly _editorObs: ObservableCodeEditor;\n\n\tprivate readonly _inlineEdit = derived<InlineEditWithChanges | undefined>(this, (reader) => {\n\t\tconst model = this._model.read(reader);\n\t\tif (!model) { return undefined; }\n\t\tconst inlineEdit = this._edit.read(reader);\n\t\tif (!inlineEdit) { return undefined; }\n\t\tconst textModel = this._editor.getModel();\n\t\tif (!textModel) { return undefined; }\n\n\t\tconst editOffset = model.inlineEditState.read(undefined)?.inlineCompletion.updatedEdit;\n\t\tif (!editOffset) { return undefined; }\n\n\t\tconst edits = editOffset.replacements.map(e => {\n\t\t\tconst innerEditRange = Range.fromPositions(\n\t\t\t\ttextModel.getPositionAt(e.replaceRange.start),\n\t\t\t\ttextModel.getPositionAt(e.replaceRange.endExclusive)\n\t\t\t);\n\t\t\treturn new TextReplacement(innerEditRange, e.newText);\n\t\t});\n\n\t\tconst diffEdits = new TextEdit(edits);\n\t\tconst text = new TextModelText(textModel);\n\n\t\treturn new InlineEditWithChanges(text, diffEdits, model.primaryPosition.read(undefined), model.allPositions.read(undefined), inlineEdit.commands, inlineEdit.inlineCompletion);\n\t});\n\n\tprivate readonly _inlineEditModel = derived<InlineEditModel | undefined>(this, reader => {\n\t\tconst model = this._model.read(reader);\n\t\tif (!model) { return undefined; }\n\t\tconst edit = this._inlineEdit.read(reader);\n\t\tif (!edit) { return undefined; }\n\n\t\tconst tabAction = derived<InlineEditTabAction>(this, reader => {\n\t\t\t/** @description tabAction */\n\t\t\tif (this._editorObs.isFocused.read(reader)) {\n\t\t\t\tif (model.tabShouldJumpToInlineEdit.read(reader)) { return InlineEditTabAction.Jump; }\n\t\t\t\tif (model.tabShouldAcceptInlineEdit.read(reader)) { return InlineEditTabAction.Accept; }\n\t\t\t}\n\t\t\treturn InlineEditTabAction.Inactive;\n\t\t});\n\n\t\treturn new InlineEditModel(model, edit, tabAction);\n\t});\n\n\tprivate readonly _inlineEditHost = derived<InlineEditHost | undefined>(this, reader => {\n\t\tconst model = this._model.read(reader);\n\t\tif (!model) { return undefined; }\n\t\treturn new InlineEditHost(model);\n\t});\n\n\tprivate readonly _ghostTextIndicator = derived<GhostTextIndicator | undefined>(this, reader => {\n\t\tconst model = this._model.read(reader);\n\t\tif (!model) { return undefined; }\n\t\tconst state = model.inlineCompletionState.read(reader);\n\t\tif (!state) { return undefined; }\n\t\tconst inlineCompletion = state.inlineCompletion;\n\t\tif (!inlineCompletion) { return undefined; }\n\n\t\tif (!inlineCompletion.showInlineEditMenu) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst lineRange = LineRange.ofLength(state.primaryGhostText.lineNumber, 1);\n\n\t\treturn new GhostTextIndicator(this._editor, model, lineRange, inlineCompletion);\n\t});\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _edit: IObservable<InlineEdit | undefined>,\n\t\tprivate readonly _model: IObservable<InlineCompletionsModel | undefined>,\n\t\tprivate readonly _focusIsInMenu: ISettableObservable<boolean>,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t) {\n\t\tsuper();\n\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\n\t\tthis._register(instantiationService.createInstance(InlineEditsView, this._editor, this._inlineEditHost, this._inlineEditModel, this._ghostTextIndicator, this._focusIsInMenu));\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\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 { createHotClass } from '../../../../../../base/common/hotReloadHelpers.js';\nimport { Disposable } from '../../../../../../base/common/lifecycle.js';\nimport { derived, IObservable, ISettableObservable } from '../../../../../../base/common/observable.js';\nimport { IInstantiationService } from '../../../../../../platform/instantiation/common/instantiation.js';\nimport { ICodeEditor } from '../../../../../browser/editorBrowser.js';\nimport { ObservableCodeEditor, observableCodeEditor } from '../../../../../browser/observableCodeEditor.js';\nimport { LineRange } from '../../../../../common/core/ranges/lineRange.js';\nimport { Range } from '../../../../../common/core/range.js';\nimport { TextReplacement, TextEdit } from '../../../../../common/core/edits/textEdit.js';\nimport { TextModelText } from '../../../../../common/model/textModelText.js';\nimport { InlineCompletionsModel } from '../../model/inlineCompletionsModel.js';\nimport { InlineEdit } from '../../model/inlineEdit.js';\nimport { InlineEditWithChanges } from './inlineEditWithChanges.js';\nimport { GhostTextIndicator, InlineEditHost, InlineEditModel } from './inlineEditsModel.js';\nimport { InlineEditsView } from './inlineEditsView.js';\nimport { InlineEditTabAction } from './inlineEditsViewInterface.js';\n\nexport class InlineEditsViewAndDiffProducer extends Disposable { // TODO: This class is no longer a diff producer. Rename it or get rid of it\n\tpublic static readonly hot = createHotClass(InlineEditsViewAndDiffProducer);\n\n\tprivate readonly _editorObs: ObservableCodeEditor;\n\n\tprivate readonly _inlineEdit = derived<InlineEditWithChanges | undefined>(this, (reader) => {\n\t\tconst model = this._model.read(reader);\n\t\tif (!model) { return undefined; }\n\t\tconst inlineEdit = this._edit.read(reader);\n\t\tif (!inlineEdit) { return undefined; }\n\t\tconst textModel = this._editor.getModel();\n\t\tif (!textModel) { return undefined; }\n\n\t\tconst editOffset = model.inlineEditState.read(undefined)?.inlineCompletion.updatedEdit;\n\t\tif (!editOffset) { return undefined; }\n\n\t\tconst edits = editOffset.replacements.map(e => {\n\t\t\tconst innerEditRange = Range.fromPositions(\n\t\t\t\ttextModel.getPositionAt(e.replaceRange.start),\n\t\t\t\ttextModel.getPositionAt(e.replaceRange.endExclusive)\n\t\t\t);\n\t\t\treturn new TextReplacement(innerEditRange, e.newText);\n\t\t});\n\n\t\tconst diffEdits = new TextEdit(edits);\n\t\tconst text = new TextModelText(textModel);\n\n\t\treturn new InlineEditWithChanges(text, diffEdits, model.primaryPosition.read(undefined), model.allPositions.read(undefined), inlineEdit.commands, inlineEdit.inlineCompletion);\n\t});\n\n\tprivate readonly _inlineEditModel = derived<InlineEditModel | undefined>(this, reader => {\n\t\tconst model = this._model.read(reader);\n\t\tif (!model) { return undefined; }\n\t\tconst edit = this._inlineEdit.read(reader);\n\t\tif (!edit) { return undefined; }\n\n\t\tconst tabAction = derived<InlineEditTabAction>(this, reader => {\n\t\t\t/** @description tabAction */\n\t\t\tif (this._editorObs.isFocused.read(reader)) {\n\t\t\t\tif (model.tabShouldJumpToInlineEdit.read(reader)) { return InlineEditTabAction.Jump; }\n\t\t\t\tif (model.tabShouldAcceptInlineEdit.read(reader)) { return InlineEditTabAction.Accept; }\n\t\t\t}\n\t\t\treturn InlineEditTabAction.Inactive;\n\t\t});\n\n\t\treturn new InlineEditModel(model, edit, tabAction);\n\t});\n\n\tprivate readonly _inlineEditHost = derived<InlineEditHost | undefined>(this, reader => {\n\t\tconst model = this._model.read(reader);\n\t\tif (!model) { return undefined; }\n\t\treturn new InlineEditHost(model);\n\t});\n\n\tprivate readonly _ghostTextIndicator = derived<GhostTextIndicator | undefined>(this, reader => {\n\t\tconst model = this._model.read(reader);\n\t\tif (!model) { return undefined; }\n\t\tconst state = model.inlineCompletionState.read(reader);\n\t\tif (!state) { return undefined; }\n\t\tconst inlineCompletion = state.inlineCompletion;\n\t\tif (!inlineCompletion) { return undefined; }\n\n\t\tif (!inlineCompletion.showInlineEditMenu) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst lineRange = LineRange.ofLength(state.primaryGhostText.lineNumber, 1);\n\n\t\treturn new GhostTextIndicator(this._editor, model, lineRange, inlineCompletion);\n\t});\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _edit: IObservable<InlineEdit | undefined>,\n\t\tprivate readonly _model: IObservable<InlineCompletionsModel | undefined>,\n\t\tprivate readonly _focusIsInMenu: ISettableObservable<boolean>,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t) {\n\t\tsuper();\n\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\n\t\tthis._register(instantiationService.createInstance(InlineEditsView, this._editor, this._inlineEditHost, this._inlineEditModel, this._ghostTextIndicator, this._focusIsInMenu));\n\t}\n}\n"]}
@@ -32,8 +32,7 @@ let DataChannelForwardingTelemetryService = class DataChannelForwardingTelemetry
32
32
  forward = Boolean(data[shouldForwardToChannel]);
33
33
  }
34
34
  if (forward) {
35
- // eslint-disable-next-line local/code-no-any-casts
36
- dataChannelService.getDataChannel('editTelemetry').sendData({ eventName, data: data });
35
+ dataChannelService.getDataChannel('editTelemetry').sendData({ eventName, data: data ?? {} });
37
36
  }
38
37
  });
39
38
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/platform/dataChannel/browser/forwardingTelemetryService.ts","vs/platform/dataChannel/browser/forwardingTelemetryService.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAGhG,OAAO,EAAkB,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxF,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,MAAM,OAAO,4BAA4B;IAGxC,YACkB,YAA+B,EAC/B,UAA8D;QAD9D,iBAAY,GAAZ,YAAY,CAAmB;QAC/B,eAAU,GAAV,UAAU,CAAoD;IAC5E,CAAC;IAEL,UAAU,CAAsF,SAAiB,EAAE,IAAgC;QAClJ,IAAI,CA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"forwardingTelemetryService.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 { ClassifiedEvent, OmitMetadata, IGDPRProperty, StrictPropertyCheck } from '../../telemetry/common/gdprTypings.js';\nimport { ITelemetryData, ITelemetryService } from '../../telemetry/common/telemetry.js';\nimport { IDataChannelService } from '../common/dataChannel.js';\n\nexport class InterceptingTelemetryService implements ITelemetryService {\n\t_serviceBrand: undefined;\n\n\tconstructor(\n\t\tprivate readonly _baseService: ITelemetryService,\n\t\tprivate readonly _intercept: (eventName: string, data?: ITelemetryData) => void,\n\t) { }\n\n\tpublicLog2<E extends ClassifiedEvent<OmitMetadata<T>> = never, T extends IGDPRProperty = never>(eventName: string, data?: StrictPropertyCheck<T, E>): void {\n\t\tthis._intercept(eventName, data);\n\t\tthis._baseService.publicLog2(eventName, data);\n\t}\n}\n\nexport interface IEditTelemetryData {\n\teventName: string;\n\tdata: Record<string, unknown>;\n}\n\nexport class DataChannelForwardingTelemetryService extends InterceptingTelemetryService {\n\tconstructor(\n\t\t@ITelemetryService telemetryService: ITelemetryService,\n\t\t@IDataChannelService dataChannelService: IDataChannelService,\n\t) {\n\t\tsuper(telemetryService, (eventName, data) => {\n\t\t\t// filter for extension\n\t\t\tlet forward = true;\n\t\t\tif (data && shouldForwardToChannel in data) {\n\t\t\t\tforward = Boolean(data[shouldForwardToChannel]);\n\t\t\t}\n\n\t\t\tif (forward) {\n\t\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\t\tdataChannelService.getDataChannel<IEditTelemetryData>('editTelemetry').sendData({ eventName, data: data as any });\n\t\t\t}\n\t\t});\n\t}\n}\n\nconst shouldForwardToChannel = Symbol('shouldForwardToChannel');\nexport function forwardToChannelIf(value: boolean): Record<string, unknown> {\n\treturn {\n\t\t// This will not be sent via telemetry, it is just a marker\n\t\t[shouldForwardToChannel]: value\n\t};\n}\n\nexport function isCopilotLikeExtension(extensionId: string | undefined): boolean {\n\tif (!extensionId) {\n\t\treturn false;\n\t}\n\tconst extIdLowerCase = extensionId.toLowerCase();\n\treturn extIdLowerCase === 'github.copilot' || extIdLowerCase === 'github.copilot-chat';\n}\n","/*---------------------------------------------------------------------------------------------\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 { ClassifiedEvent, OmitMetadata, IGDPRProperty, StrictPropertyCheck } from '../../telemetry/common/gdprTypings.js';\nimport { ITelemetryData, ITelemetryService } from '../../telemetry/common/telemetry.js';\nimport { IDataChannelService } from '../common/dataChannel.js';\n\nexport class InterceptingTelemetryService implements ITelemetryService {\n\t_serviceBrand: undefined;\n\n\tconstructor(\n\t\tprivate readonly _baseService: ITelemetryService,\n\t\tprivate readonly _intercept: (eventName: string, data?: ITelemetryData) => void,\n\t) { }\n\n\tpublicLog2<E extends ClassifiedEvent<OmitMetadata<T>> = never, T extends IGDPRProperty = never>(eventName: string, data?: StrictPropertyCheck<T, E>): void {\n\t\tthis._intercept(eventName, data);\n\t\tthis._baseService.publicLog2(eventName, data);\n\t}\n}\n\nexport interface IEditTelemetryData {\n\teventName: string;\n\tdata: Record<string, unknown>;\n}\n\nexport class DataChannelForwardingTelemetryService extends InterceptingTelemetryService {\n\tconstructor(\n\t\t@ITelemetryService telemetryService: ITelemetryService,\n\t\t@IDataChannelService dataChannelService: IDataChannelService,\n\t) {\n\t\tsuper(telemetryService, (eventName, data) => {\n\t\t\t// filter for extension\n\t\t\tlet forward = true;\n\t\t\tif (data && shouldForwardToChannel in data) {\n\t\t\t\tforward = Boolean(data[shouldForwardToChannel]);\n\t\t\t}\n\n\t\t\tif (forward) {\n\t\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\t\tdataChannelService.getDataChannel<IEditTelemetryData>('editTelemetry').sendData({ eventName, data: data as any });\n\t\t\t}\n\t\t});\n\t}\n}\n\nconst shouldForwardToChannel = Symbol('shouldForwardToChannel');\nexport function forwardToChannelIf(value: boolean): Record<string, unknown> {\n\treturn {\n\t\t// This will not be sent via telemetry, it is just a marker\n\t\t[shouldForwardToChannel]: value\n\t};\n}\n\nexport function isCopilotLikeExtension(extensionId: string | undefined): boolean {\n\tif (!extensionId) {\n\t\treturn false;\n\t}\n\tconst extIdLowerCase = extensionId.toLowerCase();\n\treturn extIdLowerCase === 'github.copilot' || extIdLowerCase === 'github.copilot-chat';\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/platform/dataChannel/browser/forwardingTelemetryService.ts","vs/platform/dataChannel/browser/forwardingTelemetryService.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAGhG,OAAO,EAAkB,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxF,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,MAAM,OAAO,4BAA4B;IAGxC,YACkB,YAA+B,EAC/B,UAA8D;QAD9D,iBAAY,GAAZ,YAAY,CAAmB;QAC/B,eAAU,GAAV,UAAU,CAAoD;IAC5E,CAAC;IAEL,UAAU,CAAsF,SAAiB,EAAE,IAAgC;QAClJ,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QACjC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAC/C,CAAC;CACD;AAOM,IAAM,qCAAqC,GAA3C,MAAM,qCAAsC,SAAQ,4BAA4B;IACtF,YACoB,gBAAmC,EACjC,kBAAuC;QAE5D,KAAK,CAAC,gBAAgB,EAAE,CAAC,SAAS,EAAE,IAAI,EAAE,EAAE;YAC3C,uBAAuB;YACvB,IAAI,OAAO,GAAG,IAAI,CAAC;YACnB,IAAI,IAAI,IAAI,sBAAsB,IAAI,IAAI,EAAE,CAAC;gBAC5C,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC;YACjD,CAAC;YAED,IAAI,OAAO,EAAE,CAAC;gBACb,kBAAkB,CAAC,cAAc,CAAqB,eAAe,CAAC,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,IAAI,EAAE,EAAE,CAAC,CAAC;YAClH,CAAC;QACF,CAAC,CAAC,CAAC;IACJ,CAAC;CACD,CAAA;AAjBY,qCAAqC;IAE/C,WAAA,iBAAiB,CAAA;IACjB,WAAA,mBAAmB,CAAA;GAHT,qCAAqC,CAiBjD;;AAED,MAAM,sBAAsB,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAChE,MAAM,UAAU,kBAAkB,CAAC,KAAc;IAChD,OAAO;QACN,2DAA2D;QAC3D,CAAC,sBAAsB,CAAC,EAAE,KAAK;KAC/B,CAAC;AACH,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,WAA+B;IACrE,IAAI,CAAC,WAAW,EAAE,CAAC;QAClB,OAAO,KAAK,CAAC;IACd,CAAC;IACD,MAAM,cAAc,GAAG,WAAW,CAAC,WAAW,EAAE,CAAC;IACjD,OAAO,cAAc,KAAK,gBAAgB,IAAI,cAAc,KAAK,qBAAqB,CAAC;AACxF,CAAC","file":"forwardingTelemetryService.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 { ClassifiedEvent, OmitMetadata, IGDPRProperty, StrictPropertyCheck } from '../../telemetry/common/gdprTypings.js';\nimport { ITelemetryData, ITelemetryService } from '../../telemetry/common/telemetry.js';\nimport { IDataChannelService } from '../common/dataChannel.js';\n\nexport class InterceptingTelemetryService implements ITelemetryService {\n\t_serviceBrand: undefined;\n\n\tconstructor(\n\t\tprivate readonly _baseService: ITelemetryService,\n\t\tprivate readonly _intercept: (eventName: string, data?: ITelemetryData) => void,\n\t) { }\n\n\tpublicLog2<E extends ClassifiedEvent<OmitMetadata<T>> = never, T extends IGDPRProperty = never>(eventName: string, data?: StrictPropertyCheck<T, E>): void {\n\t\tthis._intercept(eventName, data);\n\t\tthis._baseService.publicLog2(eventName, data);\n\t}\n}\n\nexport interface IEditTelemetryData {\n\teventName: string;\n\tdata: Record<string, unknown>;\n}\n\nexport class DataChannelForwardingTelemetryService extends InterceptingTelemetryService {\n\tconstructor(\n\t\t@ITelemetryService telemetryService: ITelemetryService,\n\t\t@IDataChannelService dataChannelService: IDataChannelService,\n\t) {\n\t\tsuper(telemetryService, (eventName, data) => {\n\t\t\t// filter for extension\n\t\t\tlet forward = true;\n\t\t\tif (data && shouldForwardToChannel in data) {\n\t\t\t\tforward = Boolean(data[shouldForwardToChannel]);\n\t\t\t}\n\n\t\t\tif (forward) {\n\t\t\t\tdataChannelService.getDataChannel<IEditTelemetryData>('editTelemetry').sendData({ eventName, data: data ?? {} });\n\t\t\t}\n\t\t});\n\t}\n}\n\nconst shouldForwardToChannel = Symbol('shouldForwardToChannel');\nexport function forwardToChannelIf(value: boolean): Record<string, unknown> {\n\treturn {\n\t\t// This will not be sent via telemetry, it is just a marker\n\t\t[shouldForwardToChannel]: value\n\t};\n}\n\nexport function isCopilotLikeExtension(extensionId: string | undefined): boolean {\n\tif (!extensionId) {\n\t\treturn false;\n\t}\n\tconst extIdLowerCase = extensionId.toLowerCase();\n\treturn extIdLowerCase === 'github.copilot' || extIdLowerCase === 'github.copilot-chat';\n}\n","/*---------------------------------------------------------------------------------------------\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 { ClassifiedEvent, OmitMetadata, IGDPRProperty, StrictPropertyCheck } from '../../telemetry/common/gdprTypings.js';\nimport { ITelemetryData, ITelemetryService } from '../../telemetry/common/telemetry.js';\nimport { IDataChannelService } from '../common/dataChannel.js';\n\nexport class InterceptingTelemetryService implements ITelemetryService {\n\t_serviceBrand: undefined;\n\n\tconstructor(\n\t\tprivate readonly _baseService: ITelemetryService,\n\t\tprivate readonly _intercept: (eventName: string, data?: ITelemetryData) => void,\n\t) { }\n\n\tpublicLog2<E extends ClassifiedEvent<OmitMetadata<T>> = never, T extends IGDPRProperty = never>(eventName: string, data?: StrictPropertyCheck<T, E>): void {\n\t\tthis._intercept(eventName, data);\n\t\tthis._baseService.publicLog2(eventName, data);\n\t}\n}\n\nexport interface IEditTelemetryData {\n\teventName: string;\n\tdata: Record<string, unknown>;\n}\n\nexport class DataChannelForwardingTelemetryService extends InterceptingTelemetryService {\n\tconstructor(\n\t\t@ITelemetryService telemetryService: ITelemetryService,\n\t\t@IDataChannelService dataChannelService: IDataChannelService,\n\t) {\n\t\tsuper(telemetryService, (eventName, data) => {\n\t\t\t// filter for extension\n\t\t\tlet forward = true;\n\t\t\tif (data && shouldForwardToChannel in data) {\n\t\t\t\tforward = Boolean(data[shouldForwardToChannel]);\n\t\t\t}\n\n\t\t\tif (forward) {\n\t\t\t\tdataChannelService.getDataChannel<IEditTelemetryData>('editTelemetry').sendData({ eventName, data: data ?? {} });\n\t\t\t}\n\t\t});\n\t}\n}\n\nconst shouldForwardToChannel = Symbol('shouldForwardToChannel');\nexport function forwardToChannelIf(value: boolean): Record<string, unknown> {\n\treturn {\n\t\t// This will not be sent via telemetry, it is just a marker\n\t\t[shouldForwardToChannel]: value\n\t};\n}\n\nexport function isCopilotLikeExtension(extensionId: string | undefined): boolean {\n\tif (!extensionId) {\n\t\treturn false;\n\t}\n\tconst extIdLowerCase = extensionId.toLowerCase();\n\treturn extIdLowerCase === 'github.copilot' || extIdLowerCase === 'github.copilot-chat';\n}\n"]}
@@ -43,10 +43,8 @@ export class LocalSelectionTransfer {
43
43
  * in a safe way without crashing the application when running in the web.
44
44
  */
45
45
  export function getPathForFile(file) {
46
- // eslint-disable-next-line local/code-no-any-casts
47
46
  if (isNative && typeof globalThis.vscode?.webUtils?.getPathForFile === 'function') {
48
- // eslint-disable-next-line local/code-no-any-casts
49
- return globalThis.vscode.webUtils.getPathForFile(file);
47
+ return globalThis.vscode?.webUtils?.getPathForFile(file);
50
48
  }
51
49
  return undefined;
52
50
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/platform/dnd/browser/dnd.ts","vs/platform/dnd/browser/dnd.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAG7D,gCAAgC;AAEhC,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAChC,OAAO,EAAE,aAAa;IACtB,KAAK,EAAE,WAAW;IAClB,OAAO,EAAE,8BAA8B;IACvC,OAAO,EAAE,kCAAkC;IAC3C,oBAAoB,EAAE,sBAAsB;IAC5C,gBAAgB,EAAE,kBAAkB;CACpC,CAAC;AAKF,MAAM,+BAA+B;CACpC;AAED,MAAM,CAAC,MAAM,UAAU,GAAG;IACzB,uBAAuB,EAAE,qCAAqC;CAC9D,CAAC;AAEF,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,uBAAuB,EAAE,IAAI,+BAA+B,EAAE,CAAC,CAAC;AAExF,YAAY;AAEZ,uBAAuB;AAEvB;;GAEG;AACH,MAAM,OAAO,sBAAsB;aAEV,aAAQ,GAAG,IAAI,sBAAsB,EAAE,CAAC;IAKhE;QACC,yCAAyC;IAC1C,CAAC;IAED,MAAM,CAAC,WAAW;QACjB,OAAO,sBAAsB,CAAC,QAAqC,CAAC;IACrE,CAAC;IAED,OAAO,CAAC,KAAQ;QACf,OAAO,KAAK,IAAI,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC;IACtC,CAAC;IAED,OAAO,CAAC,KAAQ;QACf,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO,IAAI,CAAC,IAAI,CAAC;QAClB,CAAC;QAED,OAAO,SAAS,CAAC;IAClB,CAAC;;AAGF;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,IAAU;IACxC,mDAAmD;IACnD,IAAI,QAAQ,IAAI,OAAQ,UAAkB,CAAC,MAAM,EAAE,QAAQ,EAAE,cAAc,KAAK,UAAU,EAAE,CAAC;QAC5F,mDAAmD;QACnD,OAAQ,UAAkB,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IACjE,CAAC;IAED,OAAO,SAAS,CAAC;AAClB,CAAC;AAED,YAAY","file":"dnd.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["\nimport { isNative } from '../../../base/common/platform.js';\nimport { Registry } from '../../registry/common/platform.js';\n\n\n//#region Editor / Resources DND\n\nexport const CodeDataTransfers = {\n\tEDITORS: 'CodeEditors',\n\tFILES: 'CodeFiles',\n\tSYMBOLS: 'application/vnd.code.symbols',\n\tMARKERS: 'application/vnd.code.diagnostics',\n\tNOTEBOOK_CELL_OUTPUT: 'notebook-cell-output',\n\tSCM_HISTORY_ITEM: 'scm-history-item',\n};\n\nexport interface IDragAndDropContributionRegistry {\n}\n\nclass DragAndDropContributionRegistry implements IDragAndDropContributionRegistry {\n}\n\nexport const Extensions = {\n\tDragAndDropContribution: 'workbench.contributions.dragAndDrop'\n};\n\nRegistry.add(Extensions.DragAndDropContribution, new DragAndDropContributionRegistry());\n\n//#endregion\n\n//#region DND Utilities\n\n/**\n * A singleton to store transfer data during drag & drop operations that are only valid within the application.\n */\nexport class LocalSelectionTransfer<T> {\n\n\tprivate static readonly INSTANCE = new LocalSelectionTransfer();\n\n\tprivate data?: T[];\n\tprivate proto?: T;\n\n\tprivate constructor() {\n\t\t// protect against external instantiation\n\t}\n\n\tstatic getInstance<T>(): LocalSelectionTransfer<T> {\n\t\treturn LocalSelectionTransfer.INSTANCE as LocalSelectionTransfer<T>;\n\t}\n\n\thasData(proto: T): boolean {\n\t\treturn proto && proto === this.proto;\n\t}\n\n\tgetData(proto: T): T[] | undefined {\n\t\tif (this.hasData(proto)) {\n\t\t\treturn this.data;\n\t\t}\n\n\t\treturn undefined;\n\t}\n}\n\n/**\n * A helper to get access to Electrons `webUtils.getPathForFile` function\n * in a safe way without crashing the application when running in the web.\n */\nexport function getPathForFile(file: File): string | undefined {\n\t// eslint-disable-next-line local/code-no-any-casts\n\tif (isNative && typeof (globalThis as any).vscode?.webUtils?.getPathForFile === 'function') {\n\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\treturn (globalThis as any).vscode.webUtils.getPathForFile(file);\n\t}\n\n\treturn undefined;\n}\n\n//#endregion\n","\nimport { isNative } from '../../../base/common/platform.js';\nimport { Registry } from '../../registry/common/platform.js';\n\n\n//#region Editor / Resources DND\n\nexport const CodeDataTransfers = {\n\tEDITORS: 'CodeEditors',\n\tFILES: 'CodeFiles',\n\tSYMBOLS: 'application/vnd.code.symbols',\n\tMARKERS: 'application/vnd.code.diagnostics',\n\tNOTEBOOK_CELL_OUTPUT: 'notebook-cell-output',\n\tSCM_HISTORY_ITEM: 'scm-history-item',\n};\n\nexport interface IDragAndDropContributionRegistry {\n}\n\nclass DragAndDropContributionRegistry implements IDragAndDropContributionRegistry {\n}\n\nexport const Extensions = {\n\tDragAndDropContribution: 'workbench.contributions.dragAndDrop'\n};\n\nRegistry.add(Extensions.DragAndDropContribution, new DragAndDropContributionRegistry());\n\n//#endregion\n\n//#region DND Utilities\n\n/**\n * A singleton to store transfer data during drag & drop operations that are only valid within the application.\n */\nexport class LocalSelectionTransfer<T> {\n\n\tprivate static readonly INSTANCE = new LocalSelectionTransfer();\n\n\tprivate data?: T[];\n\tprivate proto?: T;\n\n\tprivate constructor() {\n\t\t// protect against external instantiation\n\t}\n\n\tstatic getInstance<T>(): LocalSelectionTransfer<T> {\n\t\treturn LocalSelectionTransfer.INSTANCE as LocalSelectionTransfer<T>;\n\t}\n\n\thasData(proto: T): boolean {\n\t\treturn proto && proto === this.proto;\n\t}\n\n\tgetData(proto: T): T[] | undefined {\n\t\tif (this.hasData(proto)) {\n\t\t\treturn this.data;\n\t\t}\n\n\t\treturn undefined;\n\t}\n}\n\n/**\n * A helper to get access to Electrons `webUtils.getPathForFile` function\n * in a safe way without crashing the application when running in the web.\n */\nexport function getPathForFile(file: File): string | undefined {\n\t// eslint-disable-next-line local/code-no-any-casts\n\tif (isNative && typeof (globalThis as any).vscode?.webUtils?.getPathForFile === 'function') {\n\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\treturn (globalThis as any).vscode.webUtils.getPathForFile(file);\n\t}\n\n\treturn undefined;\n}\n\n//#endregion\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/platform/dnd/browser/dnd.ts","vs/platform/dnd/browser/dnd.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAG7D,gCAAgC;AAEhC,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAChC,OAAO,EAAE,aAAa;IACtB,KAAK,EAAE,WAAW;IAClB,OAAO,EAAE,8BAA8B;IACvC,OAAO,EAAE,kCAAkC;IAC3C,oBAAoB,EAAE,sBAAsB;IAC5C,gBAAgB,EAAE,kBAAkB;CACpC,CAAC;AAKF,MAAM,+BAA+B;CACpC;AAED,MAAM,CAAC,MAAM,UAAU,GAAG;IACzB,uBAAuB,EAAE,qCAAqC;CAC9D,CAAC;AAEF,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,uBAAuB,EAAE,IAAI,+BAA+B,EAAE,CAAC,CAAC;AAExF,YAAY;AAEZ,uBAAuB;AAEvB;;GAEG;AACH,MAAM,OAAO,sBAAsB;aAEV,aAAQ,GAAG,IAAI,sBAAsB,EAAE,CAAC;IAKhE;QACC,yCAAyC;IAC1C,CAAC;IAED,MAAM,CAAC,WAAW;QACjB,OAAO,sBAAsB,CAAC,QAAqC,CAAC;IACrE,CAAC;IAED,OAAO,CAAC,KAAQ;QACf,OAAO,KAAK,IAAI,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC;IACtC,CAAC;IAED,OAAO,CAAC,KAAQ;QACf,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO,IAAI,CAAC,IAAI,CAAC;QAClB,CAAC;QAED,OAAO,SAAS,CAAC;IAClB,CAAC;;AAWF;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,IAAU;IACxC,IAAI,QAAQ,IAAI,OAAQ,UAAgC,CAAC,MAAM,EAAE,QAAQ,EAAE,cAAc,KAAK,UAAU,EAAE,CAAC;QAC1G,OAAQ,UAAgC,CAAC,MAAM,EAAE,QAAQ,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC;IACjF,CAAC;IAED,OAAO,SAAS,CAAC;AAClB,CAAC;AAED,YAAY","file":"dnd.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["\nimport { isNative } from '../../../base/common/platform.js';\nimport { Registry } from '../../registry/common/platform.js';\n\n\n//#region Editor / Resources DND\n\nexport const CodeDataTransfers = {\n\tEDITORS: 'CodeEditors',\n\tFILES: 'CodeFiles',\n\tSYMBOLS: 'application/vnd.code.symbols',\n\tMARKERS: 'application/vnd.code.diagnostics',\n\tNOTEBOOK_CELL_OUTPUT: 'notebook-cell-output',\n\tSCM_HISTORY_ITEM: 'scm-history-item',\n};\n\nexport interface IDragAndDropContributionRegistry {\n}\n\nclass DragAndDropContributionRegistry implements IDragAndDropContributionRegistry {\n}\n\nexport const Extensions = {\n\tDragAndDropContribution: 'workbench.contributions.dragAndDrop'\n};\n\nRegistry.add(Extensions.DragAndDropContribution, new DragAndDropContributionRegistry());\n\n//#endregion\n\n//#region DND Utilities\n\n/**\n * A singleton to store transfer data during drag & drop operations that are only valid within the application.\n */\nexport class LocalSelectionTransfer<T> {\n\n\tprivate static readonly INSTANCE = new LocalSelectionTransfer();\n\n\tprivate data?: T[];\n\tprivate proto?: T;\n\n\tprivate constructor() {\n\t\t// protect against external instantiation\n\t}\n\n\tstatic getInstance<T>(): LocalSelectionTransfer<T> {\n\t\treturn LocalSelectionTransfer.INSTANCE as LocalSelectionTransfer<T>;\n\t}\n\n\thasData(proto: T): boolean {\n\t\treturn proto && proto === this.proto;\n\t}\n\n\tgetData(proto: T): T[] | undefined {\n\t\tif (this.hasData(proto)) {\n\t\t\treturn this.data;\n\t\t}\n\n\t\treturn undefined;\n\t}\n}\n\ninterface IElectronWebUtils {\n\tvscode?: {\n\t\twebUtils?: {\n\t\t\tgetPathForFile(file: File): string;\n\t\t};\n\t};\n}\n\n/**\n * A helper to get access to Electrons `webUtils.getPathForFile` function\n * in a safe way without crashing the application when running in the web.\n */\nexport function getPathForFile(file: File): string | undefined {\n\tif (isNative && typeof (globalThis as IElectronWebUtils).vscode?.webUtils?.getPathForFile === 'function') {\n\t\treturn (globalThis as IElectronWebUtils).vscode?.webUtils?.getPathForFile(file);\n\t}\n\n\treturn undefined;\n}\n\n//#endregion\n","\nimport { isNative } from '../../../base/common/platform.js';\nimport { Registry } from '../../registry/common/platform.js';\n\n\n//#region Editor / Resources DND\n\nexport const CodeDataTransfers = {\n\tEDITORS: 'CodeEditors',\n\tFILES: 'CodeFiles',\n\tSYMBOLS: 'application/vnd.code.symbols',\n\tMARKERS: 'application/vnd.code.diagnostics',\n\tNOTEBOOK_CELL_OUTPUT: 'notebook-cell-output',\n\tSCM_HISTORY_ITEM: 'scm-history-item',\n};\n\nexport interface IDragAndDropContributionRegistry {\n}\n\nclass DragAndDropContributionRegistry implements IDragAndDropContributionRegistry {\n}\n\nexport const Extensions = {\n\tDragAndDropContribution: 'workbench.contributions.dragAndDrop'\n};\n\nRegistry.add(Extensions.DragAndDropContribution, new DragAndDropContributionRegistry());\n\n//#endregion\n\n//#region DND Utilities\n\n/**\n * A singleton to store transfer data during drag & drop operations that are only valid within the application.\n */\nexport class LocalSelectionTransfer<T> {\n\n\tprivate static readonly INSTANCE = new LocalSelectionTransfer();\n\n\tprivate data?: T[];\n\tprivate proto?: T;\n\n\tprivate constructor() {\n\t\t// protect against external instantiation\n\t}\n\n\tstatic getInstance<T>(): LocalSelectionTransfer<T> {\n\t\treturn LocalSelectionTransfer.INSTANCE as LocalSelectionTransfer<T>;\n\t}\n\n\thasData(proto: T): boolean {\n\t\treturn proto && proto === this.proto;\n\t}\n\n\tgetData(proto: T): T[] | undefined {\n\t\tif (this.hasData(proto)) {\n\t\t\treturn this.data;\n\t\t}\n\n\t\treturn undefined;\n\t}\n}\n\ninterface IElectronWebUtils {\n\tvscode?: {\n\t\twebUtils?: {\n\t\t\tgetPathForFile(file: File): string;\n\t\t};\n\t};\n}\n\n/**\n * A helper to get access to Electrons `webUtils.getPathForFile` function\n * in a safe way without crashing the application when running in the web.\n */\nexport function getPathForFile(file: File): string | undefined {\n\tif (isNative && typeof (globalThis as IElectronWebUtils).vscode?.webUtils?.getPathForFile === 'function') {\n\t\treturn (globalThis as IElectronWebUtils).vscode?.webUtils?.getPathForFile(file);\n\t}\n\n\treturn undefined;\n}\n\n//#endregion\n"]}
@@ -10,7 +10,6 @@ import { env } from '../../../base/common/process.js';
10
10
  */
11
11
  let product;
12
12
  // Native sandbox environment
13
- // eslint-disable-next-line local/code-no-any-casts
14
13
  const vscodeGlobal = globalThis.vscode;
15
14
  if (typeof vscodeGlobal !== 'undefined' && typeof vscodeGlobal.context !== 'undefined') {
16
15
  const configuration = vscodeGlobal.context.configuration();
@@ -47,7 +46,7 @@ else if (globalThis._VSCODE_PRODUCT_JSON && globalThis._VSCODE_PACKAGE_JSON) {
47
46
  // Web environment or unknown
48
47
  else {
49
48
  // Built time configuration (do NOT modify)
50
- // eslint-disable-next-line local/code-no-any-casts
49
+ // eslint-disable-next-line local/code-no-dangerous-type-assertions
51
50
  product = { /*BUILD->INSERT_PRODUCT_CONFIGURATION*/};
52
51
  // Running out of sources
53
52
  if (Object.keys(product).length === 0) {
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/platform/product/common/product.ts","vs/platform/product/common/product.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAItD;;;;GAIG;AACH,IAAI,OAA8B,CAAC;AAEnC,6BAA6B;AAC7B,mDAAmD;AACnD,MAAM,YAAY,GAAI,UAAkB,CAAC,MAAM,CAAC;AAChD,IAAI,OAAO,YAAY,KAAK,WAAW,IAAI,OAAO,YAAY,CAAC,OAAO,KAAK,WAAW,EAAE,CAAC;IACxF,MAAM,aAAa,GAAsC,YAAY,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC;IAC9F,IAAI,aAAa,EAAE,CAAC;QACnB,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC;IACjC,CAAC;SAAM,CAAC;QACP,MAAM,IAAI,KAAK,CAAC,uEAAuE,CAAC,CAAC;IAC1F,CAAC;AACF,CAAC;AACD,sBAAsB;KACjB,IAAI,UAAU,CAAC,oBAAoB,IAAI,UAAU,CAAC,oBAAoB,EAAE,CAAC;IAC7E,wDAAwD;IACxD,OAAO,GAAG,UAAU,CAAC,oBAAwD,CAAC;IAE9E,yBAAyB;IACzB,IAAI,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;QACvB,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE;YACtB,SAAS,EAAE,GAAG,OAAO,CAAC,SAAS,MAAM;YACrC,QAAQ,EAAE,GAAG,OAAO,CAAC,QAAQ,MAAM;YACnC,cAAc,EAAE,GAAG,OAAO,CAAC,cAAc,MAAM;YAC/C,oBAAoB,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,oBAAoB,MAAM,CAAC,CAAC,CAAC,SAAS;SACtG,CAAC,CAAC;IACJ,CAAC;IAED,mDAAmD;IACnD,+CAA+C;IAC/C,kDAAkD;IAClD,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QACtB,MAAM,GAAG,GAAG,UAAU,CAAC,oBAA2C,CAAC;QAEnE,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE;YACtB,OAAO,EAAE,GAAG,CAAC,OAAO;SACpB,CAAC,CAAC;IACJ,CAAC;AACF,CAAC;AAED,6BAA6B;KACxB,CAAC;IAEL,2CAA2C;IAC3C,mDAAmD;IACnD,OAAO,GAAG,EAAE,uCAAuC,CAAS,CAAC;IAE7D,yBAAyB;IACzB,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE;YACtB,OAAO,EAAE,aAAa;YACtB,SAAS,EAAE,gBAAgB;YAC3B,QAAQ,EAAE,gBAAgB;YAC1B,eAAe,EAAE,UAAU;YAC3B,cAAc,EAAE,aAAa;YAC7B,WAAW,EAAE,UAAU;YACvB,cAAc,EAAE,gDAAgD;YAChE,WAAW,EAAE,KAAK;YAClB,UAAU,EAAE,2DAA2D;YACvE,gBAAgB,EAAE,2DAA2D;SAC7E,CAAC,CAAC;IACJ,CAAC;AACF,CAAC;AAED,eAAe,OAAO,CAAC","file":"product.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 { env } from '../../../base/common/process.js';\nimport { IProductConfiguration } from '../../../base/common/product.js';\nimport { ISandboxConfiguration } from '../../../base/parts/sandbox/common/sandboxTypes.js';\n\n/**\n * @deprecated It is preferred that you use `IProductService` if you can. This\n * allows web embedders to override our defaults. But for things like `product.quality`,\n * the use is fine because that property is not overridable.\n */\nlet product: IProductConfiguration;\n\n// Native sandbox environment\n// eslint-disable-next-line local/code-no-any-casts\nconst vscodeGlobal = (globalThis as any).vscode;\nif (typeof vscodeGlobal !== 'undefined' && typeof vscodeGlobal.context !== 'undefined') {\n\tconst configuration: ISandboxConfiguration | undefined = vscodeGlobal.context.configuration();\n\tif (configuration) {\n\t\tproduct = configuration.product;\n\t} else {\n\t\tthrow new Error('Sandbox: unable to resolve product configuration from preload script.');\n\t}\n}\n// _VSCODE environment\nelse if (globalThis._VSCODE_PRODUCT_JSON && globalThis._VSCODE_PACKAGE_JSON) {\n\t// Obtain values from product.json and package.json-data\n\tproduct = globalThis._VSCODE_PRODUCT_JSON as unknown as IProductConfiguration;\n\n\t// Running out of sources\n\tif (env['VSCODE_DEV']) {\n\t\tObject.assign(product, {\n\t\t\tnameShort: `${product.nameShort} Dev`,\n\t\t\tnameLong: `${product.nameLong} Dev`,\n\t\t\tdataFolderName: `${product.dataFolderName}-dev`,\n\t\t\tserverDataFolderName: product.serverDataFolderName ? `${product.serverDataFolderName}-dev` : undefined\n\t\t});\n\t}\n\n\t// Version is added during built time, but we still\n\t// want to have it running out of sources so we\n\t// read it from package.json only when we need it.\n\tif (!product.version) {\n\t\tconst pkg = globalThis._VSCODE_PACKAGE_JSON as { version: string };\n\n\t\tObject.assign(product, {\n\t\t\tversion: pkg.version\n\t\t});\n\t}\n}\n\n// Web environment or unknown\nelse {\n\n\t// Built time configuration (do NOT modify)\n\t// eslint-disable-next-line local/code-no-any-casts\n\tproduct = { /*BUILD->INSERT_PRODUCT_CONFIGURATION*/ } as any;\n\n\t// Running out of sources\n\tif (Object.keys(product).length === 0) {\n\t\tObject.assign(product, {\n\t\t\tversion: '1.104.0-dev',\n\t\t\tnameShort: 'Code - OSS Dev',\n\t\t\tnameLong: 'Code - OSS Dev',\n\t\t\tapplicationName: 'code-oss',\n\t\t\tdataFolderName: '.vscode-oss',\n\t\t\turlProtocol: 'code-oss',\n\t\t\treportIssueUrl: 'https://github.com/microsoft/vscode/issues/new',\n\t\t\tlicenseName: 'MIT',\n\t\t\tlicenseUrl: 'https://github.com/microsoft/vscode/blob/main/LICENSE.txt',\n\t\t\tserverLicenseUrl: 'https://github.com/microsoft/vscode/blob/main/LICENSE.txt'\n\t\t});\n\t}\n}\n\nexport default product;\n","/*---------------------------------------------------------------------------------------------\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 { env } from '../../../base/common/process.js';\nimport { IProductConfiguration } from '../../../base/common/product.js';\nimport { ISandboxConfiguration } from '../../../base/parts/sandbox/common/sandboxTypes.js';\n\n/**\n * @deprecated It is preferred that you use `IProductService` if you can. This\n * allows web embedders to override our defaults. But for things like `product.quality`,\n * the use is fine because that property is not overridable.\n */\nlet product: IProductConfiguration;\n\n// Native sandbox environment\n// eslint-disable-next-line local/code-no-any-casts\nconst vscodeGlobal = (globalThis as any).vscode;\nif (typeof vscodeGlobal !== 'undefined' && typeof vscodeGlobal.context !== 'undefined') {\n\tconst configuration: ISandboxConfiguration | undefined = vscodeGlobal.context.configuration();\n\tif (configuration) {\n\t\tproduct = configuration.product;\n\t} else {\n\t\tthrow new Error('Sandbox: unable to resolve product configuration from preload script.');\n\t}\n}\n// _VSCODE environment\nelse if (globalThis._VSCODE_PRODUCT_JSON && globalThis._VSCODE_PACKAGE_JSON) {\n\t// Obtain values from product.json and package.json-data\n\tproduct = globalThis._VSCODE_PRODUCT_JSON as unknown as IProductConfiguration;\n\n\t// Running out of sources\n\tif (env['VSCODE_DEV']) {\n\t\tObject.assign(product, {\n\t\t\tnameShort: `${product.nameShort} Dev`,\n\t\t\tnameLong: `${product.nameLong} Dev`,\n\t\t\tdataFolderName: `${product.dataFolderName}-dev`,\n\t\t\tserverDataFolderName: product.serverDataFolderName ? `${product.serverDataFolderName}-dev` : undefined\n\t\t});\n\t}\n\n\t// Version is added during built time, but we still\n\t// want to have it running out of sources so we\n\t// read it from package.json only when we need it.\n\tif (!product.version) {\n\t\tconst pkg = globalThis._VSCODE_PACKAGE_JSON as { version: string };\n\n\t\tObject.assign(product, {\n\t\t\tversion: pkg.version\n\t\t});\n\t}\n}\n\n// Web environment or unknown\nelse {\n\n\t// Built time configuration (do NOT modify)\n\t// eslint-disable-next-line local/code-no-any-casts\n\tproduct = { /*BUILD->INSERT_PRODUCT_CONFIGURATION*/ } as any;\n\n\t// Running out of sources\n\tif (Object.keys(product).length === 0) {\n\t\tObject.assign(product, {\n\t\t\tversion: '1.104.0-dev',\n\t\t\tnameShort: 'Code - OSS Dev',\n\t\t\tnameLong: 'Code - OSS Dev',\n\t\t\tapplicationName: 'code-oss',\n\t\t\tdataFolderName: '.vscode-oss',\n\t\t\turlProtocol: 'code-oss',\n\t\t\treportIssueUrl: 'https://github.com/microsoft/vscode/issues/new',\n\t\t\tlicenseName: 'MIT',\n\t\t\tlicenseUrl: 'https://github.com/microsoft/vscode/blob/main/LICENSE.txt',\n\t\t\tserverLicenseUrl: 'https://github.com/microsoft/vscode/blob/main/LICENSE.txt'\n\t\t});\n\t}\n}\n\nexport default product;\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/platform/product/common/product.ts","vs/platform/product/common/product.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAItD;;;;GAIG;AACH,IAAI,OAA8B,CAAC;AAEnC,6BAA6B;AAC7B,MAAM,YAAY,GAAI,UAAgG,CAAC,MAAM,CAAC;AAC9H,IAAI,OAAO,YAAY,KAAK,WAAW,IAAI,OAAO,YAAY,CAAC,OAAO,KAAK,WAAW,EAAE,CAAC;IACxF,MAAM,aAAa,GAAsC,YAAY,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC;I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AAE,aAAa;YACtB,SAAS,EAAE,gBAAgB;YAC3B,QAAQ,EAAE,gBAAgB;YAC1B,eAAe,EAAE,UAAU;YAC3B,cAAc,EAAE,aAAa;YAC7B,WAAW,EAAE,UAAU;YACvB,cAAc,EAAE,gDAAgD;YAChE,WAAW,EAAE,KAAK;YAClB,UAAU,EAAE,2DAA2D;YACvE,gBAAgB,EAAE,2DAA2D;SAC7E,CAAC,CAAC;IACJ,CAAC;AACF,CAAC;AAED,eAAe,OAAO,CAAC","file":"product.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 { env } from '../../../base/common/process.js';\nimport { IProductConfiguration } from '../../../base/common/product.js';\nimport { ISandboxConfiguration } from '../../../base/parts/sandbox/common/sandboxTypes.js';\n\n/**\n * @deprecated It is preferred that you use `IProductService` if you can. This\n * allows web embedders to override our defaults. But for things like `product.quality`,\n * the use is fine because that property is not overridable.\n */\nlet product: IProductConfiguration;\n\n// Native sandbox environment\nconst vscodeGlobal = (globalThis as { vscode?: { context?: { configuration(): ISandboxConfiguration | undefined } } }).vscode;\nif (typeof vscodeGlobal !== 'undefined' && typeof vscodeGlobal.context !== 'undefined') {\n\tconst configuration: ISandboxConfiguration | undefined = vscodeGlobal.context.configuration();\n\tif (configuration) {\n\t\tproduct = configuration.product;\n\t} else {\n\t\tthrow new Error('Sandbox: unable to resolve product configuration from preload script.');\n\t}\n}\n// _VSCODE environment\nelse if (globalThis._VSCODE_PRODUCT_JSON && globalThis._VSCODE_PACKAGE_JSON) {\n\t// Obtain values from product.json and package.json-data\n\tproduct = globalThis._VSCODE_PRODUCT_JSON as unknown as IProductConfiguration;\n\n\t// Running out of sources\n\tif (env['VSCODE_DEV']) {\n\t\tObject.assign(product, {\n\t\t\tnameShort: `${product.nameShort} Dev`,\n\t\t\tnameLong: `${product.nameLong} Dev`,\n\t\t\tdataFolderName: `${product.dataFolderName}-dev`,\n\t\t\tserverDataFolderName: product.serverDataFolderName ? `${product.serverDataFolderName}-dev` : undefined\n\t\t});\n\t}\n\n\t// Version is added during built time, but we still\n\t// want to have it running out of sources so we\n\t// read it from package.json only when we need it.\n\tif (!product.version) {\n\t\tconst pkg = globalThis._VSCODE_PACKAGE_JSON as { version: string };\n\n\t\tObject.assign(product, {\n\t\t\tversion: pkg.version\n\t\t});\n\t}\n}\n\n// Web environment or unknown\nelse {\n\n\t// Built time configuration (do NOT modify)\n\t// eslint-disable-next-line local/code-no-dangerous-type-assertions\n\tproduct = { /*BUILD->INSERT_PRODUCT_CONFIGURATION*/ } as unknown as IProductConfiguration;\n\n\t// Running out of sources\n\tif (Object.keys(product).length === 0) {\n\t\tObject.assign(product, {\n\t\t\tversion: '1.104.0-dev',\n\t\t\tnameShort: 'Code - OSS Dev',\n\t\t\tnameLong: 'Code - OSS Dev',\n\t\t\tapplicationName: 'code-oss',\n\t\t\tdataFolderName: '.vscode-oss',\n\t\t\turlProtocol: 'code-oss',\n\t\t\treportIssueUrl: 'https://github.com/microsoft/vscode/issues/new',\n\t\t\tlicenseName: 'MIT',\n\t\t\tlicenseUrl: 'https://github.com/microsoft/vscode/blob/main/LICENSE.txt',\n\t\t\tserverLicenseUrl: 'https://github.com/microsoft/vscode/blob/main/LICENSE.txt'\n\t\t});\n\t}\n}\n\nexport default product;\n","/*---------------------------------------------------------------------------------------------\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 { env } from '../../../base/common/process.js';\nimport { IProductConfiguration } from '../../../base/common/product.js';\nimport { ISandboxConfiguration } from '../../../base/parts/sandbox/common/sandboxTypes.js';\n\n/**\n * @deprecated It is preferred that you use `IProductService` if you can. This\n * allows web embedders to override our defaults. But for things like `product.quality`,\n * the use is fine because that property is not overridable.\n */\nlet product: IProductConfiguration;\n\n// Native sandbox environment\nconst vscodeGlobal = (globalThis as { vscode?: { context?: { configuration(): ISandboxConfiguration | undefined } } }).vscode;\nif (typeof vscodeGlobal !== 'undefined' && typeof vscodeGlobal.context !== 'undefined') {\n\tconst configuration: ISandboxConfiguration | undefined = vscodeGlobal.context.configuration();\n\tif (configuration) {\n\t\tproduct = configuration.product;\n\t} else {\n\t\tthrow new Error('Sandbox: unable to resolve product configuration from preload script.');\n\t}\n}\n// _VSCODE environment\nelse if (globalThis._VSCODE_PRODUCT_JSON && globalThis._VSCODE_PACKAGE_JSON) {\n\t// Obtain values from product.json and package.json-data\n\tproduct = globalThis._VSCODE_PRODUCT_JSON as unknown as IProductConfiguration;\n\n\t// Running out of sources\n\tif (env['VSCODE_DEV']) {\n\t\tObject.assign(product, {\n\t\t\tnameShort: `${product.nameShort} Dev`,\n\t\t\tnameLong: `${product.nameLong} Dev`,\n\t\t\tdataFolderName: `${product.dataFolderName}-dev`,\n\t\t\tserverDataFolderName: product.serverDataFolderName ? `${product.serverDataFolderName}-dev` : undefined\n\t\t});\n\t}\n\n\t// Version is added during built time, but we still\n\t// want to have it running out of sources so we\n\t// read it from package.json only when we need it.\n\tif (!product.version) {\n\t\tconst pkg = globalThis._VSCODE_PACKAGE_JSON as { version: string };\n\n\t\tObject.assign(product, {\n\t\t\tversion: pkg.version\n\t\t});\n\t}\n}\n\n// Web environment or unknown\nelse {\n\n\t// Built time configuration (do NOT modify)\n\t// eslint-disable-next-line local/code-no-dangerous-type-assertions\n\tproduct = { /*BUILD->INSERT_PRODUCT_CONFIGURATION*/ } as unknown as IProductConfiguration;\n\n\t// Running out of sources\n\tif (Object.keys(product).length === 0) {\n\t\tObject.assign(product, {\n\t\t\tversion: '1.104.0-dev',\n\t\t\tnameShort: 'Code - OSS Dev',\n\t\t\tnameLong: 'Code - OSS Dev',\n\t\t\tapplicationName: 'code-oss',\n\t\t\tdataFolderName: '.vscode-oss',\n\t\t\turlProtocol: 'code-oss',\n\t\t\treportIssueUrl: 'https://github.com/microsoft/vscode/issues/new',\n\t\t\tlicenseName: 'MIT',\n\t\t\tlicenseUrl: 'https://github.com/microsoft/vscode/blob/main/LICENSE.txt',\n\t\t\tserverLicenseUrl: 'https://github.com/microsoft/vscode/blob/main/LICENSE.txt'\n\t\t});\n\t}\n}\n\nexport default product;\n"]}
@@ -29,6 +29,7 @@ import { ILogService } from '../../log/common/log.js';
29
29
  import { PickerQuickAccessProvider } from './pickerQuickAccess.js';
30
30
  import { IStorageService, WillSaveStateReason } from '../../storage/common/storage.js';
31
31
  import { ITelemetryService } from '../../telemetry/common/telemetry.js';
32
+ import { removeAccents } from '../../../base/common/normalization.js';
32
33
  let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvider extends PickerQuickAccessProvider {
33
34
  static { AbstractCommandsQuickAccessProvider_1 = this; }
34
35
  static { this.PREFIX = '>'; }
@@ -61,11 +62,17 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
61
62
  .filter(score => score.score > AbstractCommandsQuickAccessProvider_1.TFIDF_THRESHOLD)
62
63
  .slice(0, AbstractCommandsQuickAccessProvider_1.TFIDF_MAX_RESULTS);
63
64
  });
65
+ const noAccentsFilter = this.normalizeForFiltering(filter);
64
66
  // Filter
65
67
  const filteredCommandPicks = [];
66
68
  for (const commandPick of allCommandPicks) {
67
- const labelHighlights = AbstractCommandsQuickAccessProvider_1.WORD_FILTER(filter, commandPick.label) ?? undefined;
68
- const aliasHighlights = commandPick.commandAlias ? AbstractCommandsQuickAccessProvider_1.WORD_FILTER(filter, commandPick.commandAlias) ?? undefined : undefined;
69
+ commandPick.labelNoAccents ??= this.normalizeForFiltering(commandPick.label);
70
+ const labelHighlights = AbstractCommandsQuickAccessProvider_1.WORD_FILTER(noAccentsFilter, commandPick.labelNoAccents) ?? undefined;
71
+ let aliasHighlights;
72
+ if (commandPick.commandAlias) {
73
+ commandPick.aliasNoAccents ??= this.normalizeForFiltering(commandPick.commandAlias);
74
+ aliasHighlights = AbstractCommandsQuickAccessProvider_1.WORD_FILTER(noAccentsFilter, commandPick.aliasNoAccents) ?? undefined;
75
+ }
69
76
  // Add if matching in label or alias
70
77
  if (labelHighlights || aliasHighlights) {
71
78
  commandPick.highlights = {
@@ -242,6 +249,23 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
242
249
  }
243
250
  return chunk;
244
251
  }
252
+ /**
253
+ * Normalizes a string for filtering by removing accents, but only if the result has the same length, otherwise
254
+ * returns the original string.
255
+ */
256
+ normalizeForFiltering(value) {
257
+ const withoutAccents = removeAccents(value);
258
+ if (withoutAccents.length !== value.length) {
259
+ this.telemetryService.publicLog2('QuickAccess:FilterLengthMismatch', {
260
+ originalLength: value.length,
261
+ normalizedLength: withoutAccents.length
262
+ });
263
+ return value;
264
+ }
265
+ else {
266
+ return withoutAccents;
267
+ }
268
+ }
245
269
  };
246
270
  AbstractCommandsQuickAccessProvider = AbstractCommandsQuickAccessProvider_1 = __decorate([
247
271
  __param(1, IInstantiationService),
@@ -1 +1 @@
1
- {"version":3,"sources":["vs/platform/quickinput/browser/commandsQuickAccess.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAIhG,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,0BAA0B,EAAE,aAAa,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,iCAAiC,CAAC;AAC9G,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAgC,MAAM,mCAAmC,CAAC;AAC7F,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACtF,OAAO,EAAE,QAAQ,EAAE,MAAM,iBA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oot":"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 { WorkbenchActionExecutedClassification, WorkbenchActionExecutedEvent } from '../../../base/common/actions.js';\nimport { CancellationToken } from '../../../base/common/cancellation.js';\nimport { toErrorMessage } from '../../../base/common/errorMessage.js';\nimport { isCancellationError } from '../../../base/common/errors.js';\nimport { matchesContiguousSubString, matchesPrefix, matchesWords, or } from '../../../base/common/filters.js';\nimport { createSingleCallFunction } from '../../../base/common/functional.js';\nimport { Disposable, DisposableStore, IDisposable } from '../../../base/common/lifecycle.js';\nimport { LRUCache } from '../../../base/common/map.js';\nimport { TfIdfCalculator, normalizeTfIdfScores } from '../../../base/common/tfIdf.js';\nimport { localize } from '../../../nls.js';\nimport { ILocalizedString } from '../../action/common/action.js';\nimport { ICommandService } from '../../commands/common/commands.js';\nimport { IConfigurationChangeEvent, IConfigurationService } from '../../configuration/common/configuration.js';\nimport { IDialogService } from '../../dialogs/common/dialogs.js';\nimport { IInstantiationService } from '../../instantiation/common/instantiation.js';\nimport { IKeybindingService } from '../../keybinding/common/keybinding.js';\nimport { ILogService } from '../../log/common/log.js';\nimport { FastAndSlowPicks, IPickerQuickAccessItem, IPickerQuickAccessProviderOptions, PickerQuickAccessProvider, Picks } from './pickerQuickAccess.js';\nimport { IQuickAccessProviderRunOptions } from '../common/quickAccess.js';\nimport { IQuickPickSeparator } from '../common/quickInput.js';\nimport { IStorageService, StorageScope, StorageTarget, WillSaveStateReason } from '../../storage/common/storage.js';\nimport { ITelemetryService } from '../../telemetry/common/telemetry.js';\n\nexport interface ICommandQuickPick extends IPickerQuickAccessItem {\n\treadonly commandId: string;\n\treadonly commandAlias?: string;\n\treadonly commandDescription?: ILocalizedString;\n\ttfIdfScore?: number;\n\treadonly args?: any[];\n}\n\nexport interface ICommandsQuickAccessOptions extends IPickerQuickAccessProviderOptions<ICommandQuickPick> {\n\treadonly showAlias: boolean;\n\tsuggestedCommandIds?: Set<string>;\n}\n\nexport abstract class AbstractCommandsQuickAccessProvider extends PickerQuickAccessProvider<ICommandQuickPick> implements IDisposable {\n\n\tstatic PREFIX = '>';\n\n\tprivate static readonly TFIDF_THRESHOLD = 0.5;\n\tprivate static readonly TFIDF_MAX_RESULTS = 5;\n\n\tprivate static WORD_FILTER = or(matchesPrefix, matchesWords, matchesContiguousSubString);\n\n\tprivate readonly commandsHistory: CommandsHistory;\n\n\tprotected override readonly options: ICommandsQuickAccessOptions;\n\n\tconstructor(\n\t\toptions: ICommandsQuickAccessOptions,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t\t@IKeybindingService protected readonly keybindingService: IKeybindingService,\n\t\t@ICommandService private readonly commandService: ICommandService,\n\t\t@ITelemetryService private readonly telemetryService: ITelemetryService,\n\t\t@IDialogService private readonly dialogService: IDialogService\n\t) {\n\t\tsuper(AbstractCommandsQuickAccessProvider.PREFIX, options);\n\n\t\tthis.commandsHistory = this._register(instantiationService.createInstance(CommandsHistory));\n\n\t\tthis.options = options;\n\t}\n\n\tprotected async _getPicks(filter: string, _disposables: DisposableStore, token: CancellationToken, runOptions?: IQuickAccessProviderRunOptions): Promise<Picks<ICommandQuickPick> | FastAndSlowPicks<ICommandQuickPick>> {\n\n\t\t// Ask subclass for all command picks\n\t\tconst allCommandPicks = await this.getCommandPicks(token);\n\n\t\tif (token.isCancellationRequested) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst runTfidf = createSingleCallFunction(() => {\n\t\t\tconst tfidf = new TfIdfCalculator();\n\t\t\ttfidf.updateDocuments(allCommandPicks.map(commandPick => ({\n\t\t\t\tkey: commandPick.commandId,\n\t\t\t\ttextChunks: [this.getTfIdfChunk(commandPick)]\n\t\t\t})));\n\t\t\tconst result = tfidf.calculateScores(filter, token);\n\n\t\t\treturn normalizeTfIdfScores(result)\n\t\t\t\t.filter(score => score.score > AbstractCommandsQuickAccessProvider.TFIDF_THRESHOLD)\n\t\t\t\t.slice(0, AbstractCommandsQuickAccessProvider.TFIDF_MAX_RESULTS);\n\t\t});\n\n\t\t// Filter\n\t\tconst filteredCommandPicks: ICommandQuickPick[] = [];\n\t\tfor (const commandPick of allCommandPicks) {\n\t\t\tconst labelHighlights = AbstractCommandsQuickAccessProvider.WORD_FILTER(filter, commandPick.label) ?? undefined;\n\t\t\tconst aliasHighlights = commandPick.commandAlias ? AbstractCommandsQuickAccessProvider.WORD_FILTER(filter, commandPick.commandAlias) ?? undefined : undefined;\n\n\t\t\t// Add if matching in label or alias\n\t\t\tif (labelHighlights || aliasHighlights) {\n\t\t\t\tcommandPick.highlights = {\n\t\t\t\t\tlabel: labelHighlights,\n\t\t\t\t\tdetail: this.options.showAlias ? aliasHighlights : undefined\n\t\t\t\t};\n\n\t\t\t\tfilteredCommandPicks.push(commandPick);\n\t\t\t}\n\n\t\t\t// Also add if we have a 100% command ID match\n\t\t\telse if (filter === commandPick.commandId) {\n\t\t\t\tfilteredCommandPicks.push(commandPick);\n\t\t\t}\n\n\t\t\t// Handle tf-idf scoring for the rest if there's a filter\n\t\t\telse if (filter.length >= 3) {\n\t\t\t\tconst tfidf = runTfidf();\n\t\t\t\tif (token.isCancellationRequested) {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\n\t\t\t\t// Add if we have a tf-idf score\n\t\t\t\tconst tfidfScore = tfidf.find(score => score.key === commandPick.commandId);\n\t\t\t\tif (tfidfScore) {\n\t\t\t\t\tcommandPick.tfIdfScore = tfidfScore.score;\n\t\t\t\t\tfilteredCommandPicks.push(commandPick);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Add description to commands that have duplicate labels\n\t\tconst mapLabelToCommand = new Map<string, ICommandQuickPick>();\n\t\tfor (const commandPick of filteredCommandPicks) {\n\t\t\tconst existingCommandForLabel = mapLabelToCommand.get(commandPick.label);\n\t\t\tif (existingCommandForLabel) {\n\t\t\t\tcommandPick.description = commandPick.commandId;\n\t\t\t\texistingCommandForLabel.description = existingCommandForLabel.commandId;\n\t\t\t} else {\n\t\t\t\tmapLabelToCommand.set(commandPick.label, commandPick);\n\t\t\t}\n\t\t}\n\n\t\t// Sort by MRU order and fallback to name otherwise\n\t\tfilteredCommandPicks.sort((commandPickA, commandPickB) => {\n\t\t\t// If a result came from tf-idf, we want to put that towards the bottom\n\t\t\tif (commandPickA.tfIdfScore && commandPickB.tfIdfScore) {\n\t\t\t\tif (commandPickA.tfIdfScore === commandPickB.tfIdfScore) {\n\t\t\t\t\treturn commandPickA.label.localeCompare(commandPickB.label); // prefer lexicographically smaller command\n\t\t\t\t}\n\t\t\t\treturn commandPickB.tfIdfScore - commandPickA.tfIdfScore; // prefer higher tf-idf score\n\t\t\t} else if (commandPickA.tfIdfScore) {\n\t\t\t\treturn 1; // first command has a score but other doesn't so other wins\n\t\t\t} else if (commandPickB.tfIdfScore) {\n\t\t\t\treturn -1; // other command has a score but first doesn't so first wins\n\t\t\t}\n\n\t\t\tconst commandACounter = this.commandsHistory.peek(commandPickA.commandId);\n\t\t\tconst commandBCounter = this.commandsHistory.peek(commandPickB.commandId);\n\n\t\t\tif (commandACounter && commandBCounter) {\n\t\t\t\treturn commandACounter > commandBCounter ? -1 : 1; // use more recently used command before older\n\t\t\t}\n\n\t\t\tif (commandACounter) {\n\t\t\t\treturn -1; // first command was used, so it wins over the non used one\n\t\t\t}\n\n\t\t\tif (commandBCounter) {\n\t\t\t\treturn 1; // other command was used so it wins over the command\n\t\t\t}\n\n\t\t\tif (this.options.suggestedCommandIds) {\n\t\t\t\tconst commandASuggestion = this.options.suggestedCommandIds.has(commandPickA.commandId);\n\t\t\t\tconst commandBSuggestion = this.options.suggestedCommandIds.has(commandPickB.commandId);\n\t\t\t\tif (commandASuggestion && commandBSuggestion) {\n\t\t\t\t\treturn 0; // honor the order of the array\n\t\t\t\t}\n\n\t\t\t\tif (commandASuggestion) {\n\t\t\t\t\treturn -1; // first command was suggested, so it wins over the non suggested one\n\t\t\t\t}\n\n\t\t\t\tif (commandBSuggestion) {\n\t\t\t\t\treturn 1; // other command was suggested so it wins over the command\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// both commands were never used, so we sort by name\n\t\t\treturn commandPickA.label.localeCompare(commandPickB.label);\n\t\t});\n\n\t\tconst commandPicks: Array<ICommandQuickPick | IQuickPickSeparator> = [];\n\n\t\tlet addOtherSeparator = false;\n\t\tlet addSuggestedSeparator = true;\n\t\tlet addCommonlyUsedSeparator = !!this.options.suggestedCommandIds;\n\t\tfor (let i = 0; i < filteredCommandPicks.length; i++) {\n\t\t\tconst commandPick = filteredCommandPicks[i];\n\n\t\t\t// Separator: recently used\n\t\t\tif (i === 0 && this.commandsHistory.peek(commandPick.commandId)) {\n\t\t\t\tcommandPicks.push({ type: 'separator', label: localize('recentlyUsed', \"recently used\") });\n\t\t\t\taddOtherSeparator = true;\n\t\t\t}\n\n\t\t\tif (addSuggestedSeparator && commandPick.tfIdfScore !== undefined) {\n\t\t\t\tcommandPicks.push({ type: 'separator', label: localize('suggested', \"similar commands\") });\n\t\t\t\taddSuggestedSeparator = false;\n\t\t\t}\n\n\t\t\t// Separator: commonly used\n\t\t\tif (addCommonlyUsedSeparator && commandPick.tfIdfScore === undefined && !this.commandsHistory.peek(commandPick.commandId) && this.options.suggestedCommandIds?.has(commandPick.commandId)) {\n\t\t\t\tcommandPicks.push({ type: 'separator', label: localize('commonlyUsed', \"commonly used\") });\n\t\t\t\taddOtherSeparator = true;\n\t\t\t\taddCommonlyUsedSeparator = false;\n\t\t\t}\n\n\t\t\t// Separator: other commands\n\t\t\tif (addOtherSeparator && commandPick.tfIdfScore === undefined && !this.commandsHistory.peek(commandPick.commandId) && !this.options.suggestedCommandIds?.has(commandPick.commandId)) {\n\t\t\t\tcommandPicks.push({ type: 'separator', label: localize('morecCommands', \"other commands\") });\n\t\t\t\taddOtherSeparator = false;\n\t\t\t}\n\n\t\t\t// Command\n\t\t\tcommandPicks.push(this.toCommandPick(commandPick, runOptions));\n\t\t}\n\n\t\tif (!this.hasAdditionalCommandPicks(filter, token)) {\n\t\t\treturn commandPicks;\n\t\t}\n\n\t\treturn {\n\t\t\tpicks: commandPicks,\n\t\t\tadditionalPicks: (async (): Promise<Picks<ICommandQuickPick>> => {\n\t\t\t\tconst additionalCommandPicks = await this.getAdditionalCommandPicks(allCommandPicks, filteredCommandPicks, filter, token);\n\t\t\t\tif (token.isCancellationRequested) {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\n\t\t\t\tconst commandPicks: Array<ICommandQuickPick | IQuickPickSeparator> = additionalCommandPicks.map(commandPick => this.toCommandPick(commandPick, runOptions));\n\t\t\t\t// Basically, if we haven't already added a separator, we add one before the additional picks so long\n\t\t\t\t// as one hasn't been added to the start of the array.\n\t\t\t\tif (addSuggestedSeparator && commandPicks[0]?.type !== 'separator') {\n\t\t\t\t\tcommandPicks.unshift({ type: 'separator', label: localize('suggested', \"similar commands\") });\n\t\t\t\t}\n\t\t\t\treturn commandPicks;\n\t\t\t})()\n\t\t};\n\t}\n\n\tprivate toCommandPick(commandPick: ICommandQuickPick | IQuickPickSeparator, runOptions?: IQuickAccessProviderRunOptions): ICommandQuickPick | IQuickPickSeparator {\n\t\tif (commandPick.type === 'separator') {\n\t\t\treturn commandPick;\n\t\t}\n\n\t\tconst keybinding = this.keybindingService.lookupKeybinding(commandPick.commandId);\n\t\tconst ariaLabel = keybinding ?\n\t\t\tlocalize('commandPickAriaLabelWithKeybinding', \"{0}, {1}\", commandPick.label, keybinding.getAriaLabel()) :\n\t\t\tcommandPick.label;\n\n\t\treturn {\n\t\t\t...commandPick,\n\t\t\tariaLabel,\n\t\t\tdetail: this.options.showAlias && commandPick.commandAlias !== commandPick.label ? commandPick.commandAlias : undefined,\n\t\t\tkeybinding,\n\t\t\taccept: async () => {\n\n\t\t\t\t// Add to history\n\t\t\t\tthis.commandsHistory.push(commandPick.commandId);\n\n\t\t\t\t// Telementry\n\t\t\t\tthis.telemetryService.publicLog2<WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification>('workbenchActionExecuted', {\n\t\t\t\t\tid: commandPick.commandId,\n\t\t\t\t\tfrom: runOptions?.from ?? 'quick open'\n\t\t\t\t});\n\n\t\t\t\t// Run\n\t\t\t\ttry {\n\t\t\t\t\tcommandPick.args?.length\n\t\t\t\t\t\t? await this.commandService.executeCommand(commandPick.commandId, ...commandPick.args)\n\t\t\t\t\t\t: await this.commandService.executeCommand(commandPick.commandId);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (!isCancellationError(error)) {\n\t\t\t\t\t\tthis.dialogService.error(localize('canNotRun', \"Command '{0}' resulted in an error\", commandPick.label), toErrorMessage(error));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\t// TF-IDF string to be indexed\n\tprivate getTfIdfChunk({ label, commandAlias, commandDescription }: ICommandQuickPick) {\n\t\tlet chunk = label;\n\t\tif (commandAlias && commandAlias !== label) {\n\t\t\tchunk += ` - ${commandAlias}`;\n\t\t}\n\t\tif (commandDescription && commandDescription.value !== label) {\n\t\t\t// If the original is the same as the value, don't add it\n\t\t\tchunk += ` - ${commandDescription.value === commandDescription.original ? commandDescription.value : `${commandDescription.value} (${commandDescription.original})`}`;\n\t\t}\n\t\treturn chunk;\n\t}\n\n\tprotected abstract getCommandPicks(token: CancellationToken): Promise<Array<ICommandQuickPick>>;\n\n\tprotected abstract hasAdditionalCommandPicks(filter: string, token: CancellationToken): boolean;\n\tprotected abstract getAdditionalCommandPicks(allPicks: ICommandQuickPick[], picksSoFar: ICommandQuickPick[], filter: string, token: CancellationToken): Promise<Array<ICommandQuickPick | IQuickPickSeparator>>;\n}\n\ninterface ISerializedCommandHistory {\n\treadonly usesLRU?: boolean;\n\treadonly entries: { key: string; value: number }[];\n}\n\ninterface ICommandsQuickAccessConfiguration {\n\treadonly workbench: {\n\t\treadonly commandPalette: {\n\t\t\treadonly history: number;\n\t\t\treadonly preserveInput: boolean;\n\t\t};\n\t};\n}\n\nexport class CommandsHistory extends Disposable {\n\n\tstatic readonly DEFAULT_COMMANDS_HISTORY_LENGTH = 50;\n\n\tprivate static readonly PREF_KEY_CACHE = 'commandPalette.mru.cache';\n\tprivate static readonly PREF_KEY_COUNTER = 'commandPalette.mru.counter';\n\n\tprivate static cache: LRUCache<string, number> | undefined;\n\tprivate static counter = 1;\n\tprivate static hasChanges = false;\n\n\tprivate configuredCommandsHistoryLength = 0;\n\n\tconstructor(\n\t\t@IStorageService private readonly storageService: IStorageService,\n\t\t@IConfigurationService private readonly configurationService: IConfigurationService,\n\t\t@ILogService private readonly logService: ILogService\n\t) {\n\t\tsuper();\n\n\t\tthis.updateConfiguration();\n\t\tthis.load();\n\n\t\tthis.registerListeners();\n\t}\n\n\tprivate registerListeners(): void {\n\t\tthis._register(this.configurationService.onDidChangeConfiguration(e => this.updateConfiguration(e)));\n\t\tthis._register(this.storageService.onWillSaveState(e => {\n\t\t\tif (e.reason === WillSaveStateReason.SHUTDOWN) {\n\t\t\t\t// Commands history is very dynamic and so we limit impact\n\t\t\t\t// on storage to only save on shutdown. This helps reduce\n\t\t\t\t// the overhead of syncing this data across machines.\n\t\t\t\tthis.saveState();\n\t\t\t}\n\t\t}));\n\t}\n\n\tprivate updateConfiguration(e?: IConfigurationChangeEvent): void {\n\t\tif (e && !e.affectsConfiguration('workbench.commandPalette.history')) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.configuredCommandsHistoryLength = CommandsHistory.getConfiguredCommandHistoryLength(this.configurationService);\n\n\t\tif (CommandsHistory.cache && CommandsHistory.cache.limit !== this.configuredCommandsHistoryLength) {\n\t\t\tCommandsHistory.cache.limit = this.configuredCommandsHistoryLength;\n\t\t\tCommandsHistory.hasChanges = true;\n\t\t}\n\t}\n\n\tprivate load(): void {\n\t\tconst raw = this.storageService.get(CommandsHistory.PREF_KEY_CACHE, StorageScope.PROFILE);\n\t\tlet serializedCache: ISerializedCommandHistory | undefined;\n\t\tif (raw) {\n\t\t\ttry {\n\t\t\t\tserializedCache = JSON.parse(raw);\n\t\t\t} catch (error) {\n\t\t\t\tthis.logService.error(`[CommandsHistory] invalid data: ${error}`);\n\t\t\t}\n\t\t}\n\n\t\tconst cache = CommandsHistory.cache = new LRUCache<string, number>(this.configuredCommandsHistoryLength, 1);\n\t\tif (serializedCache) {\n\t\t\tlet entries: { key: string; value: number }[];\n\t\t\tif (serializedCache.usesLRU) {\n\t\t\t\tentries = serializedCache.entries;\n\t\t\t} else {\n\t\t\t\tentries = serializedCache.entries.sort((a, b) => a.value - b.value);\n\t\t\t}\n\t\t\tentries.forEach(entry => cache.set(entry.key, entry.value));\n\t\t}\n\n\t\tCommandsHistory.counter = this.storageService.getNumber(CommandsHistory.PREF_KEY_COUNTER, StorageScope.PROFILE, CommandsHistory.counter);\n\t}\n\n\tpush(commandId: string): void {\n\t\tif (!CommandsHistory.cache) {\n\t\t\treturn;\n\t\t}\n\n\t\tCommandsHistory.cache.set(commandId, CommandsHistory.counter++); // set counter to command\n\t\tCommandsHistory.hasChanges = true;\n\t}\n\n\tpeek(commandId: string): number | undefined {\n\t\treturn CommandsHistory.cache?.peek(commandId);\n\t}\n\n\tprivate saveState(): void {\n\t\tif (!CommandsHistory.cache) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!CommandsHistory.hasChanges) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst serializedCache: ISerializedCommandHistory = { usesLRU: true, entries: [] };\n\t\tCommandsHistory.cache.forEach((value, key) => serializedCache.entries.push({ key, value }));\n\n\t\tthis.storageService.store(CommandsHistory.PREF_KEY_CACHE, JSON.stringify(serializedCache), StorageScope.PROFILE, StorageTarget.USER);\n\t\tthis.storageService.store(CommandsHistory.PREF_KEY_COUNTER, CommandsHistory.counter, StorageScope.PROFILE, StorageTarget.USER);\n\t\tCommandsHistory.hasChanges = false;\n\t}\n\n\tstatic getConfiguredCommandHistoryLength(configurationService: IConfigurationService): number {\n\t\tconst config = <ICommandsQuickAccessConfiguration>configurationService.getValue();\n\n\t\tconst configuredCommandHistoryLength = config.workbench?.commandPalette?.history;\n\t\tif (typeof configuredCommandHistoryLength === 'number') {\n\t\t\treturn configuredCommandHistoryLength;\n\t\t}\n\n\t\treturn CommandsHistory.DEFAULT_COMMANDS_HISTORY_LENGTH;\n\t}\n}\n"]}
1
+ {"version":3,"sources":["vs/platform/quickinput/browser/commandsQuickAccess.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAIhG,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAU,0BAA0B,EAAE,aAAa,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,iCAAiC,CAAC;AACtH,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAgC,MAAM,mCAAmC,CAAC;AAC7F,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACtF,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAA6B,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AAC/G,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAA+E,yBAAyB,EAAS,MAAM,wBAAwB,CAAC;AAGvJ,OAAO,EAAE,eAAe,EAA+B,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACp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;QACjF,IAAI,OAAO,8BAA8B,KAAK,QAAQ,EAAE,CAAC;YACxD,OAAO,8BAA8B,CAAC;QACvC,CAAC;QAED,OAAO,iBAAe,CAAC,+BAA+B,CAAC;IACxD,CAAC;;AAnHW,eAAe;IAczB,WAAA,eAAe,CAAA;IACf,WAAA,qBAAqB,CAAA;IACrB,WAAA,WAAW,CAAA;GAhBD,eAAe,CAoH3B","file":"commandsQuickAccess.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 { WorkbenchActionExecutedClassification, WorkbenchActionExecutedEvent } from '../../../base/common/actions.js';\nimport { CancellationToken } from '../../../base/common/cancellation.js';\nimport { toErrorMessage } from '../../../base/common/errorMessage.js';\nimport { isCancellationError } from '../../../base/common/errors.js';\nimport { IMatch, matchesContiguousSubString, matchesPrefix, matchesWords, or } from '../../../base/common/filters.js';\nimport { createSingleCallFunction } from '../../../base/common/functional.js';\nimport { Disposable, DisposableStore, IDisposable } from '../../../base/common/lifecycle.js';\nimport { LRUCache } from '../../../base/common/map.js';\nimport { TfIdfCalculator, normalizeTfIdfScores } from '../../../base/common/tfIdf.js';\nimport { localize } from '../../../nls.js';\nimport { ILocalizedString } from '../../action/common/action.js';\nimport { ICommandService } from '../../commands/common/commands.js';\nimport { IConfigurationChangeEvent, IConfigurationService } from '../../configuration/common/configuration.js';\nimport { IDialogService } from '../../dialogs/common/dialogs.js';\nimport { IInstantiationService } from '../../instantiation/common/instantiation.js';\nimport { IKeybindingService } from '../../keybinding/common/keybinding.js';\nimport { ILogService } from '../../log/common/log.js';\nimport { FastAndSlowPicks, IPickerQuickAccessItem, IPickerQuickAccessProviderOptions, PickerQuickAccessProvider, Picks } from './pickerQuickAccess.js';\nimport { IQuickAccessProviderRunOptions } from '../common/quickAccess.js';\nimport { IQuickPickSeparator } from '../common/quickInput.js';\nimport { IStorageService, StorageScope, StorageTarget, WillSaveStateReason } from '../../storage/common/storage.js';\nimport { ITelemetryService } from '../../telemetry/common/telemetry.js';\nimport { removeAccents } from '../../../base/common/normalization.js';\n\nexport interface ICommandQuickPick extends IPickerQuickAccessItem {\n\treadonly commandId: string;\n\treadonly commandAlias?: string;\n\treadonly commandDescription?: ILocalizedString;\n\ttfIdfScore?: number;\n\treadonly args?: any[];\n\n\t// These fields are lazy initialized during filtering process.\n\tlabelNoAccents?: string;\n\taliasNoAccents?: string;\n}\n\nexport interface ICommandsQuickAccessOptions extends IPickerQuickAccessProviderOptions<ICommandQuickPick> {\n\treadonly showAlias: boolean;\n\tsuggestedCommandIds?: Set<string>;\n}\n\nexport abstract class AbstractCommandsQuickAccessProvider extends PickerQuickAccessProvider<ICommandQuickPick> implements IDisposable {\n\n\tstatic PREFIX = '>';\n\n\tprivate static readonly TFIDF_THRESHOLD = 0.5;\n\tprivate static readonly TFIDF_MAX_RESULTS = 5;\n\n\tprivate static WORD_FILTER = or(matchesPrefix, matchesWords, matchesContiguousSubString);\n\n\tprivate readonly commandsHistory: CommandsHistory;\n\n\tprotected override readonly options: ICommandsQuickAccessOptions;\n\n\tconstructor(\n\t\toptions: ICommandsQuickAccessOptions,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t\t@IKeybindingService protected readonly keybindingService: IKeybindingService,\n\t\t@ICommandService private readonly commandService: ICommandService,\n\t\t@ITelemetryService private readonly telemetryService: ITelemetryService,\n\t\t@IDialogService private readonly dialogService: IDialogService\n\t) {\n\t\tsuper(AbstractCommandsQuickAccessProvider.PREFIX, options);\n\n\t\tthis.commandsHistory = this._register(instantiationService.createInstance(CommandsHistory));\n\n\t\tthis.options = options;\n\t}\n\n\tprotected async _getPicks(filter: string, _disposables: DisposableStore, token: CancellationToken, runOptions?: IQuickAccessProviderRunOptions): Promise<Picks<ICommandQuickPick> | FastAndSlowPicks<ICommandQuickPick>> {\n\n\t\t// Ask subclass for all command picks\n\t\tconst allCommandPicks = await this.getCommandPicks(token);\n\n\t\tif (token.isCancellationRequested) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst runTfidf = createSingleCallFunction(() => {\n\t\t\tconst tfidf = new TfIdfCalculator();\n\t\t\ttfidf.updateDocuments(allCommandPicks.map(commandPick => ({\n\t\t\t\tkey: commandPick.commandId,\n\t\t\t\ttextChunks: [this.getTfIdfChunk(commandPick)]\n\t\t\t})));\n\t\t\tconst result = tfidf.calculateScores(filter, token);\n\n\t\t\treturn normalizeTfIdfScores(result)\n\t\t\t\t.filter(score => score.score > AbstractCommandsQuickAccessProvider.TFIDF_THRESHOLD)\n\t\t\t\t.slice(0, AbstractCommandsQuickAccessProvider.TFIDF_MAX_RESULTS);\n\t\t});\n\n\t\tconst noAccentsFilter = this.normalizeForFiltering(filter);\n\n\t\t// Filter\n\t\tconst filteredCommandPicks: ICommandQuickPick[] = [];\n\t\tfor (const commandPick of allCommandPicks) {\n\t\t\tcommandPick.labelNoAccents ??= this.normalizeForFiltering(commandPick.label);\n\t\t\tconst labelHighlights = AbstractCommandsQuickAccessProvider.WORD_FILTER(noAccentsFilter, commandPick.labelNoAccents) ?? undefined;\n\n\t\t\tlet aliasHighlights: IMatch[] | undefined;\n\t\t\tif (commandPick.commandAlias) {\n\t\t\t\tcommandPick.aliasNoAccents ??= this.normalizeForFiltering(commandPick.commandAlias);\n\t\t\t\taliasHighlights = AbstractCommandsQuickAccessProvider.WORD_FILTER(noAccentsFilter, commandPick.aliasNoAccents) ?? undefined;\n\t\t\t}\n\n\t\t\t// Add if matching in label or alias\n\t\t\tif (labelHighlights || aliasHighlights) {\n\t\t\t\tcommandPick.highlights = {\n\t\t\t\t\tlabel: labelHighlights,\n\t\t\t\t\tdetail: this.options.showAlias ? aliasHighlights : undefined\n\t\t\t\t};\n\n\t\t\t\tfilteredCommandPicks.push(commandPick);\n\t\t\t}\n\n\t\t\t// Also add if we have a 100% command ID match\n\t\t\telse if (filter === commandPick.commandId) {\n\t\t\t\tfilteredCommandPicks.push(commandPick);\n\t\t\t}\n\n\t\t\t// Handle tf-idf scoring for the rest if there's a filter\n\t\t\telse if (filter.length >= 3) {\n\t\t\t\tconst tfidf = runTfidf();\n\t\t\t\tif (token.isCancellationRequested) {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\n\t\t\t\t// Add if we have a tf-idf score\n\t\t\t\tconst tfidfScore = tfidf.find(score => score.key === commandPick.commandId);\n\t\t\t\tif (tfidfScore) {\n\t\t\t\t\tcommandPick.tfIdfScore = tfidfScore.score;\n\t\t\t\t\tfilteredCommandPicks.push(commandPick);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Add description to commands that have duplicate labels\n\t\tconst mapLabelToCommand = new Map<string, ICommandQuickPick>();\n\t\tfor (const commandPick of filteredCommandPicks) {\n\t\t\tconst existingCommandForLabel = mapLabelToCommand.get(commandPick.label);\n\t\t\tif (existingCommandForLabel) {\n\t\t\t\tcommandPick.description = commandPick.commandId;\n\t\t\t\texistingCommandForLabel.description = existingCommandForLabel.commandId;\n\t\t\t} else {\n\t\t\t\tmapLabelToCommand.set(commandPick.label, commandPick);\n\t\t\t}\n\t\t}\n\n\t\t// Sort by MRU order and fallback to name otherwise\n\t\tfilteredCommandPicks.sort((commandPickA, commandPickB) => {\n\t\t\t// If a result came from tf-idf, we want to put that towards the bottom\n\t\t\tif (commandPickA.tfIdfScore && commandPickB.tfIdfScore) {\n\t\t\t\tif (commandPickA.tfIdfScore === commandPickB.tfIdfScore) {\n\t\t\t\t\treturn commandPickA.label.localeCompare(commandPickB.label); // prefer lexicographically smaller command\n\t\t\t\t}\n\t\t\t\treturn commandPickB.tfIdfScore - commandPickA.tfIdfScore; // prefer higher tf-idf score\n\t\t\t} else if (commandPickA.tfIdfScore) {\n\t\t\t\treturn 1; // first command has a score but other doesn't so other wins\n\t\t\t} else if (commandPickB.tfIdfScore) {\n\t\t\t\treturn -1; // other command has a score but first doesn't so first wins\n\t\t\t}\n\n\t\t\tconst commandACounter = this.commandsHistory.peek(commandPickA.commandId);\n\t\t\tconst commandBCounter = this.commandsHistory.peek(commandPickB.commandId);\n\n\t\t\tif (commandACounter && commandBCounter) {\n\t\t\t\treturn commandACounter > commandBCounter ? -1 : 1; // use more recently used command before older\n\t\t\t}\n\n\t\t\tif (commandACounter) {\n\t\t\t\treturn -1; // first command was used, so it wins over the non used one\n\t\t\t}\n\n\t\t\tif (commandBCounter) {\n\t\t\t\treturn 1; // other command was used so it wins over the command\n\t\t\t}\n\n\t\t\tif (this.options.suggestedCommandIds) {\n\t\t\t\tconst commandASuggestion = this.options.suggestedCommandIds.has(commandPickA.commandId);\n\t\t\t\tconst commandBSuggestion = this.options.suggestedCommandIds.has(commandPickB.commandId);\n\t\t\t\tif (commandASuggestion && commandBSuggestion) {\n\t\t\t\t\treturn 0; // honor the order of the array\n\t\t\t\t}\n\n\t\t\t\tif (commandASuggestion) {\n\t\t\t\t\treturn -1; // first command was suggested, so it wins over the non suggested one\n\t\t\t\t}\n\n\t\t\t\tif (commandBSuggestion) {\n\t\t\t\t\treturn 1; // other command was suggested so it wins over the command\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// both commands were never used, so we sort by name\n\t\t\treturn commandPickA.label.localeCompare(commandPickB.label);\n\t\t});\n\n\t\tconst commandPicks: Array<ICommandQuickPick | IQuickPickSeparator> = [];\n\n\t\tlet addOtherSeparator = false;\n\t\tlet addSuggestedSeparator = true;\n\t\tlet addCommonlyUsedSeparator = !!this.options.suggestedCommandIds;\n\t\tfor (let i = 0; i < filteredCommandPicks.length; i++) {\n\t\t\tconst commandPick = filteredCommandPicks[i];\n\n\t\t\t// Separator: recently used\n\t\t\tif (i === 0 && this.commandsHistory.peek(commandPick.commandId)) {\n\t\t\t\tcommandPicks.push({ type: 'separator', label: localize('recentlyUsed', \"recently used\") });\n\t\t\t\taddOtherSeparator = true;\n\t\t\t}\n\n\t\t\tif (addSuggestedSeparator && commandPick.tfIdfScore !== undefined) {\n\t\t\t\tcommandPicks.push({ type: 'separator', label: localize('suggested', \"similar commands\") });\n\t\t\t\taddSuggestedSeparator = false;\n\t\t\t}\n\n\t\t\t// Separator: commonly used\n\t\t\tif (addCommonlyUsedSeparator && commandPick.tfIdfScore === undefined && !this.commandsHistory.peek(commandPick.commandId) && this.options.suggestedCommandIds?.has(commandPick.commandId)) {\n\t\t\t\tcommandPicks.push({ type: 'separator', label: localize('commonlyUsed', \"commonly used\") });\n\t\t\t\taddOtherSeparator = true;\n\t\t\t\taddCommonlyUsedSeparator = false;\n\t\t\t}\n\n\t\t\t// Separator: other commands\n\t\t\tif (addOtherSeparator && commandPick.tfIdfScore === undefined && !this.commandsHistory.peek(commandPick.commandId) && !this.options.suggestedCommandIds?.has(commandPick.commandId)) {\n\t\t\t\tcommandPicks.push({ type: 'separator', label: localize('morecCommands', \"other commands\") });\n\t\t\t\taddOtherSeparator = false;\n\t\t\t}\n\n\t\t\t// Command\n\t\t\tcommandPicks.push(this.toCommandPick(commandPick, runOptions));\n\t\t}\n\n\t\tif (!this.hasAdditionalCommandPicks(filter, token)) {\n\t\t\treturn commandPicks;\n\t\t}\n\n\t\treturn {\n\t\t\tpicks: commandPicks,\n\t\t\tadditionalPicks: (async (): Promise<Picks<ICommandQuickPick>> => {\n\t\t\t\tconst additionalCommandPicks = await this.getAdditionalCommandPicks(allCommandPicks, filteredCommandPicks, filter, token);\n\t\t\t\tif (token.isCancellationRequested) {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\n\t\t\t\tconst commandPicks: Array<ICommandQuickPick | IQuickPickSeparator> = additionalCommandPicks.map(commandPick => this.toCommandPick(commandPick, runOptions));\n\t\t\t\t// Basically, if we haven't already added a separator, we add one before the additional picks so long\n\t\t\t\t// as one hasn't been added to the start of the array.\n\t\t\t\tif (addSuggestedSeparator && commandPicks[0]?.type !== 'separator') {\n\t\t\t\t\tcommandPicks.unshift({ type: 'separator', label: localize('suggested', \"similar commands\") });\n\t\t\t\t}\n\t\t\t\treturn commandPicks;\n\t\t\t})()\n\t\t};\n\t}\n\n\tprivate toCommandPick(commandPick: ICommandQuickPick | IQuickPickSeparator, runOptions?: IQuickAccessProviderRunOptions): ICommandQuickPick | IQuickPickSeparator {\n\t\tif (commandPick.type === 'separator') {\n\t\t\treturn commandPick;\n\t\t}\n\n\t\tconst keybinding = this.keybindingService.lookupKeybinding(commandPick.commandId);\n\t\tconst ariaLabel = keybinding ?\n\t\t\tlocalize('commandPickAriaLabelWithKeybinding', \"{0}, {1}\", commandPick.label, keybinding.getAriaLabel()) :\n\t\t\tcommandPick.label;\n\n\t\treturn {\n\t\t\t...commandPick,\n\t\t\tariaLabel,\n\t\t\tdetail: this.options.showAlias && commandPick.commandAlias !== commandPick.label ? commandPick.commandAlias : undefined,\n\t\t\tkeybinding,\n\t\t\taccept: async () => {\n\n\t\t\t\t// Add to history\n\t\t\t\tthis.commandsHistory.push(commandPick.commandId);\n\n\t\t\t\t// Telementry\n\t\t\t\tthis.telemetryService.publicLog2<WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification>('workbenchActionExecuted', {\n\t\t\t\t\tid: commandPick.commandId,\n\t\t\t\t\tfrom: runOptions?.from ?? 'quick open'\n\t\t\t\t});\n\n\t\t\t\t// Run\n\t\t\t\ttry {\n\t\t\t\t\tcommandPick.args?.length\n\t\t\t\t\t\t? await this.commandService.executeCommand(commandPick.commandId, ...commandPick.args)\n\t\t\t\t\t\t: await this.commandService.executeCommand(commandPick.commandId);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (!isCancellationError(error)) {\n\t\t\t\t\t\tthis.dialogService.error(localize('canNotRun', \"Command '{0}' resulted in an error\", commandPick.label), toErrorMessage(error));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\t// TF-IDF string to be indexed\n\tprivate getTfIdfChunk({ label, commandAlias, commandDescription }: ICommandQuickPick) {\n\t\tlet chunk = label;\n\t\tif (commandAlias && commandAlias !== label) {\n\t\t\tchunk += ` - ${commandAlias}`;\n\t\t}\n\t\tif (commandDescription && commandDescription.value !== label) {\n\t\t\t// If the original is the same as the value, don't add it\n\t\t\tchunk += ` - ${commandDescription.value === commandDescription.original ? commandDescription.value : `${commandDescription.value} (${commandDescription.original})`}`;\n\t\t}\n\t\treturn chunk;\n\t}\n\n\n\t/**\n\t * Normalizes a string for filtering by removing accents, but only if the result has the same length, otherwise\n\t * returns the original string.\n\t */\n\tprivate normalizeForFiltering(value: string): string {\n\t\tconst withoutAccents = removeAccents(value);\n\t\tif (withoutAccents.length !== value.length) {\n\t\t\ttype QuickAccessTelemetry = {\n\t\t\t\toriginalLength: number;\n\t\t\t\tnormalizedLength: number;\n\t\t\t};\n\n\t\t\ttype QuickAccessTelemetryMeta = {\n\t\t\t\toriginalLength: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Length of the original filter string' };\n\t\t\t\tnormalizedLength: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Length of the normalized filter string' };\n\t\t\t\towner: 'dmitriv';\n\t\t\t\tcomment: 'Helps to gain insights on cases where the normalized filter string length differs from the original';\n\t\t\t};\n\n\t\t\tthis.telemetryService.publicLog2<QuickAccessTelemetry, QuickAccessTelemetryMeta>('QuickAccess:FilterLengthMismatch', {\n\t\t\t\toriginalLength: value.length,\n\t\t\t\tnormalizedLength: withoutAccents.length\n\t\t\t});\n\n\t\t\treturn value;\n\t\t} else {\n\t\t\treturn withoutAccents;\n\t\t}\n\t}\n\n\tprotected abstract getCommandPicks(token: CancellationToken): Promise<Array<ICommandQuickPick>>;\n\n\tprotected abstract hasAdditionalCommandPicks(filter: string, token: CancellationToken): boolean;\n\tprotected abstract getAdditionalCommandPicks(allPicks: ICommandQuickPick[], picksSoFar: ICommandQuickPick[], filter: string, token: CancellationToken): Promise<Array<ICommandQuickPick | IQuickPickSeparator>>;\n}\n\ninterface ISerializedCommandHistory {\n\treadonly usesLRU?: boolean;\n\treadonly entries: { key: string; value: number }[];\n}\n\ninterface ICommandsQuickAccessConfiguration {\n\treadonly workbench: {\n\t\treadonly commandPalette: {\n\t\t\treadonly history: number;\n\t\t\treadonly preserveInput: boolean;\n\t\t};\n\t};\n}\n\nexport class CommandsHistory extends Disposable {\n\n\tstatic readonly DEFAULT_COMMANDS_HISTORY_LENGTH = 50;\n\n\tprivate static readonly PREF_KEY_CACHE = 'commandPalette.mru.cache';\n\tprivate static readonly PREF_KEY_COUNTER = 'commandPalette.mru.counter';\n\n\tprivate static cache: LRUCache<string, number> | undefined;\n\tprivate static counter = 1;\n\tprivate static hasChanges = false;\n\n\tprivate configuredCommandsHistoryLength = 0;\n\n\tconstructor(\n\t\t@IStorageService private readonly storageService: IStorageService,\n\t\t@IConfigurationService private readonly configurationService: IConfigurationService,\n\t\t@ILogService private readonly logService: ILogService\n\t) {\n\t\tsuper();\n\n\t\tthis.updateConfiguration();\n\t\tthis.load();\n\n\t\tthis.registerListeners();\n\t}\n\n\tprivate registerListeners(): void {\n\t\tthis._register(this.configurationService.onDidChangeConfiguration(e => this.updateConfiguration(e)));\n\t\tthis._register(this.storageService.onWillSaveState(e => {\n\t\t\tif (e.reason === WillSaveStateReason.SHUTDOWN) {\n\t\t\t\t// Commands history is very dynamic and so we limit impact\n\t\t\t\t// on storage to only save on shutdown. This helps reduce\n\t\t\t\t// the overhead of syncing this data across machines.\n\t\t\t\tthis.saveState();\n\t\t\t}\n\t\t}));\n\t}\n\n\tprivate updateConfiguration(e?: IConfigurationChangeEvent): void {\n\t\tif (e && !e.affectsConfiguration('workbench.commandPalette.history')) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.configuredCommandsHistoryLength = CommandsHistory.getConfiguredCommandHistoryLength(this.configurationService);\n\n\t\tif (CommandsHistory.cache && CommandsHistory.cache.limit !== this.configuredCommandsHistoryLength) {\n\t\t\tCommandsHistory.cache.limit = this.configuredCommandsHistoryLength;\n\t\t\tCommandsHistory.hasChanges = true;\n\t\t}\n\t}\n\n\tprivate load(): void {\n\t\tconst raw = this.storageService.get(CommandsHistory.PREF_KEY_CACHE, StorageScope.PROFILE);\n\t\tlet serializedCache: ISerializedCommandHistory | undefined;\n\t\tif (raw) {\n\t\t\ttry {\n\t\t\t\tserializedCache = JSON.parse(raw);\n\t\t\t} catch (error) {\n\t\t\t\tthis.logService.error(`[CommandsHistory] invalid data: ${error}`);\n\t\t\t}\n\t\t}\n\n\t\tconst cache = CommandsHistory.cache = new LRUCache<string, number>(this.configuredCommandsHistoryLength, 1);\n\t\tif (serializedCache) {\n\t\t\tlet entries: { key: string; value: number }[];\n\t\t\tif (serializedCache.usesLRU) {\n\t\t\t\tentries = serializedCache.entries;\n\t\t\t} else {\n\t\t\t\tentries = serializedCache.entries.sort((a, b) => a.value - b.value);\n\t\t\t}\n\t\t\tentries.forEach(entry => cache.set(entry.key, entry.value));\n\t\t}\n\n\t\tCommandsHistory.counter = this.storageService.getNumber(CommandsHistory.PREF_KEY_COUNTER, StorageScope.PROFILE, CommandsHistory.counter);\n\t}\n\n\tpush(commandId: string): void {\n\t\tif (!CommandsHistory.cache) {\n\t\t\treturn;\n\t\t}\n\n\t\tCommandsHistory.cache.set(commandId, CommandsHistory.counter++); // set counter to command\n\t\tCommandsHistory.hasChanges = true;\n\t}\n\n\tpeek(commandId: string): number | undefined {\n\t\treturn CommandsHistory.cache?.peek(commandId);\n\t}\n\n\tprivate saveState(): void {\n\t\tif (!CommandsHistory.cache) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!CommandsHistory.hasChanges) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst serializedCache: ISerializedCommandHistory = { usesLRU: true, entries: [] };\n\t\tCommandsHistory.cache.forEach((value, key) => serializedCache.entries.push({ key, value }));\n\n\t\tthis.storageService.store(CommandsHistory.PREF_KEY_CACHE, JSON.stringify(serializedCache), StorageScope.PROFILE, StorageTarget.USER);\n\t\tthis.storageService.store(CommandsHistory.PREF_KEY_COUNTER, CommandsHistory.counter, StorageScope.PROFILE, StorageTarget.USER);\n\t\tCommandsHistory.hasChanges = false;\n\t}\n\n\tstatic getConfiguredCommandHistoryLength(configurationService: IConfigurationService): number {\n\t\tconst config = <ICommandsQuickAccessConfiguration>configurationService.getValue();\n\n\t\tconst configuredCommandHistoryLength = config.workbench?.commandPalette?.history;\n\t\tif (typeof configuredCommandHistoryLength === 'number') {\n\t\t\treturn configuredCommandHistoryLength;\n\t\t}\n\n\t\treturn CommandsHistory.DEFAULT_COMMANDS_HISTORY_LENGTH;\n\t}\n}\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "monaco-editor-core",
3
3
  "private": false,
4
- "version": "0.55.0-dev-20251007",
4
+ "version": "0.55.0-dev-20251008",
5
5
  "description": "A browser based code editor",
6
6
  "author": "Microsoft Corporation",
7
7
  "license": "MIT",
@@ -14,7 +14,7 @@
14
14
  "bugs": {
15
15
  "url": "https://github.com/microsoft/vscode/issues"
16
16
  },
17
- "vscodeCommitId": "953a0432012aa223baf738a442fbde1d64dd4ced",
17
+ "vscodeCommitId": "2d66eadf7e9adc59b06fc996c85ca2c0e3e12010",
18
18
  "dependencies": {
19
19
  "marked": "14.0.0",
20
20
  "dompurify": "3.1.7"