monaco-editor-core 0.56.0-dev-20260119 → 0.56.0-dev-20260121
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/nls.messages.cs.js +1 -1
- package/esm/nls.messages.de.js +1 -1
- package/esm/nls.messages.es.js +1 -1
- package/esm/nls.messages.fr.js +1 -1
- package/esm/nls.messages.it.js +1 -1
- package/esm/nls.messages.ja.js +1 -1
- package/esm/nls.messages.ko.js +1 -1
- package/esm/nls.messages.pl.js +1 -1
- package/esm/nls.messages.pt-br.js +1 -1
- package/esm/nls.messages.ru.js +1 -1
- package/esm/nls.messages.tr.js +1 -1
- package/esm/nls.messages.zh-cn.js +1 -1
- package/esm/nls.messages.zh-tw.js +1 -1
- package/esm/vs/base/browser/dom.js +8 -0
- package/esm/vs/base/browser/dom.js.map +1 -1
- package/esm/vs/base/browser/markdownRenderer.js +1 -0
- package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
- package/esm/vs/base/browser/ui/actionbar/actionViewItems.js +4 -1
- package/esm/vs/base/browser/ui/actionbar/actionViewItems.js.map +1 -1
- package/esm/vs/base/browser/ui/actionbar/actionbar.css +8 -5
- package/esm/vs/base/browser/ui/contextview/contextview.js +1 -1
- package/esm/vs/base/browser/ui/contextview/contextview.js.map +1 -1
- package/esm/vs/base/browser/ui/hover/hover.js.map +1 -1
- package/esm/vs/base/browser/ui/list/list.js +1 -0
- package/esm/vs/base/browser/ui/list/list.js.map +1 -1
- package/esm/vs/base/browser/ui/list/listWidget.js +62 -5
- package/esm/vs/base/browser/ui/list/listWidget.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/abstractTree.js +4 -1
- package/esm/vs/base/browser/ui/tree/abstractTree.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/asyncDataTree.js +4 -1
- package/esm/vs/base/browser/ui/tree/asyncDataTree.js.map +1 -1
- package/esm/vs/base/common/defaultAccount.js +0 -4
- package/esm/vs/base/common/defaultAccount.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js +81 -35
- package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/editContext.js +11 -0
- package/esm/vs/editor/browser/controller/editContext/editContext.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js +38 -18
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +4 -0
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.js +39 -16
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.js.map +1 -1
- package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
- package/esm/vs/editor/browser/view.js +21 -1
- package/esm/vs/editor/browser/view.js.map +1 -1
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +18 -0
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
- package/esm/vs/editor/common/model/bracketPairsTextModelPart/colorizedBracketPairsDecorationProvider.js +3 -3
- package/esm/vs/editor/common/model/bracketPairsTextModelPart/colorizedBracketPairsDecorationProvider.js.map +1 -1
- package/esm/vs/editor/common/model/textModel.js +7 -5
- package/esm/vs/editor/common/model/textModel.js.map +1 -1
- package/esm/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.js +21 -17
- package/esm/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.js.map +1 -1
- package/esm/vs/editor/common/model.js.map +1 -1
- package/esm/vs/editor/common/viewModel/viewModelDecorations.js +11 -4
- package/esm/vs/editor/common/viewModel/viewModelDecorations.js.map +1 -1
- package/esm/vs/editor/common/viewModel/viewModelImpl.js +25 -14
- package/esm/vs/editor/common/viewModel/viewModelImpl.js.map +1 -1
- package/esm/vs/editor/common/viewModel.js.map +1 -1
- package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +3 -3
- package/esm/vs/editor/contrib/clipboard/browser/clipboard.js.map +1 -1
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +28 -64
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js.map +1 -1
- package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.css +27 -20
- package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.js +37 -10
- package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +2 -2
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.css +7 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +22 -3
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +19 -13
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js.map +1 -1
- package/esm/vs/editor/editor.api.d.ts +5 -1
- package/esm/vs/platform/actionWidget/browser/actionList.js +46 -6
- package/esm/vs/platform/actionWidget/browser/actionList.js.map +1 -1
- package/esm/vs/platform/actionWidget/browser/actionWidget.js +8 -1
- package/esm/vs/platform/actionWidget/browser/actionWidget.js.map +1 -1
- package/esm/vs/platform/actions/common/actions.js +2 -1
- package/esm/vs/platform/actions/common/actions.js.map +1 -1
- package/esm/vs/platform/defaultAccount/common/defaultAccount.js.map +1 -1
- package/esm/vs/platform/hover/browser/hoverService.js +1 -0
- package/esm/vs/platform/hover/browser/hoverService.js.map +1 -1
- package/esm/vs/platform/product/common/product.js +16 -1
- package/esm/vs/platform/product/common/product.js.map +1 -1
- package/monaco.d.ts +5 -1
- package/package.json +2 -2
- package/version.txt +1 -1
|
@@ -93,34 +93,38 @@ export class TokenizationFontDecorationProvider extends Disposable {
|
|
|
93
93
|
this._onDidChangeLineHeight.fire(affectedLineHeights);
|
|
94
94
|
this._onDidChangeFont.fire(affectedLineFonts);
|
|
95
95
|
}
|
|
96
|
-
getDecorationsInRange(range, ownerId, filterOutValidation, onlyMinimapDecorations) {
|
|
96
|
+
getDecorationsInRange(range, ownerId, filterOutValidation, filterFontDecorations, onlyMinimapDecorations) {
|
|
97
97
|
const startOffsetOfRange = this.textModel.getOffsetAt(range.getStartPosition());
|
|
98
98
|
const endOffsetOfRange = this.textModel.getOffsetAt(range.getEndPosition());
|
|
99
99
|
const annotations = this._fontAnnotatedString.getAnnotationsIntersecting(new OffsetRange(startOffsetOfRange, endOffsetOfRange));
|
|
100
100
|
const decorations = [];
|
|
101
101
|
for (const annotation of annotations) {
|
|
102
|
-
const annotationStartPosition = this.textModel.getPositionAt(annotation.range.start);
|
|
103
|
-
const annotationEndPosition = this.textModel.getPositionAt(annotation.range.endExclusive);
|
|
104
|
-
const range = Range.fromPositions(annotationStartPosition, annotationEndPosition);
|
|
105
102
|
const anno = annotation.annotation;
|
|
106
|
-
const className = classNameForFontTokenDecorations(anno.fontToken.fontFamily ?? '', anno.fontToken.fontSizeMultiplier ?? 0);
|
|
107
103
|
const affectsFont = !!(anno.fontToken.fontFamily || anno.fontToken.fontSizeMultiplier);
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
104
|
+
if (!(affectsFont && filterFontDecorations)) {
|
|
105
|
+
const annotationStartPosition = this.textModel.getPositionAt(annotation.range.start);
|
|
106
|
+
const annotationEndPosition = this.textModel.getPositionAt(annotation.range.endExclusive);
|
|
107
|
+
const range = Range.fromPositions(annotationStartPosition, annotationEndPosition);
|
|
108
|
+
const anno = annotation.annotation;
|
|
109
|
+
const className = classNameForFontTokenDecorations(anno.fontToken.fontFamily ?? '', anno.fontToken.fontSizeMultiplier ?? 0);
|
|
110
|
+
const id = anno.decorationId;
|
|
111
|
+
decorations.push({
|
|
112
|
+
id: id,
|
|
113
|
+
options: {
|
|
114
|
+
description: 'FontOptionDecoration',
|
|
115
|
+
inlineClassName: className,
|
|
116
|
+
lineHeight: anno.fontToken.lineHeightMultiplier,
|
|
117
|
+
affectsFont
|
|
118
|
+
},
|
|
119
|
+
ownerId: 0,
|
|
120
|
+
range
|
|
121
|
+
});
|
|
122
|
+
}
|
|
119
123
|
}
|
|
120
124
|
return decorations;
|
|
121
125
|
}
|
|
122
126
|
getAllDecorations(ownerId, filterOutValidation) {
|
|
123
|
-
return this.getDecorationsInRange(new Range(1, 1, this.textModel.getLineCount(),
|
|
127
|
+
return this.getDecorationsInRange(new Range(1, 1, this.textModel.getLineCount(), this.textModel.getLineMaxColumn(this.textModel.getLineCount())), ownerId, filterOutValidation);
|
|
124
128
|
}
|
|
125
129
|
}
|
|
126
130
|
//# sourceMappingURL=tokenizationFontDecorationsProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.ts","vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAGlE,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAsB,0BAA0B,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC;AACxH,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAE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AU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACrF,MAAM,qBAAqB,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,UAAU,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;YAC1F,MAAM,KAAK,GAAG,KAAK,CAAC,aAAa,CAAC,uBAAuB,EAAE,qBAAqB,CAAC,CAAC;YAClF,MAAM,IAAI,GAAG,UAAU,CAAC,UAAU,CAAC;YACnC,MAAM,SAAS,GAAG,gCAAgC,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,IAAI,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,kBAAkB,IAAI,CAAC,CAAC,CAAC;YAC5H,MAAM,WAAW,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,IAAI,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC;YACvF,MAAM,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC;YAC7B,WAAW,CAAC,IAAI,CAAC;gBAChB,EAAE,EAAE,EAAE;gBACN,OAAO,EAAE;oBACR,WAAW,EAAE,sBAAsB;oBACnC,eAAe,EAAE,SAAS;oBAC1B,WAAW;iBACX;gBACD,OAAO,EAAE,CAAC;gBACV,KAAK;aACL,CAAC,CAAC;QACJ,CAAC;QACD,OAAO,WAAW,CAAC;IACpB,CAAC;IAEM,iBAAiB,CAAC,OAAgB,EAAE,mBAA6B;QACvE,OAAO,IAAI,CAAC,qBAAqB,CAChC,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,EACjD,OAAO,EACP,mBAAmB,CACnB,CAAC;IACH,CAAC","file":"tokenizationFontDecorationsProvider.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 { Disposable } from '../../../../base/common/lifecycle.js';\nimport { IModelDecoration, ITextModel } from '../../model.js';\nimport { TokenizationTextModelPart } from './tokenizationTextModelPart.js';\nimport { Range } from '../../core/range.js';\nimport { DecorationProvider, LineFontChangingDecoration, LineHeightChangingDecoration } from '../decorationProvider.js';\nimport { Emitter } from '../../../../base/common/event.js';\nimport { IFontTokenOption, IModelContentChangedEvent } from '../../textModelEvents.js';\nimport { classNameForFontTokenDecorations } from '../../languages/supports/tokenization.js';\nimport { Position } from '../../core/position.js';\nimport { AnnotatedString, AnnotationsUpdate, IAnnotatedString, IAnnotationUpdate } from './annotations.js';\nimport { OffsetRange } from '../../core/ranges/offsetRange.js';\nimport { offsetEditFromContentChanges } from '../textModelStringEdit.js';\n\nexport interface IFontTokenAnnotation {\n\tdecorationId: string;\n\tfontToken: IFontTokenOption;\n}\n\nexport class TokenizationFontDecorationProvider extends Disposable implements DecorationProvider {\n\n\tprivate static DECORATION_COUNT = 0;\n\n\tprivate readonly _onDidChangeLineHeight = new Emitter<Set<LineHeightChangingDecoration>>();\n\tpublic readonly onDidChangeLineHeight = this._onDidChangeLineHeight.event;\n\n\tprivate readonly _onDidChangeFont = new Emitter<Set<LineFontChangingDecoration>>();\n\tpublic readonly onDidChangeFont = this._onDidChangeFont.event;\n\n\tprivate _fontAnnotatedString: IAnnotatedString<IFontTokenAnnotation> = new AnnotatedString<IFontTokenAnnotation>();\n\n\tconstructor(\n\t\tprivate readonly textModel: ITextModel,\n\t\tprivate readonly tokenizationTextModelPart: TokenizationTextModelPart\n\t) {\n\t\tsuper();\n\t\tthis._register(this.tokenizationTextModelPart.onDidChangeFontTokens(fontChanges => {\n\n\t\t\tconst linesChanged = new Set<number>();\n\t\t\tconst fontTokenAnnotations: IAnnotationUpdate<IFontTokenAnnotation>[] = [];\n\n\t\t\tconst affectedLineHeights = new Set<LineHeightChangingDecoration>();\n\t\t\tconst affectedLineFonts = new Set<LineFontChangingDecoration>();\n\n\t\t\tfor (const annotation of fontChanges.changes.annotations) {\n\n\t\t\t\tconst startPosition = this.textModel.getPositionAt(annotation.range.start);\n\t\t\t\tconst lineNumber = startPosition.lineNumber;\n\n\t\t\t\tlet fontTokenAnnotation: IAnnotationUpdate<IFontTokenAnnotation>;\n\t\t\t\tif (annotation.annotation === undefined) {\n\t\t\t\t\tfontTokenAnnotation = {\n\t\t\t\t\t\trange: annotation.range,\n\t\t\t\t\t\tannotation: undefined\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\tconst decorationId = `tokenization-font-decoration-${TokenizationFontDecorationProvider.DECORATION_COUNT}`;\n\t\t\t\t\tconst fontTokenDecoration: IFontTokenAnnotation = {\n\t\t\t\t\t\tfontToken: annotation.annotation,\n\t\t\t\t\t\tdecorationId\n\t\t\t\t\t};\n\t\t\t\t\tfontTokenAnnotation = {\n\t\t\t\t\t\trange: annotation.range,\n\t\t\t\t\t\tannotation: fontTokenDecoration\n\t\t\t\t\t};\n\t\t\t\t\tTokenizationFontDecorationProvider.DECORATION_COUNT++;\n\n\t\t\t\t\tif (annotation.annotation.lineHeightMultiplier) {\n\t\t\t\t\t\taffectedLineHeights.add(new LineHeightChangingDecoration(0, decorationId, lineNumber, annotation.annotation.lineHeightMultiplier));\n\t\t\t\t\t}\n\t\t\t\t\taffectedLineFonts.add(new LineFontChangingDecoration(0, decorationId, lineNumber));\n\n\t\t\t\t}\n\t\t\t\tfontTokenAnnotations.push(fontTokenAnnotation);\n\n\t\t\t\tif (!linesChanged.has(lineNumber)) {\n\t\t\t\t\t// Signal the removal of the font tokenization decorations on the line number\n\t\t\t\t\tconst lineNumberStartOffset = this.textModel.getOffsetAt(new Position(lineNumber, 1));\n\t\t\t\t\tconst lineNumberEndOffset = this.textModel.getOffsetAt(new Position(lineNumber, this.textModel.getLineMaxColumn(lineNumber)));\n\t\t\t\t\tconst lineOffsetRange = new OffsetRange(lineNumberStartOffset, lineNumberEndOffset);\n\t\t\t\t\tconst lineAnnotations = this._fontAnnotatedString.getAnnotationsIntersecting(lineOffsetRange);\n\t\t\t\t\tfor (const annotation of lineAnnotations) {\n\t\t\t\t\t\tconst decorationId = annotation.annotation.decorationId;\n\t\t\t\t\t\taffectedLineHeights.add(new LineHeightChangingDecoration(0, decorationId, lineNumber, null));\n\t\t\t\t\t\taffectedLineFonts.add(new LineFontChangingDecoration(0, decorationId, lineNumber));\n\t\t\t\t\t}\n\t\t\t\t\tlinesChanged.add(lineNumber);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._fontAnnotatedString.setAnnotations(AnnotationsUpdate.create(fontTokenAnnotations));\n\t\t\tthis._onDidChangeLineHeight.fire(affectedLineHeights);\n\t\t\tthis._onDidChangeFont.fire(affectedLineFonts);\n\t\t}));\n\t}\n\n\tpublic handleDidChangeContent(change: IModelContentChangedEvent) {\n\t\tconst edits = offsetEditFromContentChanges(change.changes);\n\t\tconst deletedAnnotations = this._fontAnnotatedString.applyEdit(edits);\n\t\tif (deletedAnnotations.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\t/* We should fire line and font change events if decorations have been added or removed\n\t\t * No decorations are added on edit, but they can be removed */\n\t\tconst affectedLineHeights = new Set<LineHeightChangingDecoration>();\n\t\tconst affectedLineFonts = new Set<LineFontChangingDecoration>();\n\t\tfor (const deletedAnnotation of deletedAnnotations) {\n\t\t\tconst startPosition = this.textModel.getPositionAt(deletedAnnotation.range.start);\n\t\t\tconst lineNumber = startPosition.lineNumber;\n\t\t\tconst decorationId = deletedAnnotation.annotation.decorationId;\n\t\t\taffectedLineHeights.add(new LineHeightChangingDecoration(0, decorationId, lineNumber, null));\n\t\t\taffectedLineFonts.add(new LineFontChangingDecoration(0, decorationId, lineNumber));\n\t\t}\n\t\tthis._onDidChangeLineHeight.fire(affectedLineHeights);\n\t\tthis._onDidChangeFont.fire(affectedLineFonts);\n\t}\n\n\tpublic getDecorationsInRange(range: Range, ownerId?: number, filterOutValidation?: boolean, onlyMinimapDecorations?: boolean): IModelDecoration[] {\n\t\tconst startOffsetOfRange = this.textModel.getOffsetAt(range.getStartPosition());\n\t\tconst endOffsetOfRange = this.textModel.getOffsetAt(range.getEndPosition());\n\t\tconst annotations = this._fontAnnotatedString.getAnnotationsIntersecting(new OffsetRange(startOffsetOfRange, endOffsetOfRange));\n\n\t\tconst decorations: IModelDecoration[] = [];\n\t\tfor (const annotation of annotations) {\n\t\t\tconst annotationStartPosition = this.textModel.getPositionAt(annotation.range.start);\n\t\t\tconst annotationEndPosition = this.textModel.getPositionAt(annotation.range.endExclusive);\n\t\t\tconst range = Range.fromPositions(annotationStartPosition, annotationEndPosition);\n\t\t\tconst anno = annotation.annotation;\n\t\t\tconst className = classNameForFontTokenDecorations(anno.fontToken.fontFamily ?? '', anno.fontToken.fontSizeMultiplier ?? 0);\n\t\t\tconst affectsFont = !!(anno.fontToken.fontFamily || anno.fontToken.fontSizeMultiplier);\n\t\t\tconst id = anno.decorationId;\n\t\t\tdecorations.push({\n\t\t\t\tid: id,\n\t\t\t\toptions: {\n\t\t\t\t\tdescription: 'FontOptionDecoration',\n\t\t\t\t\tinlineClassName: className,\n\t\t\t\t\taffectsFont\n\t\t\t\t},\n\t\t\t\townerId: 0,\n\t\t\t\trange\n\t\t\t});\n\t\t}\n\t\treturn decorations;\n\t}\n\n\tpublic getAllDecorations(ownerId?: number, filterOutValidation?: boolean): IModelDecoration[] {\n\t\treturn this.getDecorationsInRange(\n\t\t\tnew Range(1, 1, this.textModel.getLineCount(), 1),\n\t\t\townerId,\n\t\t\tfilterOutValidation\n\t\t);\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 { Disposable } from '../../../../base/common/lifecycle.js';\nimport { IModelDecoration, ITextModel } from '../../model.js';\nimport { TokenizationTextModelPart } from './tokenizationTextModelPart.js';\nimport { Range } from '../../core/range.js';\nimport { DecorationProvider, LineFontChangingDecoration, LineHeightChangingDecoration } from '../decorationProvider.js';\nimport { Emitter } from '../../../../base/common/event.js';\nimport { IFontTokenOption, IModelContentChangedEvent } from '../../textModelEvents.js';\nimport { classNameForFontTokenDecorations } from '../../languages/supports/tokenization.js';\nimport { Position } from '../../core/position.js';\nimport { AnnotatedString, AnnotationsUpdate, IAnnotatedString, IAnnotationUpdate } from './annotations.js';\nimport { OffsetRange } from '../../core/ranges/offsetRange.js';\nimport { offsetEditFromContentChanges } from '../textModelStringEdit.js';\n\nexport interface IFontTokenAnnotation {\n\tdecorationId: string;\n\tfontToken: IFontTokenOption;\n}\n\nexport class TokenizationFontDecorationProvider extends Disposable implements DecorationProvider {\n\n\tprivate static DECORATION_COUNT = 0;\n\n\tprivate readonly _onDidChangeLineHeight = new Emitter<Set<LineHeightChangingDecoration>>();\n\tpublic readonly onDidChangeLineHeight = this._onDidChangeLineHeight.event;\n\n\tprivate readonly _onDidChangeFont = new Emitter<Set<LineFontChangingDecoration>>();\n\tpublic readonly onDidChangeFont = this._onDidChangeFont.event;\n\n\tprivate _fontAnnotatedString: IAnnotatedString<IFontTokenAnnotation> = new AnnotatedString<IFontTokenAnnotation>();\n\n\tconstructor(\n\t\tprivate readonly textModel: ITextModel,\n\t\tprivate readonly tokenizationTextModelPart: TokenizationTextModelPart\n\t) {\n\t\tsuper();\n\t\tthis._register(this.tokenizationTextModelPart.onDidChangeFontTokens(fontChanges => {\n\n\t\t\tconst linesChanged = new Set<number>();\n\t\t\tconst fontTokenAnnotations: IAnnotationUpdate<IFontTokenAnnotation>[] = [];\n\n\t\t\tconst affectedLineHeights = new Set<LineHeightChangingDecoration>();\n\t\t\tconst affectedLineFonts = new Set<LineFontChangingDecoration>();\n\n\t\t\tfor (const annotation of fontChanges.changes.annotations) {\n\n\t\t\t\tconst startPosition = this.textModel.getPositionAt(annotation.range.start);\n\t\t\t\tconst lineNumber = startPosition.lineNumber;\n\n\t\t\t\tlet fontTokenAnnotation: IAnnotationUpdate<IFontTokenAnnotation>;\n\t\t\t\tif (annotation.annotation === undefined) {\n\t\t\t\t\tfontTokenAnnotation = {\n\t\t\t\t\t\trange: annotation.range,\n\t\t\t\t\t\tannotation: undefined\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\tconst decorationId = `tokenization-font-decoration-${TokenizationFontDecorationProvider.DECORATION_COUNT}`;\n\t\t\t\t\tconst fontTokenDecoration: IFontTokenAnnotation = {\n\t\t\t\t\t\tfontToken: annotation.annotation,\n\t\t\t\t\t\tdecorationId\n\t\t\t\t\t};\n\t\t\t\t\tfontTokenAnnotation = {\n\t\t\t\t\t\trange: annotation.range,\n\t\t\t\t\t\tannotation: fontTokenDecoration\n\t\t\t\t\t};\n\t\t\t\t\tTokenizationFontDecorationProvider.DECORATION_COUNT++;\n\n\t\t\t\t\tif (annotation.annotation.lineHeightMultiplier) {\n\t\t\t\t\t\taffectedLineHeights.add(new LineHeightChangingDecoration(0, decorationId, lineNumber, annotation.annotation.lineHeightMultiplier));\n\t\t\t\t\t}\n\t\t\t\t\taffectedLineFonts.add(new LineFontChangingDecoration(0, decorationId, lineNumber));\n\n\t\t\t\t}\n\t\t\t\tfontTokenAnnotations.push(fontTokenAnnotation);\n\n\t\t\t\tif (!linesChanged.has(lineNumber)) {\n\t\t\t\t\t// Signal the removal of the font tokenization decorations on the line number\n\t\t\t\t\tconst lineNumberStartOffset = this.textModel.getOffsetAt(new Position(lineNumber, 1));\n\t\t\t\t\tconst lineNumberEndOffset = this.textModel.getOffsetAt(new Position(lineNumber, this.textModel.getLineMaxColumn(lineNumber)));\n\t\t\t\t\tconst lineOffsetRange = new OffsetRange(lineNumberStartOffset, lineNumberEndOffset);\n\t\t\t\t\tconst lineAnnotations = this._fontAnnotatedString.getAnnotationsIntersecting(lineOffsetRange);\n\t\t\t\t\tfor (const annotation of lineAnnotations) {\n\t\t\t\t\t\tconst decorationId = annotation.annotation.decorationId;\n\t\t\t\t\t\taffectedLineHeights.add(new LineHeightChangingDecoration(0, decorationId, lineNumber, null));\n\t\t\t\t\t\taffectedLineFonts.add(new LineFontChangingDecoration(0, decorationId, lineNumber));\n\t\t\t\t\t}\n\t\t\t\t\tlinesChanged.add(lineNumber);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._fontAnnotatedString.setAnnotations(AnnotationsUpdate.create(fontTokenAnnotations));\n\t\t\tthis._onDidChangeLineHeight.fire(affectedLineHeights);\n\t\t\tthis._onDidChangeFont.fire(affectedLineFonts);\n\t\t}));\n\t}\n\n\tpublic handleDidChangeContent(change: IModelContentChangedEvent) {\n\t\tconst edits = offsetEditFromContentChanges(change.changes);\n\t\tconst deletedAnnotations = this._fontAnnotatedString.applyEdit(edits);\n\t\tif (deletedAnnotations.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\t/* We should fire line and font change events if decorations have been added or removed\n\t\t * No decorations are added on edit, but they can be removed */\n\t\tconst affectedLineHeights = new Set<LineHeightChangingDecoration>();\n\t\tconst affectedLineFonts = new Set<LineFontChangingDecoration>();\n\t\tfor (const deletedAnnotation of deletedAnnotations) {\n\t\t\tconst startPosition = this.textModel.getPositionAt(deletedAnnotation.range.start);\n\t\t\tconst lineNumber = startPosition.lineNumber;\n\t\t\tconst decorationId = deletedAnnotation.annotation.decorationId;\n\t\t\taffectedLineHeights.add(new LineHeightChangingDecoration(0, decorationId, lineNumber, null));\n\t\t\taffectedLineFonts.add(new LineFontChangingDecoration(0, decorationId, lineNumber));\n\t\t}\n\t\tthis._onDidChangeLineHeight.fire(affectedLineHeights);\n\t\tthis._onDidChangeFont.fire(affectedLineFonts);\n\t}\n\n\tpublic getDecorationsInRange(range: Range, ownerId?: number, filterOutValidation?: boolean, onlyMinimapDecorations?: boolean): IModelDecoration[] {\n\t\tconst startOffsetOfRange = this.textModel.getOffsetAt(range.getStartPosition());\n\t\tconst endOffsetOfRange = this.textModel.getOffsetAt(range.getEndPosition());\n\t\tconst annotations = this._fontAnnotatedString.getAnnotationsIntersecting(new OffsetRange(startOffsetOfRange, endOffsetOfRange));\n\n\t\tconst decorations: IModelDecoration[] = [];\n\t\tfor (const annotation of annotations) {\n\t\t\tconst annotationStartPosition = this.textModel.getPositionAt(annotation.range.start);\n\t\t\tconst annotationEndPosition = this.textModel.getPositionAt(annotation.range.endExclusive);\n\t\t\tconst range = Range.fromPositions(annotationStartPosition, annotationEndPosition);\n\t\t\tconst anno = annotation.annotation;\n\t\t\tconst className = classNameForFontTokenDecorations(anno.fontToken.fontFamily ?? '', anno.fontToken.fontSizeMultiplier ?? 0);\n\t\t\tconst affectsFont = !!(anno.fontToken.fontFamily || anno.fontToken.fontSizeMultiplier);\n\t\t\tconst id = anno.decorationId;\n\t\t\tdecorations.push({\n\t\t\t\tid: id,\n\t\t\t\toptions: {\n\t\t\t\t\tdescription: 'FontOptionDecoration',\n\t\t\t\t\tinlineClassName: className,\n\t\t\t\t\taffectsFont\n\t\t\t\t},\n\t\t\t\townerId: 0,\n\t\t\t\trange\n\t\t\t});\n\t\t}\n\t\treturn decorations;\n\t}\n\n\tpublic getAllDecorations(ownerId?: number, filterOutValidation?: boolean): IModelDecoration[] {\n\t\treturn this.getDecorationsInRange(\n\t\t\tnew Range(1, 1, this.textModel.getLineCount(), 1),\n\t\t\townerId,\n\t\t\tfilterOutValidation\n\t\t);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.ts","vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAGlE,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAsB,0BAA0B,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC;AACxH,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAE3D,OAAO,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IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,CAAC,CAAC,EAC9G,OAAO,EACP,mBAAmB,CACnB,CAAC;IACH,CAAC","file":"tokenizationFontDecorationsProvider.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 { Disposable } from '../../../../base/common/lifecycle.js';\nimport { IModelDecoration, ITextModel } from '../../model.js';\nimport { TokenizationTextModelPart } from './tokenizationTextModelPart.js';\nimport { Range } from '../../core/range.js';\nimport { DecorationProvider, LineFontChangingDecoration, LineHeightChangingDecoration } from '../decorationProvider.js';\nimport { Emitter } from '../../../../base/common/event.js';\nimport { IFontTokenOption, IModelContentChangedEvent } from '../../textModelEvents.js';\nimport { classNameForFontTokenDecorations } from '../../languages/supports/tokenization.js';\nimport { Position } from '../../core/position.js';\nimport { AnnotatedString, AnnotationsUpdate, IAnnotatedString, IAnnotationUpdate } from './annotations.js';\nimport { OffsetRange } from '../../core/ranges/offsetRange.js';\nimport { offsetEditFromContentChanges } from '../textModelStringEdit.js';\n\nexport interface IFontTokenAnnotation {\n\tdecorationId: string;\n\tfontToken: IFontTokenOption;\n}\n\nexport class TokenizationFontDecorationProvider extends Disposable implements DecorationProvider {\n\n\tprivate static DECORATION_COUNT = 0;\n\n\tprivate readonly _onDidChangeLineHeight = new Emitter<Set<LineHeightChangingDecoration>>();\n\tpublic readonly onDidChangeLineHeight = this._onDidChangeLineHeight.event;\n\n\tprivate readonly _onDidChangeFont = new Emitter<Set<LineFontChangingDecoration>>();\n\tpublic readonly onDidChangeFont = this._onDidChangeFont.event;\n\n\tprivate _fontAnnotatedString: IAnnotatedString<IFontTokenAnnotation> = new AnnotatedString<IFontTokenAnnotation>();\n\n\tconstructor(\n\t\tprivate readonly textModel: ITextModel,\n\t\tprivate readonly tokenizationTextModelPart: TokenizationTextModelPart\n\t) {\n\t\tsuper();\n\t\tthis._register(this.tokenizationTextModelPart.onDidChangeFontTokens(fontChanges => {\n\n\t\t\tconst linesChanged = new Set<number>();\n\t\t\tconst fontTokenAnnotations: IAnnotationUpdate<IFontTokenAnnotation>[] = [];\n\n\t\t\tconst affectedLineHeights = new Set<LineHeightChangingDecoration>();\n\t\t\tconst affectedLineFonts = new Set<LineFontChangingDecoration>();\n\n\t\t\tfor (const annotation of fontChanges.changes.annotations) {\n\n\t\t\t\tconst startPosition = this.textModel.getPositionAt(annotation.range.start);\n\t\t\t\tconst lineNumber = startPosition.lineNumber;\n\n\t\t\t\tlet fontTokenAnnotation: IAnnotationUpdate<IFontTokenAnnotation>;\n\t\t\t\tif (annotation.annotation === undefined) {\n\t\t\t\t\tfontTokenAnnotation = {\n\t\t\t\t\t\trange: annotation.range,\n\t\t\t\t\t\tannotation: undefined\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\tconst decorationId = `tokenization-font-decoration-${TokenizationFontDecorationProvider.DECORATION_COUNT}`;\n\t\t\t\t\tconst fontTokenDecoration: IFontTokenAnnotation = {\n\t\t\t\t\t\tfontToken: annotation.annotation,\n\t\t\t\t\t\tdecorationId\n\t\t\t\t\t};\n\t\t\t\t\tfontTokenAnnotation = {\n\t\t\t\t\t\trange: annotation.range,\n\t\t\t\t\t\tannotation: fontTokenDecoration\n\t\t\t\t\t};\n\t\t\t\t\tTokenizationFontDecorationProvider.DECORATION_COUNT++;\n\n\t\t\t\t\tif (annotation.annotation.lineHeightMultiplier) {\n\t\t\t\t\t\taffectedLineHeights.add(new LineHeightChangingDecoration(0, decorationId, lineNumber, annotation.annotation.lineHeightMultiplier));\n\t\t\t\t\t}\n\t\t\t\t\taffectedLineFonts.add(new LineFontChangingDecoration(0, decorationId, lineNumber));\n\n\t\t\t\t}\n\t\t\t\tfontTokenAnnotations.push(fontTokenAnnotation);\n\n\t\t\t\tif (!linesChanged.has(lineNumber)) {\n\t\t\t\t\t// Signal the removal of the font tokenization decorations on the line number\n\t\t\t\t\tconst lineNumberStartOffset = this.textModel.getOffsetAt(new Position(lineNumber, 1));\n\t\t\t\t\tconst lineNumberEndOffset = this.textModel.getOffsetAt(new Position(lineNumber, this.textModel.getLineMaxColumn(lineNumber)));\n\t\t\t\t\tconst lineOffsetRange = new OffsetRange(lineNumberStartOffset, lineNumberEndOffset);\n\t\t\t\t\tconst lineAnnotations = this._fontAnnotatedString.getAnnotationsIntersecting(lineOffsetRange);\n\t\t\t\t\tfor (const annotation of lineAnnotations) {\n\t\t\t\t\t\tconst decorationId = annotation.annotation.decorationId;\n\t\t\t\t\t\taffectedLineHeights.add(new LineHeightChangingDecoration(0, decorationId, lineNumber, null));\n\t\t\t\t\t\taffectedLineFonts.add(new LineFontChangingDecoration(0, decorationId, lineNumber));\n\t\t\t\t\t}\n\t\t\t\t\tlinesChanged.add(lineNumber);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._fontAnnotatedString.setAnnotations(AnnotationsUpdate.create(fontTokenAnnotations));\n\t\t\tthis._onDidChangeLineHeight.fire(affectedLineHeights);\n\t\t\tthis._onDidChangeFont.fire(affectedLineFonts);\n\t\t}));\n\t}\n\n\tpublic handleDidChangeContent(change: IModelContentChangedEvent) {\n\t\tconst edits = offsetEditFromContentChanges(change.changes);\n\t\tconst deletedAnnotations = this._fontAnnotatedString.applyEdit(edits);\n\t\tif (deletedAnnotations.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\t/* We should fire line and font change events if decorations have been added or removed\n\t\t * No decorations are added on edit, but they can be removed */\n\t\tconst affectedLineHeights = new Set<LineHeightChangingDecoration>();\n\t\tconst affectedLineFonts = new Set<LineFontChangingDecoration>();\n\t\tfor (const deletedAnnotation of deletedAnnotations) {\n\t\t\tconst startPosition = this.textModel.getPositionAt(deletedAnnotation.range.start);\n\t\t\tconst lineNumber = startPosition.lineNumber;\n\t\t\tconst decorationId = deletedAnnotation.annotation.decorationId;\n\t\t\taffectedLineHeights.add(new LineHeightChangingDecoration(0, decorationId, lineNumber, null));\n\t\t\taffectedLineFonts.add(new LineFontChangingDecoration(0, decorationId, lineNumber));\n\t\t}\n\t\tthis._onDidChangeLineHeight.fire(affectedLineHeights);\n\t\tthis._onDidChangeFont.fire(affectedLineFonts);\n\t}\n\n\tpublic getDecorationsInRange(range: Range, ownerId?: number, filterOutValidation?: boolean, filterFontDecorations?: boolean, onlyMinimapDecorations?: boolean): IModelDecoration[] {\n\t\tconst startOffsetOfRange = this.textModel.getOffsetAt(range.getStartPosition());\n\t\tconst endOffsetOfRange = this.textModel.getOffsetAt(range.getEndPosition());\n\t\tconst annotations = this._fontAnnotatedString.getAnnotationsIntersecting(new OffsetRange(startOffsetOfRange, endOffsetOfRange));\n\n\t\tconst decorations: IModelDecoration[] = [];\n\t\tfor (const annotation of annotations) {\n\t\t\tconst anno = annotation.annotation;\n\t\t\tconst affectsFont = !!(anno.fontToken.fontFamily || anno.fontToken.fontSizeMultiplier);\n\t\t\tif (!(affectsFont && filterFontDecorations)) {\n\t\t\t\tconst annotationStartPosition = this.textModel.getPositionAt(annotation.range.start);\n\t\t\t\tconst annotationEndPosition = this.textModel.getPositionAt(annotation.range.endExclusive);\n\t\t\t\tconst range = Range.fromPositions(annotationStartPosition, annotationEndPosition);\n\t\t\t\tconst anno = annotation.annotation;\n\t\t\t\tconst className = classNameForFontTokenDecorations(anno.fontToken.fontFamily ?? '', anno.fontToken.fontSizeMultiplier ?? 0);\n\t\t\t\tconst id = anno.decorationId;\n\t\t\t\tdecorations.push({\n\t\t\t\t\tid: id,\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tdescription: 'FontOptionDecoration',\n\t\t\t\t\t\tinlineClassName: className,\n\t\t\t\t\t\tlineHeight: anno.fontToken.lineHeightMultiplier,\n\t\t\t\t\t\taffectsFont\n\t\t\t\t\t},\n\t\t\t\t\townerId: 0,\n\t\t\t\t\trange\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\treturn decorations;\n\t}\n\n\tpublic getAllDecorations(ownerId?: number, filterOutValidation?: boolean): IModelDecoration[] {\n\t\treturn this.getDecorationsInRange(\n\t\t\tnew Range(1, 1, this.textModel.getLineCount(), this.textModel.getLineMaxColumn(this.textModel.getLineCount())),\n\t\t\townerId,\n\t\t\tfilterOutValidation\n\t\t);\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 { Disposable } from '../../../../base/common/lifecycle.js';\nimport { IModelDecoration, ITextModel } from '../../model.js';\nimport { TokenizationTextModelPart } from './tokenizationTextModelPart.js';\nimport { Range } from '../../core/range.js';\nimport { DecorationProvider, LineFontChangingDecoration, LineHeightChangingDecoration } from '../decorationProvider.js';\nimport { Emitter } from '../../../../base/common/event.js';\nimport { IFontTokenOption, IModelContentChangedEvent } from '../../textModelEvents.js';\nimport { classNameForFontTokenDecorations } from '../../languages/supports/tokenization.js';\nimport { Position } from '../../core/position.js';\nimport { AnnotatedString, AnnotationsUpdate, IAnnotatedString, IAnnotationUpdate } from './annotations.js';\nimport { OffsetRange } from '../../core/ranges/offsetRange.js';\nimport { offsetEditFromContentChanges } from '../textModelStringEdit.js';\n\nexport interface IFontTokenAnnotation {\n\tdecorationId: string;\n\tfontToken: IFontTokenOption;\n}\n\nexport class TokenizationFontDecorationProvider extends Disposable implements DecorationProvider {\n\n\tprivate static DECORATION_COUNT = 0;\n\n\tprivate readonly _onDidChangeLineHeight = new Emitter<Set<LineHeightChangingDecoration>>();\n\tpublic readonly onDidChangeLineHeight = this._onDidChangeLineHeight.event;\n\n\tprivate readonly _onDidChangeFont = new Emitter<Set<LineFontChangingDecoration>>();\n\tpublic readonly onDidChangeFont = this._onDidChangeFont.event;\n\n\tprivate _fontAnnotatedString: IAnnotatedString<IFontTokenAnnotation> = new AnnotatedString<IFontTokenAnnotation>();\n\n\tconstructor(\n\t\tprivate readonly textModel: ITextModel,\n\t\tprivate readonly tokenizationTextModelPart: TokenizationTextModelPart\n\t) {\n\t\tsuper();\n\t\tthis._register(this.tokenizationTextModelPart.onDidChangeFontTokens(fontChanges => {\n\n\t\t\tconst linesChanged = new Set<number>();\n\t\t\tconst fontTokenAnnotations: IAnnotationUpdate<IFontTokenAnnotation>[] = [];\n\n\t\t\tconst affectedLineHeights = new Set<LineHeightChangingDecoration>();\n\t\t\tconst affectedLineFonts = new Set<LineFontChangingDecoration>();\n\n\t\t\tfor (const annotation of fontChanges.changes.annotations) {\n\n\t\t\t\tconst startPosition = this.textModel.getPositionAt(annotation.range.start);\n\t\t\t\tconst lineNumber = startPosition.lineNumber;\n\n\t\t\t\tlet fontTokenAnnotation: IAnnotationUpdate<IFontTokenAnnotation>;\n\t\t\t\tif (annotation.annotation === undefined) {\n\t\t\t\t\tfontTokenAnnotation = {\n\t\t\t\t\t\trange: annotation.range,\n\t\t\t\t\t\tannotation: undefined\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\tconst decorationId = `tokenization-font-decoration-${TokenizationFontDecorationProvider.DECORATION_COUNT}`;\n\t\t\t\t\tconst fontTokenDecoration: IFontTokenAnnotation = {\n\t\t\t\t\t\tfontToken: annotation.annotation,\n\t\t\t\t\t\tdecorationId\n\t\t\t\t\t};\n\t\t\t\t\tfontTokenAnnotation = {\n\t\t\t\t\t\trange: annotation.range,\n\t\t\t\t\t\tannotation: fontTokenDecoration\n\t\t\t\t\t};\n\t\t\t\t\tTokenizationFontDecorationProvider.DECORATION_COUNT++;\n\n\t\t\t\t\tif (annotation.annotation.lineHeightMultiplier) {\n\t\t\t\t\t\taffectedLineHeights.add(new LineHeightChangingDecoration(0, decorationId, lineNumber, annotation.annotation.lineHeightMultiplier));\n\t\t\t\t\t}\n\t\t\t\t\taffectedLineFonts.add(new LineFontChangingDecoration(0, decorationId, lineNumber));\n\n\t\t\t\t}\n\t\t\t\tfontTokenAnnotations.push(fontTokenAnnotation);\n\n\t\t\t\tif (!linesChanged.has(lineNumber)) {\n\t\t\t\t\t// Signal the removal of the font tokenization decorations on the line number\n\t\t\t\t\tconst lineNumberStartOffset = this.textModel.getOffsetAt(new Position(lineNumber, 1));\n\t\t\t\t\tconst lineNumberEndOffset = this.textModel.getOffsetAt(new Position(lineNumber, this.textModel.getLineMaxColumn(lineNumber)));\n\t\t\t\t\tconst lineOffsetRange = new OffsetRange(lineNumberStartOffset, lineNumberEndOffset);\n\t\t\t\t\tconst lineAnnotations = this._fontAnnotatedString.getAnnotationsIntersecting(lineOffsetRange);\n\t\t\t\t\tfor (const annotation of lineAnnotations) {\n\t\t\t\t\t\tconst decorationId = annotation.annotation.decorationId;\n\t\t\t\t\t\taffectedLineHeights.add(new LineHeightChangingDecoration(0, decorationId, lineNumber, null));\n\t\t\t\t\t\taffectedLineFonts.add(new LineFontChangingDecoration(0, decorationId, lineNumber));\n\t\t\t\t\t}\n\t\t\t\t\tlinesChanged.add(lineNumber);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._fontAnnotatedString.setAnnotations(AnnotationsUpdate.create(fontTokenAnnotations));\n\t\t\tthis._onDidChangeLineHeight.fire(affectedLineHeights);\n\t\t\tthis._onDidChangeFont.fire(affectedLineFonts);\n\t\t}));\n\t}\n\n\tpublic handleDidChangeContent(change: IModelContentChangedEvent) {\n\t\tconst edits = offsetEditFromContentChanges(change.changes);\n\t\tconst deletedAnnotations = this._fontAnnotatedString.applyEdit(edits);\n\t\tif (deletedAnnotations.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\t/* We should fire line and font change events if decorations have been added or removed\n\t\t * No decorations are added on edit, but they can be removed */\n\t\tconst affectedLineHeights = new Set<LineHeightChangingDecoration>();\n\t\tconst affectedLineFonts = new Set<LineFontChangingDecoration>();\n\t\tfor (const deletedAnnotation of deletedAnnotations) {\n\t\t\tconst startPosition = this.textModel.getPositionAt(deletedAnnotation.range.start);\n\t\t\tconst lineNumber = startPosition.lineNumber;\n\t\t\tconst decorationId = deletedAnnotation.annotation.decorationId;\n\t\t\taffectedLineHeights.add(new LineHeightChangingDecoration(0, decorationId, lineNumber, null));\n\t\t\taffectedLineFonts.add(new LineFontChangingDecoration(0, decorationId, lineNumber));\n\t\t}\n\t\tthis._onDidChangeLineHeight.fire(affectedLineHeights);\n\t\tthis._onDidChangeFont.fire(affectedLineFonts);\n\t}\n\n\tpublic getDecorationsInRange(range: Range, ownerId?: number, filterOutValidation?: boolean, filterFontDecorations?: boolean, onlyMinimapDecorations?: boolean): IModelDecoration[] {\n\t\tconst startOffsetOfRange = this.textModel.getOffsetAt(range.getStartPosition());\n\t\tconst endOffsetOfRange = this.textModel.getOffsetAt(range.getEndPosition());\n\t\tconst annotations = this._fontAnnotatedString.getAnnotationsIntersecting(new OffsetRange(startOffsetOfRange, endOffsetOfRange));\n\n\t\tconst decorations: IModelDecoration[] = [];\n\t\tfor (const annotation of annotations) {\n\t\t\tconst anno = annotation.annotation;\n\t\t\tconst affectsFont = !!(anno.fontToken.fontFamily || anno.fontToken.fontSizeMultiplier);\n\t\t\tif (!(affectsFont && filterFontDecorations)) {\n\t\t\t\tconst annotationStartPosition = this.textModel.getPositionAt(annotation.range.start);\n\t\t\t\tconst annotationEndPosition = this.textModel.getPositionAt(annotation.range.endExclusive);\n\t\t\t\tconst range = Range.fromPositions(annotationStartPosition, annotationEndPosition);\n\t\t\t\tconst anno = annotation.annotation;\n\t\t\t\tconst className = classNameForFontTokenDecorations(anno.fontToken.fontFamily ?? '', anno.fontToken.fontSizeMultiplier ?? 0);\n\t\t\t\tconst id = anno.decorationId;\n\t\t\t\tdecorations.push({\n\t\t\t\t\tid: id,\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tdescription: 'FontOptionDecoration',\n\t\t\t\t\t\tinlineClassName: className,\n\t\t\t\t\t\tlineHeight: anno.fontToken.lineHeightMultiplier,\n\t\t\t\t\t\taffectsFont\n\t\t\t\t\t},\n\t\t\t\t\townerId: 0,\n\t\t\t\t\trange\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\treturn decorations;\n\t}\n\n\tpublic getAllDecorations(ownerId?: number, filterOutValidation?: boolean): IModelDecoration[] {\n\t\treturn this.getDecorationsInRange(\n\t\t\tnew Range(1, 1, this.textModel.getLineCount(), this.textModel.getLineMaxColumn(this.textModel.getLineCount())),\n\t\t\townerId,\n\t\t\tfilterOutValidation\n\t\t);\n\t}\n}\n"]}
|