model.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. import { equals } from '../../base/common/objects.js';
  2. /**
  3. * Vertical Lane in the overview ruler of the editor.
  4. */
  5. export var OverviewRulerLane;
  6. (function (OverviewRulerLane) {
  7. OverviewRulerLane[OverviewRulerLane["Left"] = 1] = "Left";
  8. OverviewRulerLane[OverviewRulerLane["Center"] = 2] = "Center";
  9. OverviewRulerLane[OverviewRulerLane["Right"] = 4] = "Right";
  10. OverviewRulerLane[OverviewRulerLane["Full"] = 7] = "Full";
  11. })(OverviewRulerLane || (OverviewRulerLane = {}));
  12. /**
  13. * Position in the minimap to render the decoration.
  14. */
  15. export var MinimapPosition;
  16. (function (MinimapPosition) {
  17. MinimapPosition[MinimapPosition["Inline"] = 1] = "Inline";
  18. MinimapPosition[MinimapPosition["Gutter"] = 2] = "Gutter";
  19. })(MinimapPosition || (MinimapPosition = {}));
  20. export class TextModelResolvedOptions {
  21. /**
  22. * @internal
  23. */
  24. constructor(src) {
  25. this._textModelResolvedOptionsBrand = undefined;
  26. this.tabSize = Math.max(1, src.tabSize | 0);
  27. this.indentSize = src.tabSize | 0;
  28. this.insertSpaces = Boolean(src.insertSpaces);
  29. this.defaultEOL = src.defaultEOL | 0;
  30. this.trimAutoWhitespace = Boolean(src.trimAutoWhitespace);
  31. this.bracketPairColorizationOptions = src.bracketPairColorizationOptions;
  32. }
  33. /**
  34. * @internal
  35. */
  36. equals(other) {
  37. return (this.tabSize === other.tabSize
  38. && this.indentSize === other.indentSize
  39. && this.insertSpaces === other.insertSpaces
  40. && this.defaultEOL === other.defaultEOL
  41. && this.trimAutoWhitespace === other.trimAutoWhitespace
  42. && equals(this.bracketPairColorizationOptions, other.bracketPairColorizationOptions));
  43. }
  44. /**
  45. * @internal
  46. */
  47. createChangeEvent(newOpts) {
  48. return {
  49. tabSize: this.tabSize !== newOpts.tabSize,
  50. indentSize: this.indentSize !== newOpts.indentSize,
  51. insertSpaces: this.insertSpaces !== newOpts.insertSpaces,
  52. trimAutoWhitespace: this.trimAutoWhitespace !== newOpts.trimAutoWhitespace,
  53. };
  54. }
  55. }
  56. export class FindMatch {
  57. /**
  58. * @internal
  59. */
  60. constructor(range, matches) {
  61. this._findMatchBrand = undefined;
  62. this.range = range;
  63. this.matches = matches;
  64. }
  65. }
  66. /**
  67. * @internal
  68. */
  69. export var HorizontalGuidesState;
  70. (function (HorizontalGuidesState) {
  71. HorizontalGuidesState[HorizontalGuidesState["Disabled"] = 0] = "Disabled";
  72. HorizontalGuidesState[HorizontalGuidesState["EnabledForActive"] = 1] = "EnabledForActive";
  73. HorizontalGuidesState[HorizontalGuidesState["Enabled"] = 2] = "Enabled";
  74. })(HorizontalGuidesState || (HorizontalGuidesState = {}));
  75. /**
  76. * @internal
  77. */
  78. export class IndentGuide {
  79. constructor(visibleColumn, className,
  80. /**
  81. * If set, this indent guide is a horizontal guide (no vertical part).
  82. * It starts at visibleColumn and continues until endColumn.
  83. */
  84. horizontalLine) {
  85. this.visibleColumn = visibleColumn;
  86. this.className = className;
  87. this.horizontalLine = horizontalLine;
  88. }
  89. }
  90. /**
  91. * @internal
  92. */
  93. export class IndentGuideHorizontalLine {
  94. constructor(top, endColumn) {
  95. this.top = top;
  96. this.endColumn = endColumn;
  97. }
  98. }
  99. /**
  100. * @internal
  101. */
  102. export class ValidAnnotatedEditOperation {
  103. constructor(identifier, range, text, forceMoveMarkers, isAutoWhitespaceEdit, _isTracked) {
  104. this.identifier = identifier;
  105. this.range = range;
  106. this.text = text;
  107. this.forceMoveMarkers = forceMoveMarkers;
  108. this.isAutoWhitespaceEdit = isAutoWhitespaceEdit;
  109. this._isTracked = _isTracked;
  110. }
  111. }
  112. /**
  113. * @internal
  114. */
  115. export class ApplyEditsResult {
  116. constructor(reverseEdits, changes, trimAutoWhitespaceLineNumbers) {
  117. this.reverseEdits = reverseEdits;
  118. this.changes = changes;
  119. this.trimAutoWhitespaceLineNumbers = trimAutoWhitespaceLineNumbers;
  120. }
  121. }