dap

package
v0.1.0-rc.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package dap implements the Debug Adapter Protocol independently of the UI and of the transport used to reach the adapter.

Index

Constants

View Source
const MaxMessage = 32 << 20

Variables

View Source
var ErrClosed = errors.New("dap: connection closed")

Functions

func Call

func Call[A, R any](ctx context.Context, c *Conn, command string, args A) (R, error)

Types

type Breakpoint

type Breakpoint struct {
	Message  string `json:"message"`
	Source   Source `json:"source"`
	ID       int    `json:"id"`
	Line     int    `json:"line"`
	Verified bool   `json:"verified"`
}

type Capabilities

type Capabilities struct {
	ExceptionBreakpointFilters []ExceptionFilter `json:"exceptionBreakpointFilters"`
	ConfigurationDone          bool              `json:"supportsConfigurationDoneRequest"`
	ConditionalBreakpoints     bool              `json:"supportsConditionalBreakpoints"`
	HitConditionalBreakpoints  bool              `json:"supportsHitConditionalBreakpoints"`
	LogPoints                  bool              `json:"supportsLogPoints"`
	Terminate                  bool              `json:"supportsTerminateRequest"`
	VariablePaging             bool              `json:"supportsVariablePaging"`
}

type Conn

type Conn struct {
	// contains filtered or unexported fields
}

func New

func New(stream io.ReadWriteCloser, event func(string, json.RawMessage), handler Handler) *Conn

New owns stream. Event callbacks must return promptly; requests may be made from a callback because responses are routed by the independent reader.

func (*Conn) Call

func (c *Conn) Call(ctx context.Context, command string, args any, result any) error

Call preserves adapter-specific arguments and results without a closed command enumeration. Cancellation removes the pending request immediately.

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) Done

func (c *Conn) Done() <-chan struct{}

func (*Conn) Err

func (c *Conn) Err() error

func (*Conn) EventsDone

func (c *Conn) EventsDone() <-chan struct{}

EventsDone closes after queued adapter events have been delivered, including terminal events immediately preceding EOF.

type EvaluateResponse

type EvaluateResponse struct {
	Result             string `json:"result"`
	Type               string `json:"type"`
	VariablesReference int    `json:"variablesReference"`
	NamedVariables     int    `json:"namedVariables"`
	IndexedVariables   int    `json:"indexedVariables"`
}

type ExceptionFilter

type ExceptionFilter struct {
	Filter  string `json:"filter"`
	Default bool   `json:"default"`
}

type Handler

type Handler func(context.Context, string, json.RawMessage) (any, error)

type Message

type Message struct {
	Type       string          `json:"type"`
	Command    string          `json:"command,omitempty"`
	Message    string          `json:"message,omitempty"`
	Event      string          `json:"event,omitempty"`
	Arguments  json.RawMessage `json:"arguments,omitempty"`
	Body       json.RawMessage `json:"body,omitempty"`
	Seq        int             `json:"seq"`
	RequestSeq int             `json:"request_seq,omitempty"`
	Success    bool            `json:"success"`
}

type RunInTerminalArguments

type RunInTerminalArguments struct {
	Env                         map[string]*string `json:"env"`
	Kind                        string             `json:"kind"`
	Title                       string             `json:"title"`
	Cwd                         string             `json:"cwd"`
	Args                        []string           `json:"args"`
	ArgsCanBeInterpretedByShell bool               `json:"argsCanBeInterpretedByShell"`
}

type Scope

type Scope struct {
	Name               string `json:"name"`
	VariablesReference int    `json:"variablesReference"`
	Expensive          bool   `json:"expensive"`
}

type Source

type Source struct {
	Name            string `json:"name,omitempty"`
	Path            string `json:"path,omitempty"`
	SourceReference int    `json:"sourceReference,omitempty"`
}

type SourceBreakpoint

type SourceBreakpoint struct {
	Condition    string `json:"condition,omitempty"`
	HitCondition string `json:"hitCondition,omitempty"`
	LogMessage   string `json:"logMessage,omitempty"`
	Line         int    `json:"line"`
	Column       int    `json:"column,omitempty"`
}

type StackFrame

type StackFrame struct {
	Name   string `json:"name"`
	Source Source `json:"source"`
	ID     int    `json:"id"`
	Line   int    `json:"line"`
	Column int    `json:"column"`
}

type StoppedEvent

type StoppedEvent struct {
	Reason            string `json:"reason"`
	Description       string `json:"description"`
	ThreadID          int    `json:"threadId"`
	AllThreadsStopped bool   `json:"allThreadsStopped"`
}

type Thread

type Thread struct {
	Name string `json:"name"`
	ID   int    `json:"id"`
}

type Variable

type Variable struct {
	Name               string `json:"name"`
	Value              string `json:"value"`
	Type               string `json:"type"`
	EvaluateName       string `json:"evaluateName"`
	VariablesReference int    `json:"variablesReference"`
	NamedVariables     int    `json:"namedVariables"`
	IndexedVariables   int    `json:"indexedVariables"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL