@ws-ui/code-editor 0.2.24 → 0.2.25

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.
@@ -2897,43 +2897,6 @@
2897
2897
  MarshalledId2[MarshalledId2["TestMessageMenuArgs"] = 18] = "TestMessageMenuArgs";
2898
2898
  })(MarshalledId || (MarshalledId = {}));
2899
2899
 
2900
- // node_modules/vscode/vscode/src/vs/nls.js
2901
- var isPseudo = typeof document !== "undefined" && document.location && document.location.hash.indexOf("pseudo=true") >= 0;
2902
- function _format(message, args) {
2903
- let result;
2904
- if (args.length === 0) {
2905
- result = message;
2906
- } else {
2907
- result = message.replace(/\{(\d+)\}/g, (match, rest) => {
2908
- const index = rest[0];
2909
- const arg = args[index];
2910
- let result2 = match;
2911
- if (typeof arg === "string") {
2912
- result2 = arg;
2913
- } else if (typeof arg === "number" || typeof arg === "boolean" || arg === void 0 || arg === null) {
2914
- result2 = String(arg);
2915
- }
2916
- return result2;
2917
- });
2918
- }
2919
- if (isPseudo) {
2920
- result = "\uFF3B" + result.replace(/[aouei]/g, "$&$&") + "\uFF3D";
2921
- }
2922
- return result;
2923
- }
2924
- var initialized = false;
2925
- var locale = void 0;
2926
- var translations = {};
2927
- function localizeWithPath(path, data, defaultMessage, ...args) {
2928
- initialized = true;
2929
- const key = typeof data === "object" ? data.key : data;
2930
- const message = (translations[path] ?? {})[key] ?? defaultMessage;
2931
- return _format(message, args);
2932
- }
2933
- function getConfiguredDefaultLocale(_) {
2934
- return locale;
2935
- }
2936
-
2937
2900
  // node_modules/vscode/vscode/src/vs/base/common/platform.js
2938
2901
  var LANGUAGE_DEFAULT = "en";
2939
2902
  var _isWindows = false;
@@ -2948,6 +2911,7 @@
2948
2911
  var _locale = void 0;
2949
2912
  var _language = LANGUAGE_DEFAULT;
2950
2913
  var _platformLocale = LANGUAGE_DEFAULT;
2914
+ var _translationsConfigFile = void 0;
2951
2915
  var _userAgent = void 0;
2952
2916
  var $globalThis = globalThis;
2953
2917
  var nodeProcess = void 0;
@@ -2970,10 +2934,10 @@
2970
2934
  if (rawNlsConfig) {
2971
2935
  try {
2972
2936
  const nlsConfig = JSON.parse(rawNlsConfig);
2973
- const resolved = nlsConfig.availableLanguages["*"];
2974
- _locale = nlsConfig.locale;
2937
+ _locale = nlsConfig.userLocale;
2975
2938
  _platformLocale = nlsConfig.osLocale;
2976
- _language = resolved ? resolved : LANGUAGE_DEFAULT;
2939
+ _language = nlsConfig.resolvedLanguage || LANGUAGE_DEFAULT;
2940
+ _translationsConfigFile = nlsConfig.languagePack?.translationsConfigFile;
2977
2941
  } catch (e) {
2978
2942
  }
2979
2943
  }
@@ -2986,10 +2950,9 @@
2986
2950
  _isLinux = _userAgent.indexOf("Linux") >= 0;
2987
2951
  _isMobile = _userAgent?.indexOf("Mobi") >= 0;
2988
2952
  _isWeb = true;
2989
- const configuredLocale = getConfiguredDefaultLocale();
2990
- _locale = configuredLocale || LANGUAGE_DEFAULT;
2991
- _language = _locale;
2992
- _platformLocale = navigator.language;
2953
+ _language = globalThis._VSCODE_NLS_LANGUAGE || LANGUAGE_DEFAULT;
2954
+ _locale = navigator.language.toLowerCase();
2955
+ _platformLocale = _locale;
2993
2956
  } else {
2994
2957
  console.error("Unable to resolve platform.");
2995
2958
  }
@@ -3098,7 +3061,7 @@
3098
3061
  return sandboxProcess.cwd();
3099
3062
  }
3100
3063
  };
