@@ -88,36 +88,59 @@ let tryCompareRanges code expected (results: Map<string, AnalyzerIgnoreRange lis
8888 Assert.That( ranges, Is.EquivalentTo( expected))
8989
9090[<Test>]
91- let ``get single line scoped ignore with one code`` () =
91+ let ``get next line scoped ignore with one code`` () =
9292 async {
9393 let source = """
9494module M
95- // IGNORE: IONIDE-001
95+ // fsharpanalyzer: ignore-line-next IONIDE-001
9696let x = 1
9797"""
9898 let ctx = getContext projectOptions source
99- ctx.AnalyzerIgnoreRanges |> tryCompareRanges " IONIDE-001" [ SingleLine 3 ]
99+ ctx.AnalyzerIgnoreRanges |> tryCompareRanges " IONIDE-001" [ NextLine 3 ]
100100 }
101101
102102[<Test>]
103- let ``get single line scoped ignore with multiple codes`` () =
103+ let ``get next line scoped ignore with multiple codes`` () =
104104 async {
105105 let source = """
106106module M
107- // IGNORE: IONIDE-001, IONIDE-002
107+ // fsharpanalyzer: ignore-line-next IONIDE-001, IONIDE-002
108108let x = 1
109109"""
110110 let ctx = getContext projectOptions source
111- ctx.AnalyzerIgnoreRanges |> tryCompareRanges " IONIDE-001" [ SingleLine 3 ]
112- ctx.AnalyzerIgnoreRanges |> tryCompareRanges " IONIDE-002" [ SingleLine 3 ]
111+ ctx.AnalyzerIgnoreRanges |> tryCompareRanges " IONIDE-001" [ NextLine 3 ]
112+ ctx.AnalyzerIgnoreRanges |> tryCompareRanges " IONIDE-002" [ NextLine 3 ]
113+ }
114+
115+ [<Test>]
116+ let ``get current line scoped ignore with one code`` () =
117+ async {
118+ let source = """
119+ module M
120+ let x = 1 // fsharpanalyzer: ignore-line IONIDE-001
121+ """
122+ let ctx = getContext projectOptions source
123+ ctx.AnalyzerIgnoreRanges |> tryCompareRanges " IONIDE-001" [ CurrentLine 3 ]
124+ }
125+
126+ [<Test>]
127+ let ``get current line scoped ignore with multiple codes`` () =
128+ async {
129+ let source = """
130+ module M
131+ let x = 1 // fsharpanalyzer: ignore-line IONIDE-001, IONIDE-002
132+ """
133+ let ctx = getContext projectOptions source
134+ ctx.AnalyzerIgnoreRanges |> tryCompareRanges " IONIDE-001" [ CurrentLine 3 ]
135+ ctx.AnalyzerIgnoreRanges |> tryCompareRanges " IONIDE-002" [ CurrentLine 3 ]
113136 }
114137
115138[<Test>]
116139let ``get file scoped ignore`` () =
117140 async {
118141 let source = """
119142module M
120- // IGNORE FILE: IONIDE-001
143+ // fsharpanalyzer: ignore-file IONIDE-001
121144let x = 1
122145"""
123146 let ctx = getContext projectOptions source
@@ -129,7 +152,7 @@ let ``get file scoped ignore with multiple codes`` () =
129152 async {
130153 let source = """
131154module M
132- // IGNORE FILE: IONIDE-001, IONIDE-002, IONIDE-003
155+ // fsharpanalyzer: ignore-file IONIDE-001, IONIDE-002, IONIDE-003
133156let x = 1
134157"""
135158 let ctx = getContext projectOptions source
@@ -143,9 +166,9 @@ let ``get range scoped ignore`` () =
143166 async {
144167 let source = """
145168module M
146- // IGNORE START: IONIDE-001
169+ // fsharpanalyzer: ignore-region-start IONIDE-001
147170let x = 1
148- // IGNORE END
171+ // fsharpanalyzer: ignore-region-end
149172"""
150173 let ctx = getContext projectOptions source
151174 ctx.AnalyzerIgnoreRanges |> tryCompareRanges " IONIDE-001" [ Range ( 3 , 5 )]
@@ -156,9 +179,9 @@ let ``get range scoped ignore with multiple codes`` () =
156179 async {
157180 let source = """
158181module M
159- // IGNORE START: IONIDE-001, IONIDE-002
182+ // fsharpanalyzer: ignore-region-start IONIDE-001, IONIDE-002
160183let x = 1
161- // IGNORE END
184+ // fsharpanalyzer: ignore-region-end
162185"""
163186 let ctx = getContext projectOptions source
164187 ctx.AnalyzerIgnoreRanges |> tryCompareRanges " IONIDE-001" [ Range ( 3 , 5 )]
@@ -170,11 +193,11 @@ let ``get range scoped ignore handles nested ignores`` () =
170193 async {
171194 let source = """
172195module M
173- // IGNORE START: IONIDE-001
174- // IGNORE START: IONIDE-002
196+ // fsharpanalyzer: ignore-region-start IONIDE-001
197+ // fsharpanalyzer: ignore-region-start IONIDE-002
175198let x = 1
176- // IGNORE END
177- // IGNORE END
199+ // fsharpanalyzer: ignore-region-end
200+ // fsharpanalyzer: ignore-region-end
178201"""
179202 let ctx = getContext projectOptions source
180203 ctx.AnalyzerIgnoreRanges |> tryCompareRanges " IONIDE-001" [ Range ( 3 , 7 )]
@@ -186,7 +209,7 @@ let ``ignores unclosed range scoped ignore`` () =
186209 async {
187210 let source = """
188211module M
189- // IGNORE START: IONIDE-001
212+ // fsharpanalyzer: ignore-region-start IONIDE-001
190213let x = 1
191214"""
192215 let ctx = getContext projectOptions source
@@ -199,7 +222,7 @@ let ``ignores unopened range scoped ignore`` () =
199222 let source = """
200223module M
201224let x = 1
202- // IGNORE END
225+ // fsharpanalyzer: ignore-region-end
203226"""
204227 let ctx = getContext projectOptions source
205228 Assert.That( ctx.AnalyzerIgnoreRanges, Is.Empty)
@@ -209,94 +232,92 @@ let x = 1
209232let ``code can have multiple ranges for one code`` () =
210233 async {
211234 let source = """
212- // IGNORE FILE: IONIDE-001
235+ // fsharpanalyzer: ignore-file IONIDE-001
213236module M
214- // IGNORE START: IONIDE-001
215- // IGNORE: IONIDE-001
237+ // fsharpanalyzer: ignore-region-start IONIDE-001
238+ // fsharpanalyzer: ignore-line-next IONIDE-001
216239let x = 1
217- // IGNORE END
240+ // fsharpanalyzer: ignore-region-end
218241"""
219242 let ctx = getContext projectOptions source
220243 ctx.AnalyzerIgnoreRanges
221244 |> tryCompareRanges " IONIDE-001" [
222245 File
223- SingleLine 5
246+ NextLine 5
224247 Range ( 4 , 7 )
225248 ]
226249 }
227250
228251[<Test>]
229- let ``single line ignore handles tight spacing`` () =
252+ let ``next line ignore handles tight spacing`` () =
230253 async {
231254 let source = """
232255module M
233- // IGNORE: IONIDE-001
256+ // fsharpanalyzer:ignore-line-next IONIDE-001
234257let x = 1
235258"""
236259 let ctx = getContext projectOptions source
237- ctx.AnalyzerIgnoreRanges |> tryCompareRanges " IONIDE-001 " [ SingleLine 3 ]
260+ Assert.That ( ctx.AnalyzerIgnoreRanges, Is.Empty )
238261 }
239262
240263[<Test>]
241- let ``single line ignore handles loose spacing`` () =
264+ let ``next line ignore handles loose spacing`` () =
242265 async {
243266 let source = """
244267module M
245- // IGNORE : IONIDE-001
268+ // fsharpanalyzer : ignore-line-next IONIDE-001
246269let x = 1
247270"""
248271 let ctx = getContext projectOptions source
249- ctx.AnalyzerIgnoreRanges |> tryCompareRanges " IONIDE-001 " [ SingleLine 3 ]
272+ Assert.That ( ctx.AnalyzerIgnoreRanges, Is.Empty )
250273 }
251274
252275[<Test>]
253- let ``single line , multi - code ignore handles tight spacing`` () =
276+ let ``next line , multi - code ignore handles tight spacing`` () =
254277 async {
255278 let source = """
256279module M
257- // IGNORE: IONIDE-001,IONIDE-002
280+ // fsharpanalyzer:ignore-line-next IONIDE-001,IONIDE-002
258281let x = 1
259282"""
260283 let ctx = getContext projectOptions source
261- ctx.AnalyzerIgnoreRanges |> tryCompareRanges " IONIDE-001" [ SingleLine 3 ]
262- ctx.AnalyzerIgnoreRanges |> tryCompareRanges " IONIDE-002" [ SingleLine 3 ]
284+ Assert.That( ctx.AnalyzerIgnoreRanges, Is.Empty)
263285 }
264286
265287[<Test>]
266- let ``single line , multi - code ignore handles loose spacing`` () =
288+ let ``next line , multi - code ignore handles loose spacing`` () =
267289 async {
268290 let source = """
269291module M
270- // IGNORE : IONIDE-001 , IONIDE-002
292+ // fsharpanalyzer : ignore-line-next IONIDE-001 , IONIDE-002
271293let x = 1
272294"""
273295 let ctx = getContext projectOptions source
274- ctx.AnalyzerIgnoreRanges |> tryCompareRanges " IONIDE-001" [ SingleLine 3 ]
275- ctx.AnalyzerIgnoreRanges |> tryCompareRanges " IONIDE-002" [ SingleLine 3 ]
296+ Assert.That( ctx.AnalyzerIgnoreRanges, Is.Empty)
276297 }
277298
278299[<Test>]
279300let ``file ignore handles tight spacing`` () =
280301 async {
281302 let source = """
282303module M
283- // IGNORE FILE: IONIDE-001
304+ // fsharpanalyzer:ignore-file IONIDE-001
284305let x = 1
285306"""
286307 let ctx = getContext projectOptions source
287- ctx.AnalyzerIgnoreRanges |> tryCompareRanges " IONIDE-001 " [ File ]
308+ Assert.That ( ctx.AnalyzerIgnoreRanges, Is.Empty )
288309 }
289310
290311[<Test>]
291312let ``file ignore handles loose spacing`` () =
292313 async {
293314 let source = """
294315module M
295- // IGNORE FILE : IONIDE-001
316+ // fsharpanalyzer : ignore-file IONIDE-001
296317let x = 1
297318"""
298319 let ctx = getContext projectOptions source
299- ctx.AnalyzerIgnoreRanges |> tryCompareRanges " IONIDE-001 " [ File ]
320+ Assert.That ( ctx.AnalyzerIgnoreRanges, Is.Empty )
300321 }
301322
302323
@@ -306,23 +327,23 @@ let ``range ignore handles tight spacing`` () =
306327 async {
307328 let source = """
308329module M
309- // IGNORE START: IONIDE-001
330+ // fsharpanalyzer:ignore-region-start IONIDE-001
310331let x = 1
311- // IGNORE END
332+ // fsharpanalyzer:ignore-region-end
312333"""
313334 let ctx = getContext projectOptions source
314- ctx.AnalyzerIgnoreRanges |> tryCompareRanges " IONIDE-001 " [ Range ( 3 , 5 )]
335+ Assert.That ( ctx.AnalyzerIgnoreRanges, Is.Empty )
315336 }
316337
317338[<Test>]
318339let ``range ignore handles loose spacing`` () =
319340 async {
320341 let source = """
321342module M
322- // IGNORE START : IONIDE-001
343+ // fsharpanalyzer : ignore-region-start IONIDE-001
323344let x = 1
324- // IGNORE END
345+ // fsharpanalyzer : ignore-region-start
325346"""
326347 let ctx = getContext projectOptions source
327- ctx.AnalyzerIgnoreRanges |> tryCompareRanges " IONIDE-001 " [ Range ( 3 , 5 )]
348+ Assert.That ( ctx.AnalyzerIgnoreRanges, Is.Empty )
328349 }
0 commit comments