-
Notifications
You must be signed in to change notification settings - Fork 63
Refactor dump command #1161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Refactor dump command #1161
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the "dump server state" command by moving its logic from the client to the server to enable editor-agnostic usage. The refactoring converts a custom client-side command into a standard LSP executeCommand request, with the server handling file writing and opening via the window/showDocument LSP request.
Key changes:
- Server now handles all dump logic including reading package.json version, formatting state, writing to disk, and opening the file
- Client command simplified to a single
executeCommandrequest - Old client-side
dump_server_state.tsfile removed entirely
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| server/src/server.ts | Added async dumpServerState function, registered executeCommand capability, and added handler for workspace/executeCommand requests |
| client/src/extension.ts | Simplified command handler to send executeCommand request to server instead of handling logic client-side |
| client/src/commands/dump_server_state.ts | Removed entire file as functionality moved to server |
| client/src/commands.ts | Removed export of now-deleted dumpServerState function |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
I would like to wire this up in another editor, so I shuffled some logic to the server to more easily hook it up elsewhere.