-
Notifications
You must be signed in to change notification settings - Fork 213
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
Debug: new button to export log #3256
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.
Awesome!
vscode/src/services/export-logs.ts
Outdated
// search for the file name that ends with 'Cody by Sourcegraph.log' inside the outputdir | ||
const outputDir = vscode.Uri.joinPath(logDir, outputDirStat[0]) | ||
const outputFiles = await vscode.workspace.fs.readDirectory(outputDir) | ||
const logFile = outputFiles.find(file => file[0].endsWith('Cody by Sourcegraph.log')) |
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.
Interesting! is there a way we can avoid hardcoding these values and use the ones that are currently defined for the extension name etc?
Want to avoid breaking it if we decide to change the name
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.
good point, let me check on this!
vscode/src/services/export-logs.ts
Outdated
) | ||
|
||
if (!outputDirStat) { | ||
return |
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.
Maybe if this fails here or below, we can just open the output channel as a fallback?
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.
good idea!
Can we move it behind the “…” menu, out of the treeview? Thanks! |
for sure! What is ... menu though 😆 |
When you hover over “Settings & Support” there’s the “…” button, and it opens an OS popover menu. From memory the getting started guide is there (that’s actually probably a better candidate for the treeview). If we could have the export action appear in the “…” popover menu, instead of the treeview, I think that would be best. |
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.
🙇
|
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.
Love it! One tiny thing about the action labeling, given it’s not atomic (opens the file save dialog)
Can we mention in the changelog/PR that it’s also available in the standard VS Code command palette? I feel like the easiest instructions for support people is to tell people to type Cmd-Shift-P and type “Cody export logs”
Co-authored-by: Tim Lucas <t@toolmantim.com>
Co-authored-by: Tim Lucas <t@toolmantim.com>
proof of concept: Add functionality to export Cody output logs using VS Code API
This PR introduces the ability to export Cody output as log file in the VS Code extension by utilizing the VS Code API. It provides a seamless log export experience that is compatible with all VS Code client types that supports the VS Code API.
Updated:
Moved to the ... menu
Follow-up
We should enable debugs by default.
Test plan
Click on the "Export logs" icon in the sidebar to export the text from output channel.
export.mov