Skip to content

[Windows] Suggest spec Code Lens not working #528

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

Closed
2 tasks done
gallexme opened this issue Apr 9, 2021 · 4 comments
Closed
2 tasks done

[Windows] Suggest spec Code Lens not working #528

gallexme opened this issue Apr 9, 2021 · 4 comments

Comments

@gallexme
Copy link

gallexme commented Apr 9, 2021

Environment

  • Elixir & Erlang versions (elixir --version): Erlang/OTP 23 [erts-11.2] [source] [64-bit] Elixir 1.11.4 (compiled with Erlang/OTP 21)
  • Operating system: Windows 10 /WSL Arch
  • Editor or IDE name (e.g. Emacs/VSCode): VSCode
  • Editor Plugin/LSP Client name: ElixirLS

Troubleshooting

  • Restart your editor (which will restart ElixirLS) sometimes fixes issues
  • Stop your editor, remove the entire .elixir_ls directory, then restart your editor
    • NOTE: This will cause you to have to re-run the dialyzer build for your project

If you're experiencing high CPU usage, it is most likely Dialyzer building the PLTs; after it's done the CPU usage should go back to normal. You could also disable Dialyzer in the settings.

Logs

  1. Check the output log by opening View > Output and selecting "ElixirLS" in the dropdown. Please include any output that looks relevant. (If ElixirLS isn't in the dropdown, the server failed to launch.)
    No Errors

  2. Check the developer console by opening Help > Toggle Developer Tools and include any errors that look relevant.
    No Errors

Installing 0.7.0 then repeatedly deleting .elixir_ls does not help
installing 0.6.2 then repeatedly deleting .elixir-ls does help

with 0.6.2 i get suggestions for the @SPEC , with 0.7.0 i dont

0.6.2: https://cdn.discordapp.com/attachments/269508806759809042/829735077779996712/unknown.png

0.7.0: https://media.discordapp.net/attachments/646832679999897610/829994787565731911/unknown.png

@lukaszsamson
Copy link
Collaborator

@gallexme What do you mean by "@SPEC Auto Suggestion"? Do you mean Code Lens suggesting type specs for functions/macros (which I verified is working) or @spec attribute code completion (which is also working) or code completions inside typespecs (which is also working)? We need more info and a project that reproduces this issue.

@gallexme
Copy link
Author

0.6.2 Pic shows the suggestion I'm talking about, a gray @SPEC recommendation which u can click and automatically gets inserted into the code, I'm not the only one with the issue, it happens with any project

I'm using Windowsz, but same issue with arch Linux on wsl2

For one guy it worked by repeatedly installing 0.7, but for me only after installing a 0.6 version

@axelson
Meant
"Hmm, that's likely a bug introduced since we generalized that portion of the code. Please file a bug report thumbsup"

Other user having same issue:
Screenshot_20210414_094413_com discord

Im using Using otp 23 and elixir 1.11
Same issue happens with otp24 rc2 and elixir 1.11 on arch Linux

How can I provide u more Infos?

https://gitlab.com/zen_core/zen_core
Is one project where that issue happens
But I also see it happening on empty elixir applications

@lukaszsamson
Copy link
Collaborator

@gallexme you didn't post any pic.

a gray @SPEC recommendation which u can click and automatically gets inserted into the code

It's called Code Lens and the problem is on Windows only. On macOS it works fine.

Screenshot 2021-04-14 at 09 56 33

@lukaszsamson lukaszsamson changed the title @spec Auto Suggestion Broken since somewhen around 0.6.2? [Windows] Suggest spec Code Lens not working Apr 14, 2021
@gallexme
Copy link
Author

lukaszsamson added a commit that referenced this issue Apr 14, 2021
on windows we need to convert from "c:\\some\\other.ex" to "c:/some/other.ex"

Fixes #528
vanjabucic pushed a commit to vanjabucic/elixir-ls that referenced this issue Jul 5, 2021
* Dialyzer.suggest_contracts expects absnames

on windows we need to convert from "c:\\some\\other.ex" to "c:/some/other.ex"

Fixes elixir-lsp#528

* fix test on windows

* add suggest contracts tests

* apply code review suggestion

* revert non windows compatible change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants