Small cleanup, better readme

This commit is contained in:
Krzosa Karol
2024-01-25 10:11:06 +01:00
parent 1ee4f8ce39
commit 720498a28e
5 changed files with 21 additions and 64 deletions

View File

@@ -4,5 +4,4 @@
{ "keys": ["shift+f5"], "command": "remedy_stop_debugging" },
{ "keys": ["f9"], "command": "remedy_set_breakpoint" },
{ "keys": ["ctrl+shift+f5"], "command": "remedy_restart_debugging" },
{ "keys": ["ctrl+t"], "command": "remedy_all_in_one" },
]

View File

@@ -1,9 +0,0 @@
[
{
"button": "button3",
"count": 1,
"modifiers": [],
"command": "remedy_all_in_one",
"press_command": "drag_select"
}
]

View File

@@ -17,14 +17,26 @@ You can buy the debugger here:
cd "%appdata%\Sublime Text\Packages"
git clone https://github.com/krzosa/Sublime_RemedyBG
```
Launch Sublime (maybe you will need Package Control + and call Package Control: Satisfy Dependencies?)
- Make sure you have package control (Ctrl + Shift + P => Install Package Control)
- Ctrl + Shift + P => Satisfy Dependencies
- Restart Sublime
Optional:
* Add remedy_executable to your settings if remedybg is not on your path or has different name.
* Setup vcvarsall, Look at vcvarsall section in readme.
- If remedybg is not on your path or has different name, change remedy_executable in your personal sublime settings, look at Remedy.sublime-settings for syntax reference.
- Setup visual studio developer's prompt or "vcvarsall", look at vcvarsall section in readme.
### Build before debugging
### Usage
By default plugin binds to standard debugger hotkeys. You can edit them in your personal sublime keybindings, look at "Default.sublime-keymap" for syntax reference.
- Ctrl + F10: Run to cursor
- F5: Start debugging
- Shift + F5: Stop debugging
- F9: Set breakpoint
- Ctrl + Shift + F5 - Restart debugging
### Bonus: Build before debugging
Sadly Sublime doesn't allow for querying of currently chosen build system.
Neither does it allow for effective hook into the builtin ```build``` command
@@ -55,24 +67,14 @@ you will need to add a field called ```remedy_build_system```, here is an exampl
]
}
```
### Setting up Microsoft compiler enviroment with vcvarsall.bat
### Bonus: Setting up Microsoft compiler enviroment with vcvarsall.bat
If you are developing using remedybg it seems pretty obvious that you would want access to the Microsoft compiler so additionally the package is shipping with the ```setup_vsvars.py```. You need to update the path to your vcvarsall inside ```Remedy.sublime-settings``` or your global ```Preferences.sublime-settings```. THIS ONLY WORKS FOR REMEDY_BUILD!!! If you want to setup vcvarsall for the builtin ```build``` command, copy setup_vsvars.py to your ```User``` folder. You will have 2 copies one in remedy folder and the other in user folder. You need 2 copies because it seems that sublime heavily sandboxes packages from eachother so this package cannot influence the global enviroment. If anyone has any ideas how to make it global I would be happy to hear them.
If you are developing using remedybg it seems pretty obvious that you would want access to the Microsoft compiler so additionally the package is shipping with the ```setup_vsvars.py```.
Update these settings: (you can put them into global settings ```Preferences.sublime-settings``` or ```Remedy.sublime-settings```)
```
"vc_vars_cmd": "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat",
"vc_vars_arch": "amd64",
```
1. Copy content of setup_vcvarsall to your ```User``` folder for normal build commands or to ```Sublime_RemedyBG``` dir for remedy_build.
2. You need to update the path to your vcvarsall inside your global sublime settings/preferences, use ```Remedy.sublime-settings``` for reference.
### All in one
Feature idea. By clicking using your middle mouse button you can issue most
of the available debugger commands.
* Debugger goes to the place you clicked on
* The word you clicked is going to get added to watch window
* If the word you clicked on matches "rt"(run_to_cursor), "r"(run), "rr"(stop), "rrr"(restart) then it's going to delete that word in sublime and issue a debugger command. So far I have found it to be nice for code discovery kind of stuff with the mouse + keyboard workflow, you can bind this to the keyboard too though. The commands are easy to type using single hand.
If you want vcvars for both remedy_build and normal sublime build, you will need to have 2 copies, one in remedy folder and the other in user folder. You need 2 copies because it seems that sublime heavily sandboxes packages from eachother so this package cannot influence the global enviroment. If anyone has any ideas how to make it global I would be happy to hear them.
### Credits

View File

@@ -554,41 +554,6 @@ class RemedyAddToWatchCommand(sublime_plugin.TextCommand):
remedy_instance.add_watch(self.view.substr(region_cursor))
class RemedyAllInOneCommand(sublime_plugin.TextCommand):
def run(self, edit):
if remedy_instance.try_launching():
return
sel = self.view.sel()
if len(sel) > 1:
return
region_cursor = sel[0]
settings = self.view.settings()
old_boundaries = settings.get("word_separators")
settings.set("word_separators"," ;,")
region_word_on_cursor = self.view.word(region_cursor)
settings.set("word_separators", old_boundaries)
remedy_instance.goto_cursor()
content = self.view.substr(region_word_on_cursor)
if content == "r":
remedy_instance.send_command(COMMAND_START_DEBUGGING)
self.view.replace(edit, region_word_on_cursor, "")
elif content == "rr":
remedy_instance.stop_debugging()
self.view.replace(edit, region_word_on_cursor, "")
elif content == "rrr":
remedy_instance.send_command(COMMAND_RESTART_DEBUGGING)
self.view.replace(edit, region_word_on_cursor, "")
elif content == "rt":
remedy_instance.run_to_cursor()
self.view.replace(edit, region_word_on_cursor, "")
else:
remedy_instance.add_watch(content)
class RemedyOnBuildCommand(sublime_plugin.EventListener):
def on_window_command(self, window, command_name, args):
if remedy_instance.is_connected() == False: