Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Debugging ZLS can be very annoying because it is hardly possible to use debugger like gdb or lldb because of how ZLS has to interacts with its client.
This PR adds a new command to ZLS
zls --replay
which allows you to replay a previously recorded zls session.This should allow everyone to share reproducable issues with zls with just one file and make debugging them much easier.
Having this feature integrated into https://github.com/zigtools/sus and http://zls-fuzzing.augustera.me/ would be very useful.
A replay also saves and uses the configuration options used when the replay was recorded.
This could also be expanded to include the zig and zls version used while recording.
Unfortunately these replays are not perfect, reasons why they may not reproduce an issue are:
How do i record a replay?
A replay contains the source code you are using in your editor. DO NOT share replays if you don't want to show your code.
Step 1: Enable record_session
Open your
zls.json
and set therecord_session
totrue
and specifyrecord_session_path
, which is where your replay will be created.Example:
NOTE: you can use
zls --show-config-path
to find yourzls.json
. If this fails you can runzls --config
Step 2: Record a session
Open your favorite editor which uses ZLS and do some random editing. Once you are finished you should find your
.zlsreplay
file where you specified it. Make sure you have closed your editor before using the.zlsreplay
file.In VS-Code you should find a message saying
This zls session is being recorded to <your_path>
.Step 3: Replay a session
Now you can use
zls --replay
which will simulate your editor session you had in Step 2.ZLS will find your replay file based on
record_session_path
.Alternatively you can run
zls --replay /path/to/file.zlsreplay
or specifyreplay_session_path
which has higher precedence thatrecord_session_path
.hopefully i never have to see
std.debug.print("HERE", .{})
again in my life.