Skip to content

VS Quick Info code sample formatting not preserved #57262

@scottaddie

Description

@scottaddie

Version Used:
Visual Studio 2022 17.0.0 Preview 6.0

Steps to Reproduce:

  1. Create a C# class with the following code:

    public class TestClient
    {
        /// <summary>
        /// Executes the logs query. Deserializes the result into a strongly typed model class or a primitive type if the query returns a single column.
        ///
        /// Example of querying a model:
        /// <example snippet="Snippet:QueryLogsAsModelCall">
        /// <code language="csharp"><![CDATA[
        /// Response<IReadOnlyList<MyLogEntryModel>> response = await client.QueryWorkspaceAsync<MyLogEntryModel>(
        ///     workspaceId,
        ///     "AzureActivity | summarize Count = count() by ResourceGroup | top 10 by Count",
        ///     new QueryTimeRange(TimeSpan.FromDays(1)));
        /// ]]></code>
        /// </example>
        ///
        /// </summary>
        /// <returns>Query results mapped to a type <typeparamref name="T"/>.</returns>
        public string QueryWorkspace() => "Testing";
    }    
  2. Instantiate the aforementioned class:

    var client = new TestClient();
    client.QueryWorkspace();
  3. Hover over the QueryWorkspace function call. In the Quick Info tooltip, notice that the whitespace (before the last 3 lines in the CDATA block) isn't preserved.

Expected Behavior:

The whitespace should be preserved and displayed in Quick Info.

Actual Behavior:

The whitespace is being ignored. All of the code aligns to the left margin.

image

/cc: @mikadumont

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions