package message

type MsgIDEService struct {
	RequestId uint64 `json:"request_id"`
	Cmd       string `json:"cmd"`
	Sub       string `json:"sub"`
}

type RequestIDEService_GetDocumentSymbols struct {
	MsgIDEService
	FilePath string `json:"filepath"`
}

type ResponseIDEService[T any] struct {
	MsgIDEService
	Result T `json:"result"`
}

type Symbol struct {
	Name     string
	Kind     string
	Range    TextRange
	Children []Symbol
}

func (s Symbol) Iter(fn func(s Symbol) (stop bool)) {
	if fn(s) {
		return
	}
	for _, child := range s.Children {
		if fn(child) {
			return
		}
	}
}

