Skip to content

Commit 74fb8e5

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 94352db + bfdbe82 commit 74fb8e5

4 files changed

Lines changed: 161 additions & 47 deletions

File tree

Readme_BeamNG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ This project consists of a c++ part that is compiled with the game and runs with
99
# Prerequisites
1010

1111
1) [Install VSCode](https://code.visualstudio.com)
12-
2) Install the [`LRDB` (Lua Remote Debugger) extension](https://marketplace.visualstudio.com/items?itemName=satoren.lrdb) for VScode
12+
2) Install the [`LRDB` (Lua Remote Debugger) extension](https://marketplace.visualstudio.com/items?itemName=beamng.lrdb-beamng) for VScode
1313

1414
# Quickstart
1515

1616
1) Open game folder in VScode as workspace: `File` > `Open Folder...` > `<select game folder>`
1717
2) Place breakpoints in your Lua files. (Highlight a line and press `F9`)
18-
3) Start the game separatly with the command line arguments
18+
3) Start the game separately with the command line arguments (case sensitive!)
1919
`-luadebug -attachOnStart` - The game will hang and wait for VScode to connect.
2020
4) Press `F5` in VScode (Launch in VScode to attach to the game).
2121

@@ -118,4 +118,4 @@ Run: `extensions.test_debugger.test()`
118118

119119
The debugger is based on [LRDB-0.3.1](https://github.com/satoren/LRDB) but with heavy modifications for compatiblity and speed.
120120

121-
See [LICENSE_1_0.txt](LICENSE_1_0.txt)
121+
See [LICENSE_1_0.txt](LICENSE_1_0.txt)

src/debugger/Client.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
} from './JsonRpc'
1010

1111
export type DebugRequest =
12+
| InitRequest
1213
| StepRequest
1314
| StepInRequest
1415
| StepOutRequest
@@ -84,6 +85,16 @@ export class Client {
8485
})
8586
}
8687

88+
init = (
89+
params: InitRequest['params']
90+
): Promise<DebugResponseType<InitRequest>> =>
91+
this.send({
92+
method: 'init',
93+
jsonrpc: '2.0',
94+
id: this.seqId++,
95+
params,
96+
})
97+
8798
step = (): Promise<DebugResponseType<StepRequest>> =>
8899
this.send({ method: 'step', jsonrpc: '2.0', id: this.seqId++ })
89100
stepIn = (): Promise<DebugResponseType<StepInRequest>> =>
@@ -209,6 +220,12 @@ export interface RunningNotify extends JsonRpcNotify {
209220
params?: never
210221
}
211222

223+
export interface InitRequest extends JsonRpcRequest {
224+
method: 'init'
225+
params: {
226+
protocol_version: string
227+
}
228+
}
212229
interface StepRequest extends JsonRpcRequest {
213230
method: 'step'
214231
params?: never
@@ -310,6 +327,7 @@ type Breakpoint = {
310327
}
311328

312329
type ResponseResultType = {
330+
init: never
313331
get_stacktrace: StackInfo[]
314332
get_local_variable: Record<string, unknown>
315333
get_upvalues: Record<string, unknown>

src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { LuaInstancesTreeViewProvider } from './luaInstancesTreeViewProvider'
99
// The compile time flag 'runMode' controls how the debug adapter is run.
1010
// Please note: the test suite only supports 'external' mode.
1111
// 'inline' mode is great for debugging.
12-
const runMode: 'external' | 'server' | 'inline' = 'external'
12+
const runMode: 'external' | 'server' | 'inline' = 'server'
1313

1414
export function activate(context: vscode.ExtensionContext): void {
1515

0 commit comments

Comments
 (0)