1 type derived from Diagnostic
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Protocol\Extensions\VSDiagnostic.cs (1)
12internal sealed class VSDiagnostic : Diagnostic
28 instantiations of Diagnostic
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (3)
CodeActions\CodeActionsTests.cs (3)
123new LSP.Diagnostic 127new LSP.Diagnostic 211new LSP.Diagnostic
Microsoft.CodeAnalysis.Razor.Workspaces (1)
Diagnostics\TaskListDiagnosticProvider.cs (1)
42diagnostics.Add(new LspDiagnostic
Microsoft.CodeAnalysis.Remote.Razor (1)
Diagnostics\RemoteDiagnosticsService.cs (1)
132diagnostics.Add(new LspDiagnostic
Microsoft.VisualStudio.LanguageServices.Razor.UnitTests (22)
Cohost\CohostDocumentPullDiagnosticsTest.cs (21)
143new LspDiagnostic 179new LspDiagnostic 184new LspDiagnostic 217new LspDiagnostic 222new LspDiagnostic 251new LspDiagnostic 256new LspDiagnostic 285new LspDiagnostic 290new LspDiagnostic 328new LspDiagnostic 333new LspDiagnostic 371new LspDiagnostic 376new LspDiagnostic 414new LspDiagnostic 419new LspDiagnostic 449new LspDiagnostic 454new LspDiagnostic 483new LspDiagnostic 506new LspDiagnostic 540new LspDiagnostic 545new LspDiagnostic
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\CodeActions\CohostCodeActionsEndpointTestBase.cs (1)
164diagnostics.Add(new LspDiagnostic
Microsoft.VisualStudioCode.RazorExtension.UnitTests (1)
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\CodeActions\CohostCodeActionsEndpointTestBase.cs (1)
164diagnostics.Add(new LspDiagnostic
150 references to Diagnostic
Microsoft.AspNetCore.Razor.Microbenchmarks (1)
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.Workspaces\GlobalUsings.cs (1)
13global using LspDiagnostic = Roslyn.LanguageServer.Protocol.Diagnostic;
Microsoft.AspNetCore.Razor.Test.Common.Tooling (1)
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.Workspaces\GlobalUsings.cs (1)
13global using LspDiagnostic = Roslyn.LanguageServer.Protocol.Diagnostic;
Microsoft.CodeAnalysis.ExternalAccess.Razor.Features (4)
Cohost\Handlers\Diagnostics.cs (4)
27public static async Task<ImmutableArray<LSP.Diagnostic>> GetDocumentDiagnosticsAsync(Document document, bool supportsVisualStudioExtensions, CancellationToken cancellationToken) 41public static async Task<ImmutableArray<LSP.Diagnostic>> GetTaskListAsync(Document document, bool supportsVisualStudioExtensions, CancellationToken cancellationToken) 51private static ImmutableArray<LSP.Diagnostic> GetLspDiagnostics(Document document, bool supportsVisualStudioExtensions, IGlobalOptionService globalOptionsService, ImmutableArray<DiagnosticData> diagnostics) 57var result = ArrayBuilder<LSP.Diagnostic>.GetInstance(capacity: diagnostics.Length);
Microsoft.CodeAnalysis.LanguageServer.Protocol (48)
Extensions\ProtocolConversions.Diagnostics.cs (3)
34/// Converts from <see cref="DiagnosticData"/> to <see cref="LSP.Diagnostic"/> 41public static ImmutableArray<LSP.Diagnostic> ConvertDiagnostic(DiagnosticData diagnosticData, bool supportsVisualStudioExtensions, Project project, bool potentialDuplicate, IGlobalOptionService globalOptionService) 78using var _ = ArrayBuilder<LSP.Diagnostic>.GetInstance(out var diagnosticsBuilder);
Handler\CodeActions\CodeActionHelpers.cs (5)
146LSP.Diagnostic[]? diagnosticsForFix, 182LSP.Diagnostic[]? diagnosticsForFix, 282private static LSP.Diagnostic[]? GetApplicableDiagnostics(CodeActionContext context, SuggestedAction action) 289using var _ = ArrayBuilder<LSP.Diagnostic>.GetInstance(out var diagnosticsBuilder); 290foreach (var requestDiagnostic in context.Diagnostics)
Handler\Diagnostics\AbstractPullDiagnosticHandler.cs (3)
73protected abstract TReport CreateReport(TextDocumentIdentifier identifier, LSP.Diagnostic[] diagnostics, string resultId); 276using var _ = ArrayBuilder<LSP.Diagnostic>.GetInstance(out var result); 309private ImmutableArray<LSP.Diagnostic> ConvertDiagnostic(IDiagnosticSource diagnosticSource, DiagnosticData diagnosticData, ClientCapabilities capabilities)
Handler\Diagnostics\DocumentPullDiagnosticHandler.cs (1)
27protected override VSInternalDiagnosticReport[] CreateReport(TextDocumentIdentifier identifier, Roslyn.LanguageServer.Protocol.Diagnostic[]? diagnostics, string? resultId)
Handler\Diagnostics\Public\PublicDocumentPullDiagnosticsHandler.cs (1)
37protected override DocumentDiagnosticPartialReport CreateReport(TextDocumentIdentifier identifier, Roslyn.LanguageServer.Protocol.Diagnostic[] diagnostics, string resultId)
Handler\Diagnostics\Public\PublicWorkspacePullDiagnosticsHandler.cs (1)
35protected override WorkspaceDiagnosticPartialReport CreateReport(TextDocumentIdentifier identifier, Roslyn.LanguageServer.Protocol.Diagnostic[] diagnostics, string resultId)
Handler\Diagnostics\WorkspacePullDiagnosticHandler.cs (1)
33protected override VSInternalWorkspaceDiagnosticReport[] CreateReport(TextDocumentIdentifier identifier, Roslyn.LanguageServer.Protocol.Diagnostic[]? diagnostics, string? resultId)
Protocol\CodeAction.cs (1)
46public Diagnostic[]? Diagnostics
Protocol\CodeActionContext.cs (1)
29public Diagnostic[] Diagnostics
Protocol\CodeDescription.cs (1)
11/// Class representing a description for an error code in a <see cref="Diagnostic"/>.
Protocol\Diagnostic.cs (7)
17internal class Diagnostic : IEquatable<Diagnostic> 119public static bool operator ==(Diagnostic? value1, Diagnostic? value2) 135public static bool operator !=(Diagnostic? value1, Diagnostic? value2) 141public bool Equals(Diagnostic other) 161if (obj is Diagnostic other)
Protocol\DiagnosticTagSupport.cs (1)
10/// Represent the client's support for the <see cref="Diagnostic.Tags"/> property to provide metadata about a diagnostic.
Protocol\Extensions\Converters\VSExtensionUtilities.cs (2)
22/// is defined as an array of <see cref="Diagnostic"/>. 34TryAddConverter<Diagnostic, VSDiagnostic>();
Protocol\Extensions\VSDiagnostic.cs (2)
10/// <see cref="VSDiagnostic"/> extends <see cref="Diagnostic"/> providing additional properties used by Visual Studio. 29/// Gets or sets a message shown when the user hovers over an error. If <see langword="null" />, then <see cref="Diagnostic.Message"/>
Protocol\Extensions\VSDiagnosticTags.cs (10)
13/// A <see cref="Diagnostic"/> entry generated by the build. 18/// A <see cref="Diagnostic"/> entry generated by Intellisense. 23/// A <see cref="Diagnostic"/> entry that could be generated from both builds 26/// <see cref="Diagnostic"/> entries tagged with <see cref="PotentialDuplicate"/> will be hidden 33/// A <see cref="Diagnostic"/> entry is never displayed in the error list. 38/// The <see cref="Diagnostic"/> entry is always displayed in the error list. 43/// The <see cref="Diagnostic"/> entry is never displayed in the editor. 48/// No tooltip is shown for the <see cref="Diagnostic"/> entry in the editor. 53/// The <see cref="Diagnostic"/> entry is represented in the Editor as an Edit 59/// A <see cref="Diagnostic"/> entry is represented in the Editor as a Task List item in the TODO list.
Protocol\FullDocumentDiagnosticReport.cs (1)
44public Diagnostic[] Items
Protocol\Internal\Diagnostics\VSInternalDiagnosticReport.cs (2)
35public Diagnostic[]? Diagnostics { get; set; } 41/// <see cref="Diagnostic" /> entries tagged with <see cref="VSDiagnosticTags.PotentialDuplicate" /> will
Protocol\PublishDiagnosticParams.cs (1)
39public Diagnostic[] Diagnostics
Protocol\PublishDiagnosticsSetting.cs (4)
18/// Whether the client supports the <see cref="Diagnostic.RelatedInformation"/> property. 23/// Client supports the <see cref="Diagnostic.Tags"/> property to provide meta data about a diagnostic. 46/// Whether the client supports the <see cref="Diagnostic.CodeDescription"/> property. 54/// Whether the client supports propagating the <see cref="Diagnostic.Data"/> property from
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (6)
CodeActions\CodeActionsTests.cs (1)
304CodeActionResolveData data, LSP.Diagnostic[]? diagnostics,
Diagnostics\AbstractPullDiagnosticTestsBase.cs (1)
362private protected sealed record TestDiagnosticResult(TextDocumentIdentifier TextDocument, string? ResultId, LSP.Diagnostic[]? Diagnostics)
Diagnostics\PullDiagnosticTests.cs (4)
677var diagnostic = AssertEx.Single(results.Single().Diagnostics); 747var diagnostic = AssertEx.Single(results.Single().Diagnostics); 783var firstDiagnostic = AssertEx.Single(firstResult.Diagnostics!.Where(d => d.Code!.Value.Second == "CS0246")); 799var secondDiagnostic = AssertEx.Single(secondResult.Diagnostics!.Where(d => d.Code!.Value.Second == "CS0246"));
Microsoft.CodeAnalysis.Razor.Workspaces (42)
CodeActions\CSharp\TypeAccessibilityCodeActionProvider.cs (2)
83foreach (var diagnostic in diagnostics) 260LspDiagnostic fqnDiagnostic,
CodeActions\Razor\SimplifyFullyQualifiedComponentCodeActionProvider.cs (1)
104foreach (var diagnostic in context.Request.Context.Diagnostics)
CodeActions\RazorCodeActionContext.cs (1)
33foreach (var diagnostic in Request.Context.Diagnostics)
Diagnostics\RazorDiagnosticHelper.cs (3)
18public static async Task<LspDiagnostic[]?> GetRazorDiagnosticsAsync(IDocumentSnapshot documentSnapshot, CancellationToken cancellationToken) 48internal static LspDiagnostic[] Convert(ImmutableArray<RazorDiagnostic> diagnostics, SourceText sourceText, IDocumentSnapshot documentSnapshot) 50var convertedDiagnostics = new LspDiagnostic[diagnostics.Length];
Diagnostics\RazorTranslateDiagnosticsService.cs (27)
51internal async Task<LspDiagnostic[]> TranslateAsync( 53LspDiagnostic[] diagnostics, 79private static LspDiagnostic[] FilterHTMLDiagnostics( 80LspDiagnostic[] unmappedDiagnostics, 100internal LspDiagnostic[] MapDiagnostics( 102LspDiagnostic[] diagnostics, 107using var mappedDiagnostics = new PooledArrayBuilder<LspDiagnostic>(); 109foreach (var diagnostic in diagnostics) 136LspDiagnostic d, 148LspDiagnostic d, 179private static bool AppliesToTagHelperTagName(LspDiagnostic diagnostic, SourceText sourceText, RazorSyntaxTree syntaxTree) 216private static bool ShouldFilterHtmlDiagnosticBasedOnErrorCode(LspDiagnostic diagnostic, SourceText sourceText, RazorSyntaxTree syntaxTree) 241static bool IsEscapedAtSign(LspDiagnostic diagnostic, SourceText sourceText) 269static bool IsAtCSharpTransitionInStyleBlock(LspDiagnostic diagnostic, SourceText sourceText, RazorSyntaxTree syntaxTree) 299static bool IsAnyFilteredTooFewElementsError(LspDiagnostic diagnostic, SourceText sourceText, RazorSyntaxTree syntaxTree) 329static bool IsHtmlWithBangAndMatchingTags(LspDiagnostic diagnostic, SourceText sourceText, RazorSyntaxTree syntaxTree) 353static bool IsAnyFilteredInvalidNestingError(LspDiagnostic diagnostic, SourceText sourceText, RazorSyntaxTree syntaxTree) 357static bool IsInvalidNestingWarningWithinComponent(LspDiagnostic diagnostic, SourceText sourceText, RazorSyntaxTree syntaxTree) 372static bool IsInvalidNestingFromBody(LspDiagnostic diagnostic, SourceText sourceText, RazorSyntaxTree syntaxTree) 397LspDiagnostic diagnostic, 473private LspDiagnostic[] FilterCSharpDiagnostics(LspDiagnostic[] diagnostics, RazorCodeDocument codeDocument) 475using var filteredDiagnostics = new PooledArrayBuilder<LspDiagnostic>(); 477foreach (var diagnostic in diagnostics) 504bool ShouldIgnoreCS1525(LspDiagnostic diagnostic, RazorCodeDocument codeDocument) 523private bool IsUsingDirectiveUsed(LspDiagnostic diagnostic, RazorCodeDocument codeDocument) 557private bool TryGetOriginalDiagnosticRange(LspDiagnostic diagnostic, RazorCodeDocument codeDocument, [NotNullWhen(true)] out LspRange? originalRange)
Diagnostics\TaskListDiagnosticProvider.cs (2)
17public static ImmutableArray<LspDiagnostic> GetTaskListDiagnostics(RazorCodeDocument codeDocument, ImmutableArray<string> taskListDescriptors) 22using var diagnostics = new PooledArrayBuilder<LspDiagnostic>();
GlobalUsings.cs (1)
13global using LspDiagnostic = Roslyn.LanguageServer.Protocol.Diagnostic;
Remote\IRemoteDiagnosticsService.cs (5)
13ValueTask<ImmutableArray<LspDiagnostic>> GetDiagnosticsAsync( 16LspDiagnostic[] csharpDiagnostics, 17LspDiagnostic[] htmlDiagnostics, 20ValueTask<ImmutableArray<LspDiagnostic>> GetTaskListDiagnosticsAsync( 23LspDiagnostic[] csharpTaskItems,
Microsoft.CodeAnalysis.Razor.Workspaces.UnitTests (1)
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.Workspaces\GlobalUsings.cs (1)
13global using LspDiagnostic = Roslyn.LanguageServer.Protocol.Diagnostic;
Microsoft.CodeAnalysis.Remote.Razor (16)
Diagnostics\RemoteDiagnosticsService.cs (15)
36public ValueTask<ImmutableArray<LspDiagnostic>> GetDiagnosticsAsync( 39LspDiagnostic[] csharpDiagnostics, 40LspDiagnostic[] htmlDiagnostics, 48private async ValueTask<ImmutableArray<LspDiagnostic>> GetDiagnosticsAsync( 50LspDiagnostic[] csharpDiagnostics, 51LspDiagnostic[] htmlDiagnostics, 57ImmutableArray<LspDiagnostic> allDiagnostics = [ 78foreach (var diagnostic in allDiagnostics) 108private static ImmutableArray<LspDiagnostic> GetRazorDiagnostics(RemoteDocumentContext context, RazorCodeDocument codeDocument) 110using var diagnostics = new PooledArrayBuilder<LspDiagnostic>(); 152public ValueTask<ImmutableArray<LspDiagnostic>> GetTaskListDiagnosticsAsync( 155LspDiagnostic[] csharpTaskItems, 163private async ValueTask<ImmutableArray<LspDiagnostic>> GetTaskListDiagnosticsAsync( 165LspDiagnostic[] csharpTaskItems, 170using var diagnostics = new PooledArrayBuilder<LspDiagnostic>();
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.Workspaces\GlobalUsings.cs (1)
13global using LspDiagnostic = Roslyn.LanguageServer.Protocol.Diagnostic;
Microsoft.VisualStudio.LanguageServices.Razor (15)
LanguageClient\Cohost\CohostDocumentPullDiagnosticsEndpoint.cs (7)
92private async Task<LspDiagnostic[]?> GetVSDiagnosticsAsync(TextDocument razorDocument, CancellationToken cancellationToken) 109var vsDiagnostic = JsonHelpers.Convert<LspDiagnostic, VSDiagnostic>(diagnostics[i]).AssumeNotNull(); 131protected override LspDiagnostic[] ExtractHtmlDiagnostics(VSInternalDiagnosticReport[] result) 133using var allDiagnostics = new PooledArrayBuilder<LspDiagnostic>(); 149var diagnostics = await _remoteServiceInvoker.TryInvokeAsync<IRemoteDiagnosticsService, ImmutableArray<LspDiagnostic>>( 169private async Task<LspDiagnostic[]> GetCSharpTaskListItemsAsync(TextDocument razorDocument, CancellationToken cancellationToken) 186public Task<LspDiagnostic[]?> HandleRequestAsync(TextDocument razorDocument, CancellationToken cancellationToken)
OrganizeUsingsCommand.cs (1)
74await _remoteServiceInvoker.TryInvokeAsync<IRemoteDiagnosticsService, ImmutableArray<LspDiagnostic>>(
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.CohostingShared\Diagnostics\CohostDocumentPullDiagnosticsEndpointBase.cs (6)
43protected virtual LspDiagnostic[] ExtractHtmlDiagnostics(TResponse result) 53protected async Task<LspDiagnostic[]?> GetDiagnosticsAsync(TextDocument razorDocument, CancellationToken cancellationToken) 67: SpecializedTasks.EmptyArray<LspDiagnostic>(); 88var diagnostics = await _remoteServiceInvoker.TryInvokeAsync<IRemoteDiagnosticsService, ImmutableArray<LspDiagnostic>>( 107private async Task<LspDiagnostic[]> GetCSharpDiagnosticsAsync(TextDocument razorDocument, Guid correletionId, CancellationToken cancellationToken) 123private async Task<LspDiagnostic[]> GetHtmlDiagnosticsAsync(TextDocument razorDocument, Guid correletionId, CancellationToken cancellationToken)
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.Workspaces\GlobalUsings.cs (1)
13global using LspDiagnostic = Roslyn.LanguageServer.Protocol.Diagnostic;
Microsoft.VisualStudio.LanguageServices.Razor.UnitTests (4)
Cohost\CohostDocumentPullDiagnosticsTest.cs (2)
46var diagnostic = Assert.Single(result); 628internal static async Task<LspDiagnostic[]?> MakeDiagnosticsRequestAsync(
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.Workspaces\GlobalUsings.cs (1)
13global using LspDiagnostic = Roslyn.LanguageServer.Protocol.Diagnostic;
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\CodeActions\CohostCodeActionsEndpointTestBase.cs (1)
141using var diagnostics = new PooledArrayBuilder<LspDiagnostic>();
Microsoft.VisualStudioCode.RazorExtension (8)
Endpoints\DocumentPullDiagnosticsEndpoint.cs (1)
85public Task<LspDiagnostic[]?> HandleRequestAsync(TextDocument razorDocument, CancellationToken cancellationToken)
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.CohostingShared\Diagnostics\CohostDocumentPullDiagnosticsEndpointBase.cs (6)
43protected virtual LspDiagnostic[] ExtractHtmlDiagnostics(TResponse result) 53protected async Task<LspDiagnostic[]?> GetDiagnosticsAsync(TextDocument razorDocument, CancellationToken cancellationToken) 67: SpecializedTasks.EmptyArray<LspDiagnostic>(); 88var diagnostics = await _remoteServiceInvoker.TryInvokeAsync<IRemoteDiagnosticsService, ImmutableArray<LspDiagnostic>>( 107private async Task<LspDiagnostic[]> GetCSharpDiagnosticsAsync(TextDocument razorDocument, Guid correletionId, CancellationToken cancellationToken) 123private async Task<LspDiagnostic[]> GetHtmlDiagnosticsAsync(TextDocument razorDocument, Guid correletionId, CancellationToken cancellationToken)
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.Workspaces\GlobalUsings.cs (1)
13global using LspDiagnostic = Roslyn.LanguageServer.Protocol.Diagnostic;
Microsoft.VisualStudioCode.RazorExtension.UnitTests (4)
Endpoints\CohostDocumentPullDiagnosticsTest.cs (2)
45var diagnostic = Assert.Single(result); 87internal static Task<LspDiagnostic[]?> MakeDiagnosticsRequestAsync(
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.Workspaces\GlobalUsings.cs (1)
13global using LspDiagnostic = Roslyn.LanguageServer.Protocol.Diagnostic;
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\CodeActions\CohostCodeActionsEndpointTestBase.cs (1)
141using var diagnostics = new PooledArrayBuilder<LspDiagnostic>();