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

The type of selected expression #514

Closed
nartamonov opened this issue Oct 16, 2020 · 3 comments
Closed

The type of selected expression #514

nartamonov opened this issue Oct 16, 2020 · 3 comments
Labels

Comments

@nartamonov
Copy link

Since Haskell is rather expression-heavy language and sometimes expressions in our programs can be complicated, it would be invalueable if this extension allows to select arbitrary expression and show its type. The feature is one of the most demanded and useful in other IDEs for "functional" languages. For example, IntelliJ IDEA (with Scala plugin) can show the type of Scala expression under selection:

image

Importantly that the showed type above is already inferred and concrete, in contrast to the generic type of foldLeft function which we can find out by hovering over function name:

image

That's why "Type information and documentation on hover" (already implemented in extension) does not replace "Type of selected expression" functionality.

I'm novice Haskell programmer and like the language a lot. So I really miss that feature when learning Haskell. I had many years of experience in Scala and use the feature constantly. It helps a lot when you work on real-world projects.

@jneira
Copy link
Member

jneira commented Oct 18, 2020

Thanks for the suggestion, it is really well exposed and makes sense. It belongs to haskell-language-server, the default lsp server backend of this extension so i am gonna move to that repo.
It was already suggested (signal of a nice feature request) in ghcide (the core library of haskell-language-server): https://github.com/haskell/ghcide/issues/70

@jneira jneira transferred this issue from haskell/vscode-haskell Oct 18, 2020
@alanz
Copy link
Collaborator

alanz commented Oct 20, 2020

I guess someone needs to actually make a PR for microsoft/language-server-protocol#377

@jneira
Copy link
Member

jneira commented Jan 19, 2021

The linked issue in ghcide was moved here so i am gonna close this one.

@jneira jneira closed this as completed Jan 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants