-
Notifications
You must be signed in to change notification settings - Fork 56
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 on hover missing #185
Comments
Thank you for the bug report! Currently type information can only be provided for methods / etc that are included in the final executable. Can you try doing this, and seeing if the hover works over the foo method call? def foo : String
"hello"
end
puts foo # <-- here It is weird though that there were no messages after "getting context...", I'll try to get a WSL2 system setup soon to see if I can reproduce. |
Thanks for the quick response 🙌
Is that something that is planned to be improved later on or a limitation coming from Crystal ? 🤔 require "spec"
def foo : String
"hello"
end
describe "#foo" do
it "should return 'hello'" do
foo.should eq "hello"
end
end |
Ah alright good to know, thank you for testing that! I also started on Ruby before finding Crystal, let me know if you have any questions about the language. It's a limitation of the compiler currently, it removes anything not included in an executable (methods defined but never used, for example). Also due to type inference, the types can change depending on what's using the method (unless you've explicitly typed it like with your foo method). Specs are executables though, so that should work. |
It's a bit early but I'll be sure to take you on that offer soon 👀 Thank you very much |
I just realized but it seems I'm not getting any type error either LSP which btw no prints an additional
|
So currently, you're not utilizing an LSP but instead wrappers for several compiler tools. I should provide better documentation but you need to install https://github.com/elbywan/crystalline somewhere and point the You should be seeing type error information, looks like the problems tool isn't running for some reason. It's supposed to run every time you save or open a new file. |
Yes that was it 🙌 Thank you @nobodywasishere I could probably open a PR within the next couple of days to update the README if you'd like |
Describe the bug
I've just installed the extension (
0.9.1
) on my WSL machine and no types are appearing on hover despite the setting being enabled.In my Crystal lsp output I can see
getting context...
frozeTo Reproduce
Not sure tbh
I just installed Crystal with asdf
Then installed the extension in vscode
Reloaded vscode, created a .cr file and wrote a simple method
Expected behavior
To see the type of what I'm hovering
Screenshots
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: