@@ -801,8 +801,8 @@ toExprReport source name expr _ _ =
801 If _ _ _ ->
801 If _ _ _ ->
802 error "TODO If"
802 error "TODO If"
804− List _ _ _ ->
804+ List list row col ->
805− error "TODO List"
805+ toListReport source name list row col
807 Record _ _ _ ->
807 Record _ _ _ ->
808 error "TODO Record"
808 error "TODO Record"
@@ -1327,8 +1327,121 @@ toOperatorReport source name operator row col =
1330+toListReport :: Code.Source -> Name.Name -> List -> Row -> Col -> Report.Report
1331+toListReport source name func startRow startCol =
1333+ ListSpace space row col ->
1334+ toSpaceReport source space row col
1336+ ListOpen row col ->
1337+ error "TODO ListOpen" row col
1339+ ListExpr expr row col ->
1340+ toExprReport source name expr row col
1343+ error "TODO ListEnd" row col
1345+ ListIndentOpen row col ->
1347+ surroundings = A.Region (A.Position startRow startCol) (A.Position row col)
1348+ region = toRegion row col
1350+ Report.Report "UNFINISHED LIST" region [] $
1351+ Report.toCodeSnippet source surroundings (Just region)
1354+ "I cannot find the end of this list:"
1358+ ["You","could","change","it","to","something","like"
1359+ ,D.dullyellow "[3,4,5]"
1360+ ,"or","even","just"
1361+ ,D.dullyellow "[]" <> "."
1362+ ,"Anything","where","there","is","an","open","and","close","square","brace,"
1363+ ,"and","where","the","elements","of","the","list","are","separated","by","commas."
1366+ "I may be confused by indentation. For example, if you are trying to define\
1367+ \ a list across multiple lines, I recommend using this format:"
1368+ , D.indent 4 $ D.vcat $
1375+ "Notice that nothing comes directly after a newline. Each line starts with some spaces.\
1376+ \ This style can be jarring for people coming from C-like syntax, but folks generally\
1377+ \ report that they are used to it (and often prefer it!) after a week or two of using Elm."
1381+ ListIndentEnd row col ->
1383+ surroundings = A.Region (A.Position startRow startCol) (A.Position row col)
1384+ region = toRegion row col
1386+ Report.Report "UNFINISHED LIST" region [] $
1387+ Report.toCodeSnippet source surroundings (Just region)
1390+ "I cannot find the end of this list:"
1394+ ["You","can","just","add","a","closing",D.dullyellow "]"
1395+ ,"right","here,","and","I","will","be","all","set!"
1398+ "I may be confused by indentation. For example, if you are trying to define\
1399+ \ a list across multiple lines, I recommend using this format:"
1400+ , D.indent 4 $ D.vcat $
1407+ "Notice that nothing comes directly after a newline. Each line starts with some spaces.\
1408+ \ This style can be jarring for people coming from C-like syntax, but folks generally\
1409+ \ report that they are used to it (and often prefer it!) after a week or two of using Elm."
1413+ ListIndentExpr row col ->
1415+ surroundings = A.Region (A.Position startRow startCol) (A.Position row col)
1416+ region = toRegion row col
1418+ Report.Report "UNFINISHED LIST" region [] $
1419+ Report.toCodeSnippet source surroundings (Just region)
1422+ "I was expecting to see another list entry after this comma:"
1426+ "Trailing commas are not allowed in lists, so the fix may be to delete the comma?"
1428+ "I recommend using the following format for lists that span multiple lines:"
1429+ , D.indent 4 $ D.vcat $
1436+ "Notice that nothing comes directly after a newline. Each line starts with some spaces.\
1437+ \ This style can be jarring for people coming from C-like syntax, but folks generally\
1438+ \ report that they are used to it (and often prefer it!) after a week or two of using Elm."
1330toFuncReport :: Code.Source -> Name.Name -> Func -> Row -> Col -> Report.Report
1443toFuncReport :: Code.Source -> Name.Name -> Func -> Row -> Col -> Report.Report
1331−toFuncReport source name func frow fcol =
1444+toFuncReport source name func startRow startCol =
1332 case func of
1445 case func of
1333 FuncSpace space row col ->
1446 FuncSpace space row col ->
1334 toSpaceReport source space row col
1447 toSpaceReport source space row col
@@ -1341,7 +1454,7 @@ toFuncReport source name func frow fcol =
1342 FuncArrow row col ->
1455 FuncArrow row col ->
1344− surroundings = A.Region (A.Position frow fcol) (A.Position row col)
1457+ surroundings = A.Region (A.Position startRow startCol) (A.Position row col)
1345 region = toRegion row col
1458 region = toRegion row col
1347 Report.Report "UNFINISHED ANONYMOUS FUNCTION" region [] $
1460 Report.Report "UNFINISHED ANONYMOUS FUNCTION" region [] $
@@ -1350,14 +1463,16 @@ toFuncReport source name func frow fcol =
1350 D.reflow $
1463 D.reflow $
1351 "I was expecting to see an arrow here:"
1464 "I was expecting to see an arrow here:"
1353− D.reflow $
1466+ D.fillSep $
1354− "The syntax for anonymous functions is (\\x -> x + 1) so I am missing the arrow\
1467+ ["The","syntax","for","anonymous","functions","is"
1468+ ,D.dullyellow "(\\x -> x + 1)"
1355− \ and the body of the function."
1469+ ,"so","I","am","missing","the","arrow","and","the","body","of","the","function."
1358 FuncIndentArg row col ->
1473 FuncIndentArg row col ->
1360− surroundings = A.Region (A.Position frow fcol) (A.Position row col)
1475+ surroundings = A.Region (A.Position startRow startCol) (A.Position row col)
1361 region = toRegion row col
1476 region = toRegion row col
1363 Report.Report "MISSING ARGUMENT" region [] $
1478 Report.Report "MISSING ARGUMENT" region [] $
@@ -1380,7 +1495,7 @@ toFuncReport source name func frow fcol =
1381 FuncIndentArrow row col ->
1496 FuncIndentArrow row col ->
1383− surroundings = A.Region (A.Position frow fcol) (A.Position row col)
1498+ surroundings = A.Region (A.Position startRow startCol) (A.Position row col)
1384 region = toRegion row col
1499 region = toRegion row col
1386 Report.Report "UNFINISHED ANONYMOUS FUNCTION" region [] $
1501 Report.Report "UNFINISHED ANONYMOUS FUNCTION" region [] $
@@ -1390,9 +1505,11 @@ toFuncReport source name func frow fcol =
1390 "I was expecting to see an arrow here:"
1505 "I was expecting to see an arrow here:"
1393− [ D.reflow $
1508+ [ D.fillSep $
1394− "The syntax for anonymous functions is (\\x -> x + 1) so I am missing the arrow\
1509+ ["The","syntax","for","anonymous","functions","is"
1510+ ,D.dullyellow "(\\x -> x + 1)"
1395− \ and the body of the function."
1511+ ,"so","I","am","missing","the","arrow","and","the","body","of","the","function."
1396 , D.toSimpleNote $
1513 , D.toSimpleNote $
1397 "It is possible that I am confused about indetation! I generally recommend\
1514 "It is possible that I am confused about indetation! I generally recommend\
1398 \ switching to named functions if the definition cannot fit inline nicely, so\
1515 \ switching to named functions if the definition cannot fit inline nicely, so\
@@ -1403,7 +1520,7 @@ toFuncReport source name func frow fcol =
1404 FuncIndentBody row col ->
1521 FuncIndentBody row col ->
1406− surroundings = A.Region (A.Position frow fcol) (A.Position row col)
1523+ surroundings = A.Region (A.Position startRow startCol) (A.Position row col)
1407 region = toRegion row col
1524 region = toRegion row col
1409 Report.Report "UNFINISHED ANONYMOUS FUNCTION" region [] $
1526 Report.Report "UNFINISHED ANONYMOUS FUNCTION" region [] $
@@ -1413,8 +1530,11 @@ toFuncReport source name func frow fcol =
1413 "I was expecting to see the body of your anonymous function here:"
1530 "I was expecting to see the body of your anonymous function here:"
1416− [ D.reflow $
1533+ [ D.fillSep $
1534+ ["The","syntax","for","anonymous","functions","is"
1535+ ,D.dullyellow "(\\x -> x + 1)"
1417− "The syntax for anonymous functions is (\\x -> x + 1) so I am missing all the stuff after the arrow!"
1536+ ,"so","I","am","missing","all","the","stuff","after","the","arrow!"
1418 , D.toSimpleNote $
1538 , D.toSimpleNote $
1419 "It is possible that I am confused about indetation! I generally recommend\
1539 "It is possible that I am confused about indetation! I generally recommend\
1420 \ switching to named functions if the definition cannot fit inline nicely, so\
1540 \ switching to named functions if the definition cannot fit inline nicely, so\