textModelSync.impl.ts ×7

Frontier kind: Code frontier

unlabeled · c_dc3766a7f98d

13 tests · 18711 LOC · 91 files · introduces 0 tests · 22 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges22 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
2009 ranges18711 lines · 91 files · Browse complete extent
All tests (intent)
13 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

2 files ranked by introduced lines: 22 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/editor/common/services/textModelSync/textModelSync.impl.ts 16 introduced LOC · 7 ranges

Open complete file

372
373 private _validatePosition(position: IPosition): IPosition {
374 > if (!Position.isIPosition(position)) { textModelSync.impl.ts
375 throw new Error('bad position');
376 }
377 > let { lineNumber, column } = position; textModelSync.impl.ts
378 > let hasChanged = false;
379 >
380 > if (lineNumber < 1) {
381 lineNumber = 1;
382 column = 1;
383 hasChanged = true;
384
385 > } else if (lineNumber > this._lines.length) { textModelSync.impl.ts
386 lineNumber = this._lines.length;
387 column = this._lines[lineNumber - 1].length + 1;
388 hasChanged = true;
389
390 > } else { textModelSync.impl.ts
391 > const maxCharacter = this._lines[lineNumber - 1].length + 1;
392 > if (column < 1) {
393 column = 1;
394 hasChanged = true;
395 }
396 > else if (column > maxCharacter) { textModelSync.impl.ts
397 column = maxCharacter;
398 hasChanged = true;
399 }
401 >
402 > if (!hasChanged) {
403 > return position;
404 > } else {
405 return { lineNumber, column };
406 }
408 }
409
src/vs/editor/common/core/position.ts 6 introduced LOC · 1 range

Open complete file

169 */
170 public static isIPosition(obj: unknown): obj is IPosition {
171 > return ( position.ts
172 > !!obj
173 > && (typeof (obj as IPosition).lineNumber === 'number')
174 > && (typeof (obj as IPosition).column === 'number')
175 > );
176 > }
177
178 public toJSON(): IPosition {