Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ namespace Microsoft.CodeAnalysis.CSharp
/// When runtime async is enabled for this await expression, this represents either:
/// <list type="bullet">
/// <item>
/// A call to <c>System.Runtime.CompilerServices.AsyncHelpers.Await</c>, if this is a
/// <description>A call to <c>System.Runtime.CompilerServices.AsyncHelpers.Await</c>, if this is a
/// supported task type. In such cases, <see cref="GetAwaiterMethod" />,
/// <see cref="IsCompletedProperty" />, and <see cref="GetResultMethod" /> will be
/// <see langword="null" />.
/// <see langword="null" />.</description>
/// </item>
/// <item>
/// A call to <c>System.Runtime.CompilerServices.AsyncHelpers.AwaitAwaiter|UnsafeAwaitAwaiter</c>.
/// <description>A call to <c>System.Runtime.CompilerServices.AsyncHelpers.AwaitAwaiter|UnsafeAwaitAwaiter</c>.
/// In these cases, the other properties may be non-<see langword="null" /> if the
/// the rest of the await expression is successfully bound.
/// the rest of the await expression is successfully bound.</description>
/// </item>
/// </list>
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ internal sealed partial class LocalRewriter
/// <summary>
/// Lowers a lock statement to a try-finally block that calls (before and after the body, respectively):
/// <list type="bullet">
/// <item>Lock.EnterScope and Lock+Scope.Dispose if the argument is of type Lock, or</item>
/// <item>Monitor.Enter and Monitor.Exit.</item>
/// <item><description>Lock.EnterScope and Lock+Scope.Dispose if the argument is of type Lock, or</description></item>
/// <item><description>Monitor.Enter and Monitor.Exit.</description></item>
/// </list>
/// </summary>
public override BoundNode VisitLockStatement(BoundLockStatement node)
Expand Down Expand Up @@ -122,20 +122,20 @@ public override BoundNode VisitLockStatement(BoundLockStatement node)
MethodSymbol? enterMethod;

