MCPcopy Create free account
hub / github.com/YtFlow/Maple / parseSectionGeneral

Function parseSectionGeneral

Maple.App/MonacoEditor/src/parse.ts:125–141  ·  view source on GitHub ↗
(
    model: monaco.editor.ITextModel,
    struct: ILeafConfStruct,
)

Source from the content-addressed store, hash-verified

123}
124
125export function parseSectionGeneral(
126 model: monaco.editor.ITextModel,
127 struct: ILeafConfStruct,
128): ILeafConfKvItem[] {
129 let ret: ILeafConfKvItem[] = []
130 for (const lineId of struct.sections
131 .filter(s => s.sectionName === SECTION_GENERAL)
132 .flatMap(s => Array.from({ length: s.endLine - s.startLine }, (_, i) => i + s.startLine + 1))) {
133
134 const line = model.getLineContent(lineId)
135 const item = parseKvLine(line, lineId, 1)
136 if (item !== undefined) {
137 ret.push(item)
138 }
139 }
140 return ret
141}

Callers 1

completeGeneralSectionFunction · 0.90

Calls 1

parseKvLineFunction · 0.85

Tested by

no test coverage detected