yaml.ts ×22

Frontier kind: Code frontier

unlabeled · c_92d6ec26082f

6 tests · 4100 LOC · 19 files · introduces 0 tests · 136 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
22 ranges136 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
652 ranges4100 lines · 19 files · Browse complete extent
All tests (intent)
6 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.

Introduced files, introduced tests, and structurally relevant concept specializationyaml.test|title=YAML Parser Scalars folded block scalar keep chomping (>+)|occurrence=1 · 0 introduced LOCyaml.test|title=YAML Par…yaml.test|title=YAML Parser Scalars folded block scalar strip chomping (>-)|occurrence=1 · 0 introduced LOCyaml.test|title=YAML Par…yaml.test|title=YAML Parser Scalars folded block scalar format|occurrence=1 · 0 introduced LOCyaml.test|title=YAML Par…yaml.test|title=YAML Parser Scalars literal block scalar keep chomping (%7C+)|occurrence=1 · 0 introduced LOCyaml.test|title=YAML Par…yaml.ts ×4 · 29 introduced LOCyaml.ts ×4yaml.test|title=YAML Parser Scalars literal block scalar strip chomping (%7C-)|occurrence=1 · 0 introduced LOCyaml.test|title=YAML Par…yaml.ts ×3 · 8 introduced LOCyaml.ts ×3yaml.test|title=YAML Parser Scalars literal block scalar format|occurrence=1 · 0 introduced LOCyaml.test|title=YAML Par…yaml.ts ×2 · 4 introduced LOCyaml.ts ×2yaml.ts ×1 · 2 introduced LOCyaml.ts ×1yaml.ts ×1 · 5 introduced LOCyaml.ts ×1yaml.ts ×1 · 2 introduced LOCyaml.ts ×1yaml.ts ×2 · 4 introduced LOCyaml.ts ×2yaml.ts ×1 · 2 introduced LOCyaml.ts ×1yaml.ts ×1 · 3 introduced LOCyaml.ts ×1yaml.ts ×1 · 1 introduced LOCyaml.ts ×1yaml.ts ×11 · 52 introduced LOCyaml.ts ×11yaml.ts ×1 · 3 introduced LOCyaml.ts ×1yaml.ts ×2 · 5 introduced LOCyaml.ts ×2yaml.ts ×4 · 10 introduced LOCyaml.ts ×4yaml.ts ×1 · 9 introduced LOCyaml.ts ×1yaml.ts ×1 · 1 introduced LOCyaml.ts ×1yaml.ts ×1 · 3 introduced LOCyaml.ts ×1yaml.ts ×2 · 32 introduced LOCyaml.ts ×2yaml.ts ×2 · 4 introduced LOCyaml.ts ×2yaml.ts ×5 · 5 introduced LOCyaml.ts ×5yaml.ts ×5 · 14 introduced LOCyaml.ts ×5yaml.ts ×2 · 2 introduced LOCyaml.ts ×2yaml.ts ×4 · 10 introduced LOCyaml.ts ×4yaml.ts ×10 · 25 introduced LOCyaml.ts ×10yaml.ts ×1 · 3 introduced LOCyaml.ts ×1yaml.ts ×1 · 2 introduced LOCyaml.ts ×1yaml.ts ×3 · 8 introduced LOCyaml.ts ×3yaml.ts ×2 · 2 introduced LOCyaml.ts ×2yaml.ts ×1 · 3 introduced LOCyaml.ts ×1yaml.ts ×6 · 9 introduced LOCyaml.ts ×6yaml.ts ×1 · 6 introduced LOCyaml.ts ×1yaml.ts ×4 · 8 introduced LOCyaml.ts ×4yaml.ts ×1 · 5 introduced LOCyaml.ts ×1yaml.ts ×8 · 12 introduced LOCyaml.ts ×8yaml.ts ×7 · 18 introduced LOCyaml.ts ×7yaml.ts ×3 · 20 introduced LOCyaml.ts ×3yaml.ts ×54 · 301 introduced LOCyaml.ts ×54uri.test|title=URI URI#file, win-speciale|occurrence=1, charCode.test|title=CharCode has good values|occurrence=1, +2 · 0 introduced LOCuri.test|title=URI URI#f…utils.ts ×3 · 9 introduced LOCutils.ts ×3lifecycle.ts ×2 · 4 introduced LOClifecycle.ts ×2lifecycle.ts ×1 · 2 introduced LOClifecycle.ts ×1lifecycle.ts ×4 · 8 introduced LOClifecycle.ts ×4lifecycle.ts ×6 · 16 introduced LOClifecycle.ts ×6lifecycle.ts ×1 · 2 introduced LOClifecycle.ts ×1lifecycle.ts ×1 · 2 introduced LOClifecycle.ts ×1lifecycle.ts ×1 · 3 introduced LOClifecycle.ts ×1map.ts ×97 · 3334 introduced LOCmap.ts ×97src/vs/base/common/arrays.ts · 949 LOCcommon/arrays.tssrc/vs/base/common/arraysFind.ts · 226 LOCcommon/arraysFind.tssrc/vs/base/common/assert.ts · 91 LOCcommon/assert.tssrc/vs/base/common/charCode.ts · 450 LOCcommon/charCode.tssrc/vs/base/common/collections.ts · 176 LOCcommon/collections.tssrc/vs/base/common/errors.ts · 357 LOCcommon/errors.tssrc/vs/base/common/functional.ts · 32 LOCcommon/functional.tssrc/vs/base/common/iterator.ts · 194 LOCcommon/iterator.tssrc/vs/base/common/lifecycle.ts · 974 LOCcommon/lifecycle.tssrc/vs/base/common/map.ts · 1016 LOCcommon/map.tssrc/vs/base/common/marshallingIds.ts · 33 LOCcommon/marshallingIds.tssrc/vs/base/common/path.ts · 1589 LOCcommon/path.tssrc/vs/base/common/platform.ts · 281 LOCcommon/platform.tssrc/vs/base/common/process.ts · 76 LOCcommon/process.tssrc/vs/base/common/types.ts · 410 LOCcommon/types.tssrc/vs/base/common/uri.ts · 754 LOCcommon/uri.tssrc/vs/base/common/yaml.ts · 1701 LOCcommon/yaml.tssrc/vs/base/test/common/utils.ts · 107 LOCcommon/utils.tssrc/vs/nls.ts · 244 LOCvs/nls.tscharCode.test|title=CharCode has good values|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/charCode.test|title=CharCode has good values|occurrence=1charCode.test|title=Char…path.test|title=Paths (Node Implementation) path|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/path.test|title=Paths (Node Implementation) path|occurrence=1path.test|title=Paths (N…uri.test|title=URI File paths containing apostrophes break URI parsing and cannot be opened #276075|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/uri.test|title=URI File paths containing apostrophes break URI parsing and cannot be opened #276075|occurrence=1uri.test|title=URI File …uri.test|title=URI URI#file, win-speciale|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/uri.test|title=URI URI#file, win-speciale|occurrence=1uri.test|title=URI URI#f…yaml.test|title=YAML Parser Scalars folded block scalar format|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/yaml.test|title=YAML Parser Scalars folded block scalar format|occurrence=1yaml.test|title=YAML Par…yaml.test|title=YAML Parser Scalars folded block scalar keep chomping (>+)|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/yaml.test|title=YAML Parser Scalars folded block scalar keep chomping (>+)|occurrence=1yaml.test|title=YAML Par…yaml.test|title=YAML Parser Scalars folded block scalar strip chomping (>-)|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/yaml.test|title=YAML Parser Scalars folded block scalar strip chomping (>-)|occurrence=1yaml.test|title=YAML Par…yaml.test|title=YAML Parser Scalars literal block scalar format|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/yaml.test|title=YAML Parser Scalars literal block scalar format|occurrence=1yaml.test|title=YAML Par…yaml.test|title=YAML Parser Scalars literal block scalar keep chomping (%7C+)|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/yaml.test|title=YAML Parser Scalars literal block scalar keep chomping (%7C+)|occurrence=1yaml.test|title=YAML Par…yaml.test|title=YAML Parser Scalars literal block scalar strip chomping (%7C-)|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/yaml.test|title=YAML Parser Scalars literal block scalar strip chomping (%7C-)|occurrence=1yaml.test|title=YAML Par…Focused concept · yaml.ts ×22 · 136 introduced LOCyaml.ts ×22

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.

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

