-
Notifications
You must be signed in to change notification settings - Fork 29.3k
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
code block pasting in chat #233358
base: main
Are you sure you want to change the base?
code block pasting in chat #233358
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.
Looks like a good direction. Added a few initial comments on the paste api usage
const fileName = file.split('/').pop() || 'unknown file'; | ||
const start = ranges.startLineNumber; | ||
const end = ranges.endLineNumber; | ||
const resultText = `Copied Selection of Code: \n\n\n From the file: ${fileName} From lines ${start} to ${end} \n \`\`\`${code}\`\`\``; |
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.
Does this need to be valid markdown? If it does, you can use the createFencedCodeBlock
helper with have for copilot as this will handle cases where the code contains triple backticks
cc. @jrieken