API reference / @jsprismarine/script-host / debugger/DebugSession
debugger/DebugSession
Classes
Interfaces
DebugSessionOptions
Defined in: script-host/src/debugger/DebugSession.ts:52
How a ScriptDebugSession presents the world's scripts to the extension.
Properties
diagnosticsTabs?
readonlyoptionaldiagnosticsTabs?: readonlyDiagnosticsTab[]
Defined in: script-host/src/debugger/DebugSession.ts:77
The tabs the SchemaEvent after the handshake describes; BDS's DIAGNOSTICS_TABS when absent.
fromDebuggerPath?
readonlyoptionalfromDebuggerPath?: (path) =>string
Defined in: script-host/src/debugger/DebugSession.ts:62
Turns a path from the extension into the engine's file name. The same path when absent.
Parameters
path
string
Returns
string
knowsFile?
readonlyoptionalknowsFile?: (file) =>boolean
Defined in: script-host/src/debugger/DebugSession.ts:64
Whether the engine knows a file, so a breakpoint in it is verified. Every file when absent.
Parameters
file
string
Returns
boolean
passcode?
readonlyoptionalpasscode?:string
Defined in: script-host/src/debugger/DebugSession.ts:56
The script-debugger-passcode the extension must send. None when absent or empty.
plugins
readonlyplugins: readonlyDebuggerPlugin[]
Defined in: script-host/src/debugger/DebugSession.ts:54
The script packs the extension may pick, by the UUID of each pack's script module.
pollLines?
readonlyoptionalpollLines?:number
Defined in: script-host/src/debugger/DebugSession.ts:75
The lines a running script runs between polls, DebuggerOptions.pollLines. The profiler samples the stack at each poll.
profilerClock?
readonlyoptionalprofilerClock?: () =>number
Defined in: script-host/src/debugger/DebugSession.ts:79
The time in microseconds, which labels the profiler's samples; the system clock when absent.
Returns
number
runCommand?
readonlyoptionalrunCommand?: (command,dimension) =>void
Defined in: script-host/src/debugger/DebugSession.ts:70
Runs a command the extension's command box sent, in the named dimension. It is called while the session handles a message, which can be inside a stopped or running script, so a host whose commands reach the scripts queues it for later.
Parameters
command
string
dimension
string
Returns
void
threadId?
readonlyoptionalthreadId?:number
Defined in: script-host/src/debugger/DebugSession.ts:58
The thread id the extension shows for the scripts.
toDebuggerPath?
readonlyoptionaltoDebuggerPath?: (file) =>string
Defined in: script-host/src/debugger/DebugSession.ts:60
Turns an engine file name into the path the extension knows it by. The same name when absent.
Parameters
file
string
Returns
string
DebuggerChannel
Defined in: script-host/src/debugger/DebugSession.ts:37
Carries whole messages between a session and the extension. A session calls it only on the engine's thread.
Properties
closed
readonlyclosed:boolean
Defined in: script-host/src/debugger/DebugSession.ts:48
Whether the connection has closed. receive and poll still return the messages that arrived before it closed.
Methods
poll()
poll():
unknown
Defined in: script-host/src/debugger/DebugSession.ts:43
Returns the next message if one has arrived, without waiting; undefined otherwise.
Returns
unknown
receive()
receive():
unknown
Defined in: script-host/src/debugger/DebugSession.ts:41
Returns the next message, waiting as long as it takes; undefined once the connection has closed.
Returns
unknown
send()
send(
message):void
Defined in: script-host/src/debugger/DebugSession.ts:39
Sends one message to the extension.
Parameters
message
Returns
void
Variables
DEFAULT_THREAD_ID
constDEFAULT_THREAD_ID:1=1
Defined in: script-host/src/debugger/DebugSession.ts:83
The thread id a session reports when none is given.