New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvements in common error messages #55
Improvements in common error messages #55
Conversation
Great that you've been working on this Inari! Would it be too much to ask to paste the before & after error messages here? Or as files in the error Gist/repo? It will be easier for people to comment that way. |
Sure! Here are the new errors. Note that original messages are kept, I have only added clarifications. All my additions start with **. Unsupported token gluingOffending code: lin unsupportedTokenGluing str = ss (str + bar") ; Error. First line is the original, my addition starts from **
|
Too many argumentsOffending GF code: lin tooManyArgs = mkSS2 "too" "many" "args" ;
oper mkSS2 : Str -> Str -> SS = \str,dummy -> ss str ; Error. First 2 lines are the original, my addition starts from **
Too few argumentsOffending GF code: lin tooFewArgs = mkSS2 "toofew" ;
oper mkSS2 : Str -> Str -> SS = \str,dummy -> ss str ; Error. First 4 lines are original, my addition starts from **.
Internal error in GeneratePMCFGOffending GF code: patternMatchingRuntime a = ss (case a.s of {"foo" => "bar"}) ; Error. My addition starts with **.
Mismatch in type signature: too many types in signatureOffending GF code. oper mkSSTooManyInTypeSignature : Str -> Str -> SS = \x -> ss x ; Error. My addition after **.
Mismatch in type signature: too few types in signatureOffending GF code. mkSSTooFewInTypeSignature : Str -> SS = \x,y -> ss x ; Error. My addition after **.
|
Oh wow that is quite long! While very pedagogical and helpful for new users, it might be too much text to show by default. What if the default error is just something short plus a hint on how you can get the full version:
|
I agree that the unsupported token gluing one is long. That's the error that pops up inappropriately (see #52 for details), so I wanted to make the error message reflect those options. Would be much better to split that message in two, and give the correct one for correct occasion. As for |
On other hand adding a new flag for basically one use case isn't a good idea. Maybe the error message can link to a file in the repo hosted on GitHub. I've seen this done in other projects like linters.
Full details, including the suggestion to file a bug report, can then be at |
A real world example I just came across:
|
That's a good idea @johnjcamilleri ! I'll update my longer error messages like that, and create the documentation files. |
I think we can merge this now? |
Yes, I agree! In this one I just tackled the ones I found myself needing to explain the most often. :-D Aarne collected all errors last year in this file https://github.com/GrammaticalFramework/gf-core/blob/master/doc/error-messages.txt so the trouble of searching is already done. Is there a plan for a release? I could be more motivated to document other errors if I knew that there's a deadline. |
👍
It's been a while hasn't it? Traditionally there's a release before a summer school. For my part I would at least like to see that we have some updated build routines which use GitHub actions, and ideally the next release can be built & hosted directly on GitHub rather than the GF server. But I guess this discussion deserves its own thread, either here as an issue or maybe better on the GF mailing list. |
Yes, that's a separate discussion. As part of my new job, I'll be teaching GF to the other research group members, so when that becomes relevant (only 3 people have started this week, the rest will join later!), I'll get more input about which errors are confusing! But in any case, we can merge this now and just do a new PR for next improvements. |
I have added clarification and debug suggestions to some of the most common error messages.
Here are GF grammars to trigger these errors: https://gist.github.com/inariksit/88281c9698fd45a5f2bd00aaf14fa183. (Note that the error message in Unsupported token gluing prints out the wrong variable due to the bug #53.)
Any suggestions and feedback are welcome!