buildMappings.ts — astro Source File
Architecture documentation for buildMappings.ts, a typescript file in the astro codebase. 2 imports, 1 dependents.
Entity Profile
Dependency Diagram
graph LR 18a90012_a9fe_857c_0c4e_1491c91fd354["buildMappings.ts"] 040ca79b_dadf_4383_efd2_c0b13744e9f1["language-core"] 18a90012_a9fe_857c_0c4e_1491c91fd354 --> 040ca79b_dadf_4383_efd2_c0b13744e9f1 240c179d_8195_bda1_51ea_09ccf72ff044["muggle-string"] 18a90012_a9fe_857c_0c4e_1491c91fd354 --> 240c179d_8195_bda1_51ea_09ccf72ff044 2208f162_1b21_d542_51aa_98ca1eda9260["parseJS.ts"] 2208f162_1b21_d542_51aa_98ca1eda9260 --> 18a90012_a9fe_857c_0c4e_1491c91fd354 style 18a90012_a9fe_857c_0c4e_1491c91fd354 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import type { Mapping } from '@volar/language-core';
import type { Segment } from 'muggle-string';
export function buildMappings<T>(chunks: Segment<T>[]) {
let length = 0;
const mappings: Mapping<T>[] = [];
for (const segment of chunks) {
if (typeof segment === 'string') {
length += segment.length;
} else {
mappings.push({
sourceOffsets: [segment[2]],
generatedOffsets: [length],
lengths: [segment[0].length],
data: segment[3]!,
});
length += segment[0].length;
}
}
return mappings;
}
Domain
Subdomains
Functions
Dependencies
- language-core
- muggle-string
Source
Frequently Asked Questions
What does buildMappings.ts do?
buildMappings.ts is a source file in the astro codebase, written in typescript. It belongs to the CoreAstro domain, RoutingSystem subdomain.
What functions are defined in buildMappings.ts?
buildMappings.ts defines 1 function(s): buildMappings.
What does buildMappings.ts depend on?
buildMappings.ts imports 2 module(s): language-core, muggle-string.
What files import buildMappings.ts?
buildMappings.ts is imported by 1 file(s): parseJS.ts.
Where is buildMappings.ts in the architecture?
buildMappings.ts is located at packages/language-tools/language-server/src/buildMappings.ts (domain: CoreAstro, subdomain: RoutingSystem, directory: packages/language-tools/language-server/src).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free