Browse pages
LS3001: Asynchronous Method Name Lacks Async
LS3001 is a compiler check that reports an async method whose name does not end in Async, which reads as a plain call where it is used, so readers miss the await and the cancellation token it needs. This page states what the rule reports, where the warning sits, and how to complete the name.
Reference#
What the rule enforces#
LS3001 enforces Name asynchronous methods completely (litespec/backend/dotnet/naming#name-asynchronous-methods-completely). It runs in all five projects. Its category is LiteSpec.Style. It reports a warning and is enabled by default, as the Analyzers overview describes.
What the rule reports#
The rule reports a method or local function that returns Task or ValueTask, including the generic forms, whose name does not end in Async. The diagnostic sits on the method name. Its message names the return type.
Failing example#
public Task Place() => Task.CompletedTask;Passing example#
public Task PlaceAsync(CancellationToken cancellationToken) => Task.CompletedTask;How to fix#
End the method name in Async.
Notes#
What the rule ignores#
The rule does not report overrides, explicit interface implementations, implementations of members from outside interfaces such as framework contracts, the static Main entry point, or lambdas. It does not run outside the five projects.