Closed VladimirMarko closed 6 months ago
Here is a video showing how the documentation tooltip looks like in practice:
If you found a case where it does not work as expected, let us know.
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.
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.
This issue was fixed with commit https://github.com/pine-vm/pine/commit/e4949e0d1fdfe7eba8dd326f8429b8765276dc6e
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/:
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.