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 ¶
- func FindChromiumBrowser() string
- type Breakpoint
- type CommandExecutor
- type Connector
- type LanguageAdapter
- type Plan
- type Registry
- func (registry *Registry) Descriptors() []dap.AdapterDescriptor
- func (registry *Registry) DetectFile(path string, source []byte) ([]Target, error)
- func (registry *Registry) DetectWorkspace(ctx context.Context, root string) ([]Target, error)
- func (registry *Registry) Plan(language string, request Request) (Plan, error)
- func (registry *Registry) ServerInitializations() map[string]any
- type Request
- type Target
- type ToolDirectory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindChromiumBrowser ¶ added in v0.15.0
func FindChromiumBrowser() string
FindChromiumBrowser returns an explicitly configured or standard system Chromium-family installation.
Types ¶
type Breakpoint ¶
type CommandExecutor ¶ added in v0.15.0
type CommandExecutor interface {
ExecuteCommand(ctx context.Context, filePath string, content *string, command lsp.Command) (any, error)
}
CommandExecutor is the single language-service capability host connectors need: running a workspace-scoped LSP command against a source file. The composition layer injects the implementation so adapters never depend on service wiring.
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: its DAP socket is opened by JDT LS rather than a standalone executable.
func NewConnector ¶
func NewConnector(commands CommandExecutor) *Connector
func (*Connector) ConnectAdapter ¶
func (*Connector) PrepareAdapter ¶ added in v0.15.3
PrepareAdapter resolves the Java launch details normally supplied by the VS Code Java extension. java-debug requires these values even though its DAP endpoint is already hosted inside JDT LS.
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 Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry(toolDirectories ...ToolDirectory) *Registry
NewRegistry uses managed adapters and optionally loads their bundled files.
func NewRegistryWith ¶
func NewRegistryWith(adapters ...LanguageAdapter) *Registry
func (*Registry) Descriptors ¶
func (registry *Registry) Descriptors() []dap.AdapterDescriptor
func (*Registry) DetectFile ¶
func (*Registry) DetectWorkspace ¶
func (*Registry) ServerInitializations ¶ added in v0.15.0
ServerInitializations returns the language-server initialization options required by hosted adapters, keyed by server name.
type ToolDirectory ¶ added in v0.15.0
ToolDirectory locates managed installations for adapters that load bundled files in addition to resolving an executable availability token.