@@ -542,10 +542,36 @@ toReport source err =
544 UnexpectedPort region ->
544 UnexpectedPort region ->
545− error "TODO UnexpectedPort" region
545+ Report.Report "UNEXPECTED PORTS" region [] $
546+ Code.toSnippet source region Nothing
549+ "You are declaring ports in a normal module."
553+ ["Switch","this","to","say",D.green "port module","instead,"
554+ ,"marking","that","this","module","contains","port","declarations."
557+ "Ports are not a traditional FFI for calling JS functions directly. They need a different mindset! Read"
559+ "to learn the syntax and how to use it effectively."
547 NoPorts region ->
563 NoPorts region ->
548− error "TODO NoPorts" region
564+ Report.Report "NO PORTS" region [] $
565+ Code.toSnippet source region Nothing
568+ "This module does not declare any ports, but it says it will:"
571+ ["Switch","this","to",D.green "module"
572+ ,"and","you","should","be","all","set!"
550 ParseError modul ->
576 ParseError modul ->
551 toParseErrorReport source modul
577 toParseErrorReport source modul
@@ -640,8 +666,7 @@ toParseErrorReport source modul =
640 [ D.fillSep [D.blue "port",D.blue "module","WebSockets",D.blue "exposing","(send, listen, keepAlive)"]
666 [ D.fillSep [D.blue "port",D.blue "module","WebSockets",D.blue "exposing","(send, listen, keepAlive)"]
641 , D.fillSep [D.blue "port",D.blue "module","Maps",D.blue "exposing","(Location, goto)"]
667 , D.fillSep [D.blue "port",D.blue "module","Maps",D.blue "exposing","(Location, goto)"]
643− , D.reflow $
669+ , D.link "Note" "Read" "ports" "for more help."
644− "Go to the section in https://guide.elm-lang.org on ports for more information!"
@@ -2500,38 +2525,6 @@ toFuncReport source context func startRow startCol =
2500 \ maybe this comment is here by accident?"
2525 \ maybe this comment is here by accident?"
2503− UnexpectedPort region ->
2504− Report.Report "UNEXPECTED PORTS" region [] $
2505− Code.toSnippet source region Nothing
2508− "You are declaring ports in a normal module."
2512− ["Switch","this","to","say",D.green "port module","instead,"
2513− ,"marking","that","this","module","contains","port","declarations."
2516− "Ports are not a traditional FFI for calling JS functions directly. They need a different mindset! Read"
2518− "to learn the syntax and how to use it effectively."
2523− Report.Report "NO PORTS" region [] $
2524− Code.toSnippet source region Nothing
2527− "This module does not declare any ports, but it says it will:"
2530− ["Switch","this","to",D.green "module"
2531− ,"and","you","should","be","all","set!"
2535 ParseError row col context expectation ->
2528 ParseError row col context expectation ->
2537 pos = A.Position row col
2530 pos = A.Position row col