MCPcopy
hub / github.com/imcuttle/mometa / insertContent

Function insertContent

packages/fs-handler/src/common/insert-node.ts:17–28  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15 let lineChars = line.toChars()
16
17 const insertContent = async () => {
18 if (newText) {
19 lineChars.insert(toPos.column, newText)
20 } else if (material) {
21 const ops = await getAddMaterialOps(ctx.lineContents, toPos, material)
22 await ctx.runLoop(ops.insertDeps as any, ctx)
23 if (ops.insertCode) {
24 // @ts-ignore
25 lineChars.insert(toPos.column, ops.insertCode.preload.data?.newText)
26 }
27 }
28 }
29
30 if (wrap) {
31 const { startStr = '', endStr = '', anotherTo } = wrap

Callers 1

insertNodeMiddlewareFunction · 0.85

Calls 2

getAddMaterialOpsFunction · 0.90
insertMethod · 0.80

Tested by

no test coverage detected