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 · 3 comments
Open

support syntax highlighting for code documentation comments #75181

Meir017 opened this issue Sep 20, 2024 · 3 comments
Labels
Area-IDE Concept-Design Debt Engineering Debt, Design Debt, or poor product code quality LSP issues related to the roslyn language server protocol implementation untriaged Issues and PRs which have not yet been triaged by a lead VSCode

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
@sharwell sharwell added LSP issues related to the roslyn language server protocol implementation VSCode Concept-Design Debt Engineering Debt, Design Debt, or poor product code quality and removed Feature Request labels Sep 24, 2024
@sharwell
Copy link
Member

Changing from Feature Request to Design Debt, since this feature was originally implemented in #35667 and the more recent LSP work failed to meet parity.

@CyrusNajmabadi
Copy link
Member

@sharwell we added support for c# syntax highlighting within a doc comment codeblock in VS?

@sharwell
Copy link
Member

@CyrusNajmabadi Sorry, I added the above comment after seeing #75215. There are two separate reports here: a request for syntax highlighting, and an observation that the comment renders as inline text instead of a code block. The part implemented previously is just the code block portion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Concept-Design Debt Engineering Debt, Design Debt, or poor product code quality LSP issues related to the roslyn language server protocol implementation untriaged Issues and PRs which have not yet been triaged by a lead VSCode
Projects
None yet
Development

No branches or pull requests

3 participants