-
-
Notifications
You must be signed in to change notification settings - Fork 369
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
Type information for arbitrary portions of code #709
Comments
Operators should definitely work, given that it seems to work in some cases, it would be good if you could provide a specific test case where it fails. Getting type information of a range is a bit more tricky. It is obviously more complex to implement but there is a second issue here: LSP hover does only give us a position not a range. I’ve taken a quick look at the spec and I also couldn’t find any other method that we could use here either. |
Sorry, yes, they do (it's just that in my configuration symbols' types were being shown spontaneously, while it took a bit more effort for symbols). |
I guess that the |
The type of arbitrary expression can be extracted indirectly in hls, using the eval plugin, that includes @jacg does the workaround using eval works for you? |
That question should be addressed by me nearly twin @jacg :) |
@jneira Could you please give some more advice on how to install/ configure? |
@normenmueller you have to install haskell-language-server which includes by default the eval plugin (you can see it in action here ). Then you can write
You can write arbitrary expressions:
|
@alanz commented in the issue originally in hls:
|
“Type information on arbitrary selected expressions” is the killer feature of any Haskell IDE. vim-hdevtools has that. Actually, what it has works a little bit differently:
... and you can repeat step 2 as many times as you like. It would be great if we could have that feature again with HLS. |
As @jamesdbrock gently pointed in #1973, this feature used to work in haskell-ide-engine (see the pr in the vscode extension which added the feature here) |
I found this comment explaining a bit on how they implemented this in rust-analyzer: microsoft/language-server-protocol#377 (comment) -> maybe this is useful to guide the possible implementation efforts? |
@alanz @mpickering does anyone have knowledge whether this is difficult in ghcide itself (getting type of arbitrary expression), ignoring the issues with LSP and clients? Maybe we can make some step by step progress. |
For type information, I bet we can hack something together using HIE files and hiedb. |
ghcide
gives me information on most alphanumeric symbols (and numeric literals) but there are two features that I'm used to fromdante
and/orintero
:Do these features exist, and have I simply not found them?
If not, any hints on how to implement them?
The text was updated successfully, but these errors were encountered: