unisonweb / unison

A friendly programming language from the future
https://unison-lang.org
Other
5.64k stars 267 forks source link

LSP hover info uses wrong name for term ending in bang #5097

Open ceedubs opened 1 week ago

ceedubs commented 1 week ago

Describe and demonstrate the bug

The LSP hover info functionality has curious behavior for terms whose name ends in ! (and possibly other characters...I haven't checked).

See the screenshot below. It seems to show the correct type signature and doc, but the term name in the type signature is wrong; it shows Stream.flatMap while it should show Stream.flatMap!. Notably in this case Stream.flatMap is an existing term but has a different type signature.

Screenshots

image

Environment (please complete the following information):

Additional context

My guess is that it is just using the name from the scratch file to avoid confusion with aliases but that it isn't quite using the right tokenization or something.

ChrisPenner commented 1 week ago

Yeah I think I probably just need to change what I consider a valid symbol name, I think I had ! out of the set so I wouldn't parse !foo as a symbol. Can probably just strip leading bangs but not trailing ones.