KronicDeth / intellij-elixir

Elixir plugin for JetBrain's IntelliJ Platform (including Rubymine)
Other
1.83k stars 153 forks source link

'No Documentation found' popup is shown(instead of the docs) when `Ctrl + Q` is pressed for well-known functions #3636

Open SergeyMosin opened 4 weeks ago

SergeyMosin commented 4 weeks ago

Describe the bug No Documentation found. popup is shown(instead of the docs) when Ctrl + Q is pressed while a function such as IO.inspect("foo") is under the caret.

To Reproduce Steps to reproduce the behavior:

  1. Create a project
  2. Insert/type IO.inspect("foo") where it is allowed
  3. Place cursor/caret inside the inspect function name
  4. Press Ctrl + Q
  5. No Documentation found. popup is shown

Expected behavior When Ctrl + Q is pressed while cursor/caret is place inside a function name, documentation for that function should be shown.

Screenshots Ctrl + Q when inside inspect image

Ctrl + Left Click image

Ctrl + Q when inside IO (works as expected) image

Logs N/A

Desktop:

IntelliJ IDEA 2024.2.0.1 (Community Edition)
Build #IC-242.20224.387, built on August 13, 2024
Runtime version: 21.0.3+13-b509.4 amd64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.awt.X11.XToolkit
Linux 6.8.0-40-generic
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 3968M
Cores: 8
Registry:
  ide.experimental.ui=true
Non-Bundled Plugins:
  com.intellij.plugins.watcher (242.20224.155)
  org.elixir_lang (19.0.0)
Kotlin: 242.20224.387-IJ
Current Desktop: ubuntu:GNOME

Erlang:

Elixir:

Plugin:

Additional context I have not used this plugin prior to v19.0.0 (IntelliJ IDEA 2024.2.0.1) , so I don't know if it worked in previous versions or if this is specific to v19.0.0 / IDEA 2024.2.0.1

joshuataylor commented 3 weeks ago

Reader mode works, so it must be parsing somehow.

Thanks for the report, it's definitely a very useful feature so let's get it sorted.

joshuataylor commented 3 weeks ago

I believe this might be due to having multiple definitions for functions, and it isn't sure which it should use.

Perhaps we could have a way of determining if there are multiple definitions, and if there is only one docblock, show that? Or we could have a "known good" list for inbuilt, as we don't want to show the wrong docs as well.

Eg Enum.sort can display the docs, when within the module:

SCR-20240820-udwq

And it works for within the same module:

SCR-20240820-uejw

But Enum.map autocomplete DOES work:

SCR-20240820-ufzd SCR-20240820-ufmj

Just not when multiple definitions.

SCR-20240820-ugex

I'll dig into it, would be great to get this solved.

SergeyMosin commented 3 weeks ago

I see now. I did not realize that I can get the docs by pressing Ctrl + Q while inside the drop-down, like the Enum.map example above. This is perfectly fine for me. Thank you for the great plugin.