@@ -425,6 +425,119 @@ module IgnoreRangeTests =
425425 Assert.That( ctx.AnalyzerIgnoreRanges, Is.Empty)
426426 }
427427
428+ [<Test>]
429+ let ``block comment ignore - line - next does not include trailing asterisk parenthesis`` () =
430+ async {
431+ let source =
432+ """
433+ module M
434+ (* fsharpanalyzer: ignore-line-next IONIDE-001 *)
435+ let x = 1
436+ """
437+
438+ let ctx = getContext projectOptions source
439+
440+ ctx.AnalyzerIgnoreRanges
441+ |> tryCompareRanges " IONIDE-001" [ NextLine 3 ]
442+ }
443+
444+ [<Test>]
445+ let ``block comment ignore - line does not include trailing asterisk parenthesis`` () =
446+ async {
447+ let source =
448+ """
449+ module M
450+ let x = 1 (* fsharpanalyzer: ignore-line IONIDE-001 *)
451+ """
452+
453+ let ctx = getContext projectOptions source
454+
455+ ctx.AnalyzerIgnoreRanges
456+ |> tryCompareRanges " IONIDE-001" [ CurrentLine 3 ]
457+ }
458+
459+ [<Test>]
460+ let ``block comment ignore - file does not include trailing asterisk parenthesis`` () =
461+ async {
462+ let source =
463+ """
464+ (* fsharpanalyzer: ignore-file IONIDE-001 *)
465+ module M
466+ let x = 1
467+ """
468+
469+ let ctx = getContext projectOptions source
470+
471+ ctx.AnalyzerIgnoreRanges
472+ |> tryCompareRanges " IONIDE-001" [ File ]
473+ }
474+
475+ [<Test>]
476+ let ``block comment ignore - region - start does not include trailing asterisk parenthesis`` () =
477+ async {
478+ let source =
479+ """
480+ module M
481+ (* fsharpanalyzer: ignore-region-start IONIDE-001 *)
482+ let x = 1
483+ (* fsharpanalyzer: ignore-region-end *)
484+ """
485+
486+ let ctx = getContext projectOptions source
487+
488+ ctx.AnalyzerIgnoreRanges
489+ |> tryCompareRanges " IONIDE-001" [ Range( 3 , 5 ) ]
490+ }
491+
492+ [<Test>]
493+ let ``block comment with multiple codes does not include trailing asterisk parenthesis`` () =
494+ async {
495+ let source =
496+ """
497+ module M
498+ (* fsharpanalyzer: ignore-line-next IONIDE-001, IONIDE-002, IONIDE-003 *)
499+ let x = 1
500+ """
501+
502+ let ctx = getContext projectOptions source
503+
504+ ctx.AnalyzerIgnoreRanges
505+ |> tryCompareRanges " IONIDE-001" [ NextLine 3 ]
506+
507+ ctx.AnalyzerIgnoreRanges
508+ |> tryCompareRanges " IONIDE-002" [ NextLine 3 ]
509+
510+ ctx.AnalyzerIgnoreRanges
511+ |> tryCompareRanges " IONIDE-003" [ NextLine 3 ]
512+ }
513+
514+ [<Test>]
515+ let ``mixed line and block comments work correctly`` () =
516+ async {
517+ let source =
518+ """
519+ module M
520+ // fsharpanalyzer: ignore-line-next IONIDE-001
521+ (* fsharpanalyzer: ignore-line-next IONIDE-002 *)
522+ let x = 1 // fsharpanalyzer: ignore-line IONIDE-003
523+ let y = 2 (* fsharpanalyzer: ignore-line IONIDE-004 *)
524+ """
525+
526+ let ctx = getContext projectOptions source
527+
528+ ctx.AnalyzerIgnoreRanges
529+ |> tryCompareRanges " IONIDE-001" [ NextLine 3 ]
530+
531+ ctx.AnalyzerIgnoreRanges
532+ |> tryCompareRanges " IONIDE-002" [ NextLine 4 ]
533+
534+ ctx.AnalyzerIgnoreRanges
535+ |> tryCompareRanges " IONIDE-003" [ CurrentLine 5 ]
536+
537+ ctx.AnalyzerIgnoreRanges
538+ |> tryCompareRanges " IONIDE-004" [ CurrentLine 6 ]
539+ }
540+
428541module ClientTests =
429542
430543 module RunAnalyzersSafelyTests =
0 commit comments