Skip to content
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

Unhelpful error message if doc backtick is unmatched #5353

Open
ceedubs opened this issue Sep 17, 2024 · 1 comment
Open

Unhelpful error message if doc backtick is unmatched #5353

ceedubs opened this issue Sep 17, 2024 · 1 comment
Assignees
Labels
error-message Request for improved error message triaged

Comments

@ceedubs
Copy link
Contributor

ceedubs commented Sep 17, 2024

If you have an unclosed backtick in a doc literal, the parser will continue searching for its match until the end of the file. As far as I know, using single backticks in markdown only supports inline code, so ideally this could give an error message citing the relevant line and noting that a backtick wasn't matched.

Here is an example:

{{
``foo t`` does stuff with `t.
}}
foo : Text -> Text
foo t = t ++ t

What's the message you're seeing?

  Loading changes detected in ~/code/unison/base.u.


  I got confused here:
  
   1678 | 
  
  resetting state

The error message isn't very helpful, and it continues past the fold in my scratch file and reports the error on line 1678.

What would a better version look like?

  Unmatched backtick in doc literal.
  
      2 | ``foo t`` does stuff with `t.
                                    ^

Environment (please complete the following information):

  • ucm --version 0.5.26
@ceedubs ceedubs added the error-message Request for improved error message label Sep 17, 2024
@aryairani
Copy link
Contributor

Likely dupe of #5073 (in progress)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error-message Request for improved error message triaged
Projects
None yet
Development

No branches or pull requests

3 participants