@@ -266,11 +266,22 @@ val myFunc2: param: int -> int
266266 }
267267
268268module Exceptions =
269- let project () = SyntheticProject.Create(
270- { sourceFile " First" [] with ExtraSource = " exception MyException of string" },
271- { sourceFile " Second" [] with ExtraSource = """
269+ let source1 = " exception MyException of string"
270+ let signature1 = " exception MyException of string"
271+
272+ let source2 = """
272273open ModuleFirst
273- let foo x = raise (MyException "foo")""" })
274+ let foo x = raise (MyException "foo")
275+ """
276+ let project () = SyntheticProject.Create(
277+ { sourceFile " First" [] with ExtraSource = source1 },
278+ { sourceFile " Second" [] with ExtraSource = source2 })
279+
280+ let projectWithSignature () = SyntheticProject.Create(
281+ { sourceFile " First" [] with
282+ ExtraSource = source1
283+ SignatureFile = Custom signature1 },
284+ { sourceFile " Second" [] with ExtraSource = source2 })
274285
275286 [<Fact>]
276287 let ``We find exception from definition`` () =
@@ -292,6 +303,28 @@ let foo x = raise (MyException "foo")""" })
292303 ])
293304 }
294305
306+ [<Fact>]
307+ let ``We find exception from definition and signature`` () =
308+ projectWithSignature() .Workflow {
309+ placeCursor " First" 6 21 " exception MyException of string" [ " MyException" ]
310+ findAllReferences ( expectToFind [
311+ " FileFirst.fs" , 6 , 10 , 21
312+ " FileFirst.fsi" , 2 , 10 , 21
313+ " FileSecond.fs" , 8 , 19 , 30
314+ ])
315+ }
316+
317+ [<Fact>]
318+ let ``We find exception from usage and signature`` () =
319+ projectWithSignature() .Workflow {
320+ placeCursor " Second" 8 30 " raise (MyException \" foo\" )" [ " MyException" ]
321+ findAllReferences ( expectToFind [
322+ " FileFirst.fs" , 6 , 10 , 21
323+ " FileFirst.fsi" , 2 , 10 , 21
324+ " FileSecond.fs" , 8 , 19 , 30
325+ ])
326+ }
327+
295328module Attributes =
296329
297330 let project () = SyntheticProject.Create(
0 commit comments