src/vs/base/common/yaml.ts 136 introduced LOC · 22 ranges

Open complete file

369 this.scanQuotedScalar(ch);
370 } else if ((ch === '|' || ch === '>') && this.flowDepth === 0 && this.isBlockScalarStart()) {
371 > this.scanBlockScalar(ch as '|' | '>'); yaml.ts
372 > break; // Block scalar consumed multiple lines; return to main scan loop
373 } else {
374 this.scanUnquotedScalar();
604 */
605 private isBlockScalarStart(): boolean {
606 > let p = this.pos + 1; yaml.ts
607 > // Skip optional indentation indicator (digit 1-9) and chomping indicator (+/-)
608 > while (p < this.input.length) {
609 > const c = this.input[p];
610 > if (c >= '1' && c <= '9') { p++; continue; }
611 > if (c === '+' || c === '-') { p++; continue; }
612 > break;
613 > }
614 > // Skip optional whitespace
615 > while (p < this.input.length && (this.input[p] === ' ' || this.input[p] === '\t')) { p++; }
616 > // Must be at newline, EOF, or comment
617 > if (p >= this.input.length) { return true; }
618 > const c = this.input[p];
619 > return c === '\n' || c === '\r' || c === '#';
620 > }
621
622 /**
626 */
627 private scanBlockScalar(style: '|' | '>'): void {
628 > const start = this.pos; yaml.ts
629 > this.pos++; // skip '|' or '>'
630 >
631 > // Parse header: optional indentation indicator (1-9) and chomping indicator (+/-)
632 > let explicitIndent = 0;
633 > let chomping: 'clip' | 'strip' | 'keep' = 'clip';
634 >
635 > // The order of indent indicator and chomping indicator can vary (D83L test)
636 > for (let i = 0; i < 2; i++) {
637 > if (this.pos < this.input.length) {
638 > const c = this.input[this.pos];
639 > if (c >= '1' && c <= '9' && explicitIndent === 0) {
640 explicitIndent = parseInt(c, 10);
641 this.pos++;
642 > } else if (c === '-' && chomping === 'clip') { yaml.ts
643 chomping = 'strip';
644 this.pos++;
645 > } else if (c === '+' && chomping === 'clip') { yaml.ts
646 chomping = 'keep';
647 this.pos++;
648 }
649 > } yaml.ts
650 > }
651 >
652 > // Skip any trailing whitespace on the header line
653 > while (this.pos < this.input.length && (this.input[this.pos] === ' ' || this.input[this.pos] === '\t')) {
654 this.pos++;
655 }
656 > yaml.ts
657 > // Skip optional comment on header line
658 > if (this.pos < this.input.length && this.input[this.pos] === '#') {
659 while (this.pos < this.input.length && this.input[this.pos] !== '\n' && this.input[this.pos] !== '\r') {
660 this.pos++;
661 }
662 }
663 > yaml.ts
664 > // Skip the header line's newline
665 > this.consumeNewline();
666 >
667 > // Determine the parent block's indentation level.
668 > // Per YAML spec 8.1.1.1, content indentation = parent_block_indent + N
669 > // where N is the explicit indent indicator (or auto-detected).
670 > // Also used to establish a minimum content indent for auto-detection.
671 > const parentBlockIndent = this.getParentBlockIndent(start);
672 >
673 > // Compute the content indentation level
674 > let contentIndent = explicitIndent > 0 ? parentBlockIndent + explicitIndent : 0;
675 > const lines: string[] = [];
676 > let trailingNewlines = 0;
677 >
678 > while (this.pos < this.input.length) {
679 > const lineStart = this.pos;
680 >
681 > // Count leading spaces on this line (tabs are not valid YAML indentation)
682 > let lineIndent = 0;
683 > while (this.pos < this.input.length && this.input[this.pos] === ' ') {
684 > lineIndent++;
685 > this.pos++;
686 > }
687 >
688 > // Check if this is an empty or whitespace-only line
689 > if (this.pos >= this.input.length || this.input[this.pos] === '\n' || this.input[this.pos] === '\r') {
690 if (contentIndent > 0 && lineIndent >= contentIndent) {
691 // Whitespace-only line with enough indent - preserve excess whitespace
707 continue;
708 }
709 > yaml.ts
710 > // Check for document markers at column 0 - they terminate the block scalar
711 > if (lineIndent === 0 && this.input.length - this.pos >= 3) {
712 const c0 = this.input[this.pos];
713 const c1 = this.input[this.pos + 1];
721 }
722 }
723 > yaml.ts
724 > // Auto-detect content indent from first non-empty line.
725 > // Content must be more indented than the parent block.
726 > if (contentIndent === 0) {
727 > if (lineIndent <= parentBlockIndent) {
728 // Not enough indentation - terminates the block scalar
729 this.pos = lineStart;
730 break;
731 }
732 > contentIndent = lineIndent; yaml.ts
733 > }
734 >
735 > // If this line's indentation is less than the content indent, the block scalar is done
736 > if (lineIndent < contentIndent) {
737 this.pos = lineStart;
738 break;
739 }
740 > yaml.ts
741 > // Read the rest of the line (the content)
742 > const contentStart = lineStart + contentIndent;
743 > while (this.pos < this.input.length && this.input[this.pos] !== '\n' && this.input[this.pos] !== '\r') {
744 > this.pos++;
745 > }
746 > // The line content includes any extra indentation beyond contentIndent
747 > const lineContent = this.input.substring(contentStart, this.pos);
748 > lines.push(lineContent);
749 > trailingNewlines = 0;
750 >
751 > // Skip newline
752 > this.consumeNewline();
753 > }
754 >
755 > // Process the collected lines according to the block scalar style
756 > let value: string;
757 > if (style === '|') {
758 // Literal: join lines with newlines (preserving all line breaks as-is)
759 value = lines.join('\n');
760 > } else { yaml.ts
761 // Folded: per YAML spec, line breaks between adjacent non-more-indented
762 // content lines are folded into spaces. More-indented lines preserve breaks.
807 }
808 }
809 > yaml.ts
810 > // Apply chomping to trailing newlines
811 > if (trailingNewlines > 0) {
812 // Strip all trailing newlines from the value
813 let end = value.length;
817 value = value.substring(0, end);
818 }
819 > yaml.ts
820 > // Determine if there was any actual (non-empty) content
821 > const hasContent = lines.some(l => l !== '');
822 >
823 > switch (chomping) {
824 > case 'clip':
825 if (hasContent) {
826 // Add exactly one trailing newline
828 }
829 break;
830 > case 'keep': yaml.ts
831 if (hasContent) {
832 // Content + trailing: final line break + trailing empty line breaks
837 }
838 break;
839 > case 'strip': yaml.ts
840 // No trailing newline
841 break;
842 > } yaml.ts
843 >
844 > const rawValue = this.input.substring(start, this.pos);
845 > this.tokens.push(makeToken(TokenType.Scalar, start, this.pos, {
846 > rawValue,
847 > value,
848 > format: style === '|' ? 'literal' : 'folded',
849 > }));
850 > }
851
852 /**
858 */
859 private getParentBlockIndent(blockScalarPos: number): number {
860 > for (let i = this.tokens.length - 1; i >= 0; i--) { yaml.ts
861 > const t = this.tokens[i];
862 > if (t.type === TokenType.Newline || t.type === TokenType.Comment || t.type === TokenType.Indent) { continue; }
863 > if (t.type === TokenType.Colon) {
864 > // Block scalar is a mapping value. The parent indentation
865 > // is the column of the mapping key (the scalar before the colon).
866 > for (let j = i - 1; j >= 0; j--) {
867 > const kt = this.tokens[j];
868 > if (kt.type === TokenType.Newline || kt.type === TokenType.Comment || kt.type === TokenType.Indent) { continue; }
869 > // Found the key token - return its column
870 > return this.getColumnAt(kt.startOffset);
871 > }
872 return 0;
873 }
882 }
883 return 0;
884 > } yaml.ts
885
886 /**
888 */
889 private getColumnAt(offset: number): number {
890 > let col = 0; yaml.ts
891 > let p = offset - 1;
892 > while (p >= 0 && this.input[p] !== '\n' && this.input[p] !== '\r') {
893 col++;
894 p--;
895 }
896 > return col; yaml.ts
897 > }
898
899 private scanComment(): void {