monaco-editor 0.56.0-dev-20260120 → 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/dev/vs/basic-languages/monaco.contribution.js +18 -18
- package/dev/vs/{cssMode-DYAvCb0Q.js → cssMode-B0VkNrib.js} +1 -1
- package/dev/vs/editor/editor.main.css +34 -20
- package/dev/vs/editor/editor.main.js +1 -1
- package/dev/vs/{editor-V-thM4Kh.js → editor-CR18QzPP.js} +541 -177
- package/dev/vs/editor.js +1 -1
- package/dev/vs/{freemarker2-DNhaeW6n.js → freemarker2-Byr9HmH9.js} +1 -1
- package/dev/vs/{handlebars-B9XLHU9b.js → handlebars-BEVXeROF.js} +1 -1
- package/dev/vs/{html-CSZlVq5J.js → html-CetHjWIf.js} +1 -1
- package/dev/vs/{htmlMode-DkNCbjhM.js → htmlMode-BNKYUVNo.js} +1 -1
- package/dev/vs/{index-CuJyCoc4.js → index-g_7JbDIY.js} +1 -1
- package/dev/vs/index.js +1 -1
- package/dev/vs/{javascript-D1PoJUjx.js → javascript-BEgEU725.js} +1 -1
- package/dev/vs/{jsonMode-C84g5aG1.js → jsonMode-CT2UkfFE.js} +1 -1
- package/dev/vs/language/css/monaco.contribution.js +1 -1
- package/dev/vs/language/html/monaco.contribution.js +1 -1
- package/dev/vs/language/json/monaco.contribution.js +1 -1
- package/dev/vs/language/typescript/monaco.contribution.js +1 -1
- package/dev/vs/{liquid-BR1qAgSc.js → liquid-D-aiCb1P.js} +1 -1
- package/dev/vs/{lspLanguageFeatures-e8bPBYUK.js → lspLanguageFeatures-CE9Occyu.js} +1 -1
- package/dev/vs/{mdx-BLfAN-pP.js → mdx-DchJ8pbq.js} +1 -1
- package/dev/vs/{monaco.contribution-BpJCJ2aN.js → monaco.contribution-CHqb1dWh.js} +2 -2
- package/dev/vs/{monaco.contribution-BoVCpaaV.js → monaco.contribution-CVBrIlxn.js} +2 -2
- package/dev/vs/{monaco.contribution-Ccg01HGd.js → monaco.contribution-CZxuzvA9.js} +2 -2
- package/dev/vs/{monaco.contribution-ehavOHIf.js → monaco.contribution-Cw4OdERZ.js} +2 -2
- package/dev/vs/nls/lang/cs.js +1 -1
- package/dev/vs/nls/lang/de.js +1 -1
- package/dev/vs/nls/lang/es.js +1 -1
- package/dev/vs/nls/lang/fr.js +1 -1
- package/dev/vs/nls/lang/it.js +1 -1
- package/dev/vs/nls/lang/ja.js +1 -1
- package/dev/vs/nls/lang/ko.js +1 -1
- package/dev/vs/nls/lang/pl.js +1 -1
- package/dev/vs/nls/lang/pt-br.js +1 -1
- package/dev/vs/nls/lang/ru.js +1 -1
- package/dev/vs/nls/lang/tr.js +1 -1
- package/dev/vs/nls/lang/zh-cn.js +1 -1
- package/dev/vs/nls/lang/zh-tw.js +1 -1
- package/dev/vs/{python-sycHAgxs.js → python-BCOSaCC8.js} +1 -1
- package/dev/vs/{razor-B62R6Lsx.js → razor-BM2tZCwj.js} +1 -1
- package/dev/vs/{toggleHighContrast-3bUMPAmT.js → toggleHighContrast-CLgtrrIB.js} +141 -310
- package/dev/vs/{tsMode-Co79Xo5K.js → tsMode-jpkv3SbL.js} +1 -1
- package/dev/vs/{typescript-_1BH4dlp.js → typescript-f8pt88eA.js} +1 -1
- package/dev/vs/{workers-BGdHt1rb.js → workers-zrUx_2Gw.js} +1 -1
- package/dev/vs/{xml-Cqh8dVgY.js → xml-CmSjtiR0.js} +1 -1
- package/dev/vs/{yaml-D6-bhWv5.js → yaml-PRriLGdw.js} +1 -1
- package/esm/vs/base/browser/markdownRenderer.js +1 -0
- package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js +81 -35
- package/esm/vs/editor/browser/controller/editContext/editContext.js +11 -0
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js +39 -32
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +5 -16
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.js +39 -16
- package/esm/vs/editor/browser/dataTransfer.js +1 -1
- package/esm/vs/editor/browser/view.js +21 -1
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +18 -0
- package/esm/vs/editor/common/model/bracketPairsTextModelPart/colorizedBracketPairsDecorationProvider.js +3 -3
- package/esm/vs/editor/common/model/textModel.js +4 -4
- package/esm/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.js +20 -16
- package/esm/vs/editor/common/viewModel/viewModelDecorations.js +11 -4
- package/esm/vs/editor/common/viewModel/viewModelImpl.js +25 -14
- package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +3 -3
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +28 -64
- package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.css +27 -20
- package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.js +37 -9
- 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/inlineSuggestionsView.js +1 -0
- package/esm/vs/editor/editor.api.d.ts +5 -1
- package/esm/vs/nls/lang/cs.js +1 -1
- package/esm/vs/nls/lang/de.js +1 -1
- package/esm/vs/nls/lang/es.js +1 -1
- package/esm/vs/nls/lang/fr.js +1 -1
- package/esm/vs/nls/lang/it.js +1 -1
- package/esm/vs/nls/lang/ja.js +1 -1
- package/esm/vs/nls/lang/ko.js +1 -1
- package/esm/vs/nls/lang/pl.js +1 -1
- package/esm/vs/nls/lang/pt-br.js +1 -1
- package/esm/vs/nls/lang/ru.js +1 -1
- package/esm/vs/nls/lang/tr.js +1 -1
- package/esm/vs/nls/lang/zh-cn.js +1 -1
- package/esm/vs/nls/lang/zh-tw.js +1 -1
- package/esm/vs/platform/actionWidget/browser/actionList.js +46 -6
- package/esm/vs/platform/actionWidget/browser/actionWidget.js +9 -2
- package/min/vs/basic-languages/monaco.contribution.js +1 -1
- package/min/vs/{cssMode-C9eBIuJR.js → cssMode-CheCY05R.js} +1 -1
- package/min/vs/editor/editor.main.css +1 -1
- package/min/vs/editor/editor.main.js +1 -1
- package/min/vs/{editor-Ch74nR58.js → editor-DxYWA3-X.js} +112 -110
- package/min/vs/editor.js +1 -1
- package/min/vs/{freemarker2-sjIgVc3I.js → freemarker2-C7J7V1Hp.js} +1 -1
- package/min/vs/{handlebars-IDPYJ5Bq.js → handlebars-DsCar5Ix.js} +1 -1
- package/min/vs/{html-DfUrEqvV.js → html-BGLIaUZV.js} +1 -1
- package/min/vs/{htmlMode-Dg0zLT1w.js → htmlMode-BB6WOoy3.js} +1 -1
- package/min/vs/{index-D6TJnMd3.js → index-BdR0nSqf.js} +1 -1
- package/min/vs/index.js +1 -1
- package/min/vs/{javascript-BpnRo0yM.js → javascript-CXE3i1eX.js} +1 -1
- package/min/vs/{jsonMode-DtUQxAtK.js → jsonMode-rtaE9alu.js} +1 -1
- package/min/vs/language/css/monaco.contribution.js +1 -1
- package/min/vs/language/html/monaco.contribution.js +1 -1
- package/min/vs/language/json/monaco.contribution.js +1 -1
- package/min/vs/language/typescript/monaco.contribution.js +1 -1
- package/min/vs/{liquid-Bpv368IV.js → liquid-CEdn0ovR.js} +1 -1
- package/min/vs/{lspLanguageFeatures-C0Mzq6q_.js → lspLanguageFeatures-CRAjJmzF.js} +1 -1
- package/min/vs/{mdx-CT-XRvYr.js → mdx-DLDMIqnu.js} +1 -1
- package/min/vs/{monaco.contribution-tn0sN6iU.js → monaco.contribution-BrRAk-VA.js} +1 -1
- package/min/vs/{monaco.contribution-B6pVhtM0.js → monaco.contribution-C67XgReK.js} +1 -1
- package/min/vs/{monaco.contribution-ZmSpiAe2.js → monaco.contribution-CYT-Sx3l.js} +1 -1
- package/min/vs/{monaco.contribution-Bp7k_fZE.js → monaco.contribution-DjiQkKLa.js} +1 -1
- package/min/vs/nls/lang/cs.js +1 -1
- package/min/vs/nls/lang/de.js +1 -1
- package/min/vs/nls/lang/es.js +1 -1
- package/min/vs/nls/lang/fr.js +1 -1
- package/min/vs/nls/lang/it.js +1 -1
- package/min/vs/nls/lang/ja.js +1 -1
- package/min/vs/nls/lang/ko.js +1 -1
- package/min/vs/nls/lang/pl.js +1 -1
- package/min/vs/nls/lang/pt-br.js +1 -1
- package/min/vs/nls/lang/ru.js +1 -1
- package/min/vs/nls/lang/tr.js +1 -1
- package/min/vs/nls/lang/zh-cn.js +1 -1
- package/min/vs/nls/lang/zh-tw.js +1 -1
- package/min/vs/{python-CdDzXJRR.js → python-CKbl_I3e.js} +1 -1
- package/min/vs/{razor-oKyioz5n.js → razor--RjiPxbd.js} +1 -1
- package/min/vs/{toggleHighContrast-CKdnSOZR.js → toggleHighContrast-BKDMxisH.js} +30 -32
- package/min/vs/{tsMode-cB-UHsG6.js → tsMode-C48d5M22.js} +1 -1
- package/min/vs/{typescript-B8RK7Scz.js → typescript-e7oUhPyX.js} +1 -1
- package/min/vs/{workers-DYaZhUMn.js → workers-CtpYUoCo.js} +1 -1
- package/min/vs/{xml-DvqAg4in.js → xml-tOyfgws7.js} +1 -1
- package/min/vs/{yaml-KLiQ2nzu.js → yaml-Cmf9NYDf.js} +1 -1
- package/monaco.d.ts +5 -1
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
define("vs/toggleHighContrast-
|
|
1
|
+
define("vs/toggleHighContrast-CLgtrrIB", ["./editorWorkerHost--0eDLpc-", "./editor-CR18QzPP"], (function(editorWorkerHost, editor) {
|
|
2
2
|
"use strict";
|
|
3
3
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va;
|
|
4
4
|
class ToggleCollapseUnchangedRegions extends editor.Action2 {
|
|
@@ -932,125 +932,6 @@ define("vs/toggleHighContrast-3bUMPAmT", ["./editorWorkerHost--0eDLpc-", "./edit
|
|
|
932
932
|
}
|
|
933
933
|
}
|
|
934
934
|
editor.registerEditorAction(TransposeLettersAction);
|
|
935
|
-
function createStringDataTransferItem(stringOrPromise, id) {
|
|
936
|
-
return {
|
|
937
|
-
id,
|
|
938
|
-
asString: async () => stringOrPromise,
|
|
939
|
-
asFile: () => void 0,
|
|
940
|
-
value: typeof stringOrPromise === "string" ? stringOrPromise : void 0
|
|
941
|
-
};
|
|
942
|
-
}
|
|
943
|
-
function createFileDataTransferItem(fileName, uri, data, id) {
|
|
944
|
-
const file = { id: editor.generateUuid(), name: fileName, uri, data };
|
|
945
|
-
return {
|
|
946
|
-
id,
|
|
947
|
-
asString: async () => "",
|
|
948
|
-
asFile: () => file,
|
|
949
|
-
value: void 0
|
|
950
|
-
};
|
|
951
|
-
}
|
|
952
|
-
class VSDataTransfer {
|
|
953
|
-
constructor() {
|
|
954
|
-
this._entries = /* @__PURE__ */ new Map();
|
|
955
|
-
}
|
|
956
|
-
get size() {
|
|
957
|
-
let size = 0;
|
|
958
|
-
for (const _ of this._entries) {
|
|
959
|
-
size++;
|
|
960
|
-
}
|
|
961
|
-
return size;
|
|
962
|
-
}
|
|
963
|
-
has(mimeType) {
|
|
964
|
-
return this._entries.has(this.toKey(mimeType));
|
|
965
|
-
}
|
|
966
|
-
matches(pattern) {
|
|
967
|
-
const mimes = [...this._entries.keys()];
|
|
968
|
-
if (editorWorkerHost.Iterable.some(this, ([_, item]) => item.asFile())) {
|
|
969
|
-
mimes.push("files");
|
|
970
|
-
}
|
|
971
|
-
return matchesMimeType_normalized(normalizeMimeType(pattern), mimes);
|
|
972
|
-
}
|
|
973
|
-
get(mimeType) {
|
|
974
|
-
return this._entries.get(this.toKey(mimeType))?.[0];
|
|
975
|
-
}
|
|
976
|
-
/**
|
|
977
|
-
* Add a new entry to this data transfer.
|
|
978
|
-
*
|
|
979
|
-
* This does not replace existing entries for `mimeType`.
|
|
980
|
-
*/
|
|
981
|
-
append(mimeType, value) {
|
|
982
|
-
const existing = this._entries.get(mimeType);
|
|
983
|
-
if (existing) {
|
|
984
|
-
existing.push(value);
|
|
985
|
-
} else {
|
|
986
|
-
this._entries.set(this.toKey(mimeType), [value]);
|
|
987
|
-
}
|
|
988
|
-
}
|
|
989
|
-
/**
|
|
990
|
-
* Set the entry for a given mime type.
|
|
991
|
-
*
|
|
992
|
-
* This replaces all existing entries for `mimeType`.
|
|
993
|
-
*/
|
|
994
|
-
replace(mimeType, value) {
|
|
995
|
-
this._entries.set(this.toKey(mimeType), [value]);
|
|
996
|
-
}
|
|
997
|
-
/**
|
|
998
|
-
* Remove all entries for `mimeType`.
|
|
999
|
-
*/
|
|
1000
|
-
delete(mimeType) {
|
|
1001
|
-
this._entries.delete(this.toKey(mimeType));
|
|
1002
|
-
}
|
|
1003
|
-
/**
|
|
1004
|
-
* Iterate over all `[mime, item]` pairs in this data transfer.
|
|
1005
|
-
*
|
|
1006
|
-
* There may be multiple entries for each mime type.
|
|
1007
|
-
*/
|
|
1008
|
-
*[Symbol.iterator]() {
|
|
1009
|
-
for (const [mine, items] of this._entries) {
|
|
1010
|
-
for (const item of items) {
|
|
1011
|
-
yield [mine, item];
|
|
1012
|
-
}
|
|
1013
|
-
}
|
|
1014
|
-
}
|
|
1015
|
-
toKey(mimeType) {
|
|
1016
|
-
return normalizeMimeType(mimeType);
|
|
1017
|
-
}
|
|
1018
|
-
}
|
|
1019
|
-
function normalizeMimeType(mimeType) {
|
|
1020
|
-
return mimeType.toLowerCase();
|
|
1021
|
-
}
|
|
1022
|
-
function matchesMimeType(pattern, mimeTypes) {
|
|
1023
|
-
return matchesMimeType_normalized(normalizeMimeType(pattern), mimeTypes.map(normalizeMimeType));
|
|
1024
|
-
}
|
|
1025
|
-
function matchesMimeType_normalized(normalizedPattern, normalizedMimeTypes) {
|
|
1026
|
-
if (normalizedPattern === "*/*") {
|
|
1027
|
-
return normalizedMimeTypes.length > 0;
|
|
1028
|
-
}
|
|
1029
|
-
if (normalizedMimeTypes.includes(normalizedPattern)) {
|
|
1030
|
-
return true;
|
|
1031
|
-
}
|
|
1032
|
-
const wildcard = normalizedPattern.match(/^([a-z]+)\/([a-z]+|\*)$/i);
|
|
1033
|
-
if (!wildcard) {
|
|
1034
|
-
return false;
|
|
1035
|
-
}
|
|
1036
|
-
const [_, type, subtype] = wildcard;
|
|
1037
|
-
if (subtype === "*") {
|
|
1038
|
-
return normalizedMimeTypes.some((mime) => mime.startsWith(type + "/"));
|
|
1039
|
-
}
|
|
1040
|
-
return false;
|
|
1041
|
-
}
|
|
1042
|
-
const UriList = Object.freeze({
|
|
1043
|
-
// http://amundsen.com/hypermedia/urilist/
|
|
1044
|
-
create: (entries) => {
|
|
1045
|
-
return editorWorkerHost.distinct(entries.map((x) => x.toString())).join("\r\n");
|
|
1046
|
-
},
|
|
1047
|
-
split: (str) => {
|
|
1048
|
-
return str.split("\r\n");
|
|
1049
|
-
},
|
|
1050
|
-
parse: (str) => {
|
|
1051
|
-
return UriList.split(str).filter((value) => !value.startsWith("#"));
|
|
1052
|
-
}
|
|
1053
|
-
});
|
|
1054
935
|
const _HierarchicalKind = class _HierarchicalKind {
|
|
1055
936
|
constructor(value) {
|
|
1056
937
|
this.value = value;
|
|
@@ -1072,101 +953,6 @@ define("vs/toggleHighContrast-3bUMPAmT", ["./editorWorkerHost--0eDLpc-", "./edit
|
|
|
1072
953
|
_HierarchicalKind.None = new _HierarchicalKind("@@none@@");
|
|
1073
954
|
_HierarchicalKind.Empty = new _HierarchicalKind("");
|
|
1074
955
|
let HierarchicalKind = _HierarchicalKind;
|
|
1075
|
-
const CodeDataTransfers = {
|
|
1076
|
-
EDITORS: "CodeEditors",
|
|
1077
|
-
FILES: "CodeFiles"
|
|
1078
|
-
};
|
|
1079
|
-
class DragAndDropContributionRegistry {
|
|
1080
|
-
}
|
|
1081
|
-
const Extensions = {
|
|
1082
|
-
DragAndDropContribution: "workbench.contributions.dragAndDrop"
|
|
1083
|
-
};
|
|
1084
|
-
editor.Registry.add(Extensions.DragAndDropContribution, new DragAndDropContributionRegistry());
|
|
1085
|
-
const _LocalSelectionTransfer = class _LocalSelectionTransfer {
|
|
1086
|
-
constructor() {
|
|
1087
|
-
}
|
|
1088
|
-
static getInstance() {
|
|
1089
|
-
return _LocalSelectionTransfer.INSTANCE;
|
|
1090
|
-
}
|
|
1091
|
-
hasData(proto) {
|
|
1092
|
-
return proto && proto === this.proto;
|
|
1093
|
-
}
|
|
1094
|
-
getData(proto) {
|
|
1095
|
-
if (this.hasData(proto)) {
|
|
1096
|
-
return this.data;
|
|
1097
|
-
}
|
|
1098
|
-
return void 0;
|
|
1099
|
-
}
|
|
1100
|
-
};
|
|
1101
|
-
_LocalSelectionTransfer.INSTANCE = new _LocalSelectionTransfer();
|
|
1102
|
-
let LocalSelectionTransfer = _LocalSelectionTransfer;
|
|
1103
|
-
function getPathForFile(file) {
|
|
1104
|
-
if (editorWorkerHost.isNative && typeof globalThis.vscode?.webUtils?.getPathForFile === "function") {
|
|
1105
|
-
return globalThis.vscode?.webUtils?.getPathForFile(file);
|
|
1106
|
-
}
|
|
1107
|
-
return void 0;
|
|
1108
|
-
}
|
|
1109
|
-
function toVSDataTransfer(dataTransfer) {
|
|
1110
|
-
const vsDataTransfer = new VSDataTransfer();
|
|
1111
|
-
for (const item of dataTransfer.items) {
|
|
1112
|
-
const type = item.type;
|
|
1113
|
-
if (item.kind === "string") {
|
|
1114
|
-
const asStringValue = new Promise((resolve) => item.getAsString(resolve));
|
|
1115
|
-
vsDataTransfer.append(type, createStringDataTransferItem(asStringValue));
|
|
1116
|
-
} else if (item.kind === "file") {
|
|
1117
|
-
const file = item.getAsFile();
|
|
1118
|
-
if (file) {
|
|
1119
|
-
vsDataTransfer.append(type, createFileDataTransferItemFromFile(file));
|
|
1120
|
-
}
|
|
1121
|
-
}
|
|
1122
|
-
}
|
|
1123
|
-
return vsDataTransfer;
|
|
1124
|
-
}
|
|
1125
|
-
function createFileDataTransferItemFromFile(file) {
|
|
1126
|
-
const path = getPathForFile(file);
|
|
1127
|
-
const uri = path ? editorWorkerHost.URI.parse(path) : void 0;
|
|
1128
|
-
return createFileDataTransferItem(file.name, uri, async () => {
|
|
1129
|
-
return new Uint8Array(await file.arrayBuffer());
|
|
1130
|
-
});
|
|
1131
|
-
}
|
|
1132
|
-
const INTERNAL_DND_MIME_TYPES = Object.freeze([
|
|
1133
|
-
CodeDataTransfers.EDITORS,
|
|
1134
|
-
CodeDataTransfers.FILES,
|
|
1135
|
-
editor.DataTransfers.RESOURCES,
|
|
1136
|
-
editor.DataTransfers.INTERNAL_URI_LIST
|
|
1137
|
-
]);
|
|
1138
|
-
function toExternalVSDataTransfer(sourceDataTransfer, overwriteUriList = false) {
|
|
1139
|
-
const vsDataTransfer = toVSDataTransfer(sourceDataTransfer);
|
|
1140
|
-
const uriList = vsDataTransfer.get(editor.DataTransfers.INTERNAL_URI_LIST);
|
|
1141
|
-
if (uriList) {
|
|
1142
|
-
vsDataTransfer.replace(editor.Mimes.uriList, uriList);
|
|
1143
|
-
} else {
|
|
1144
|
-
if (overwriteUriList || !vsDataTransfer.has(editor.Mimes.uriList)) {
|
|
1145
|
-
const editorData = [];
|
|
1146
|
-
for (const item of sourceDataTransfer.items) {
|
|
1147
|
-
const file = item.getAsFile();
|
|
1148
|
-
if (file) {
|
|
1149
|
-
const path = getPathForFile(file);
|
|
1150
|
-
try {
|
|
1151
|
-
if (path) {
|
|
1152
|
-
editorData.push(editorWorkerHost.URI.file(path).toString());
|
|
1153
|
-
} else {
|
|
1154
|
-
editorData.push(editorWorkerHost.URI.parse(file.name, true).toString());
|
|
1155
|
-
}
|
|
1156
|
-
} catch {
|
|
1157
|
-
}
|
|
1158
|
-
}
|
|
1159
|
-
}
|
|
1160
|
-
if (editorData.length) {
|
|
1161
|
-
vsDataTransfer.replace(editor.Mimes.uriList, createStringDataTransferItem(UriList.create(editorData)));
|
|
1162
|
-
}
|
|
1163
|
-
}
|
|
1164
|
-
}
|
|
1165
|
-
for (const internal of INTERNAL_DND_MIME_TYPES) {
|
|
1166
|
-
vsDataTransfer.delete(internal);
|
|
1167
|
-
}
|
|
1168
|
-
return vsDataTransfer;
|
|
1169
|
-
}
|
|
1170
956
|
var __decorate$1V = function(decorators, target, key, desc) {
|
|
1171
957
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1172
958
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1640,7 +1426,7 @@ define("vs/toggleHighContrast-3bUMPAmT", ["./editorWorkerHost--0eDLpc-", "./edit
|
|
|
1640
1426
|
}
|
|
1641
1427
|
const strUriList = await urlListEntry.asString();
|
|
1642
1428
|
const entries = [];
|
|
1643
|
-
for (const entry of UriList.parse(strUriList)) {
|
|
1429
|
+
for (const entry of editor.UriList.parse(strUriList)) {
|
|
1644
1430
|
try {
|
|
1645
1431
|
entries.push({ uri: editorWorkerHost.URI.parse(entry), originalText: entry });
|
|
1646
1432
|
} catch {
|
|
@@ -2827,6 +2613,8 @@ define("vs/toggleHighContrast-3bUMPAmT", ["./editorWorkerHost--0eDLpc-", "./edit
|
|
|
2827
2613
|
data.container.title = element.tooltip;
|
|
2828
2614
|
} else if (element.disabled) {
|
|
2829
2615
|
data.container.title = element.label;
|
|
2616
|
+
} else if (element.hover?.content) {
|
|
2617
|
+
data.container.title = "";
|
|
2830
2618
|
} else if (actionTitle && previewTitle) {
|
|
2831
2619
|
if (this._supportsPreview && element.canPreview) {
|
|
2832
2620
|
data.container.title = editorWorkerHost.localize(1668, "{0} to Apply, {1} to Preview", actionTitle, previewTitle);
|
|
@@ -2861,16 +2649,18 @@ define("vs/toggleHighContrast-3bUMPAmT", ["./editorWorkerHost--0eDLpc-", "./edit
|
|
|
2861
2649
|
return void 0;
|
|
2862
2650
|
}
|
|
2863
2651
|
let ActionList = class ActionList extends editorWorkerHost.Disposable {
|
|
2864
|
-
constructor(user, preview, items, _delegate, accessibilityProvider, _contextViewService, _keybindingService, _layoutService) {
|
|
2652
|
+
constructor(user, preview, items, _delegate, accessibilityProvider, _contextViewService, _keybindingService, _layoutService, _hoverService) {
|
|
2865
2653
|
super();
|
|
2866
2654
|
this._delegate = _delegate;
|
|
2867
2655
|
this._contextViewService = _contextViewService;
|
|
2868
2656
|
this._keybindingService = _keybindingService;
|
|
2869
2657
|
this._layoutService = _layoutService;
|
|
2658
|
+
this._hoverService = _hoverService;
|
|
2870
2659
|
this._actionLineHeight = 28;
|
|
2871
2660
|
this._headerLineHeight = 28;
|
|
2872
2661
|
this._separatorLineHeight = 8;
|
|
2873
2662
|
this.cts = this._register(new editorWorkerHost.CancellationTokenSource());
|
|
2663
|
+
this._hover = this._register(new editorWorkerHost.MutableDisposable());
|
|
2874
2664
|
this.domNode = document.createElement("div");
|
|
2875
2665
|
this.domNode.classList.add("actionList");
|
|
2876
2666
|
const virtualDelegate = {
|
|
@@ -2940,6 +2730,7 @@ define("vs/toggleHighContrast-3bUMPAmT", ["./editorWorkerHost--0eDLpc-", "./edit
|
|
|
2940
2730
|
hide(didCancel) {
|
|
2941
2731
|
this._delegate.onHide(didCancel);
|
|
2942
2732
|
this.cts.cancel();
|
|
2733
|
+
this._hover.clear();
|
|
2943
2734
|
this._contextViewService.hideContextView();
|
|
2944
2735
|
}
|
|
2945
2736
|
layout(minWidth) {
|
|
@@ -2954,7 +2745,7 @@ define("vs/toggleHighContrast-3bUMPAmT", ["./editorWorkerHost--0eDLpc-", "./edit
|
|
|
2954
2745
|
maxWidth = 380;
|
|
2955
2746
|
} else {
|
|
2956
2747
|
const itemWidths = this._allMenuItems.map((_, index) => {
|
|
2957
|
-
const element = this.
|
|
2748
|
+
const element = this._getRowElement(index);
|
|
2958
2749
|
if (element) {
|
|
2959
2750
|
element.style.width = "auto";
|
|
2960
2751
|
const width = element.getBoundingClientRect().width;
|
|
@@ -3010,6 +2801,32 @@ define("vs/toggleHighContrast-3bUMPAmT", ["./editorWorkerHost--0eDLpc-", "./edit
|
|
|
3010
2801
|
const focusIndex = focused[0];
|
|
3011
2802
|
const element = this._list.element(focusIndex);
|
|
3012
2803
|
this._delegate.onFocus?.(element.item);
|
|
2804
|
+
this._showHoverForElement(element, focusIndex);
|
|
2805
|
+
}
|
|
2806
|
+
_getRowElement(index) {
|
|
2807
|
+
return this.domNode.ownerDocument.getElementById(this._list.getElementID(index));
|
|
2808
|
+
}
|
|
2809
|
+
_showHoverForElement(element, index) {
|
|
2810
|
+
let newHover;
|
|
2811
|
+
if (element.hover?.content && this.focusCondition(element)) {
|
|
2812
|
+
const rowElement = this._getRowElement(index);
|
|
2813
|
+
if (rowElement) {
|
|
2814
|
+
const markdown = element.hover.content ? new editor.MarkdownString(element.hover.content) : void 0;
|
|
2815
|
+
newHover = this._hoverService.showDelayedHover({
|
|
2816
|
+
content: markdown ?? "",
|
|
2817
|
+
target: rowElement,
|
|
2818
|
+
additionalClasses: ["action-widget-hover"],
|
|
2819
|
+
position: {
|
|
2820
|
+
hoverPosition: 0,
|
|
2821
|
+
forcePosition: false
|
|
2822
|
+
},
|
|
2823
|
+
appearance: {
|
|
2824
|
+
showPointer: true
|
|
2825
|
+
}
|
|
2826
|
+
}, { groupId: `actionListHover` });
|
|
2827
|
+
}
|
|
2828
|
+
}
|
|
2829
|
+
this._hover.value = newHover;
|
|
3013
2830
|
}
|
|
3014
2831
|
async onListHover(e) {
|
|
3015
2832
|
const element = e.element;
|
|
@@ -3021,8 +2838,8 @@ define("vs/toggleHighContrast-3bUMPAmT", ["./editorWorkerHost--0eDLpc-", "./edit
|
|
|
3021
2838
|
if (e.index) {
|
|
3022
2839
|
this._list.splice(e.index, 1, [element]);
|
|
3023
2840
|
}
|
|
2841
|
+
this._list.setFocus(typeof e.index === "number" ? [e.index] : []);
|
|
3024
2842
|
}
|
|
3025
|
-
this._list.setFocus(typeof e.index === "number" ? [e.index] : []);
|
|
3026
2843
|
}
|
|
3027
2844
|
onListClick(e) {
|
|
3028
2845
|
if (e.element && this.focusCondition(e.element)) {
|
|
@@ -3033,7 +2850,8 @@ define("vs/toggleHighContrast-3bUMPAmT", ["./editorWorkerHost--0eDLpc-", "./edit
|
|
|
3033
2850
|
ActionList = __decorate$1S([
|
|
3034
2851
|
__param$1S(5, editor.IContextViewService),
|
|
3035
2852
|
__param$1S(6, editor.IKeybindingService),
|
|
3036
|
-
__param$1S(7, editor.ILayoutService)
|
|
2853
|
+
__param$1S(7, editor.ILayoutService),
|
|
2854
|
+
__param$1S(8, editor.IHoverService)
|
|
3037
2855
|
], ActionList);
|
|
3038
2856
|
function stripNewlines(str) {
|
|
3039
2857
|
return str.replace(/\r\n|\r|\n/g, " ");
|
|
@@ -3125,7 +2943,13 @@ define("vs/toggleHighContrast-3bUMPAmT", ["./editorWorkerHost--0eDLpc-", "./edit
|
|
|
3125
2943
|
const width = this._list.value?.layout(actionBarWidth);
|
|
3126
2944
|
widget.style.width = `${width}px`;
|
|
3127
2945
|
const focusTracker = renderDisposables.add(editor.trackFocus(element));
|
|
3128
|
-
renderDisposables.add(focusTracker.onDidBlur(() =>
|
|
2946
|
+
renderDisposables.add(focusTracker.onDidBlur(() => {
|
|
2947
|
+
const activeElement = editor.getActiveElement();
|
|
2948
|
+
if (activeElement?.closest(".action-widget-hover")) {
|
|
2949
|
+
return;
|
|
2950
|
+
}
|
|
2951
|
+
this.hide(true);
|
|
2952
|
+
}));
|
|
3129
2953
|
return renderDisposables;
|
|
3130
2954
|
}
|
|
3131
2955
|
_createActionBar(className, actions) {
|
|
@@ -3486,7 +3310,7 @@ define("vs/toggleHighContrast-3bUMPAmT", ["./editorWorkerHost--0eDLpc-", "./edit
|
|
|
3486
3310
|
static get(editor2) {
|
|
3487
3311
|
return editor2.getContribution(CopyPasteController_1.ID);
|
|
3488
3312
|
}
|
|
3489
|
-
constructor(
|
|
3313
|
+
constructor(editor2, instantiationService, _logService, _bulkEditService, _clipboardService, _commandService, _configService, _languageFeaturesService, _quickInputService, _progressService) {
|
|
3490
3314
|
super();
|
|
3491
3315
|
this._logService = _logService;
|
|
3492
3316
|
this._bulkEditService = _bulkEditService;
|
|
@@ -3496,13 +3320,12 @@ define("vs/toggleHighContrast-3bUMPAmT", ["./editorWorkerHost--0eDLpc-", "./edit
|
|
|
3496
3320
|
this._languageFeaturesService = _languageFeaturesService;
|
|
3497
3321
|
this._quickInputService = _quickInputService;
|
|
3498
3322
|
this._progressService = _progressService;
|
|
3499
|
-
this._editor =
|
|
3500
|
-
|
|
3501
|
-
this._register(
|
|
3502
|
-
this._register(
|
|
3503
|
-
this._register(
|
|
3504
|
-
this.
|
|
3505
|
-
this._postPasteWidgetManager = this._register(instantiationService.createInstance(PostEditWidgetManager, "pasteIntoEditor", editor$1, pasteWidgetVisibleCtx, { id: changePasteTypeCommandId, label: editorWorkerHost.localize(927, "Show paste options...") }, () => CopyPasteController_1._configureDefaultAction ? [CopyPasteController_1._configureDefaultAction] : []));
|
|
3323
|
+
this._editor = editor2;
|
|
3324
|
+
this._register(editor2.onWillCopy((e) => this.handleCopy(e)));
|
|
3325
|
+
this._register(editor2.onWillCut((e) => this.handleCopy(e)));
|
|
3326
|
+
this._register(editor2.onWillPaste((e) => this.handlePaste(e)));
|
|
3327
|
+
this._pasteProgressManager = this._register(new InlineProgressManager("pasteIntoEditor", editor2, instantiationService));
|
|
3328
|
+
this._postPasteWidgetManager = this._register(instantiationService.createInstance(PostEditWidgetManager, "pasteIntoEditor", editor2, pasteWidgetVisibleCtx, { id: changePasteTypeCommandId, label: editorWorkerHost.localize(927, "Show paste options...") }, () => CopyPasteController_1._configureDefaultAction ? [CopyPasteController_1._configureDefaultAction] : []));
|
|
3506
3329
|
}
|
|
3507
3330
|
changePasteType() {
|
|
3508
3331
|
this._postPasteWidgetManager.tryShowSelector();
|
|
@@ -3531,44 +3354,23 @@ define("vs/toggleHighContrast-3bUMPAmT", ["./editorWorkerHost--0eDLpc-", "./edit
|
|
|
3531
3354
|
await this._currentPasteOperation;
|
|
3532
3355
|
}
|
|
3533
3356
|
handleCopy(e) {
|
|
3534
|
-
|
|
3535
|
-
if (e.clipboardData) {
|
|
3536
|
-
const [text, metadata] = editor.ClipboardEventUtils.getTextData(e.clipboardData);
|
|
3537
|
-
const storedMetadata = metadata || editor.InMemoryClipboardMetadataManager.INSTANCE.get(text);
|
|
3538
|
-
id = storedMetadata?.id || null;
|
|
3539
|
-
this._logService.trace("CopyPasteController#handleCopy for id : ", id, " with text.length : ", text.length);
|
|
3540
|
-
} else {
|
|
3541
|
-
this._logService.trace("CopyPasteController#handleCopy");
|
|
3542
|
-
}
|
|
3357
|
+
this._logService.trace("CopyPasteController#handleCopy");
|
|
3543
3358
|
if (!this._editor.hasTextFocus()) {
|
|
3544
3359
|
return;
|
|
3545
3360
|
}
|
|
3546
3361
|
this._clipboardService.clearInternalState?.();
|
|
3547
|
-
if (!
|
|
3362
|
+
if (!this.isPasteAsEnabled()) {
|
|
3548
3363
|
return;
|
|
3549
3364
|
}
|
|
3550
3365
|
const model = this._editor.getModel();
|
|
3366
|
+
const viewModel = this._editor._getViewModel();
|
|
3551
3367
|
const selections = this._editor.getSelections();
|
|
3552
|
-
if (!model || !selections?.length) {
|
|
3368
|
+
if (!model || !viewModel || !selections?.length) {
|
|
3553
3369
|
return;
|
|
3554
3370
|
}
|
|
3555
|
-
const enableEmptySelectionClipboard = this._editor.getOption(
|
|
3556
|
-
45
|
|
3557
|
-
/* EditorOption.emptySelectionClipboard */
|
|
3558
|
-
);
|
|
3559
|
-
let ranges = selections;
|
|
3560
|
-
const wasFromEmptySelection = selections.length === 1 && selections[0].isEmpty();
|
|
3561
|
-
if (wasFromEmptySelection) {
|
|
3562
|
-
if (!enableEmptySelectionClipboard) {
|
|
3563
|
-
return;
|
|
3564
|
-
}
|
|
3565
|
-
ranges = [new editorWorkerHost.Range(ranges[0].startLineNumber, 1, ranges[0].startLineNumber, 1 + model.getLineLength(ranges[0].startLineNumber))];
|
|
3566
|
-
}
|
|
3567
|
-
const toCopy = this._editor._getViewModel()?.getPlainTextToCopy(selections, enableEmptySelectionClipboard, editorWorkerHost.isWindows);
|
|
3568
|
-
const multicursorText = Array.isArray(toCopy) ? toCopy : null;
|
|
3569
3371
|
const defaultPastePayload = {
|
|
3570
|
-
multicursorText,
|
|
3571
|
-
pasteOnNewLine:
|
|
3372
|
+
multicursorText: e.dataToCopy.multicursorText ?? null,
|
|
3373
|
+
pasteOnNewLine: e.dataToCopy.isFromEmptySelection,
|
|
3572
3374
|
mode: null
|
|
3573
3375
|
};
|
|
3574
3376
|
const providers = this._languageFeaturesService.documentPasteEditProvider.ordered(model).filter((x) => !!x.prepareDocumentPaste);
|
|
@@ -3576,9 +3378,9 @@ define("vs/toggleHighContrast-3bUMPAmT", ["./editorWorkerHost--0eDLpc-", "./edit
|
|
|
3576
3378
|
this.setCopyMetadata(e.clipboardData, { defaultPastePayload });
|
|
3577
3379
|
return;
|
|
3578
3380
|
}
|
|
3579
|
-
const dataTransfer =
|
|
3381
|
+
const dataTransfer = new editor.VSDataTransfer();
|
|
3580
3382
|
const providerCopyMimeTypes = providers.flatMap((x) => x.copyMimeTypes ?? []);
|
|
3581
|
-
const handle =
|
|
3383
|
+
const handle = editor.generateUuid();
|
|
3582
3384
|
this.setCopyMetadata(e.clipboardData, {
|
|
3583
3385
|
id: handle,
|
|
3584
3386
|
providerCopyMimeTypes,
|
|
@@ -3587,7 +3389,7 @@ define("vs/toggleHighContrast-3bUMPAmT", ["./editorWorkerHost--0eDLpc-", "./edit
|
|
|
3587
3389
|
const operations = providers.map((provider) => {
|
|
3588
3390
|
return {
|
|
3589
3391
|
providerMimeTypes: provider.copyMimeTypes,
|
|
3590
|
-
operation: editorWorkerHost.createCancelablePromise((token) => provider.prepareDocumentPaste(model,
|
|
3392
|
+
operation: editorWorkerHost.createCancelablePromise((token) => provider.prepareDocumentPaste(model, e.dataToCopy.sourceRanges, dataTransfer, token).catch((err) => {
|
|
3591
3393
|
console.error(err);
|
|
3592
3394
|
return void 0;
|
|
3593
3395
|
}))
|
|
@@ -3597,16 +3399,15 @@ define("vs/toggleHighContrast-3bUMPAmT", ["./editorWorkerHost--0eDLpc-", "./edit
|
|
|
3597
3399
|
CopyPasteController_1._currentCopyOperation = { handle, operations };
|
|
3598
3400
|
}
|
|
3599
3401
|
async handlePaste(e) {
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
this._logService.trace("CopyPasteController#handlePaste for id : ", metadataComputed?.id);
|
|
3604
|
-
} else {
|
|
3605
|
-
this._logService.trace("CopyPasteController#handlePaste");
|
|
3402
|
+
this._logService.trace("CopyPasteController#handlePaste for id : ", e.metadata?.id);
|
|
3403
|
+
if (!this._editor.hasTextFocus()) {
|
|
3404
|
+
return;
|
|
3606
3405
|
}
|
|
3607
|
-
|
|
3406
|
+
const dataTransfer = e.toExternalVSDataTransfer();
|
|
3407
|
+
if (!dataTransfer) {
|
|
3608
3408
|
return;
|
|
3609
3409
|
}
|
|
3410
|
+
dataTransfer.delete(vscodeClipboardMime);
|
|
3610
3411
|
MessageController.get(this._editor)?.closeMessage();
|
|
3611
3412
|
this._currentPasteOperation?.cancel();
|
|
3612
3413
|
this._currentPasteOperation = void 0;
|
|
@@ -3623,8 +3424,6 @@ define("vs/toggleHighContrast-3bUMPAmT", ["./editorWorkerHost--0eDLpc-", "./edit
|
|
|
3623
3424
|
}
|
|
3624
3425
|
const metadata = this.fetchCopyMetadata(e);
|
|
3625
3426
|
this._logService.trace("CopyPasteController#handlePaste with metadata : ", metadata?.id, " and text.length : ", e.clipboardData.getData("text/plain").length);
|
|
3626
|
-
const dataTransfer = toExternalVSDataTransfer(e.clipboardData);
|
|
3627
|
-
dataTransfer.delete(vscodeClipboardMime);
|
|
3628
3427
|
const fileTypes = Array.from(e.clipboardData.files).map((file) => file.type);
|
|
3629
3428
|
const allPotentialMimeTypes = [
|
|
3630
3429
|
...e.clipboardData.types,
|
|
@@ -3642,22 +3441,20 @@ define("vs/toggleHighContrast-3bUMPAmT", ["./editorWorkerHost--0eDLpc-", "./edit
|
|
|
3642
3441
|
return false;
|
|
3643
3442
|
}
|
|
3644
3443
|
}
|
|
3645
|
-
return provider.pasteMimeTypes?.some((type) => matchesMimeType(type, allPotentialMimeTypes));
|
|
3444
|
+
return provider.pasteMimeTypes?.some((type) => editor.matchesMimeType(type, allPotentialMimeTypes));
|
|
3646
3445
|
});
|
|
3647
3446
|
if (!allProviders.length) {
|
|
3648
3447
|
if (this._pasteAsActionContext?.preferred) {
|
|
3649
3448
|
this.showPasteAsNoEditMessage(selections, this._pasteAsActionContext.preferred);
|
|
3650
|
-
e.
|
|
3651
|
-
e.stopImmediatePropagation();
|
|
3449
|
+
e.setHandled();
|
|
3652
3450
|
}
|
|
3653
3451
|
return;
|
|
3654
3452
|
}
|
|
3655
|
-
e.
|
|
3656
|
-
e.stopImmediatePropagation();
|
|
3453
|
+
e.setHandled();
|
|
3657
3454
|
if (this._pasteAsActionContext) {
|
|
3658
3455
|
this.showPasteAsPick(this._pasteAsActionContext.preferred, allProviders, selections, dataTransfer, metadata);
|
|
3659
3456
|
} else {
|
|
3660
|
-
this.doPasteInline(allProviders, selections, dataTransfer, metadata, e);
|
|
3457
|
+
this.doPasteInline(allProviders, selections, dataTransfer, metadata, e.browserEvent);
|
|
3661
3458
|
}
|
|
3662
3459
|
}
|
|
3663
3460
|
showPasteAsNoEditMessage(selections, preference) {
|
|
@@ -3838,15 +3635,12 @@ define("vs/toggleHighContrast-3bUMPAmT", ["./editorWorkerHost--0eDLpc-", "./edit
|
|
|
3838
3635
|
title: editorWorkerHost.localize(934, "Running paste handlers")
|
|
3839
3636
|
}, () => p);
|
|
3840
3637
|
}
|
|
3841
|
-
setCopyMetadata(
|
|
3638
|
+
setCopyMetadata(clipboardData, metadata) {
|
|
3842
3639
|
this._logService.trace("CopyPasteController#setCopyMetadata new id : ", metadata.id);
|
|
3843
|
-
|
|
3640
|
+
clipboardData.setData(vscodeClipboardMime, JSON.stringify(metadata));
|
|
3844
3641
|
}
|
|
3845
3642
|
fetchCopyMetadata(e) {
|
|
3846
3643
|
this._logService.trace("CopyPasteController#fetchCopyMetadata");
|
|
3847
|
-
if (!e.clipboardData) {
|
|
3848
|
-
return;
|
|
3849
|
-
}
|
|
3850
3644
|
const rawMetadata = e.clipboardData.getData(vscodeClipboardMime);
|
|
3851
3645
|
if (rawMetadata) {
|
|
3852
3646
|
try {
|
|
@@ -3855,13 +3649,12 @@ define("vs/toggleHighContrast-3bUMPAmT", ["./editorWorkerHost--0eDLpc-", "./edit
|
|
|
3855
3649
|
return void 0;
|
|
3856
3650
|
}
|
|
3857
3651
|
}
|
|
3858
|
-
|
|
3859
|
-
if (metadata) {
|
|
3652
|
+
if (e.metadata) {
|
|
3860
3653
|
return {
|
|
3861
3654
|
defaultPastePayload: {
|
|
3862
|
-
mode: metadata.mode,
|
|
3863
|
-
multicursorText: metadata.multicursorText ?? null,
|
|
3864
|
-
pasteOnNewLine: !!metadata.isFromEmptySelection
|
|
3655
|
+
mode: e.metadata.mode,
|
|
3656
|
+
multicursorText: e.metadata.multicursorText ?? null,
|
|
3657
|
+
pasteOnNewLine: !!e.metadata.isFromEmptySelection
|
|
3865
3658
|
}
|
|
3866
3659
|
};
|
|
3867
3660
|
}
|
|
@@ -3870,7 +3663,7 @@ define("vs/toggleHighContrast-3bUMPAmT", ["./editorWorkerHost--0eDLpc-", "./edit
|
|
|
3870
3663
|
async mergeInDataFromCopy(allProviders, dataTransfer, metadata, token) {
|
|
3871
3664
|
this._logService.trace("CopyPasteController#mergeInDataFromCopy with metadata : ", metadata?.id);
|
|
3872
3665
|
if (metadata?.id && CopyPasteController_1._currentCopyOperation?.handle === metadata.id) {
|
|
3873
|
-
const toResolve = CopyPasteController_1._currentCopyOperation.operations.filter((op) => allProviders.some((provider) => provider.pasteMimeTypes.some((type) => matchesMimeType(type, op.providerMimeTypes)))).map((op) => op.operation);
|
|
3666
|
+
const toResolve = CopyPasteController_1._currentCopyOperation.operations.filter((op) => allProviders.some((provider) => provider.pasteMimeTypes.some((type) => editor.matchesMimeType(type, op.providerMimeTypes)))).map((op) => op.operation);
|
|
3874
3667
|
const toMergeResults = await Promise.all(toResolve);
|
|
3875
3668
|
if (token.isCancellationRequested) {
|
|
3876
3669
|
return;
|
|
@@ -3889,7 +3682,7 @@ define("vs/toggleHighContrast-3bUMPAmT", ["./editorWorkerHost--0eDLpc-", "./edit
|
|
|
3889
3682
|
return;
|
|
3890
3683
|
}
|
|
3891
3684
|
if (resources.length) {
|
|
3892
|
-
dataTransfer.append(editor.Mimes.uriList, createStringDataTransferItem(UriList.create(resources)));
|
|
3685
|
+
dataTransfer.append(editor.Mimes.uriList, editor.createStringDataTransferItem(editor.UriList.create(resources)));
|
|
3893
3686
|
}
|
|
3894
3687
|
}
|
|
3895
3688
|
}
|
|
@@ -4150,7 +3943,7 @@ define("vs/toggleHighContrast-3bUMPAmT", ["./editorWorkerHost--0eDLpc-", "./edit
|
|
|
4150
3943
|
editor.CopyOptions.electronBugWorkaroundCopyEventHasFired = false;
|
|
4151
3944
|
editor$1.getContainerDomNode().ownerDocument.execCommand("copy");
|
|
4152
3945
|
if (editorWorkerHost.isNative && editor.CopyOptions.electronBugWorkaroundCopyEventHasFired === false) {
|
|
4153
|
-
const { dataToCopy } = editor.generateDataToCopyAndStoreInMemory(editor$1._getViewModel(),
|
|
3946
|
+
const { dataToCopy } = editor.generateDataToCopyAndStoreInMemory(editor$1._getViewModel(), void 0, editor.isFirefox);
|
|
4154
3947
|
clipboardService.writeText(dataToCopy.text);
|
|
4155
3948
|
}
|
|
4156
3949
|
}
|
|
@@ -4212,7 +4005,7 @@ define("vs/toggleHighContrast-3bUMPAmT", ["./editorWorkerHost--0eDLpc-", "./edit
|
|
|
4212
4005
|
if (editContextEnabled) {
|
|
4213
4006
|
const nativeEditContext = editor.NativeEditContextRegistry.get(editor$1.getId());
|
|
4214
4007
|
if (nativeEditContext) {
|
|
4215
|
-
nativeEditContext.
|
|
4008
|
+
nativeEditContext.handleWillCopy();
|
|
4216
4009
|
}
|
|
4217
4010
|
}
|
|
4218
4011
|
}
|
|
@@ -4233,7 +4026,7 @@ define("vs/toggleHighContrast-3bUMPAmT", ["./editorWorkerHost--0eDLpc-", "./edit
|
|
|
4233
4026
|
if (editContextEnabled) {
|
|
4234
4027
|
const nativeEditContext = editor.NativeEditContextRegistry.get(focusedEditor.getId());
|
|
4235
4028
|
if (nativeEditContext) {
|
|
4236
|
-
nativeEditContext.
|
|
4029
|
+
nativeEditContext.handleWillPaste();
|
|
4237
4030
|
}
|
|
4238
4031
|
}
|
|
4239
4032
|
logService.trace("registerExecCommandImpl (before triggerPaste)");
|
|
@@ -20076,15 +19869,15 @@ define("vs/toggleHighContrast-3bUMPAmT", ["./editorWorkerHost--0eDLpc-", "./edit
|
|
|
20076
19869
|
static get(editor2) {
|
|
20077
19870
|
return editor2.getContribution(DropIntoEditorController_1.ID);
|
|
20078
19871
|
}
|
|
20079
|
-
constructor(
|
|
19872
|
+
constructor(editor$1, instantiationService, _configService, _languageFeaturesService, _treeViewsDragAndDropService) {
|
|
20080
19873
|
super();
|
|
20081
19874
|
this._configService = _configService;
|
|
20082
19875
|
this._languageFeaturesService = _languageFeaturesService;
|
|
20083
19876
|
this._treeViewsDragAndDropService = _treeViewsDragAndDropService;
|
|
20084
|
-
this.treeItemsTransfer = LocalSelectionTransfer.getInstance();
|
|
20085
|
-
this._dropProgressManager = this._register(instantiationService.createInstance(InlineProgressManager, "dropIntoEditor",
|
|
20086
|
-
this._postDropWidgetManager = this._register(instantiationService.createInstance(PostEditWidgetManager, "dropIntoEditor",
|
|
20087
|
-
this._register(
|
|
19877
|
+
this.treeItemsTransfer = editor.LocalSelectionTransfer.getInstance();
|
|
19878
|
+
this._dropProgressManager = this._register(instantiationService.createInstance(InlineProgressManager, "dropIntoEditor", editor$1));
|
|
19879
|
+
this._postDropWidgetManager = this._register(instantiationService.createInstance(PostEditWidgetManager, "dropIntoEditor", editor$1, dropWidgetVisibleCtx, { id: changeDropTypeCommandId, label: editorWorkerHost.localize(944, "Show drop options...") }, () => DropIntoEditorController_1._configureDefaultAction ? [DropIntoEditorController_1._configureDefaultAction] : []));
|
|
19880
|
+
this._register(editor$1.onDropIntoEditor((e) => this.onDropIntoEditor(editor$1, e.position, e.event)));
|
|
20088
19881
|
}
|
|
20089
19882
|
clearWidgets() {
|
|
20090
19883
|
this._postDropWidgetManager.clear();
|
|
@@ -20175,9 +19968,9 @@ define("vs/toggleHighContrast-3bUMPAmT", ["./editorWorkerHost--0eDLpc-", "./edit
|
|
|
20175
19968
|
}
|
|
20176
19969
|
async extractDataTransferData(dragEvent) {
|
|
20177
19970
|
if (!dragEvent.dataTransfer) {
|
|
20178
|
-
return new VSDataTransfer();
|
|
19971
|
+
return new editor.VSDataTransfer();
|
|
20179
19972
|
}
|
|
20180
|
-
const dataTransfer = toExternalVSDataTransfer(dragEvent.dataTransfer);
|
|
19973
|
+
const dataTransfer = editor.toExternalVSDataTransfer(dragEvent.dataTransfer);
|
|
20181
19974
|
if (this.treeItemsTransfer.hasData(DraggedTreeItemsIdentifier.prototype)) {
|
|
20182
19975
|
const data = this.treeItemsTransfer.getData(DraggedTreeItemsIdentifier.prototype);
|
|
20183
19976
|
if (Array.isArray(data)) {
|
|
@@ -37649,14 +37442,26 @@ define("vs/toggleHighContrast-3bUMPAmT", ["./editorWorkerHost--0eDLpc-", "./edit
|
|
|
37649
37442
|
});
|
|
37650
37443
|
this._onDidClick = this._register(new editorWorkerHost.Emitter());
|
|
37651
37444
|
this.onDidClick = this._onDidClick.event;
|
|
37445
|
+
this._nonWhitespaceCount = editor.derived(this, (reader) => {
|
|
37446
|
+
const data = this._data.read(reader);
|
|
37447
|
+
if (!data) {
|
|
37448
|
+
return void 0;
|
|
37449
|
+
}
|
|
37450
|
+
const ghostText = data.ghostText;
|
|
37451
|
+
const allText = ghostText.parts.map((p) => p.lines.map((l) => l.line).join("")).join("");
|
|
37452
|
+
return allText.replace(/\s/g, "").length;
|
|
37453
|
+
});
|
|
37652
37454
|
this._extraClassNames = editor.derived(this, (reader) => {
|
|
37653
37455
|
const extraClasses = this._extraClasses.slice();
|
|
37654
|
-
if (this._useSyntaxHighlighting.read(reader)) {
|
|
37655
|
-
extraClasses.push("syntax-highlighted");
|
|
37656
|
-
}
|
|
37657
37456
|
if (this._warningState.read(reader)) {
|
|
37658
37457
|
extraClasses.push("warning");
|
|
37659
37458
|
}
|
|
37459
|
+
const nonWhitespaceCount = this._nonWhitespaceCount.read(reader);
|
|
37460
|
+
if (this._highlightShortText && nonWhitespaceCount && nonWhitespaceCount < 3) {
|
|
37461
|
+
extraClasses.push("short-text");
|
|
37462
|
+
} else if (this._useSyntaxHighlighting.read(reader)) {
|
|
37463
|
+
extraClasses.push("syntax-highlighted");
|
|
37464
|
+
}
|
|
37660
37465
|
const extraClassNames = extraClasses.map((c) => ` ${c}`).join("");
|
|
37661
37466
|
return extraClassNames;
|
|
37662
37467
|
});
|
|
@@ -37728,6 +37533,10 @@ define("vs/toggleHighContrast-3bUMPAmT", ["./editorWorkerHost--0eDLpc-", "./edit
|
|
|
37728
37533
|
});
|
|
37729
37534
|
}
|
|
37730
37535
|
for (const p of uiState.inlineTexts) {
|
|
37536
|
+
let inlineExtraClassNames = "";
|
|
37537
|
+
if (this._highlightShortText && p.text.length < 5) {
|
|
37538
|
+
inlineExtraClassNames += " short-text";
|
|
37539
|
+
}
|
|
37731
37540
|
decorations.push({
|
|
37732
37541
|
range: editorWorkerHost.Range.fromPositions(new editorWorkerHost.Position(uiState.lineNumber, p.column)),
|
|
37733
37542
|
options: {
|
|
@@ -37735,7 +37544,7 @@ define("vs/toggleHighContrast-3bUMPAmT", ["./editorWorkerHost--0eDLpc-", "./edit
|
|
|
37735
37544
|
after: {
|
|
37736
37545
|
content: p.text,
|
|
37737
37546
|
tokens: p.tokens,
|
|
37738
|
-
inlineClassName: (p.preview ? "ghost-text-decoration-preview" : "ghost-text-decoration") + (this._isClickable ? " clickable" : "") + extraClassNames + p.lineDecorations.map((d) => " " + d.className).join(" "),
|
|
37547
|
+
inlineClassName: (p.preview ? "ghost-text-decoration-preview" : "ghost-text-decoration") + (this._isClickable ? " clickable" : "") + extraClassNames + inlineExtraClassNames + p.lineDecorations.map((d) => " " + d.className).join(" "),
|
|
37739
37548
|
// TODO: take the ranges into account for line decorations
|
|
37740
37549
|
cursorStops: editorWorkerHost.InjectedTextCursorStops.Left,
|
|
37741
37550
|
attachedData: new GhostTextAttachedData(this)
|
|
@@ -37764,6 +37573,7 @@ define("vs/toggleHighContrast-3bUMPAmT", ["./editorWorkerHost--0eDLpc-", "./edit
|
|
|
37764
37573
|
this._shouldKeepCursorStable = options.shouldKeepCursorStable ?? false;
|
|
37765
37574
|
this._minReservedLineCount = options.minReservedLineCount ?? editor.constObservable(0);
|
|
37766
37575
|
this._useSyntaxHighlighting = options.useSyntaxHighlighting ?? editor.constObservable(true);
|
|
37576
|
+
this._highlightShortText = options.highlightShortSuggestions ?? false;
|
|
37767
37577
|
this._editorObs = editor.observableCodeEditor(this._editor);
|
|
37768
37578
|
this._additionalLinesWidget = this._register(new AdditionalLinesWidget(this._editor, editor.derivedOpts({ owner: this, equalsFn: editor.equalsIfDefinedC(editor.thisEqualsC()) }, (reader) => {
|
|
37769
37579
|
const uiState = this._state.read(reader);
|
|
@@ -44867,7 +44677,8 @@ ${keybindingTooltip}` : void 0,
|
|
|
44867
44677
|
useSyntaxHighlighting: this._editorObs.getOption(
|
|
44868
44678
|
71
|
|
44869
44679
|
/* EditorOption.inlineSuggest */
|
|
44870
|
-
).map((v) => v.syntaxHighlightingEnabled)
|
|
44680
|
+
).map((v) => v.syntaxHighlightingEnabled),
|
|
44681
|
+
highlightShortSuggestions: true
|
|
44871
44682
|
});
|
|
44872
44683
|
}
|
|
44873
44684
|
shouldShowHoverAtViewZone(viewZoneId) {
|
|
@@ -54741,27 +54552,47 @@ ${json}
|
|
|
54741
54552
|
super();
|
|
54742
54553
|
const editorObs = this._register(editor.observableCodeEditor(editor$1));
|
|
54743
54554
|
const menu = this._register(menuService.createMenu(editor.MenuId.EditorContent, editor$1.contextKeyService));
|
|
54744
|
-
const
|
|
54555
|
+
const menuActionsObs = editor.observableFromEvent(this, menu.onDidChange, () => menu.getActions());
|
|
54556
|
+
const menuPrimaryActionIdObs = editor.derived((reader) => {
|
|
54557
|
+
const menuActions = menuActionsObs.read(reader);
|
|
54558
|
+
if (menuActions.length === 0) {
|
|
54559
|
+
return void 0;
|
|
54560
|
+
}
|
|
54561
|
+
const navigationGroup = menuActions.find((group) => group[0] === "navigation");
|
|
54562
|
+
if (navigationGroup && navigationGroup[1].length > 0) {
|
|
54563
|
+
return navigationGroup[1][0].id;
|
|
54564
|
+
}
|
|
54565
|
+
for (const [, actions] of menuActions) {
|
|
54566
|
+
if (actions.length > 0) {
|
|
54567
|
+
return actions[0].id;
|
|
54568
|
+
}
|
|
54569
|
+
}
|
|
54570
|
+
return void 0;
|
|
54571
|
+
});
|
|
54745
54572
|
this._register(editor.autorun((reader) => {
|
|
54746
|
-
const
|
|
54747
|
-
if (
|
|
54573
|
+
const menuPrimaryActionId = menuPrimaryActionIdObs.read(reader);
|
|
54574
|
+
if (!menuPrimaryActionId) {
|
|
54748
54575
|
return;
|
|
54749
54576
|
}
|
|
54750
54577
|
const container = editor.h("div.floating-menu-overlay-widget");
|
|
54751
|
-
container.root.style.height = "
|
|
54578
|
+
container.root.style.height = "26px";
|
|
54752
54579
|
const toolbar = instantiationService.createInstance(editor.MenuWorkbenchToolBar, container.root, editor.MenuId.EditorContent, {
|
|
54753
54580
|
actionViewItemProvider: (action, options) => {
|
|
54754
54581
|
if (!(action instanceof editor.MenuItemAction)) {
|
|
54755
54582
|
return void 0;
|
|
54756
54583
|
}
|
|
54757
|
-
const keybinding = keybindingService.lookupKeybinding(action.id);
|
|
54758
|
-
if (!keybinding) {
|
|
54759
|
-
return void 0;
|
|
54760
|
-
}
|
|
54761
54584
|
return instantiationService.createInstance(class extends editor.MenuEntryActionViewItem {
|
|
54585
|
+
render(container2) {
|
|
54586
|
+
super.render(container2);
|
|
54587
|
+
if (action.id === menuPrimaryActionId) {
|
|
54588
|
+
this.element?.classList.add("primary");
|
|
54589
|
+
}
|
|
54590
|
+
}
|
|
54762
54591
|
updateLabel() {
|
|
54592
|
+
const keybinding = keybindingService.lookupKeybinding(action.id);
|
|
54593
|
+
const keybindingLabel2 = keybinding ? keybinding.getLabel() : void 0;
|
|
54763
54594
|
if (this.options.label && this.label) {
|
|
54764
|
-
this.label.textContent = `${this._commandAction.label} (${
|
|
54595
|
+
this.label.textContent = keybindingLabel2 ? `${this._commandAction.label} (${keybindingLabel2})` : this._commandAction.label;
|
|
54765
54596
|
}
|
|
54766
54597
|
}
|
|
54767
54598
|
}, action, { ...options, keybindingNotRenderedWithLabel: true });
|