debugadapter

package
v0.14.10 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 28 Imported by: 0

Documentation

Overview

Package debugadapter contains the language-specific edge of debugging: source target discovery, deterministic launch policy, and the descriptor for starting each language's standalone Debug Adapter Protocol process.

Protocol framing and session state remain in package dap.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Breakpoint

type Breakpoint struct {
	FilePath string
	Line     int
	Column   int
}

type Connector

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

Connector bridges host-created adapters into the language-neutral DAP manager. At present only java-debug needs this path.

func NewConnector

func NewConnector(service *language.Service) *Connector

func (*Connector) ConnectAdapter

func (connector *Connector) ConnectAdapter(ctx context.Context, plan dap.Plan) (io.ReadWriteCloser, error)

type LanguageAdapter

type LanguageAdapter interface {
	Language() string
	Descriptor() dap.AdapterDescriptor
	Matches(path string) bool
	Detect(path string, source []byte) ([]Target, error)
	Plan(Request) (Plan, error)
}

LanguageAdapter owns all stable language-specific behavior. Implementations must not execute user code while detecting targets or preparing a plan.

type Plan

type Plan struct {
	Title               string
	Summary             string
	ProjectDir          string
	Request             string
	IO                  dap.IOMode
	SupportsTerminal    bool
	Configuration       map[string]any
	Breakpoints         []Breakpoint
	FunctionBreakpoints []string
}

type Registry

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

func NewRegistry

func NewRegistry() *Registry

func NewRegistryWith

func NewRegistryWith(adapters ...LanguageAdapter) *Registry

func (*Registry) Descriptors

func (registry *Registry) Descriptors() []dap.AdapterDescriptor

func (*Registry) DetectFile

func (registry *Registry) DetectFile(path string, source []byte) ([]Target, error)

func (*Registry) DetectWorkspace

func (registry *Registry) DetectWorkspace(ctx context.Context, root string) ([]Target, error)

func (*Registry) JDTLSBundles

func (registry *Registry) JDTLSBundles() []string

JDTLSBundles returns Java debug plug-ins that must be loaded when JDT LS is initialized. The Java DAP server is supplied by this bundle, not by a standalone executable.

func (*Registry) Plan

func (registry *Registry) Plan(language string, request Request) (Plan, error)

type Request

type Request struct {
	Action       string
	WorkspaceDir string
	ProjectDir   string
	Target       Target
}

type Target

type Target struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	Detail    string `json:"detail,omitempty"`
	Kind      string `json:"kind"`
	Language  string `json:"language"`
	Path      string `json:"path"`
	Directory string `json:"directory"`
	Line      int    `json:"line"`
	Column    int    `json:"column"`
}

Jump to

Keyboard shortcuts

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