pine icon indicating copy to clipboard operation
pine copied to clipboard

Hover does not open documentation in the editor

Open VladimirMarko opened this issue 3 years ago • 3 comments

According to https://github.com/elm-fullstack/elm-fullstack/tree/main/implement/example-apps/elm-editor, the following functionality should exist in https://elm-editor.com/:

Showing documentation and details when hovering the mouse cursor over a part of the code.

However, no such thing occurs.

In fact, I do not believe that there is any way to access documentation in the editor, except as part of a code suggestion.

VladimirMarko avatar Nov 13 '21 21:11 VladimirMarko

Here is a video showing how the documentation tooltip looks like in practice:

2021-11-14-elm-editor-hover-tips

If you found a case where it does not work as expected, let us know.

Viir avatar Nov 14 '21 17:11 Viir

Thank you. You are correct - it does indeed work for many identifiers.

What confused me is that there is no documentation shown for the majority of the identifiers in the default "increment/decrement buttons" demo project that loads when you visit the https://elm-editor.com/ website:

Program, Browser, Browser.sandbox, Html.Html, Html.div, Html.Attributes.style, Html.Events.onClick, Html.text (all the interesting stuff in that demo project) all have no documentation (on hover).

What's the type of Html.text? Well from context I can see that it is gonna be String -> something, but I see no way to get the editor to tell me what exactly it is.

EDIT: Well, technically you can get the editor to tell you the type by producing a type error like test = Html.text + 1, but that's less than ideal.

VladimirMarko avatar Nov 14 '21 21:11 VladimirMarko

What confused me is that there is no documentation shown for the majority of the identifiers in the default "increment/decrement buttons" demo project that loads when you visit the https://elm-editor.com/ website:

That default project came from https://github.com/elm-fullstack/elm-fullstack/tree/f6bccc95add7755ccae31ac310b6cdd99c2ef7d7/implement/example-apps/elm-editor/default-app

In this case, the modules Browser and Html are not part of the project. Instead, they comes via a reference in the elm.json file when using the 'Compile' function. The language service uses the modules present in the project to derive the completion suggestions. With the current implementation, it does not consider the references in elm.json that could bring more modules.

I am sure we can find a better example project. One that is less confusing and better illustrates the available functionality. The current default example project was just a quick sketch, nothing we need to keep.

Viir avatar Nov 18 '21 09:11 Viir