if ((TryGetWellKnownTypeMember(lockSyntax, WellKnownMember.System_Threading_Monitor__Enter2, out enterMethod, isOptional: true) ||
TryGetWellKnownTypeMember(lockSyntax, WellKnownMember.System_Threading_Monitor__Enter, out enterMethod)) && // If we didn't find the overload introduced in .NET 4.0, then use the older one.
TryGetWellKnownTypeMember(lockSyntax, WellKnownMember.System_Threading_Monitor__Enter, out enterMethod)) && // If we didn't find the overload introduced in .NET 4.0, then use the older one.
enterMethod.ParameterCount == 2)
{
// C# 4.0+ version
// L $lock = `argument`; // sequence point
// bool $lockTaken = false;
// bool $lockTaken = false;
// try
// {
// Monitor.Enter($lock, ref $lockTaken);
// `body` // sequence point
// `body` // sequence point
// }
// finally
// { // hidden sequence point
// if ($lockTaken) Monitor.Exit($lock);
// { // hidden sequence point
// if ($lockTaken) Monitor.Exit($lock);
// }

TypeSymbol boolType = _compilation.GetSpecialType(SpecialType.System_Boolean);
Expand Down Expand Up @@ -185,11 +185,11 @@ public override BoundNode VisitLockStatement(BoundLockStatement node)
// Pre-4.0 version
// L $lock = `argument`; // sequence point
// Monitor.Enter($lock); // NB: before try-finally so we don't Exit if an exception prevents us from acquiring the lock.
// try
// try
// {
// `body` // sequence point
// }
// finally
// }
// finally
// {
// Monitor.Exit($lock); // hidden sequence point
// }
Expand Down
22 changes: 11 additions & 11 deletions src/Compilers/Core/Portable/Compilation/IImportScope.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,25 @@ namespace Microsoft.CodeAnalysis;
/// </summary>
/// <remarks>
/// <list type="bullet">
/// <item>Scopes returned will always have at least one non-empty property value in them.</item>
/// <item>Symbols may be imported, but may not necessarily be available at that location (for example, an alias
/// symbol hidden by another symbol).</item>
/// <item><description>Scopes returned will always have at least one non-empty property value in them.</description></item>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It seems unfortunate to require <description> in <item>s. We will likely need to fix this again at some point in the future unless we also create a linter for this.

Would it be possible to instead fix the rendering to handle the current form?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@kexugit @huangmin-ms Can you comment on Jan's question? What's the likelihood of a fix?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The docs here do state that <description> is required. However, that requirement does seem to be specific to the rendering on Learn, as the list renders correctly in IntelliSense without <description>:

image

(cc @BillWagner in case the doc should be updated to remove that requirement)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@gewarren unless I'm reading them wrong those docs only indicate that description is required when making a definition list. This is not a definition list, there is no listheader tag. This is just a normal bulleted list.

Copy link
Copy Markdown
Contributor Author

@gewarren gewarren Jan 7, 2026

Choose a reason for hiding this comment

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

@333fred I think you might have read them wrong, because they state that description is required for table items too

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Okay, I logged https://portal.microsofticm.com/imp/v5/incidents/details/731178896/summary for the reference docs team to address.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Given that it will likely be 6+ months (at least) for this to be fixed (many ref bugs don't ever get fixed), do you want to take this PR meanwhile?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Okay, I logged https://portal.microsofticm.com/imp/v5/incidents/details/731178896/summary for the reference docs team to address.

The fix is in progress. Will update the incident once it is deployed.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is fixed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thank you Min!

/// <item><description>Symbols may be imported, but may not necessarily be available at that location (for example, an alias
/// symbol hidden by another symbol).</description></item>
/// <item>
/// In C# there will be an <see cref="IImportScope"/> for every containing namespace-declarations that include any
/// <description>In C# there will be an <see cref="IImportScope"/> for every containing namespace-declarations that include any
/// import directives. There will also be an <see cref="IImportScope"/> for the containing compilation-unit if it
/// includes any import directives or if there are global import directives pulled in from other files.
/// includes any import directives or if there are global import directives pulled in from other files.</description>
/// </item>
/// <item>
/// In Visual Basic there will commonly be one or two <see cref="IImportScope"/>s returned for any position. This will
/// <description>In Visual Basic there will commonly be one or two <see cref="IImportScope"/>s returned for any position. This will
/// commonly be a scope for the containing compilation unit if it includes any import directives. As well as a scope
/// representing any imports specified at the project level.
/// representing any imports specified at the project level.</description>
/// </item>
/// <item>
/// Elements of any property have no defined order. Even if they represent items from a single document, they are
/// not guaranteed to be returned in any specific file-oriented order.
/// <description>Elements of any property have no defined order. Even if they represent items from a single document, they are
/// not guaranteed to be returned in any specific file-oriented order.</description>
/// </item>
/// <item>There is no guarantee that the same scope instances will be returned from successive calls to <see
/// cref="SemanticModel.GetImportScopes"/>.</item>
/// <item><description>There is no guarantee that the same scope instances will be returned from successive calls to <see
/// cref="SemanticModel.GetImportScopes"/>.</description></item>
/// </list>
/// </remarks>
public interface IImportScope
Expand Down
8 changes: 4 additions & 4 deletions src/Dependencies/Threading/CancellationSeries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ public bool HasActiveToken
/// <returns>
/// A cancellation token that will be cancelled when either:
/// <list type="bullet">
/// <item><see cref="CreateNext"/> is called again</item>
/// <item>The token passed to this method (if any) is cancelled</item>
/// <item>The token passed to the constructor (if any) is cancelled</item>
/// <item><see cref="Dispose"/> is called</item>
/// <item><description><see cref="CreateNext"/> is called again</description></item>
/// <item><description>The token passed to this method (if any) is cancelled</description></item>
/// <item><description>The token passed to the constructor (if any) is cancelled</description></item>
/// <item><description><see cref="Dispose"/> is called</description></item>
/// </list>
/// </returns>
/// <exception cref="ObjectDisposedException">This object has been disposed.</exception>
Expand Down
12 changes: 6 additions & 6 deletions src/LanguageServer/Protocol/Protocol/CodeAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,18 @@ public Diagnostic[]? Diagnostics
/// actions:
/// <list type="bullet">
/// <item>
/// Disabled code actions are not shown in automatic lightbulbs code
/// action menus.
/// <description>Disabled code actions are not shown in automatic lightbulbs code
/// action menus.</description>
/// </item>
/// <item>
/// Disabled actions are shown as faded out in the code action menu when
/// <description>Disabled actions are shown as faded out in the code action menu when
/// the user request a more specific type of code action, such as
/// refactorings.
/// refactorings.</description>
/// </item>
/// <item>
/// If the user has a keybinding that auto applies a code action and only
/// <description>If the user has a keybinding that auto applies a code action and only
/// a disabled code actions are returned, the client should show the user
/// an error message with <see cref="CodeActionDisabledReason.Reason"/> in the editor.
/// an error message with <see cref="CodeActionDisabledReason.Reason"/> in the editor.</description>
/// </item>
/// </list>
/// </para>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ namespace Roslyn.LanguageServer.Protocol;
/// Per <see href="https://microsoft.github.io/language-server-protocol/specifications/specification-current/#initialize">the LSP Spec</see>:
/// <list type="bullet">
/// <item>
/// If the property is NOT present, the client does not support workspace folders.
/// <description>If the property is NOT present, the client does not support workspace folders.</description>
/// </item>
/// <item>
/// If the property is present but null, or an empty array, the client supports workspace folders but none are open.
/// <description>If the property is present but null, or an empty array, the client supports workspace folders but none are open.</description>
/// </item>
/// </list>
/// </para>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ public VersionedTextDocumentIdentifier TextDocument
/// To mirror the content of a document using change events use the following
/// approach:
/// <list type="bullet">
/// <item>Start with the same initial content</item>
/// <item>Apply the 'textDocument/didChange' notifications in the order you receive them.</item>
/// <item>Apply the `TextDocumentContentChangeEvent`s in a single notification in the order you receive them.</item>
/// <item><description>Start with the same initial content</description></item>
/// <item><description>Apply the 'textDocument/didChange' notifications in the order you receive them.</description></item>
/// <item><description>Apply the `TextDocumentContentChangeEvent`s in a single notification in the order you receive them.</description></item>
/// </list>
/// </para>
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ internal sealed class FileOperationPattern
/// <summary>
/// The glob pattern to match. Glob patterns can have the following syntax:
/// <list type="bullet">
/// <item><c>*</c> to match one or more characters in a path segment</item>
/// <item><c>?</c> to match on one character in a path segment</item>
/// <item><c>**</c> to match any number of path segments, including none</item>
/// <item><c>{}</c> to group sub patterns into an OR expression.
/// (e.g. <c>**​/*.{ts,js}</c>matches all TypeScript and JavaScript files)</item>
/// <item><c>[]</c>to declare a range of characters to match in a path segment
/// (e.g., <c>example.[0-9]</c> to match on <c>example.0</c>, <c>example.1</c>, …)</item>
/// <item><c>[!...]</c> to negate a range of characters to match in a path segment
/// (e.g., <c>example.[!0-9]</c> to match on <c>example.a</c>, <c>example.b</c>, but not <c>example.0</c>)</item>
/// <item><description><c>*</c> to match one or more characters in a path segment</description></item>
/// <item><description><c>?</c> to match on one character in a path segment</description></item>
/// <item><description><c>**</c> to match any number of path segments, including none</description></item>
/// <item><description><c>{}</c> to group sub patterns into an OR expression.
/// (e.g. <c>**​/*.{ts,js}</c>matches all TypeScript and JavaScript files)</description></item>
/// <item><description><c>[]</c>to declare a range of characters to match in a path segment
/// (e.g., <c>example.[0-9]</c> to match on <c>example.0</c>, <c>example.1</c>, …)</description></item>
/// <item><description><c>[!...]</c> to negate a range of characters to match in a path segment
/// (e.g., <c>example.[!0-9]</c> to match on <c>example.a</c>, <c>example.b</c>, but not <c>example.0</c>)</description></item>
/// </list>
/// </summary>
[JsonPropertyName("glob")]
Expand Down
14 changes: 7 additions & 7 deletions src/LanguageServer/Protocol/Protocol/Methods.Document.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ partial class Methods
/// The returned result is either:
/// <list type="bullet">
/// <item>
/// An array of <see cref="SymbolInformation"/>, which is a flat list of all symbols found in a given text document. Neither the symbol’s location range nor the symbol’s container name should be used to infer a hierarchy.
/// <description>An array of <see cref="SymbolInformation"/>, which is a flat list of all symbols found in a given text document. Neither the symbol’s location range nor the symbol’s container name should be used to infer a hierarchy.</description>
/// </item>
/// <item>
/// An array of <see cref="DocumentSymbol"/>, which is a hierarchy of symbols found in a given text document.
/// <description>An array of <see cref="DocumentSymbol"/>, which is a hierarchy of symbols found in a given text document.</description>
/// </item>
/// </list>
/// Servers should whenever possible return <see cref="DocumentSymbol"/> since it is the richer data structure.
Expand Down Expand Up @@ -372,7 +372,7 @@ partial class Methods
/// </para>
/// <para>
/// If computing full completion items is expensive, servers can additionally provide a handler for the completion
/// item resolve request (‘completionItem/resolve’), which is sent when a completion item is selected in the user interface.
/// item resolve request (‘completionItem/resolve’), which is sent when a completion item is selected in the user interface.
/// </para>
/// <para>
/// See the <see href="https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_completion">Language Server Protocol specification</see> for additional information.
Expand Down Expand Up @@ -466,10 +466,10 @@ partial class Methods
/// Clients can use the result to decorate color references in an editor. For example:
/// <list type="bullet">
/// <item>
/// Color boxes showing the actual color next to the reference
/// <description>Color boxes showing the actual color next to the reference</description>
/// </item>
/// <item>
/// Show a color picker when a color reference is edited
/// <description>Show a color picker when a color reference is edited</description>
/// </item>
/// </list>
/// </para>
Expand All @@ -495,10 +495,10 @@ partial class Methods
/// Clients can use the result to:
/// <list type="bullet">
/// <item>
/// modify a color reference.
/// <description>Modify a color reference</description>
/// </item>
/// <item>
/// show in a color picker and let users pick one of the presentations
/// <description>Show in a color picker and let users pick one of the presentations</description>
/// </item>
/// </list>
/// </para>
Expand Down
8 changes: 4 additions & 4 deletions src/LanguageServer/Protocol/Protocol/Methods.Navigation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ partial class Methods
/// <para>
/// The call hierarchy request is sent from the client to the server to return a call hierarchy for the language element of given text document positions. The call hierarchy requests are executed in two steps:
/// <list type="bullet">
/// <item>first a call hierarchy item is resolved for the given text document position</item>
/// <item>for a call hierarchy item the incoming or outgoing call hierarchy items are resolved.</item>
/// <item><description>First a call hierarchy item is resolved for the given text document position.</description></item>
/// <item><description>For a call hierarchy item the incoming or outgoing call hierarchy items are resolved.</description></item>
/// </list>
/// </para>
/// <para>
Expand Down Expand Up @@ -169,8 +169,8 @@ partial class Methods
/// </para>
/// The type hierarchy requests are executed in two steps:
/// <list type="bullet">
/// <item>first a type hierarchy item is prepared for the given text document position.</item>
/// <item>for a type hierarchy item the supertype or subtype type hierarchy items are resolved.</item>
/// <item><description>First a type hierarchy item is prepared for the given text document position.</description></item>
/// <item><description>For a type hierarchy item the supertype or subtype type hierarchy items are resolved.</description></item>
/// </list>
/// </para>
/// <para>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ internal sealed class DidChangeNotebookDocumentParams
/// To mirror the content of a notebook using change events use the
/// following approach:
/// <list type="bullet">
/// <item>start with the same initial content</item>
/// <item>apply the <c>notebookDocument/didChange</c> notifications in the order you receive them.</item>
/// <item><description>Start with the same initial content.</description></item>
/// <item><description>Apply the <c>notebookDocument/didChange</c> notifications in the order you receive them.</description></item>
/// </list>
/// </para>
/// </summary>
Expand Down
Loading