guidesTextModelPart.ts ×5

Frontier kind: Code frontier

unlabeled · c_c2a829f9210b

17 tests · 41083 LOC · 239 files · introduces 0 tests · 49 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges49 lines · 3 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
5080 ranges41083 lines · 239 files · Browse complete extent
All tests (intent)
17 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.

3 files ranked by introduced lines: 49 introduced LOC across 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/editor/common/model/guidesTextModelPart.ts 46 introduced LOC · 5 ranges

Open complete file

470
471 public getLinesIndentGuides(
472 > startLineNumber: number, guidesTextModelPart.ts
473 > endLineNumber: number
474 > ): number[] {
475 > this.assertNotDisposed();
476 > const lineCount = this.textModel.getLineCount();
477 >
478 > if (startLineNumber < 1 || startLineNumber > lineCount) {
479 throw new Error('Illegal value for startLineNumber');
480 }
481 > if (endLineNumber < 1 || endLineNumber > lineCount) { guidesTextModelPart.ts
482 throw new Error('Illegal value for endLineNumber');
483 }
485 > const options = this.textModel.getOptions();
486 > const foldingRules = this.getLanguageConfiguration(
487 > this.textModel.getLanguageId()
488 > ).foldingRules;
489 > const offSide = Boolean(foldingRules && foldingRules.offSide);
490 >
491 > const result: number[] = new Array<number>(
492 > endLineNumber - startLineNumber + 1
493 > );
494 >
495 > let aboveContentLineIndex =
496 > -2; /* -2 is a marker for not having computed it */
497 > let aboveContentLineIndent = -1;
498 >
499 > let belowContentLineIndex =
500 > -2; /* -2 is a marker for not having computed it */
501 > let belowContentLineIndent = -1;
502 >
503 > for (
504 > let lineNumber = startLineNumber;
505 > lineNumber <= endLineNumber;
506 > lineNumber++
507 > ) {
508 > const resultIndex = lineNumber - startLineNumber;
509 >
510 > const currentIndent = this._computeIndentLevel(lineNumber - 1);
511 > if (currentIndent >= 0) {
512 > // This line has content (besides whitespace)
513 > // Use the line's indent
514 > aboveContentLineIndex = lineNumber - 1;
515 > aboveContentLineIndent = currentIndent;
516 > result[resultIndex] = Math.ceil(currentIndent / options.indentSize);
517 > continue;
518 > }
519
520 if (aboveContentLineIndex === -2) {
536 belowContentLineIndex !== -1 &&
537 (belowContentLineIndex === -2 || belowContentLineIndex < lineNumber - 1)
539 belowContentLineIndex = -1;
540 belowContentLineIndent = -1;
557 );
558 }
559 > return result; guidesTextModelPart.ts
560 > }
561
562 private _getIndentLevelForWhitespaceLine(
src/vs/editor/common/model.ts 2 introduced LOC · 1 range

Open complete file

604 return (
605 this.tabSize === other.tabSize
606 > && this._indentSizeIsTabSize === other._indentSizeIsTabSize model.ts
607 > && this.indentSize === other.indentSize
608 && this.insertSpaces === other.insertSpaces
609 && this.defaultEOL === other.defaultEOL
src/vs/editor/test/common/modes/testLanguageConfigurationService.ts 1 introduced LOC · 1 range

Open complete file

27 getLanguageConfiguration(languageId: string): ResolvedLanguageConfiguration {
28 return this._registry.getLanguageConfiguration(languageId) ??
29 > new ResolvedLanguageConfiguration('unknown', {}); testLanguageConfigurationService.ts
30 }
31 }