MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / CreateSubBlockCommand

Method CreateSubBlockCommand

pkg/wshrpc/wshserver/wshserver.go:299–307  ·  view source on GitHub ↗
(ctx context.Context, data wshrpc.CommandCreateSubBlockData)

Source from the content-addressed store, hash-verified

297}
298
299func (ws *WshServer) CreateSubBlockCommand(ctx context.Context, data wshrpc.CommandCreateSubBlockData) (*waveobj.ORef, error) {
300 parentBlockId := data.ParentBlockId
301 blockData, err := wcore.CreateSubBlock(ctx, parentBlockId, data.BlockDef)
302 if err != nil {
303 return nil, fmt.Errorf("error creating block: %w", err)
304 }
305 blockRef := &waveobj.ORef{OType: waveobj.OType_Block, OID: blockData.OID}
306 return blockRef, nil
307}
308
309func (ws *WshServer) ControllerDestroyCommand(ctx context.Context, blockId string) error {
310 blockcontroller.DestroyBlockController(blockId)

Callers

nothing calls this directly

Calls 1

CreateSubBlockFunction · 0.92

Tested by

no test coverage detected