-
Notifications
You must be signed in to change notification settings - Fork 832
[WIP] Add warning for XML documentation comments not positioned as first non-whitespace on line #18891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[WIP] Add warning for XML documentation comments not positioned as first non-whitespace on line #18891
Changes from all commits
5c1cb81
1713662
8698eef
21333cf
7d2be7e
6413c55
92f2c02
e12e8cc
fb42cf8
28a6204
56607de
9d9a664
83a3454
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. | ||
|
|
||
| namespace FSharp.Compiler.ComponentTests.Language | ||
|
|
||
| open Xunit | ||
| open FSharp.Test | ||
|
|
||
| module XmlDocCommentPositionTests = | ||
|
|
||
| [<Fact>] | ||
| let ``XML doc comment after code should warn``() = | ||
| FSharp """ | ||
| let x = 42 /// This should trigger warning | ||
| """ | ||
| |> compile | ||
| |> shouldFail | ||
| |> withDiagnostics [ | ||
| (Warning 3537, Line 2, Col 25, Line 2, Col 28, "XML documentation comments should be the first non-whitespace text on a line.") | ||
| ] | ||
|
|
||
| [<Fact>] | ||
| let ``XML doc comment at start of line should not warn``() = | ||
| FSharp """ | ||
| /// This is proper documentation | ||
| let x = 42 | ||
| """ | ||
| |> compile | ||
| |> shouldSucceed | ||
|
|
||
| [<Fact>] | ||
| let ``XML doc comment with indentation should not warn``() = | ||
| FSharp """ | ||
| module Test = | ||
| /// This is properly indented | ||
| let x = 42 | ||
| """ | ||
| |> compile | ||
| |> shouldSucceed | ||
|
|
||
| [<Fact>] | ||
| let ``XML doc comment after let binding should warn``() = | ||
| FSharp """ | ||
| let value = "test" /// Bad position | ||
| """ | ||
| |> compile | ||
| |> shouldFail | ||
| |> withDiagnostics [ | ||
| (Warning 3537, Line 2, Col 25, Line 2, Col 28, "XML documentation comments should be the first non-whitespace text on a line.") | ||
| ] |
Uh oh!
There was an error while loading. Please reload this page.