You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* start writing ### Automatically transforming scripts into debugger commands + some screenshots
* improve Automatically transforming scripts into debugger commands and add How to load a scripting library
---------
Co-authored-by: FlavienVolant <[email protected]>
Copy file name to clipboardExpand all lines: sindarin/extending.md
+38-11Lines changed: 38 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -260,18 +260,36 @@ here, you can see all your saved scripts. Select 'Step Until #parseObject', then
260
260
261
261
### Automatically transforming scripts into debugger commands
262
262
263
-
(This part do Adding a new menu extending the debugger and Command for you)
263
+
Previously we learned how to turn a script to a command. We had to manually extend the debugger and its toolbar and create our SindarinCommand subclasse. Theses steps are not easy and can be redundant especially if you wish to have several commands.
264
264
265
-
Click the "+" button (Create a command from the current debugging scripts)
266
-
Then give your command a description and give it an Icon (from the pharo icon list)
267
-
Restart your debuggeur to update the menus lists and theirs commands (By default your command is created in the "Scripts" menu).
268
-
If you don't want this command in your group you can delete it by pressing the "x" button.
265
+
Fortunately transforming a script to a debugger command make this process for you !
266
+
267
+
First, load or write your script and then click the "Create a command from the current debugging scripts" button:
268
+

The script name is used to generate the command name.
273
+
You can give your command a description and select an icon (from the pharo icon list) before clicking 'Create'.
274
+
275
+
Restart your debuggeur to update the menus lists and theirs commands (By default your command is created in the "Scripts" menu) now you should see your command menu with yout command in it !
276
+

277
+
278
+
If you wish to find the generated code go to the package 'NewTools-Sindarin-Tools' (it's the default location):
- In the tag 'Extensions', in StDebugger class side you can find the method to 'buildSindarin...ExtensionCommandsGroupWith: forRoot' that add your menu:
If you wish to remove a command from your group, load it from the script loader and delete it by pressing the "x" button. The generated code is deleted.
269
285
270
286
### Build your own scripting library and make it available to the community
271
287
272
-
create a new class in your package, this class should extend StSindarinDebuggerScriptRepository
288
+
For now every commands you create are display in the 'Scripts' group. You may be working on domain specific scripts and wish to have them in a specific group, like previously with the STON group.
289
+
290
+
In the package you want to save your commands, create a class wich extend StSindarinDebuggerScriptRepository
0 commit comments