Debugging - XLRIT/gears GitHub Wiki
At times you need to debug your application. This is how you do that from VS Code:
Prerequisites
- From VS Code simply install the extension Java Extension Pack.
- Have you GEARS project open in a VS code window. We will call this your GEARS VS Code window.
Debugging
- From your project folder open a new VS Code windows and then open the generated Java project folder. We will call this you Java VS Code window. We'll use a project called planning as an example.
- Open the file you want to debug and just left of the line number you want your debugging to start, simply click on it and a red dot will appear. See screenshot below:
You can add multiple breakpoints if you like.
- Now use menu Run > Start Debugging (or press [F5] or click the Run and Debug button).
- If you need to choose which class to start, simply choose the first (and only) option.
Your application should start and you will see logging in the Terminal pane of VS Code.
- You you have any data to load: from you GEARS VS Code window, press [CTRL+SHIFT+B] and choose GEARS: ... Load data
- From now use your application as you would normally do. You application will stop on the breakpoints you have set.
Good to know
- [F5] = try to go to the next break-point and start the application in debug mode if it was not yet started like that.
- [F10] = step over, which means continue and stop at the next statement.
- [F11] = step into, which means continue but the debugger will try to dive into the first (not yet executed) method or function of the current line.
- [SHIFT+F11] = step out, which means continue and stop only when the method/function you just dove into has ended.
- You can hover over almost any value and investigate its current value. See screenshot below in where we hover over the value of
playerToBePlacedExecution
(red arrow) which is an array of players and their planning score which we can expand (blue arrow):
- In Home the setting
graphql.servlet.async-timeout
is described. While debugging you may want to set this to a rather high value.