Skip to content

Commit edc442e

Browse files
ensured that help urls are set up for our analyzers (#13097)
Main change is the addition of DiagnosticDescriptorHelper.Create method that sets up the help link following the common pattern. I'm using the new aka.ms links in the documentation files. Steps to create links and set them up with the diagnostic descriptors are in the list-of-diagnostics.md We had a special "experimental" URL pattern used in VB with 2 APIs, I replaced it with the common one for the NET10, the old link still works for NET9 Potential follow up - combine ObsoletionIDs with DiagnosticIDs and move the resulting file to the Primitives assembly(to make it visible to VB) and Common folder(for Drawing)
2 parents df745d6 + ab440ef commit edc442e

File tree

18 files changed

+174
-127
lines changed

18 files changed

+174
-127
lines changed

docs/analyzers/AppManifestAnalyzer.Help.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ are automatically referenced for Window Forms .NET applications.
77

88
`AppManifestAnalyzer` is automatically invoked when a Windows Forms application (`OutputType=Exe` or `OutputType=WinExe`) has a custom app.manifest.
99

10-
## [WFO0003](https://learn.microsoft.com/dotnet/desktop/winforms/compiler-messages/wfo0003): Unsupported high DPI configuration.
10+
## [WFO0003](https://aka.ms/winforms-warnings/wfo0003): Unsupported high DPI configuration.
1111

1212
Windows Forms applications should specify application DPI-awareness via the [application configuration](https://aka.ms/applicationconfiguration) or
13-
[`Application.SetHighDpiMode` API](https://docs.microsoft.com/dotnet/api/system.windows.forms.application.sethighdpimode).
13+
[`Application.SetHighDpiMode` API](https://learn.microsoft.com/dotnet/api/system.windows.forms.application.sethighdpimode).
1414

1515
In NET6.0 the same warning was shipped with ID `WFAC010`.
1616

docs/analyzers/ApplicationConfigurationGenerator.Help.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public static void Initialize()
1818

1919
For more information on application configuration refer to https://aka.ms/applicationconfiguration.
2020

21-
## [WFO0001](https://learn.microsoft.com/dotnet/desktop/winforms/compiler-messages/wfo0001): Unsupported project type.
21+
## [WFO0001](https://aka.ms/winforms-warnings/wfo0001): Unsupported project type.
2222

2323
Only projects with `OutputType` set to "Exe" or "WinExe" are supported, because only applications projects define an application entry point,
2424
where the application bootstrap code must reside.
@@ -35,7 +35,7 @@ In NET6.0 the same error was shipped with ID `WFAC001`.
3535

3636
---
3737

38-
## [WFO0002](https://learn.microsoft.com/dotnet/desktop/winforms/compiler-messages/wfo0002): Unsupported property value.
38+
## [WFO0002](https://aka.ms/winforms-warnings/wfo0002): Unsupported property value.
3939

4040
The specified project property cannot be set to the given value.
4141
In NET6.0 the same error was shipped with ID `WFAC002`.

docs/analyzers/WinFormsCSharpAnalyzers.Help.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ are automatically referenced for Window Forms .NET applications.
88
`MissingPropertySerializationConfiguration` checks for missing `DesignerSerializationVisibilityAttribute` on properties of classes which are
99
derived from `Control` and could potentially serialize design-time data by the designer without the user being aware of it.
1010

11-
### [WFO1000](https://learn.microsoft.com/dotnet/desktop/winforms/compiler-messages/wfo1000): Missing property serialization configuration.
11+
### [WFO1000](https://aka.ms/winforms-warnings/wfo1000): Missing property serialization configuration.
1212

1313
Properties of classes derived from `Control` should have `DesignerSerializationVisibilityAttribute`
1414
set to `DesignerSerializationVisibility.Content` or `DesignerSerializationVisibility.Visible`.
@@ -27,7 +27,7 @@ set to `DesignerSerializationVisibility.Content` or `DesignerSerializationVisibi
2727

2828
`AvoidPassingFuncReturningTaskWithoutCancellationToken` checks parameters passed to `Control.InvokeAsync`. It suggests to use a cancellation token when passing a task to these methods.
2929

30-
### [WFO2001](https://learn.microsoft.com/dotnet/desktop/winforms/compiler-messages/wfo2001): Task is being passed to InvokeAsync without a cancellation token.
30+
### [WFO2001](https://aka.ms/winforms-warnings/wfo2001): Task is being passed to InvokeAsync without a cancellation token.
3131

3232
Avoid passing a `Func<T>` to `InvokeAsync` where `T` is a `Task` or `ValueTask`, unless your intention is for the delegate to simply be kicked off as an unsupervised task. Instead, use `Func<CancellationToken, ValueTask>` or `Func<CancellationToken, ValueTask<T>>`, so that the delegate passed to `InvokeAsync` can be awaited, allowing exceptions to be properly handled.
3333

@@ -45,7 +45,7 @@ Avoid passing a `Func<T>` to `InvokeAsync` where `T` is a `Task` or `ValueTask`,
4545

4646
`ImplementITypedDataObject` checks custom implementations of the managed `IDataObject` interface and suggests to also implement the `ITypedDataObject` interface.
4747

48-
### [WFO1001](https://github.com/dotnet/winforms/blob/main/docs/analyzers/WinFormsCSharpAnalyzers.Help.md#implementitypeddataobject): `IDataObject` type does not implement `ITypedDataObject`.
48+
### [WFO1001](https://aka.ms/winforms-warnings/wfo1001): `IDataObject` type does not implement `ITypedDataObject`.
4949

5050
Types should implement `ITypedDataObject` to support best practices when interacting with data. Types will not work with typed APIs in Clipboard and other data exchange scenarios if they only implement `IDataObject`.
5151

docs/analyzers/WinFormsVisualBasicAnalyzers.Help.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ are automatically referenced for Window Forms .NET applications.
88
`MissingPropertySerializationConfiguration` checks for missing `DesignerSerializationVisibilityAttribute` on properties of classes which are
99
derived from `Control` and could potentially serialize design-time data by the designer without the user being aware of it.
1010

11-
### [WFO1000](https://learn.microsoft.com/dotnet/desktop/winforms/compiler-messages/wfo1000): Missing property serialization configuration.
11+
### [WFO1000](https://aka.ms/winforms-warnings/wfo1000): Missing property serialization configuration.
1212

1313
Properties of classes derived from `Control` should have `DesignerSerializationVisibilityAttribute`
1414
set to `DesignerSerializationVisibility.Content` or `DesignerSerializationVisibility.Visible`.
@@ -27,7 +27,7 @@ set to `DesignerSerializationVisibility.Content` or `DesignerSerializationVisibi
2727

2828
`AvoidPassingFuncReturningTaskWithoutCancellationToken` checks parameters passed to `Control.InvokeAsync`. It suggests to use a cancellation token when passing a task to these methods.
2929

30-
### [WFO2001](https://learn.microsoft.com/dotnet/desktop/winforms/compiler-messages/wfo2001): Task is being passed to InvokeAsync without a cancellation token.
30+
### [WFO2001](https://aka.ms/winforms-warnings/wfo2001): Task is being passed to InvokeAsync without a cancellation token.
3131

3232
Avoid passing a `Func<T>` to `InvokeAsync` where `T` is a `Task` or `ValueTask`, unless your intention is for the delegate to simply be kicked off as an unsupervised task. Instead, use `Func<CancellationToken, ValueTask>` or `Func<CancellationToken, ValueTask<T>>`, so that the delegate passed to `InvokeAsync` can be awaited, allowing exceptions to be properly handled.
3333

@@ -45,7 +45,7 @@ Avoid passing a `Func<T>` to `InvokeAsync` where `T` is a `Task` or `ValueTask`,
4545

4646
`ImplementITypedDataObject` checks custom implementations of the managed `IDataObject` interface and suggests to also implement the `ITypedDataObject` interface.
4747

48-
### [WFO1001](https://github.com/dotnet/winforms/blob/main/docs/analyzers/WinFormsCSharpAnalyzers.Help.md#implementitypeddataobject): `IDataObject` type does not implement `ITypedDataObject`.
48+
### [WFO1001](https://aka.ms/winforms-warnings/wfo1001): `IDataObject` type does not implement `ITypedDataObject`.
4949

5050
Types should implement `ITypedDataObject` to support best practices when interacting with data. Types will not work with typed APIs in Clipboard and other data exchange scenarios if they only implement `IDataObject`.
5151

0 commit comments

Comments
 (0)