Skip to content
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

feat: render keybinding label for chat /help command link #199831

Merged
merged 1 commit into from
Dec 2, 2023

Conversation

joyceerhl
Copy link
Contributor

@joyceerhl joyceerhl self-assigned this Dec 2, 2023
@joyceerhl joyceerhl enabled auto-merge (squash) December 2, 2023 00:18
@joyceerhl joyceerhl merged commit 4fc3ed3 into main Dec 2, 2023
7 checks passed
@joyceerhl joyceerhl deleted the dev/joyceerhl/conscious-horse branch December 2, 2023 00:37
@@ -814,7 +816,18 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
const disposables = new DisposableStore();
let codeBlockIndex = 0;

markdown = new MarkdownString(markdown.value, {
// inject keybinding hints for command links
const value = markdown.value.replace(/\[([^\]]+)\]\(command:([^\)]+)\)/g, (match, label, command) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer doing this on the other side of the markdown renderer, like

export function walkTreeAndAnnotateReferenceLinks(element: HTMLElement): void {
, because then we could be sure that the command link was actually allowed and not stripped by the sanitizer, or that it was actually a link and not something in a codeblock. This is fine for now

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would hit this

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

/help inline chat link doesn't work
3 participants