-
Notifications
You must be signed in to change notification settings - Fork 2
debug
Daniel Larraz edited this page Jul 27, 2023
·
2 revisions
The LSP server can communicate with the client through either the stdin/stdout interface or TCP connection. By default, the client uses the stdin/stdout interface. For debugging the server, however, it's better to use the TCP interface.
- Ensure that all the tools for (
z3
,kind2
, andkind2-language-server
) are installed in the right locations. - Put a breakpoint in the lines that you want to debug.
- From the client workspace, press
F5
to run the Extension host debugger. This should open a new window of VS Code with extension enabled. - Open a Lustre file and reproduce the steps that trigger the breakpoint.
- Ensure that all the tools for (
z3
andkind2
) are installed in the right locations. - Modify lines 58-59 of
src/extension.ts
:// Create the language client and start the client. client = new LanguageClient( 'vscode-kind2', 'Kind 2', - serverOptions, - // connectToTCPServer(), + // serverOptions, + connectToTCPServer(), clientOptions );
- Put a breakpoint in the lines that you want to debug.
- From the client workspace, press
F5
to run the Extension host debugger. This should open a new window of VS Code with extension enabled. - Open a Lustre file.
- Add the following debug configurations to
.vscode/launch.json
in the server workspace:{ "version": "0.2.0", "configurations": [ { "type": "java", "name": "Launch Main", "request": "launch", "mainClass": "edu.uiowa.kind2.lsp.Main", "projectName": "kind2-language-server", "args": [ "23555" ] } ] }
- From the server workspace in a Java file, press
F5
to run the Java debugger (a Java debugger is included in extensions such as Extension Pack for Java). - Reproduce the steps that trigger the breakpoint.
After you finish debugging, restore lines 58-59 of src/extension.ts
:
// Create the language client and start the client.
client = new LanguageClient(
'vscode-kind2',
'Kind 2',
- // serverOptions,
- connectToTCPServer(),
+ serverOptions,
+ // connectToTCPServer(),
clientOptions
);