@@ -151,7 +151,7 @@ toReport source err =
151151 numDefArgs = numTypeArgs + leftovers
152152 in
153153 Report.Report "BAD TYPE ANNOTATION" region [] $
154− Report.toCodeSnippet source region Nothing
154+ Code.toSnippet source region Nothing
155155 (
156156 D.reflow $
157157 "The type annotation for `" <> Name.toChars name <> "` says it can accept "
@@ -185,7 +185,7 @@ toReport source err =
185185 in
186186 if actual < expected then
187187 Report.Report "TOO FEW ARGS" region [] $
188− Report.toCodeSnippet source region Nothing
188+ Code.toSnippet source region Nothing
189189 (
190190 D.reflow $
191191 "The `" <> Name.toChars name <> "` " <> thing <> " needs "
@@ -197,7 +197,7 @@ toReport source err =
197197
198198 else
199199 Report.Report "TOO MANY ARGS" region [] $
200− Report.toCodeSnippet source region Nothing
200+ Code.toSnippet source region Nothing
201201 (
202202 D.reflow $
203203 "The `" <> Name.toChars name <> "` " <> thing <> " needs "
@@ -211,7 +211,7 @@ toReport source err =
211211
212212 Binop region op1 op2 ->
213213 Report.Report "INFIX PROBLEM" region [] $
214− Report.toCodeSnippet source region Nothing
214+ Code.toSnippet source region Nothing
215215 (
216216 D.reflow $
217217 "You cannot mix (" <> Name.toChars op1 <> ") and (" <> Name.toChars op2 <> ") without parentheses."
@@ -268,7 +268,7 @@ toReport source err =
268268
269269 EffectNotFound region name ->
270270 Report.Report "EFFECT PROBLEM" region [] $
271− Report.toCodeSnippet source region Nothing
271+ Code.toSnippet source region Nothing
272272 (
273273 D.reflow $
274274 "You have declared that `" ++ Name.toChars name ++ "` is an effect type:"
@@ -279,7 +279,7 @@ toReport source err =
279279
280280 EffectFunctionNotFound region name ->
281281 Report.Report "EFFECT PROBLEM" region [] $
282− Report.toCodeSnippet source region Nothing
282+ Code.toSnippet source region Nothing
283283 (
284284 D.reflow $
285285 "This kind of effect module must define a `" ++ Name.toChars name ++ "` function."
@@ -295,7 +295,7 @@ toReport source err =
295295 "You are trying to expose `" <> Name.toChars name <> "` multiple times!"
296296 in
297297 Report.Report "REDUNDANT EXPORT" r2 [] $
298− Report.toCodePair source r1 r2
298+ Code.toPair source r1 r2
299299 (
300300 D.reflow messageThatEndsWithPunctuation
301301 ,
@@ -339,7 +339,7 @@ toReport source err =
339339
340340 ExportOpenAlias region name ->
341341 Report.Report "BAD EXPORT" region [] $
342− Report.toCodeSnippet source region Nothing
342+ Code.toSnippet source region Nothing
343343 (
344344 D.reflow $
345345 "The (..) syntax is for exposing union type constructors. It cannot be used with a type alias like `"
@@ -351,7 +351,7 @@ toReport source err =
351351
352352 ImportCtorByName region ctor tipe ->
353353 Report.Report "BAD IMPORT" region [] $
354− Report.toCodeSnippet source region Nothing
354+ Code.toSnippet source region Nothing
355355 (
356356 D.reflow $
357357 "You are trying to import the `" <> Name.toChars ctor
@@ -371,7 +371,7 @@ toReport source err =
371371 -- So this error should never actually get printed out.
372372 --
373373 Report.Report "UNKNOWN IMPORT" region [] $
374− Report.toCodeSnippet source region Nothing
374+ Code.toSnippet source region Nothing
375375 (
376376 D.reflow $
377377 "I could not find a `" <> Name.toChars name <> "` module to import!"
@@ -381,7 +381,7 @@ toReport source err =
381381
382382 ImportOpenAlias region name ->
383383 Report.Report "BAD IMPORT" region [] $
384− Report.toCodeSnippet source region Nothing
384+ Code.toSnippet source region Nothing
385385 (
386386 D.reflow $
387387 "The `" <> Name.toChars name <> "` type alias cannot be followed by (..) like this:"
@@ -402,7 +402,7 @@ toReport source err =
402402 Suggest.sort (Name.toChars home) Name.toChars possibleNames
403403 in
404404 Report.Report "BAD IMPORT" region suggestions $
405− Report.toCodeSnippet source region Nothing
405+ Code.toSnippet source region Nothing
406406 (
407407 D.reflow $
408408 "The `" <> Name.toChars home
@@ -435,7 +435,7 @@ toReport source err =
435435 NotFoundBinop region op locals ->
436436 if op == "===" then
437437 Report.Report "UNKNOWN OPERATOR" region ["=="] $
438− Report.toCodeSnippet source region Nothing
438+ Code.toSnippet source region Nothing
439439 (
440440 "Elm does not have a (===) operator like JavaScript."
441441 ,
@@ -444,7 +444,7 @@ toReport source err =
444444
445445 else if op == "!=" || op == "!==" then
446446 Report.Report "UNKNOWN OPERATOR" region ["/="] $
447− Report.toCodeSnippet source region Nothing
447+ Code.toSnippet source region Nothing
448448 (
449449 D.reflow $
450450 "Elm uses a different name for the “not equal” operator:"
@@ -459,7 +459,7 @@ toReport source err =
459459
460460 else if op == "**" then
461461 Report.Report "UNKNOWN OPERATOR" region ["^","*"] $
462− Report.toCodeSnippet source region Nothing
462+ Code.toSnippet source region Nothing
463463 (
464464 D.reflow $
465465 "I do not recognize the (**) operator:"
@@ -470,7 +470,7 @@ toReport source err =
470470
471471 else if op == "%" then
472472 Report.Report "UNKNOWN OPERATOR" region [] $
473− Report.toCodeSnippet source region Nothing
473+ Code.toSnippet source region Nothing
474474 (
475475 D.reflow $
476476 "Elm does not use (%) as the remainder operator:"
@@ -497,7 +497,7 @@ toReport source err =
497497 D.green $ "(" <> altOp <> ")"
498498 in
499499 Report.Report "UNKNOWN OPERATOR" region suggestions $
500− Report.toCodeSnippet source region Nothing
500+ Code.toSnippet source region Nothing
501501 (
502502 D.reflow $
503503 "I do not recognize the (" ++ Name.toChars op ++ ") operator."
@@ -515,7 +515,7 @@ toReport source err =
515515
516516 PatternHasRecordCtor region name ->
517517 Report.Report "BAD PATTERN" region [] $
518− Report.toCodeSnippet source region Nothing
518+ Code.toSnippet source region Nothing
519519 (
520520 D.reflow $
521521 "You can construct records by using `" <> Name.toChars name
@@ -529,7 +529,7 @@ toReport source err =
529529 let
530530 formatDetails (aBadKindOfThing, elaboration) =
531531 Report.Report "PORT ERROR" region [] $
532− Report.toCodeSnippet source region Nothing
532+ Code.toSnippet source region Nothing
533533 (
534534 D.reflow $
535535 "The `" <> Name.toChars portName <> "` port is trying to transmit " <> aBadKindOfThing <> ":"
@@ -595,7 +595,7 @@ toReport source err =
595595 let
596596 formatDetails (before, after) =
597597 Report.Report "BAD PORT" region [] $
598− Report.toCodeSnippet source region Nothing $
598+ Code.toSnippet source region Nothing $
599599 (
600600 D.reflow before
601601 ,
@@ -674,7 +674,7 @@ toReport source err =
674674 D.fillSep $ map (D.dullyellow . D.fromChars) (words question) ++ map D.fromChars (words details)
675675 in
676676 Report.Report "CYCLIC DEFINITION" region [] $
677− Report.toCodeSnippet source region Nothing $
677+ Code.toSnippet source region Nothing $
678678 case names of
679679 [] ->
680680 (
@@ -716,7 +716,7 @@ toReport source err =
716716
717717 RecursiveLet (A.At region name) names ->
718718 Report.Report "CYCLIC VALUE" region [] $
719− Report.toCodeSnippet source region Nothing $
719+ Code.toSnippet source region Nothing $
720720 case names of
721721 [] ->
722722 let
@@ -762,7 +762,7 @@ toReport source err =
762762
763763 Shadowing name r1 r2 ->
764764 Report.Report "SHADOWING" r2 [] $
765− Report.toCodePair source r1 r2
765+ Code.toPair source r1 r2
766766 ( "These variables cannot have the same name:"
767767 , advice
768768 )
@@ -783,7 +783,7 @@ toReport source err =
783783
784784 TupleLargerThanThree region ->
785785 Report.Report "BAD TUPLE" region [] $
786− Report.toCodeSnippet source region Nothing
786+ Code.toSnippet source region Nothing
787787 (
788788 "I only accept tuples with two or three items. This has too many:"
789789 ,
@@ -832,7 +832,7 @@ toReport source err =
832832 )
833833 in
834834 Report.Report title aliasRegion [] $
835− Report.toCodeSnippet source aliasRegion subRegion
835+ Code.toSnippet source aliasRegion subRegion
836836 (
837837 D.fillSep overview
838838 ,
@@ -885,7 +885,7 @@ toReport source err =
885885
886886 in
887887 Report.Report "TYPE VARIABLE PROBLEMS" aliasRegion [] $
888− Report.toCodeSnippet source aliasRegion Nothing
888+ Code.toSnippet source aliasRegion Nothing
889889 (
890890 D.reflow $
891891 "Type alias `" <> Name.toChars typeName <> "` has some type variable problems."
@@ -932,7 +932,7 @@ unboundTypeVars source declRegion tipe typeName allVars (unboundVar, varRegion)
932932 )
933933 in
934934 Report.Report title declRegion [] $
935− Report.toCodeSnippet source declRegion subRegion
935+ Code.toSnippet source declRegion subRegion
936936 (
937937 D.fillSep overview
938938 ,
@@ -960,7 +960,7 @@ unboundTypeVars source declRegion tipe typeName allVars (unboundVar, varRegion)
960960nameClash :: Code.Source -> A.Region -> A.Region -> String -> Report.Report
961961nameClash source r1 r2 messageThatEndsWithPunctuation =
962962 Report.Report "NAME CLASH" r2 [] $
963− Report.toCodePair source r1 r2
963+ Code.toPair source r1 r2
964964 (
965965 D.reflow messageThatEndsWithPunctuation
966966 ,
@@ -982,7 +982,7 @@ nameClash source r1 r2 messageThatEndsWithPunctuation =
982982ambiguousName :: Code.Source -> A.Region -> Maybe Name.Name -> Name.Name -> [ModuleName.Canonical] -> String -> Report.Report
983983ambiguousName source region maybePrefix name possibleHomes thing =
984984 Report.Report "AMBIGUOUS NAME" region [] $
985− Report.toCodeSnippet source region Nothing $
985+ Code.toSnippet source region Nothing $
986986 case maybePrefix of
987987 Nothing ->
988988 let
@@ -1065,7 +1065,7 @@ notFound source region maybePrefix name thing (PossibleNames locals quals) =
10651065
10661066 in
10671067 Report.Report "NAMING ERROR" region nearbyNames $
1068− Report.toCodeSnippet source region Nothing
1068+ Code.toSnippet source region Nothing
10691069 (
10701070 D.reflow $
10711071 "I cannot find a `" ++ givenName ++ "` " ++ thing ++ ":"
@@ -1195,7 +1195,7 @@ _argMismatchReport source region kind name expected actual =
11951195 <> " arguments"
11961196 in
11971197 Report.Report (map Char.toUpper numArgs) region [] $
1198− Report.toCodeSnippet source region Nothing
1198+ Code.toSnippet source region Nothing
11991199 (
12001200 D.reflow $
12011201 kind <> " " <> Name.toChars name <> " has " <> numArgs <> "."
@@ -1214,7 +1214,7 @@ aliasRecursionReport source region name args tipe others =
12141214 case others of
12151215 [] ->
12161216 Report.Report "ALIAS PROBLEM" region [] $
1217− Report.toCodeSnippet source region Nothing
1217+ Code.toSnippet source region Nothing
12181218 (
12191219 "This type alias is recursive, forming an infinite type!"
12201220 ,
@@ -1233,7 +1233,7 @@ aliasRecursionReport source region name args tipe others =
12331233
12341234 _ ->
12351235 Report.Report "ALIAS PROBLEM" region [] $
1236− Report.toCodeSnippet source region Nothing
1236+ Code.toSnippet source region Nothing
12371237 (
12381238 "This type alias is part of a mutually recursive set of type aliases."
12391239 ,