unisonweb / vscode-unison

Official Unison extension for Visual Studio Code
MIT License
23 stars 4 forks source link

Doc blocks with nested multiline comments have syntax coloring wrong #12

Closed kylegoetz closed 3 months ago

kylegoetz commented 1 year ago

Drop this in a file

{{ this is a doc block {link} {- foo }}
x = 5

In VSCode this results in everything beginning with {- being colored green (like a multiline comment) all the way to the end of the file, presumably because there is no closing -}

However, ucm validates this as correct code with x: Nat and x.doc : Doc.

So multiline comments inside a doc block are it seems ignored by ucm, but the VS Code highlighter attempts to parse them.

Indeed, > x.doc prints out

Paragraph
            [ Word "this",
              Word "is",
              Word "a",
              Word "doc",
              Word "block",
              Special (SpecialForm.Link (Right (Term.Term (Any 'link)))),
              Word "{-",
              Word "foo" ]

So it does seem like {- is a nothingburger for ucm when inside a doc block.

ChrisPenner commented 3 months ago

Thanks for the report!

I think Rúnar must've fixed this as part of his syntax patches because I can't reproduce :) Let me know if you still can.

kylegoetz commented 3 months ago

I cannot reproduce anymore. Yay!