-
Notifications
You must be signed in to change notification settings - Fork 17
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 hovers just shows "Loading..." forever #17
Comments
Totally agree, we will look into it. |
Thanks for looking into it. It shows "Loading..." for me no matter what I'm looking at - single Haskell file or source file within a project. |
I also get this. Worth mentioning that I'm on windows and the project is on my D: drive (although it still didn't work when I moved the project to C: ) |
Just to confirm, you don't get any code completion either right? (Code completion suggestions coming from the extension have a wrench icon next to them). Also, do your file/project paths have white spaces? |
No, I don't get any code completion either. I didn't even know you could get that. I do get syntax highlighting. For a single-file program, I get a button to "Run file", and that works. (Also "Load GHCi" and "QuickCheck". The "Load GHCi" button works - QuickCheck just errors because there are no QuickCheck defs.) For stack projects, I get "Load GHCi", "Stack test", "Stack build", and "Stack run". The first three work, but "Stack run" gives an error "Invalid argument `run'". Perhaps it should be "stack exec"? stack --version gives me: Version 1.3.2 x86_64 hpack-0.15.0 |
To make sure, do you have Intero installed? |
No, what's Intero? Is that something I should or should not have installed? |
Ah, I see it now in the installation instructions. Sorry, I missed that. I'll follow the instructions to install the additional packages. |
Well, I've now installed Intero, QuickCheck and stack-run. Good and bad news: When I fire up VS Code, there are some files where I can see type annotations. It seems to be OK with standalone files or files that are in stack projects. If I look at a file that's in a cabal (non-stack) project, it tells me "Couldn't guess that module name. Does it exist?" And then once it has done that, it gets stuck doing that. I can go to a file that it worked on before and now it gives me that same error. |
It also gives some weird results for type annotations, such as:
...and more. But I'm guessing these are more due to Intero. |
@lylek OK great that it works on both single files and Stack project. Currently Haskelly only supports this two scenarios, so it's normal that you don't get any type hover or code completion in the folder with just a cabal file. Regarding your last comment, it sounds that the problems are related to Intero itself. Maybe we can open an issue in their repo? |
OK thanks, understood about the two scenarios. I feel like sometimes though it successfully does inference on a file, and then after I click around a while on other files and go back to that file, it can't do inference on it anymore. I suspect that the reason is that once you open a Stack project in a window, Haskelly associates that with the window. That actually seems reasonable if your normal use case is opening a separate window for each project and not just browsing around at random. If I figure out more of a pattern behind the behavior, I'll let you know. I've posted another issue for the bit about the string literals. I can actually see in the Haskelly source where the limitation is. As for hovering over the zero and getting 'IO : ()', agreed that sounds like an Intero problem. If I figure out a bit more of a pattern to the Intero issues, I can post a bug report with them. |
The way we designed Haskelly is that it detects every change in the opened file. In every change we check if that new file belongs to a different Stack project, if so we refresh the Intero process with the new project. However, that's doesn't work for you right? Even after 10 seconds? Take into account that loading the new Stack project takes some time, so until it hasn't been fully loaded it's normal to see the |
Updated to Haskelly 0.4.14 (as well as VS Code 1.9.1) and the original problem I reported still occurs with no change. I wonder if the problem is fixed in an unreleased version of Haskelly? Then should I test the github version to check if the problem is fixed? Or maybe the issue was closed because of other topics folks discussed here in this thread unrelated to my original bug report? @martrik |
That's true, the issue was closed by mistake, sorry about that. I've opened a new issue (#23) that targets the root issue that's causing the 'Loading...'. |
Having this problem as well, for did: stack install intero QuickCheck stack-run I get neither type hovers, snippets, or code completion. stack --version: ghc --version: I also tried installing via git. |
When I hover on an expression to see its type it looks like this:
And it stays at "Loading..." forever.
This is when trying to use Haskelly for https://github.com/lamdu/lamdu/. I did also check on a different project, https://github.com/yairchu/generator/, where it worked fine.
So I guess something about Lamdu (multiple targets in single .cabal file?) doesn't work well with Intero, but it's better to have a nice error message than "Loading..." and false hope..
The text was updated successfully, but these errors were encountered: