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

support syntax highlighting for code documentation comments #75181

Open
Meir017 opened this issue Sep 20, 2024 · 0 comments
Open

support syntax highlighting for code documentation comments #75181

Meir017 opened this issue Sep 20, 2024 · 0 comments
Labels
Area-IDE Feature Request untriaged Issues and PRs which have not yet been triaged by a lead

Comments

@Meir017
Copy link
Contributor

Meir017 commented Sep 20, 2024

Summary

In many libraries authors add code sample inside the <code> documentation comment, it would be helpful to have syntax highlighting for these code comments

Background and Motivation

This type of syntax-highlighting already exists in the form of adding a // lang=C#-test or annotation an argument with [StringSyntax("C#-test")]

however, this doesn't work

// lang=C#-test
var code = """
using System;
using System.Text;
var builder = new StringBuilder();
test.AppendLine(""Hello, World!"");
Console.WriteLine(builder.ToString());
""";

/// <code lang="C#-test">
/// using System;
/// using System.Text;
/// var builder = new StringBuilder();
/// test.AppendLine("Hello, World!");
/// Console.WriteLine(builder.ToString());
/// </code>
void Test() { }

from vscode:
image

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Feature Request untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

No branches or pull requests

1 participant