File tree Expand file tree Collapse file tree 5 files changed +57
-30
lines changed
src/Ionide.Analyzers/Suggestion Expand file tree Collapse file tree 5 files changed +57
-30
lines changed Original file line number Diff line number Diff line change @@ -58,14 +58,20 @@ let analyze parseTree (typedTree: FSharpImplementationFileContents option) =
5858
5959 Seq.toList messages
6060
61- [<CliAnalyzer( " CopyAndUpdateRecordChangesAllFieldsAnalyzer" ,
62- " Detect if all fields in a record update expression are updated." ,
63- " https://ionide.io/ionide-analyzers/suggestion/001.html" ) >]
61+ [<Literal>]
62+ let name = " CopyAndUpdateRecordChangesAllFieldsAnalyzer"
63+
64+ [<Literal>]
65+ let shortDescription =
66+ " Detect if all fields in a record update expression are updated."
67+
68+ [<Literal>]
69+ let helpUri = " https://ionide.io/ionide-analyzers/suggestion/001.html"
70+
71+ [<CliAnalyzer( name, shortDescription, helpUri) >]
6472let copyAndUpdateRecordChangesAllFieldsCliAnalyzer : Analyzer < CliContext > =
6573 fun ( context : CliContext ) -> async { return analyze context.ParseFileResults.ParseTree context.TypedTree }
6674
67- [<EditorAnalyzer( " CopyAndUpdateRecordChangesAllFieldsAnalyzer" ,
68- " Detect if all fields in a record update expression are updated." ,
69- " https://ionide.io/ionide-analyzers/suggestion/001.html" ) >]
75+ [<EditorAnalyzer( name, shortDescription, helpUri) >]
7076let copyAndUpdateRecordChangesAllFieldsEditorAnalyzer : Analyzer < EditorContext > =
7177 fun ( context : EditorContext ) -> async { return analyze context.ParseFileResults.ParseTree context.TypedTree }
Original file line number Diff line number Diff line change @@ -41,14 +41,19 @@ let analyze (typedTree: FSharpImplementationFileContents) =
4141 )
4242 |> Seq.toList
4343
44- [<EditorAnalyzer( " EmptyStringAnalyzer" ,
45- " Verifies testing for an empty string is done efficiently." ,
46- " https://ionide.io/ionide-analyzers/suggestion/005.html" ) >]
44+ [<Literal>]
45+ let name = " EmptyStringAnalyzer"
46+
47+ [<Literal>]
48+ let shortDescription = " Verifies testing for an empty string is done efficiently."
49+
50+ [<Literal>]
51+ let helpUri = " https://ionide.io/ionide-analyzers/suggestion/005.html"
52+
53+ [<EditorAnalyzer( name, shortDescription, helpUri) >]
4754let emptyStringEditorAnalyzer ( ctx : EditorContext ) =
4855 async { return ctx.TypedTree |> Option.map analyze |> Option.defaultValue [] }
4956
50- [<CliAnalyzer( " EmptyStringAnalyzer" ,
51- " Verifies testing for an empty string is done efficiently." ,
52- " https://ionide.io/ionide-analyzers/suggestion/005.html" ) >]
57+ [<CliAnalyzer( name, shortDescription, helpUri) >]
5358let emptyStringCliAnalyzer ( ctx : CliContext ) =
5459 async { return ctx.TypedTree |> Option.map analyze |> Option.defaultValue [] }
Original file line number Diff line number Diff line change @@ -45,12 +45,18 @@ let analyze (typedTree: FSharpImplementationFileContents option) =
4545 walkTast walker typedTree
4646 Seq.toList messages
4747
48- [<CliAnalyzer( " HandleOptionGracefullyAnalyzer" ,
49- " Replace unsafe option unwrapping with graceful handling of each case." ,
50- " https://ionide.io/ionide-analyzers/suggestion/006.html" ) >]
48+ [<Literal>]
49+ let name = " HandleOptionGracefullyAnalyzer"
50+
51+ [<Literal>]
52+ let shortDescription =
53+ " Replace unsafe option unwrapping with graceful handling of each case."
54+
55+ [<Literal>]
56+ let helpUri = " https://ionide.io/ionide-analyzers/suggestion/006.html"
57+
58+ [<CliAnalyzer( name, shortDescription, helpUri) >]
5159let optionGetCliAnalyzer ( ctx : CliContext ) = async { return analyze ctx.TypedTree }
5260
53- [<EditorAnalyzer( " HandleOptionGracefullyAnalyzer" ,
54- " Replace unsafe option unwrapping with graceful handling of each case." ,
55- " https://ionide.io/ionide-analyzers/suggestion/006.html" ) >]
61+ [<EditorAnalyzer( name, shortDescription, helpUri) >]
5662let optionGetEditorAnalyzer ( ctx : EditorContext ) = async { return analyze ctx.TypedTree }
Original file line number Diff line number Diff line change @@ -33,12 +33,17 @@ let analyzer (typedTree: FSharpImplementationFileContents option) =
3333 walkTast tastCollector typedTree
3434 Seq.toList messages
3535
36- [<CliAnalyzer( " IgnoreFunctionAnalyzer" ,
37- " A function is being ignored. Did you mean to execute this?" ,
38- " https://ionide.io/ionide-analyzers/suggestion/003.html" ) >]
36+ [<Literal>]
37+ let name = " IgnoreFunctionAnalyzer"
38+
39+ [<Literal>]
40+ let shortDescription = " A function is being ignored. Did you mean to execute this?"
41+
42+ [<Literal>]
43+ let helpUri = " https://ionide.io/ionide-analyzers/suggestion/003.html"
44+
45+ [<CliAnalyzer( name, shortDescription, helpUri) >]
3946let ignoreFunctionCliAnalyzer ( ctx : CliContext ) = async { return analyzer ctx.TypedTree }
4047
41- [<EditorAnalyzer( " IgnoreFunctionAnalyzer" ,
42- " A function is being ignored. Did you mean to execute this?" ,
43- " https://ionide.io/ionide-analyzers/suggestion/003.html" ) >]
48+ [<EditorAnalyzer( name, shortDescription, helpUri) >]
4449let ignoreFunctionEditorAnalyzer ( ctx : EditorContext ) = async { return analyzer ctx.TypedTree }
Original file line number Diff line number Diff line change @@ -37,14 +37,19 @@ let analyze parseTree =
3737
3838 Seq.toList messages
3939
40- [<CliAnalyzer( " UnnamedDiscriminatedUnionFieldAnalyzer" ,
41- " Verifies each field in a union case is named." ,
42- " https://ionide.io/ionide-analyzers/suggestion/004.html" ) >]
40+ [<Literal>]
41+ let name = " UnnamedDiscriminatedUnionFieldAnalyzer"
42+
43+ [<Literal>]
44+ let shortDescription = " Verifies each field in a union case is named."
45+
46+ [<Literal>]
47+ let helpUri = " https://ionide.io/ionide-analyzers/suggestion/004.html"
48+
49+ [<CliAnalyzer( name, shortDescription, helpUri) >]
4350let unnamedDiscriminatedUnionFieldCliAnalyzer ( ctx : CliContext ) =
4451 async { return analyze ctx.ParseFileResults.ParseTree }
4552
46- [<EditorAnalyzer( " UnnamedDiscriminatedUnionFieldAnalyzer" ,
47- " Verifies each field in a union case is named." ,
48- " https://ionide.io/ionide-analyzers/suggestion/004.html" ) >]
53+ [<EditorAnalyzer( name, shortDescription, helpUri) >]
4954let unnamedDiscriminatedUnionFieldEditorAnalyzer ( ctx : EditorContext ) =
5055 async { return analyze ctx.ParseFileResults.ParseTree }
You can’t perform that action at this time.
0 commit comments