3101
- } else if (typeof process !== "undefined") {
3064
+ } else if (typeof process !== "undefined" && typeof process?.versions?.node === "string") {
3102
3065
  safeProcess = {
3103
3066
  get platform() {
3104
3067
  return process.platform;
@@ -3241,10 +3204,13 @@
3241
3204
  }
3242
3205
  return res;
3243
3206
  }
3244
- function _format2(sep2, pathObject) {
3207
+ function formatExt(ext) {
3208
+ return ext ? `${ext[0] === "." ? "" : "."}${ext}` : "";
3209
+ }
3210
+ function _format(sep2, pathObject) {
3245
3211
  validateObject(pathObject, "pathObject");
3246
3212
  const dir = pathObject.dir || pathObject.root;
3247
- const base = pathObject.base || `${pathObject.name || ""}${pathObject.ext || ""}`;
3213
+ const base = pathObject.base || `${pathObject.name || ""}${formatExt(pathObject.ext)}`;
3248
3214
  if (!dir) {
3249
3215
  return base;
3250
3216
  }
@@ -3259,7 +3225,7 @@
3259
3225
  let path;
3260
3226
  if (i >= 0) {
3261
3227
  path = pathSegments[i];
3262
- validateString(path, "path");
3228
+ validateString(path, `paths[${i}]`);
3263
3229
  if (path.length === 0) {
3264
3230
  continue;
3265
3231
  }
@@ -3627,9 +3593,9 @@
3627
3593
  }
3628
3594
  return path.slice(0, end);
3629
3595
  },
3630
- basename(path, ext) {
3631
- if (ext !== void 0) {
3632
- validateString(ext, "ext");
3596
+ basename(path, suffix) {
3597
+ if (suffix !== void 0) {
3598
+ validateString(suffix, "suffix");
3633
3599
  }
3634
3600
  validateString(path, "path");
3635
3601
  let start = 0;
@@ -3639,11 +3605,11 @@
3639
3605
  if (path.length >= 2 && isWindowsDeviceRoot(path.charCodeAt(0)) && path.charCodeAt(1) === CHAR_COLON) {
3640
3606
  start = 2;
3641
3607
  }
3642
- if (ext !== void 0 && ext.length > 0 && ext.length <= path.length) {
3643
- if (ext === path) {
3608
+ if (suffix !== void 0 && suffix.length > 0 && suffix.length <= path.length) {
3609
+ if (suffix === path) {
3644
3610
  return "";
3645
3611
  }
3646
- let extIdx = ext.length - 1;
3612
+ let extIdx = suffix.length - 1;
3647
3613
  let firstNonSlashEnd = -1;
3648
3614
  for (i = path.length - 1; i >= start; --i) {
3649
3615
  const code = path.charCodeAt(i);
@@ -3658,7 +3624,7 @@
3658
3624
  firstNonSlashEnd = i + 1;
3659
3625
  }
3660
3626
  if (extIdx >= 0) {
3661
- if (code === ext.charCodeAt(extIdx)) {
3627
+ if (code === suffix.charCodeAt(extIdx)) {
3662
3628
  if (--extIdx === -1) {
3663
3629
  end = i;
3664
3630
  }
@@ -3731,7 +3697,7 @@
3731
3697
  }
3732
3698
  return path.slice(startDot, end);
3733
3699
  },
3734
- format: _format2.bind(null, "\\"),
3700
+ format: _format.bind(null, "\\"),
3735
3701
  parse(path) {
3736
3702
  validateString(path, "path");
3737
3703
  const ret = { root: "", dir: "", base: "", ext: "", name: "" };
@@ -3858,7 +3824,7 @@
3858
3824
  let resolvedAbsolute = false;
3859
3825
  for (let i = pathSegments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
3860
3826
  const path = i >= 0 ? pathSegments[i] : posixCwd();
3861
- validateString(path, "path");
3827
+ validateString(path, `paths[${i}]`);
3862
3828
  if (path.length === 0) {
3863
3829
  continue;
3864
3830
  }
@@ -3995,20 +3961,20 @@
3995
3961
  }
3996
3962
  return path.slice(0, end);
3997
3963
  },
3998
- basename(path, ext) {
3999
- if (ext !== void 0) {
4000
- validateString(ext, "ext");
3964
+ basename(path, suffix) {
3965
+ if (suffix !== void 0) {
3966
+ validateString(suffix, "ext");
4001
3967
  }
4002
3968
  validateString(path, "path");
4003
3969
  let start = 0;
4004
3970
  let end = -1;
4005
3971
  let matchedSlash = true;
4006
3972
  let i;
4007
- if (ext !== void 0 && ext.length > 0 && ext.length <= path.length) {
4008
- if (ext === path) {
3973
+ if (suffix !== void 0 && suffix.length > 0 && suffix.length <= path.length) {
3974
+ if (suffix === path) {
4009
3975
  return "";
4010
3976
  }
4011
- let extIdx = ext.length - 1;
3977
+ let extIdx = suffix.length - 1;
4012
3978
  let firstNonSlashEnd = -1;
4013
3979
  for (i = path.length - 1; i >= 0; --i) {
4014
3980
  const code = path.charCodeAt(i);
@@ -4023,7 +3989,7 @@
4023
3989
  firstNonSlashEnd = i + 1;
4024
3990
  }
4025
3991
  if (extIdx >= 0) {
4026
- if (code === ext.charCodeAt(extIdx)) {
3992
+ if (code === suffix.charCodeAt(extIdx)) {
4027
3993
  if (--extIdx === -1) {
4028
3994
  end = i;
4029
3995
  }
@@ -4092,7 +4058,7 @@
4092
4058
  }
4093
4059
  return path.slice(startDot, end);
4094
4060
  },
4095
- format: _format2.bind(null, "/"),
4061
+ format: _format.bind(null, "/"),
4096
4062
  parse(path) {
4097
4063
  validateString(path, "path");
4098
4064
  const ret = { root: "", dir: "", base: "", ext: "", name: "" };
@@ -4360,6 +4326,9 @@
4360
4326
  return result;
4361
4327
  }
4362
4328
  }
4329
+ [Symbol.for("debug.description")]() {
4330
+ return `URI(${this.toString()})`;
4331
+ }
4363
4332
  };
4364
4333
  var _pathSepMarker = isWindows ? 1 : void 0;
4365
4334
  var Uri = class extends URI {
@@ -4801,6 +4770,7 @@
4801
4770
  };
4802
4771
 
4803
4772
  // node_modules/vscode/vscode/src/vs/base/common/collections.js
4773
+ var _a;
4804
4774
  function groupBy(data, groupFn) {
4805
4775
  const result = /* @__PURE__ */ Object.create(null);
4806
4776
  for (const element of data) {
@@ -4813,9 +4783,58 @@
4813
4783
  }
4814
4784
  return result;
4815
4785
  }
4786
+ var SetWithKey = class {
4787
+ static {
4788
+ _a = Symbol.toStringTag;
4789
+ }
4790
+ constructor(values, toKey) {
4791
+ this.toKey = toKey;
4792
+ this._map = /* @__PURE__ */ new Map();
4793
+ this[_a] = "SetWithKey";
4794
+ for (const value of values) {
4795
+ this.add(value);
4796
+ }
4797
+ }
4798
+ get size() {
4799
+ return this._map.size;
4800
+ }
4801
+ add(value) {
4802
+ const key = this.toKey(value);
4803
+ this._map.set(key, value);
4804
+ return this;
4805
+ }
4806
+ delete(value) {
4807
+ return this._map.delete(this.toKey(value));
4808
+ }
4809
+ has(value) {
4810
+ return this._map.has(this.toKey(value));
4811
+ }
4812
+ *entries() {
4813
+ for (const entry of this._map.values()) {
4814
+ yield [entry, entry];
4815
+ }
4816
+ }
4817
+ keys() {
4818
+ return this.values();
4819
+ }
4820
+ *values() {
4821
+ for (const entry of this._map.values()) {
4822
+ yield entry;
4823
+ }
4824
+ }
4825
+ clear() {
4826
+ this._map.clear();
4827
+ }
4828
+ forEach(callbackfn, thisArg) {
4829
+ this._map.forEach((entry) => callbackfn.call(thisArg, entry, entry, this));
4830
+ }
4831
+ [Symbol.iterator]() {
4832
+ return this.values();
4833
+ }
4834
+ };
4816
4835
 
4817
4836
  // node_modules/vscode/vscode/src/vs/base/common/map.js
4818
- var _a;
4837
+ var _a2;
4819
4838
  var _b;
4820
4839
  var _c;
4821
4840
  var ResourceMapEntry = class {
@@ -4832,7 +4851,7 @@
4832
4851
  this.defaultToKey = (resource) => resource.toString();
4833
4852
  }
4834
4853
  constructor(arg, toKey) {
4835
- this[_a] = "ResourceMap";
4854
+ this[_a2] = "ResourceMap";
4836
4855
  if (arg instanceof _ResourceMap) {
4837
4856
  this.map = new Map(arg.map);
4838
4857
  this.toKey = toKey ?? _ResourceMap.defaultToKey;
@@ -4889,7 +4908,7 @@
4889
4908
  yield [entry.uri, entry.value];
4890
4909
  }
4891
4910
  }
4892
- *[(_a = Symbol.toStringTag, Symbol.iterator)]() {
4911
+ *[(_a2 = Symbol.toStringTag, Symbol.iterator)]() {
4893
4912
  for (const [, entry] of this.map) {
4894
4913
  yield [entry.uri, entry.value];
4895
4914
  }
@@ -5434,8 +5453,9 @@
5434
5453
  }
5435
5454
  Iterable2.first = first;
5436
5455
  function some(iterable, predicate) {
5456
+ let i = 0;
5437
5457
  for (const element of iterable) {
5438
- if (predicate(element)) {
5458
+ if (predicate(element, i++)) {
5439
5459
  return true;
5440
5460
  }
5441
5461
  }
@@ -5466,6 +5486,13 @@
5466
5486
  }
5467
5487
  }
5468
5488
  Iterable2.map = map;
5489
+ function* flatMap(iterable, fn) {
5490
+ let index = 0;
5491
+ for (const element of iterable) {
5492
+ yield* fn(element, index++);
5493
+ }
5494
+ }
5495
+ Iterable2.flatMap = flatMap;
5469
5496
  function* concat(...iterables) {
5470
5497
  for (const iterable of iterables) {
5471
5498
  yield* iterable;
@@ -6533,6 +6560,10 @@ ${stackTraceFormattedLines.join("\n")}
6533
6560
  return result.event;
6534
6561
  }
6535
6562
  Event2.fromPromise = fromPromise;
6563
+ function forward(from, to) {
6564
+ return from((e) => to.fire(e));
6565
+ }
6566
+ Event2.forward = forward;
6536
6567
  function runAndSubscribe(event, handler, initial) {
6537
6568
  handler(initial);
6538
6569
  return event((e) => handler(e));
@@ -6651,8 +6682,11 @@ ${stackTraceFormattedLines.join("\n")}
6651
6682
  }
6652
6683
  };
6653
6684
  var _globalLeakWarningThreshold = -1;
6654
- var LeakageMonitor = class {
6655
- constructor(_errorHandler, threshold, name = Math.random().toString(18).slice(2, 5)) {
6685
+ var LeakageMonitor = class _LeakageMonitor {
6686
+ static {
6687
+ this._idPool = 1;
6688
+ }
6689
+ constructor(_errorHandler, threshold, name = (_LeakageMonitor._idPool++).toString(16).padStart(3, "0")) {
6656
6690
  this._errorHandler = _errorHandler;
6657
6691
  this.threshold = threshold;
6658
6692
  this.name = name;
@@ -7320,8 +7354,8 @@ ${stackTraceFormattedLines.join("\n")}
7320
7354
  filteredLocales = ["_default"];
7321
7355
  }
7322
7356
  let languageSpecificMap = void 0;
7323
- for (const locale2 of filteredLocales) {
7324
- const map2 = arrayToMap(data[locale2]);
7357
+ for (const locale of filteredLocales) {
7358
+ const map2 = arrayToMap(data[locale]);
7325
7359
  languageSpecificMap = intersectMaps(languageSpecificMap, map2);
7326
7360
  }
7327
7361
  const commonMap = arrayToMap(data["_common"]);
@@ -8302,6 +8336,12 @@ ${stackTraceFormattedLines.join("\n")}
8302
8336
  return result?.trim();
8303
8337
  }
8304
8338
 
8339
+ // node_modules/vscode/vscode/src/vs/base/common/observableInternal/logging.js
8340
+ var globalObservableLogger;
8341
+ function getLogger() {
8342
+ return globalObservableLogger;
8343
+ }
8344
+
8305
8345
  // node_modules/vscode/vscode/src/vs/base/common/observableInternal/base.js
8306
8346
  var _recomputeInitiallyAndOnChange;
8307
8347
  function _setRecomputeInitiallyAndOnChange(recomputeInitiallyAndOnChange2) {
@@ -8352,6 +8392,12 @@ ${stackTraceFormattedLines.join("\n")}
8352
8392
  debugReferenceFn: fn
8353
8393
  }, (reader) => fn(this.read(reader), reader));
8354
8394
  }
8395
+ flatten() {
8396
+ return _derived({
8397
+ owner: void 0,
8398
+ debugName: () => `${this.debugName} (flattened)`
8399
+ }, (reader) => this.read(reader).read(reader));
8400
+ }
8355
8401
  recomputeInitiallyAndOnChange(store, handleValue) {
8356
8402
  store.add(_recomputeInitiallyAndOnChange(this, handleValue));
8357
8403
  return this;
@@ -8459,7 +8505,9 @@ ${stackTraceFormattedLines.join("\n")}
8459
8505
  }, () => `Setting ${this.debugName}`);
8460
8506
  }
8461
8507
  try {
8508
+ const oldValue = this._value;
8462
8509
  this._setValue(value);
8510
+ getLogger()?.handleObservableChanged(this, { oldValue, newValue: value, change, didChange: true, hadValue: true });
8463
8511
  for (const observer of this.observers) {
8464
8512
  tx.updateObserver(observer, this);
8465
8513
  observer.handleChange(this, change);
@@ -8719,6 +8767,7 @@ ${stackTraceFormattedLines.join("\n")}
8719
8767
  const isDisposed = this.disposed;
8720
8768
  try {
8721
8769
  if (!isDisposed) {
8770
+ getLogger()?.handleAutorunTriggered(this);
8722
8771
  const changeSummary = this.changeSummary;
8723
8772
  this.changeSummary = this.createChangeSummary?.();
8724
8773
  this._runFn(this, changeSummary);
@@ -8790,23 +8839,34 @@ ${stackTraceFormattedLines.join("\n")}
8790
8839
  })(autorun || (autorun = {}));
8791
8840
 
8792
8841
  // node_modules/vscode/vscode/src/vs/base/common/observableInternal/utils.js
8793
- function observableFromEvent(event, getValue) {
8794
- return new FromEventObservable(event, getValue);
8842
+ function observableFromEvent(...args) {
8843
+ let owner;
8844
+ let event;
8845
+ let getValue;
8846
+ if (args.length === 3) {
8847
+ [owner, event, getValue] = args;
8848
+ } else {
8849
+ [event, getValue] = args;
8850
+ }
8851
+ return new FromEventObservable(new DebugNameData(owner, void 0, getValue), event, getValue, () => FromEventObservable.globalTransaction, strictEquals);
8795
8852
  }
8796
- var FromEventObservable = class _FromEventObservable extends BaseObservable {
8797
- constructor(event, _getValue) {
8853
+ var FromEventObservable = class extends BaseObservable {
8854
+ constructor(_debugNameData, event, _getValue, _getTransaction, _equalityComparator) {
8798
8855
  super();
8856
+ this._debugNameData = _debugNameData;
8799
8857
  this.event = event;
8800
8858
  this._getValue = _getValue;
8859
+ this._getTransaction = _getTransaction;
8860
+ this._equalityComparator = _equalityComparator;
8801
8861
  this.hasValue = false;
8802
8862
  this.handleEvent = (args) => {
8803
8863
  const newValue = this._getValue(args);
8804
8864
  const oldValue = this.value;
8805
- const didChange = !this.hasValue || oldValue !== newValue;
8865
+ const didChange = !this.hasValue || !this._equalityComparator(oldValue, newValue);
8806
8866
  if (didChange) {
8807
8867
  this.value = newValue;
8808
8868
  if (this.hasValue) {
8809
- subtransaction(_FromEventObservable.globalTransaction, (tx) => {
8869
+ subtransaction(this._getTransaction(), (tx) => {
8810
8870
  for (const o of this.observers) {
8811
8871
  tx.updateObserver(o, this);
8812
8872
  o.handleChange(this, void 0);
@@ -8821,7 +8881,7 @@ ${stackTraceFormattedLines.join("\n")}
8821
8881
  };
8822
8882
  }
8823
8883
  getDebugName() {
8824
- return getFunctionName(this._getValue);
8884
+ return this._debugNameData.getDebugName(this);
8825
8885
  }
8826
8886
  get debugName() {
8827
8887
  const name = this.getDebugName();
@@ -10807,8 +10867,50 @@ ${stackTraceFormattedLines.join("\n")}
10807
10867
  }
10808
10868
  };
10809
10869
 
10870
+ // node_modules/vscode/vscode/src/vs/nls.js
10871
+ var isPseudo = globalThis._VSCODE_NLS_LANGUAGE === "pseudo" || typeof document !== "undefined" && document.location && document.location.hash.indexOf("pseudo=true") >= 0;
10872
+ function _format2(message, args) {
10873
+ let result;
10874
+ if (args.length === 0) {
10875
+ result = message;
10876
+ } else {
10877
+ result = message.replace(/\{(\d+)\}/g, (match, rest) => {
10878
+ const index = rest[0];
10879
+ const arg = args[index];
10880
+ let result2 = match;
10881
+ if (typeof arg === "string") {
10882
+ result2 = arg;
10883
+ } else if (typeof arg === "number" || typeof arg === "boolean" || arg === void 0 || arg === null) {
10884
+ result2 = String(arg);
10885
+ }
10886
+ return result2;
10887
+ });
10888
+ }
10889
+ if (isPseudo) {
10890
+ result = "\uFF3B" + result.replace(/[aouei]/g, "$&$&") + "\uFF3D";
10891
+ }
10892
+ return result;
10893
+ }
10894
+ var initialized = false;
10895
+ function localize(data, message, ...args) {
10896
+ if (typeof data === "number") {
10897
+ return _format2(lookupMessage(data, message), args);
10898
+ }
10899
+ return _format2(message, args);
10900
+ }
10901
+ function lookupMessage(index, fallback) {
10902
+ initialized = true;
10903
+ const message = globalThis._VSCODE_NLS_MESSAGES?.[index];
10904
+ if (typeof message !== "string") {
10905
+ if (typeof fallback === "string") {
10906
+ return fallback;
10907
+ }
10908
+ throw new Error(`!!! NLS MISSING: ${index} !!!`);
10909
+ }
10910
+ return message;
10911
+ }
10912
+
10810
10913
  // node_modules/vscode/vscode/src/vs/editor/common/languages.js
10811
- var _moduleId = "vs/editor/common/languages";
10812
10914
  var Token = class {
10813
10915
  constructor(offset, type, language2) {
10814
10916
  this.offset = offset;
@@ -11023,32 +11125,32 @@ ${stackTraceFormattedLines.join("\n")}
11023
11125
  SymbolKind3[SymbolKind3["TypeParameter"] = 25] = "TypeParameter";
11024
11126
  })(SymbolKind || (SymbolKind = {}));
11025
11127
  var symbolKindNames = {
11026
- [SymbolKind.Array]: localizeWithPath(_moduleId, 0, "array"),
11027
- [SymbolKind.Boolean]: localizeWithPath(_moduleId, 1, "boolean"),
11028
- [SymbolKind.Class]: localizeWithPath(_moduleId, 2, "class"),
11029
- [SymbolKind.Constant]: localizeWithPath(_moduleId, 3, "constant"),
11030
- [SymbolKind.Constructor]: localizeWithPath(_moduleId, 4, "constructor"),
11031
- [SymbolKind.Enum]: localizeWithPath(_moduleId, 5, "enumeration"),
11032
- [SymbolKind.EnumMember]: localizeWithPath(_moduleId, 6, "enumeration member"),
11033
- [SymbolKind.Event]: localizeWithPath(_moduleId, 7, "event"),
11034
- [SymbolKind.Field]: localizeWithPath(_moduleId, 8, "field"),
11035
- [SymbolKind.File]: localizeWithPath(_moduleId, 9, "file"),
11036
- [SymbolKind.Function]: localizeWithPath(_moduleId, 10, "function"),
11037
- [SymbolKind.Interface]: localizeWithPath(_moduleId, 11, "interface"),
11038
- [SymbolKind.Key]: localizeWithPath(_moduleId, 12, "key"),
11039
- [SymbolKind.Method]: localizeWithPath(_moduleId, 13, "method"),
11040
- [SymbolKind.Module]: localizeWithPath(_moduleId, 14, "module"),
11041
- [SymbolKind.Namespace]: localizeWithPath(_moduleId, 15, "namespace"),
11042
- [SymbolKind.Null]: localizeWithPath(_moduleId, 16, "null"),
11043
- [SymbolKind.Number]: localizeWithPath(_moduleId, 17, "number"),
11044
- [SymbolKind.Object]: localizeWithPath(_moduleId, 18, "object"),
11045
- [SymbolKind.Operator]: localizeWithPath(_moduleId, 19, "operator"),
11046
- [SymbolKind.Package]: localizeWithPath(_moduleId, 20, "package"),
11047
- [SymbolKind.Property]: localizeWithPath(_moduleId, 21, "property"),
11048
- [SymbolKind.String]: localizeWithPath(_moduleId, 22, "string"),
11049
- [SymbolKind.Struct]: localizeWithPath(_moduleId, 23, "struct"),
11050
- [SymbolKind.TypeParameter]: localizeWithPath(_moduleId, 24, "type parameter"),
11051
- [SymbolKind.Variable]: localizeWithPath(_moduleId, 25, "variable")
11128
+ [SymbolKind.Array]: localize(1658, "array"),
11129
+ [SymbolKind.Boolean]: localize(1659, "boolean"),
11130
+ [SymbolKind.Class]: localize(1660, "class"),
11131
+ [SymbolKind.Constant]: localize(1661, "constant"),
11132
+ [SymbolKind.Constructor]: localize(1662, "constructor"),
11133
+ [SymbolKind.Enum]: localize(1663, "enumeration"),
11134
+ [SymbolKind.EnumMember]: localize(1664, "enumeration member"),
11135
+ [SymbolKind.Event]: localize(1665, "event"),
11136
+ [SymbolKind.Field]: localize(1666, "field"),
11137
+ [SymbolKind.File]: localize(1667, "file"),
11138
+ [SymbolKind.Function]: localize(1668, "function"),
11139
+ [SymbolKind.Interface]: localize(1669, "interface"),
11140
+ [SymbolKind.Key]: localize(1670, "key"),
11141
+ [SymbolKind.Method]: localize(1671, "method"),
11142
+ [SymbolKind.Module]: localize(1672, "module"),
11143
+ [SymbolKind.Namespace]: localize(1673, "namespace"),
11144
+ [SymbolKind.Null]: localize(1674, "null"),
11145
+ [SymbolKind.Number]: localize(1675, "number"),
11146
+ [SymbolKind.Object]: localize(1676, "object"),
11147
+ [SymbolKind.Operator]: localize(1677, "operator"),
11148
+ [SymbolKind.Package]: localize(1678, "package"),
11149
+ [SymbolKind.Property]: localize(1679, "property"),
11150
+ [SymbolKind.String]: localize(1680, "string"),
11151
+ [SymbolKind.Struct]: localize(1681, "struct"),
11152
+ [SymbolKind.TypeParameter]: localize(1682, "type parameter"),
11153
+ [SymbolKind.Variable]: localize(1683, "variable")
11052
11154
  };
11053
11155
  var SymbolTag;
11054
11156
  (function(SymbolTag3) {
@@ -12097,12 +12199,13 @@ ${stackTraceFormattedLines.join("\n")}
12097
12199
  get backgroundTokenizerShouldOnlyVerifyTokens() {
12098
12200
  return this._actual.backgroundTokenizerShouldOnlyVerifyTokens;
12099
12201
  }
12100
- constructor(_encodedLanguageId, _actual, _maxTokenizationLineLength) {
12202
+ constructor(_encodedLanguageId, _actual, disposable, _maxTokenizationLineLength) {
12101
12203
  super();
12102
12204
  this._encodedLanguageId = _encodedLanguageId;
12103
12205
  this._actual = _actual;
12104
12206
  this._maxTokenizationLineLength = _maxTokenizationLineLength;
12105
12207
  this._register(keepObserved(this._maxTokenizationLineLength));
12208
+ this._register(disposable);
12106
12209
  }
12107
12210
  getInitialState() {
12108
12211
  return this._actual.getInitialState();
@@ -12182,7 +12285,7 @@ ${stackTraceFormattedLines.join("\n")}
12182
12285
  this._host.reportTokenizationTime(timeMs, languageId, r.sourceExtensionId, lineLength, isRandomSample);
12183
12286
  },
12184
12287
  false
12185
- ), this._maxTokenizationLineLength);
12288
+ ), Disposable.None, this._maxTokenizationLineLength);
12186
12289
  this._tokenizerWithStateStore = new TokenizerWithStateStore(this._lines.length, tokenizationSupport);
12187
12290
  } else {
12188
12291
  this._tokenizerWithStateStore = null;
@@ -15008,68 +15111,69 @@ ${stackTraceFormattedLines.join("\n")}
15008
15111
  EditorOption2[EditorOption2["pasteAs"] = 85] = "pasteAs";
15009
15112
  EditorOption2[EditorOption2["parameterHints"] = 86] = "parameterHints";
15010
15113
  EditorOption2[EditorOption2["peekWidgetDefaultFocus"] = 87] = "peekWidgetDefaultFocus";
15011
- EditorOption2[EditorOption2["definitionLinkOpensInPeek"] = 88] = "definitionLinkOpensInPeek";
15012
- EditorOption2[EditorOption2["quickSuggestions"] = 89] = "quickSuggestions";
15013
- EditorOption2[EditorOption2["quickSuggestionsDelay"] = 90] = "quickSuggestionsDelay";
15014
- EditorOption2[EditorOption2["readOnly"] = 91] = "readOnly";
15015
- EditorOption2[EditorOption2["readOnlyMessage"] = 92] = "readOnlyMessage";
15016
- EditorOption2[EditorOption2["renameOnType"] = 93] = "renameOnType";
15017
- EditorOption2[EditorOption2["renderControlCharacters"] = 94] = "renderControlCharacters";
15018
- EditorOption2[EditorOption2["renderFinalNewline"] = 95] = "renderFinalNewline";
15019
- EditorOption2[EditorOption2["renderLineHighlight"] = 96] = "renderLineHighlight";
15020
- EditorOption2[EditorOption2["renderLineHighlightOnlyWhenFocus"] = 97] = "renderLineHighlightOnlyWhenFocus";
15021
- EditorOption2[EditorOption2["renderValidationDecorations"] = 98] = "renderValidationDecorations";
15022
- EditorOption2[EditorOption2["renderWhitespace"] = 99] = "renderWhitespace";
15023
- EditorOption2[EditorOption2["revealHorizontalRightPadding"] = 100] = "revealHorizontalRightPadding";
15024
- EditorOption2[EditorOption2["roundedSelection"] = 101] = "roundedSelection";
15025
- EditorOption2[EditorOption2["rulers"] = 102] = "rulers";
15026
- EditorOption2[EditorOption2["scrollbar"] = 103] = "scrollbar";
15027
- EditorOption2[EditorOption2["scrollBeyondLastColumn"] = 104] = "scrollBeyondLastColumn";
15028
- EditorOption2[EditorOption2["scrollBeyondLastLine"] = 105] = "scrollBeyondLastLine";
15029
- EditorOption2[EditorOption2["scrollPredominantAxis"] = 106] = "scrollPredominantAxis";
15030
- EditorOption2[EditorOption2["selectionClipboard"] = 107] = "selectionClipboard";
15031
- EditorOption2[EditorOption2["selectionHighlight"] = 108] = "selectionHighlight";
15032
- EditorOption2[EditorOption2["selectOnLineNumbers"] = 109] = "selectOnLineNumbers";
15033
- EditorOption2[EditorOption2["showFoldingControls"] = 110] = "showFoldingControls";
15034
- EditorOption2[EditorOption2["showUnused"] = 111] = "showUnused";
15035
- EditorOption2[EditorOption2["snippetSuggestions"] = 112] = "snippetSuggestions";
15036
- EditorOption2[EditorOption2["smartSelect"] = 113] = "smartSelect";
15037
- EditorOption2[EditorOption2["smoothScrolling"] = 114] = "smoothScrolling";
15038
- EditorOption2[EditorOption2["stickyScroll"] = 115] = "stickyScroll";
15039
- EditorOption2[EditorOption2["stickyTabStops"] = 116] = "stickyTabStops";
15040
- EditorOption2[EditorOption2["stopRenderingLineAfter"] = 117] = "stopRenderingLineAfter";
15041
- EditorOption2[EditorOption2["suggest"] = 118] = "suggest";
15042
- EditorOption2[EditorOption2["suggestFontSize"] = 119] = "suggestFontSize";
15043
- EditorOption2[EditorOption2["suggestLineHeight"] = 120] = "suggestLineHeight";
15044
- EditorOption2[EditorOption2["suggestOnTriggerCharacters"] = 121] = "suggestOnTriggerCharacters";
15045
- EditorOption2[EditorOption2["suggestSelection"] = 122] = "suggestSelection";
15046
- EditorOption2[EditorOption2["tabCompletion"] = 123] = "tabCompletion";
15047
- EditorOption2[EditorOption2["tabIndex"] = 124] = "tabIndex";
15048
- EditorOption2[EditorOption2["unicodeHighlighting"] = 125] = "unicodeHighlighting";
15049
- EditorOption2[EditorOption2["unusualLineTerminators"] = 126] = "unusualLineTerminators";
15050
- EditorOption2[EditorOption2["useShadowDOM"] = 127] = "useShadowDOM";
15051
- EditorOption2[EditorOption2["useTabStops"] = 128] = "useTabStops";
15052
- EditorOption2[EditorOption2["wordBreak"] = 129] = "wordBreak";
15053
- EditorOption2[EditorOption2["wordSegmenterLocales"] = 130] = "wordSegmenterLocales";
15054
- EditorOption2[EditorOption2["wordSeparators"] = 131] = "wordSeparators";
15055
- EditorOption2[EditorOption2["wordWrap"] = 132] = "wordWrap";
15056
- EditorOption2[EditorOption2["wordWrapBreakAfterCharacters"] = 133] = "wordWrapBreakAfterCharacters";
15057
- EditorOption2[EditorOption2["wordWrapBreakBeforeCharacters"] = 134] = "wordWrapBreakBeforeCharacters";
15058
- EditorOption2[EditorOption2["wordWrapColumn"] = 135] = "wordWrapColumn";
15059
- EditorOption2[EditorOption2["wordWrapOverride1"] = 136] = "wordWrapOverride1";
15060
- EditorOption2[EditorOption2["wordWrapOverride2"] = 137] = "wordWrapOverride2";
15061
- EditorOption2[EditorOption2["wrappingIndent"] = 138] = "wrappingIndent";
15062
- EditorOption2[EditorOption2["wrappingStrategy"] = 139] = "wrappingStrategy";
15063
- EditorOption2[EditorOption2["showDeprecated"] = 140] = "showDeprecated";
15064
- EditorOption2[EditorOption2["inlayHints"] = 141] = "inlayHints";
15065
- EditorOption2[EditorOption2["editorClassName"] = 142] = "editorClassName";
15066
- EditorOption2[EditorOption2["pixelRatio"] = 143] = "pixelRatio";
15067
- EditorOption2[EditorOption2["tabFocusMode"] = 144] = "tabFocusMode";
15068
- EditorOption2[EditorOption2["layoutInfo"] = 145] = "layoutInfo";
15069
- EditorOption2[EditorOption2["wrappingInfo"] = 146] = "wrappingInfo";
15070
- EditorOption2[EditorOption2["defaultColorDecorators"] = 147] = "defaultColorDecorators";
15071
- EditorOption2[EditorOption2["colorDecoratorsActivatedOn"] = 148] = "colorDecoratorsActivatedOn";
15072
- EditorOption2[EditorOption2["inlineCompletionsAccessibilityVerbose"] = 149] = "inlineCompletionsAccessibilityVerbose";
15114
+ EditorOption2[EditorOption2["placeholder"] = 88] = "placeholder";
15115
+ EditorOption2[EditorOption2["definitionLinkOpensInPeek"] = 89] = "definitionLinkOpensInPeek";
15116
+ EditorOption2[EditorOption2["quickSuggestions"] = 90] = "quickSuggestions";
15117
+ EditorOption2[EditorOption2["quickSuggestionsDelay"] = 91] = "quickSuggestionsDelay";
15118
+ EditorOption2[EditorOption2["readOnly"] = 92] = "readOnly";
15119
+ EditorOption2[EditorOption2["readOnlyMessage"] = 93] = "readOnlyMessage";
15120
+ EditorOption2[EditorOption2["renameOnType"] = 94] = "renameOnType";
15121
+ EditorOption2[EditorOption2["renderControlCharacters"] = 95] = "renderControlCharacters";
15122
+ EditorOption2[EditorOption2["renderFinalNewline"] = 96] = "renderFinalNewline";
15123
+ EditorOption2[EditorOption2["renderLineHighlight"] = 97] = "renderLineHighlight";
15124
+ EditorOption2[EditorOption2["renderLineHighlightOnlyWhenFocus"] = 98] = "renderLineHighlightOnlyWhenFocus";
15125
+ EditorOption2[EditorOption2["renderValidationDecorations"] = 99] = "renderValidationDecorations";
15126
+ EditorOption2[EditorOption2["renderWhitespace"] = 100] = "renderWhitespace";
15127
+ EditorOption2[EditorOption2["revealHorizontalRightPadding"] = 101] = "revealHorizontalRightPadding";
15128
+ EditorOption2[EditorOption2["roundedSelection"] = 102] = "roundedSelection";
15129
+ EditorOption2[EditorOption2["rulers"] = 103] = "rulers";
15130
+ EditorOption2[EditorOption2["scrollbar"] = 104] = "scrollbar";
15131
+ EditorOption2[EditorOption2["scrollBeyondLastColumn"] = 105] = "scrollBeyondLastColumn";
15132
+ EditorOption2[EditorOption2["scrollBeyondLastLine"] = 106] = "scrollBeyondLastLine";
15133
+ EditorOption2[EditorOption2["scrollPredominantAxis"] = 107] = "scrollPredominantAxis";
15134
+ EditorOption2[EditorOption2["selectionClipboard"] = 108] = "selectionClipboard";
15135
+ EditorOption2[EditorOption2["selectionHighlight"] = 109] = "selectionHighlight";
15136
+ EditorOption2[EditorOption2["selectOnLineNumbers"] = 110] = "selectOnLineNumbers";
15137
+ EditorOption2[EditorOption2["showFoldingControls"] = 111] = "showFoldingControls";
15138
+ EditorOption2[EditorOption2["showUnused"] = 112] = "showUnused";
15139
+ EditorOption2[EditorOption2["snippetSuggestions"] = 113] = "snippetSuggestions";
15140
+ EditorOption2[EditorOption2["smartSelect"] = 114] = "smartSelect";
15141
+ EditorOption2[EditorOption2["smoothScrolling"] = 115] = "smoothScrolling";
15142
+ EditorOption2[EditorOption2["stickyScroll"] = 116] = "stickyScroll";
15143
+ EditorOption2[EditorOption2["stickyTabStops"] = 117] = "stickyTabStops";
15144
+ EditorOption2[EditorOption2["stopRenderingLineAfter"] = 118] = "stopRenderingLineAfter";
15145
+ EditorOption2[EditorOption2["suggest"] = 119] = "suggest";
15146
+ EditorOption2[EditorOption2["suggestFontSize"] = 120] = "suggestFontSize";
15147
+ EditorOption2[EditorOption2["suggestLineHeight"] = 121] = "suggestLineHeight";
15148
+ EditorOption2[EditorOption2["suggestOnTriggerCharacters"] = 122] = "suggestOnTriggerCharacters";
15149
+ EditorOption2[EditorOption2["suggestSelection"] = 123] = "suggestSelection";
15150
+ EditorOption2[EditorOption2["tabCompletion"] = 124] = "tabCompletion";
15151
+ EditorOption2[EditorOption2["tabIndex"] = 125] = "tabIndex";
15152
+ EditorOption2[EditorOption2["unicodeHighlighting"] = 126] = "unicodeHighlighting";
15153
+ EditorOption2[EditorOption2["unusualLineTerminators"] = 127] = "unusualLineTerminators";
15154
+ EditorOption2[EditorOption2["useShadowDOM"] = 128] = "useShadowDOM";
15155
+ EditorOption2[EditorOption2["useTabStops"] = 129] = "useTabStops";
15156
+ EditorOption2[EditorOption2["wordBreak"] = 130] = "wordBreak";
15157
+ EditorOption2[EditorOption2["wordSegmenterLocales"] = 131] = "wordSegmenterLocales";
15158
+ EditorOption2[EditorOption2["wordSeparators"] = 132] = "wordSeparators";
15159
+ EditorOption2[EditorOption2["wordWrap"] = 133] = "wordWrap";
15160
+ EditorOption2[EditorOption2["wordWrapBreakAfterCharacters"] = 134] = "wordWrapBreakAfterCharacters";
15161
+ EditorOption2[EditorOption2["wordWrapBreakBeforeCharacters"] = 135] = "wordWrapBreakBeforeCharacters";
15162
+ EditorOption2[EditorOption2["wordWrapColumn"] = 136] = "wordWrapColumn";
15163
+ EditorOption2[EditorOption2["wordWrapOverride1"] = 137] = "wordWrapOverride1";
15164
+ EditorOption2[EditorOption2["wordWrapOverride2"] = 138] = "wordWrapOverride2";
15165
+ EditorOption2[EditorOption2["wrappingIndent"] = 139] = "wrappingIndent";
15166
+ EditorOption2[EditorOption2["wrappingStrategy"] = 140] = "wrappingStrategy";
15167
+ EditorOption2[EditorOption2["showDeprecated"] = 141] = "showDeprecated";
15168
+ EditorOption2[EditorOption2["inlayHints"] = 142] = "inlayHints";
15169
+ EditorOption2[EditorOption2["editorClassName"] = 143] = "editorClassName";
15170
+ EditorOption2[EditorOption2["pixelRatio"] = 144] = "pixelRatio";
15171
+ EditorOption2[EditorOption2["tabFocusMode"] = 145] = "tabFocusMode";
15172
+ EditorOption2[EditorOption2["layoutInfo"] = 146] = "layoutInfo";
15173
+ EditorOption2[EditorOption2["wrappingInfo"] = 147] = "wrappingInfo";
15174
+ EditorOption2[EditorOption2["defaultColorDecorators"] = 148] = "defaultColorDecorators";
15175
+ EditorOption2[EditorOption2["colorDecoratorsActivatedOn"] = 149] = "colorDecoratorsActivatedOn";
15176
+ EditorOption2[EditorOption2["inlineCompletionsAccessibilityVerbose"] = 150] = "inlineCompletionsAccessibilityVerbose";
15073
15177
  })(EditorOption || (EditorOption = {}));
15074
15178
  var EndOfLinePreference;
15075
15179
  (function(EndOfLinePreference3) {
@@ -16043,7 +16147,35 @@ ${stackTraceFormattedLines.join("\n")}
16043
16147
  ));
16044
16148
  }
16045
16149
  }
16150
+ toRangeMapping2(original, modified) {
16151
+ if (isValidLineNumber(this.original.endLineNumberExclusive, original) && isValidLineNumber(this.modified.endLineNumberExclusive, modified)) {
16152
+ return new RangeMapping(new Range(this.original.startLineNumber, 1, this.original.endLineNumberExclusive, 1), new Range(this.modified.startLineNumber, 1, this.modified.endLineNumberExclusive, 1));
16153
+ }
16154
+ if (!this.original.isEmpty && !this.modified.isEmpty) {
16155
+ return new RangeMapping(Range.fromPositions(new Position(this.original.startLineNumber, 1), normalizePosition(new Position(this.original.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), original)), Range.fromPositions(new Position(this.modified.startLineNumber, 1), normalizePosition(new Position(this.modified.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), modified)));
16156
+ }
16157
+ if (this.original.startLineNumber > 1 && this.modified.startLineNumber > 1) {
16158
+ return new RangeMapping(Range.fromPositions(normalizePosition(new Position(this.original.startLineNumber - 1, Number.MAX_SAFE_INTEGER), original), normalizePosition(new Position(this.original.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), original)), Range.fromPositions(normalizePosition(new Position(this.modified.startLineNumber - 1, Number.MAX_SAFE_INTEGER), modified), normalizePosition(new Position(this.modified.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), modified)));
16159
+ }
16160
+ throw new BugIndicatingError();
16161
+ }
16046
16162
  };
16163
+ function normalizePosition(position, content) {
16164
+ if (position.lineNumber < 1) {
16165
+ return new Position(1, 1);
16166
+ }
16167
+ if (position.lineNumber > content.length) {
16168
+ return new Position(content.length, content[content.length - 1].length + 1);
16169
+ }
16170
+ const line = content[position.lineNumber - 1];
16171
+ if (position.column > line.length + 1) {
16172
+ return new Position(position.lineNumber, line.length + 1);
16173
+ }
16174
+ return position;
16175
+ }
16176
+ function isValidLineNumber(lineNumber, lines) {
16177
+ return lineNumber >= 1 && lineNumber <= lines.length;
16178
+ }
16047
16179
  var DetailedLineRangeMapping = class _DetailedLineRangeMapping extends LineRangeMapping {
16048
16180
  static fromRangeMappings(rangeMappings) {
16049
16181
  const originalRange = LineRange.join(rangeMappings.map((r) => LineRange.fromRangeInclusive(r.originalRange)));
@@ -16062,6 +16194,15 @@ ${stackTraceFormattedLines.join("\n")}
16062
16194
  }
16063
16195
  };
16064
16196
  var RangeMapping = class _RangeMapping {
16197
+ static assertSorted(rangeMappings) {
16198
+ for (let i = 1; i < rangeMappings.length; i++) {
16199
+ const previous = rangeMappings[i - 1];
16200
+ const current = rangeMappings[i];
16201
+ if (!(previous.originalRange.getEndPosition().isBeforeOrEqual(current.originalRange.getStartPosition()) && previous.modifiedRange.getEndPosition().isBeforeOrEqual(current.modifiedRange.getStartPosition()))) {
16202
+ throw new BugIndicatingError("Range mappings must be sorted");
16203
+ }
16204
+ }
16205
+ }
16065
16206
  constructor(originalRange, modifiedRange) {
16066
16207
  this.originalRange = originalRange;
16067
16208
  this.modifiedRange = modifiedRange;
@@ -16587,6 +16728,17 @@ ${stackTraceFormattedLines.join("\n")}
16587
16728
  static fromOffsetPairs(start, endExclusive) {
16588
16729
  return new _SequenceDiff(new OffsetRange(start.offset1, endExclusive.offset1), new OffsetRange(start.offset2, endExclusive.offset2));
16589
16730
  }
16731
+ static assertSorted(sequenceDiffs) {
16732
+ let last = void 0;
16733
+ for (const cur of sequenceDiffs) {
16734
+ if (last) {
16735
+ if (!(last.seq1Range.endExclusive <= cur.seq1Range.start && last.seq2Range.endExclusive <= cur.seq2Range.start)) {
16736
+ throw new BugIndicatingError("Sequence diffs must be sorted");
16737
+ }
16738
+ }
16739
+ last = cur;
16740
+ }
16741
+ }
16590
16742
  constructor(seq1Range, seq2Range) {
16591
16743
  this.seq1Range = seq1Range;
16592
16744
  this.seq2Range = seq2Range;
@@ -16960,41 +17112,39 @@ ${stackTraceFormattedLines.join("\n")}
16960
17112
 
16961
17113
  // node_modules/vscode/vscode/src/vs/editor/common/diff/defaultLinesDiffComputer/linesSliceCharSequence.js
16962
17114
  var LinesSliceCharSequence = class {
16963
- constructor(lines, lineRange, considerWhitespaceChanges) {
17115
+ constructor(lines, range, considerWhitespaceChanges) {
16964
17116
  this.lines = lines;
17117
+ this.range = range;
16965
17118
  this.considerWhitespaceChanges = considerWhitespaceChanges;
16966
17119
  this.elements = [];
16967
- this.firstCharOffsetByLine = [];
16968
- this.additionalOffsetByLine = [];
16969
- let trimFirstLineFully = false;
16970
- if (lineRange.start > 0 && lineRange.endExclusive >= lines.length) {
16971
- lineRange = new OffsetRange(lineRange.start - 1, lineRange.endExclusive);
16972
- trimFirstLineFully = true;
16973
- }
16974
- this.lineRange = lineRange;
16975
- this.firstCharOffsetByLine[0] = 0;
16976
- for (let i = this.lineRange.start; i < this.lineRange.endExclusive; i++) {
16977
- let line = lines[i];
16978
- let offset = 0;
16979
- if (trimFirstLineFully) {
16980
- offset = line.length;
16981
- line = "";
16982
- trimFirstLineFully = false;
16983
- } else if (!considerWhitespaceChanges) {
17120
+ this.firstElementOffsetByLineIdx = [];
17121
+ this.lineStartOffsets = [];
17122
+ this.trimmedWsLengthsByLineIdx = [];
17123
+ this.firstElementOffsetByLineIdx.push(0);
17124
+ for (let lineNumber = this.range.startLineNumber; lineNumber <= this.range.endLineNumber; lineNumber++) {
17125
+ let line = lines[lineNumber - 1];
17126
+ let lineStartOffset = 0;
17127
+ if (lineNumber === this.range.startLineNumber && this.range.startColumn > 1) {
17128
+ lineStartOffset = this.range.startColumn - 1;
17129
+ line = line.substring(lineStartOffset);
17130
+ }
17131
+ this.lineStartOffsets.push(lineStartOffset);
17132
+ let trimmedWsLength = 0;
17133
+ if (!considerWhitespaceChanges) {
16984
17134
  const trimmedStartLine = line.trimStart();
16985
- offset = line.length - trimmedStartLine.length;
17135
+ trimmedWsLength = line.length - trimmedStartLine.length;
16986
17136
  line = trimmedStartLine.trimEnd();
16987
17137
  }
16988
- this.additionalOffsetByLine.push(offset);
16989
- for (let i2 = 0; i2 < line.length; i2++) {
16990
- this.elements.push(line.charCodeAt(i2));
17138
+ this.trimmedWsLengthsByLineIdx.push(trimmedWsLength);
17139
+ const lineLength = lineNumber === this.range.endLineNumber ? Math.min(this.range.endColumn - 1 - lineStartOffset - trimmedWsLength, line.length) : line.length;
17140
+ for (let i = 0; i < lineLength; i++) {
17141
+ this.elements.push(line.charCodeAt(i));
16991
17142
  }
16992
- if (i < lines.length - 1) {
17143
+ if (lineNumber < this.range.endLineNumber) {
16993
17144
  this.elements.push("\n".charCodeAt(0));
16994
- this.firstCharOffsetByLine[i - this.lineRange.start + 1] = this.elements.length;
17145
+ this.firstElementOffsetByLineIdx.push(this.elements.length);
16995
17146
  }
16996
17147
  }
16997
- this.additionalOffsetByLine.push(0);
16998
17148
  }
16999
17149
  toString() {
17000
17150
  return `Slice: "${this.text}"`;
@@ -17031,18 +17181,21 @@ ${stackTraceFormattedLines.join("\n")}
17031
17181
  score2 += getCategoryBoundaryScore(nextCategory);
17032
17182
  return score2;
17033
17183
  }
17034
- translateOffset(offset) {
17035
- if (this.lineRange.isEmpty) {
17036
- return new Position(this.lineRange.start + 1, 1);
17037
- }
17038
- const i = findLastIdxMonotonous(this.firstCharOffsetByLine, (value) => value <= offset);
17184
+ translateOffset(offset, preference = "right") {
17185
+ const i = findLastIdxMonotonous(this.firstElementOffsetByLineIdx, (value) => value <= offset);
17186
+ const lineOffset = offset - this.firstElementOffsetByLineIdx[i];
17039
17187
  return new Position(
17040
- this.lineRange.start + i + 1,
17041
- offset - this.firstCharOffsetByLine[i] + this.additionalOffsetByLine[i] + 1
17188
+ this.range.startLineNumber + i,
17189
+ 1 + this.lineStartOffsets[i] + lineOffset + (lineOffset === 0 && preference === "left" ? 0 : this.trimmedWsLengthsByLineIdx[i])
17042
17190
  );
17043
17191
  }
17044
17192
  translateRange(range) {
17045
- return Range.fromPositions(this.translateOffset(range.start), this.translateOffset(range.endExclusive));
17193
+ const pos1 = this.translateOffset(range.start, "right");
17194
+ const pos2 = this.translateOffset(range.endExclusive, "left");
17195
+ if (pos2.isBefore(pos1)) {
17196
+ return Range.fromPositions(pos2, pos2);
17197
+ }
17198
+ return Range.fromPositions(pos1, pos2);
17046
17199
  }
17047
17200
  findWordContaining(offset) {
17048
17201
  if (offset < 0 || offset >= this.elements.length) {
@@ -17068,8 +17221,8 @@ ${stackTraceFormattedLines.join("\n")}
17068
17221
  return this.elements[offset1] === this.elements[offset2];
17069
17222
  }
17070
17223
  extendToFullLines(range) {
17071
- const start = findLastMonotonous(this.firstCharOffsetByLine, (x) => x <= range.start) ?? 0;
17072
- const end = findFirstMonotonous(this.firstCharOffsetByLine, (x) => range.endExclusive <= x) ?? this.elements.length;
17224
+ const start = findLastMonotonous(this.firstElementOffsetByLineIdx, (x) => x <= range.start) ?? 0;
17225
+ const end = findFirstMonotonous(this.firstElementOffsetByLineIdx, (x) => range.endExclusive <= x) ?? this.elements.length;
17073
17226
  return new OffsetRange(start, end);
17074
17227
  }
17075
17228
  };
@@ -17314,7 +17467,7 @@ ${stackTraceFormattedLines.join("\n")}
17314
17467
  return false;
17315
17468
  }
17316
17469
  const myersDiffingAlgorithm = new MyersDiffAlgorithm();
17317
- const result = myersDiffingAlgorithm.compute(new LinesSliceCharSequence([line1], new OffsetRange(0, 1), false), new LinesSliceCharSequence([line2], new OffsetRange(0, 1), false), timeout);
17470
+ const result = myersDiffingAlgorithm.compute(new LinesSliceCharSequence([line1], new Range(1, 1, 1, line1.length), false), new LinesSliceCharSequence([line2], new Range(1, 1, 1, line2.length), false), timeout);
17318
17471
  let commonNonSpaceCharCount = 0;
17319
17472
  const inverted = SequenceDiff.invert(result.diffs, line1.length);
17320
17473
  for (const seq of inverted) {
@@ -17855,8 +18008,10 @@ ${stackTraceFormattedLines.join("\n")}
17855
18008
  return movesWithDiffs;
17856
18009
  }
17857
18010
  refineDiff(originalLines, modifiedLines, diff, timeout, considerWhitespaceChanges) {
17858
- const slice1 = new LinesSliceCharSequence(originalLines, diff.seq1Range, considerWhitespaceChanges);
17859
- const slice2 = new LinesSliceCharSequence(modifiedLines, diff.seq2Range, considerWhitespaceChanges);
18011
+ const lineRangeMapping = toLineRangeMapping(diff);
18012
+ const rangeMapping = lineRangeMapping.toRangeMapping2(originalLines, modifiedLines);
18013
+ const slice1 = new LinesSliceCharSequence(originalLines, rangeMapping.originalRange, considerWhitespaceChanges);
18014
+ const slice2 = new LinesSliceCharSequence(modifiedLines, rangeMapping.modifiedRange, considerWhitespaceChanges);
17860
18015
  const diffResult = slice1.length + slice2.length < 500 ? this.dynamicProgrammingDiffing.compute(slice1, slice2, timeout) : this.myersDiffingAlgorithm.compute(slice1, slice2, timeout);
17861
18016
  let diffs = diffResult.diffs;
17862
18017
  diffs = optimizeSequenceDiffs(slice1, slice2, diffs);
@@ -17913,6 +18068,9 @@ ${stackTraceFormattedLines.join("\n")}
17913
18068
  );
17914
18069
  return new DetailedLineRangeMapping(originalLineRange, modifiedLineRange, [rangeMapping]);
17915
18070
  }
18071
+ function toLineRangeMapping(sequenceDiff) {
18072
+ return new LineRangeMapping(new LineRange(sequenceDiff.seq1Range.start + 1, sequenceDiff.seq1Range.endExclusive + 1), new LineRange(sequenceDiff.seq2Range.start + 1, sequenceDiff.seq2Range.endExclusive + 1));
18073
+ }
17916
18074
 
17917
18075
  // node_modules/vscode/vscode/src/vs/editor/common/diff/linesDiffComputers.js
17918
18076
  var linesDiffComputers = {