nwolverson / vscode-ide-purescript

PureScript IDE support for VS Code
https://marketplace.visualstudio.com/items/nwolverson.ide-purescript
MIT License
188 stars 35 forks source link

Tooltips for .:, .:? and etc don't work #184

Closed unorsk closed 2 years ago

unorsk commented 3 years ago

Hey and thanks for all the good work done on the plugin!

I'm using argonaut that has a couple of operators like ".:" and for some reason tooltips don't work on those operators (perhaps it has something to do with the way these are - the leading dot may be causing the confusion?)

While tooltips seem to appear for <> or ~> or other operators.

I'm using the latest plugin version, and VSCode "Version: 1.59.0-insider (Universal) Commit: 379476f0e13988d90fab105c5c19e7abc8b1dea8"

Hope that helps :)

PS Jump to definition doesn't work either on the above mentioned operators, might be somehow related to the problem.

nwolverson commented 3 years ago

The leading dot might be causing confusion with module separators, yes

natefaubion commented 3 years ago

Is there opportunity to use the CST lexer to normalize handling of things like this? I can understand why you might not want to include the dependency, but it might help with edge cases like this.

nwolverson commented 3 years ago

Probably, the current code is in a hard to understand place because it's driven by the need to match the (qualified) identifier around the cursor - it does some weirdness in separately matching regexes before and after the cursor, when probably it should just tokenize the current line (I guess things that are split over lines are still fine at a lexical level) and compare the cursor position with the result of that

I note that for qualified imports Data.Lens..= has the same issue, as does Data.Array...

natefaubion commented 3 years ago

(I guess things that are split over lines are still fine at a lexical level) and compare the cursor position with the result of that

This is only problematic for string literals, but otherwise qualified names cannot contain whitespace.

nwolverson commented 3 years ago

Same issue as https://github.com/nwolverson/purescript-language-server/issues/146

nwolverson commented 2 years ago

Linked issue is fixed since 0.15.5 (which is already in the current ide-purescript release)