How realistic would it be to expect the documentation to be a part of the engine?

Defold has a great documentation so I was curious if it would be possible for it to be a part of the engine in the future, similar to how Godot handles it.
For example clicking on a function while pressing Ctrl could take the user to the definition of it.
Or, when mouse hovered over a property it could show explanation of it (from the documentation or a separate one) instead of only showing “Available as * in editor scripts” etc.

Not sure how feasible it is but if possible, would love to see it implemented. Defold has a steep learning curve for new users and this would smooth the curve a lot

1 Like

We already have this implemented:

(ctrl+space while completions are showing)

I assume you mean Editor (not Engine), but yes, this would be great. Having all of the Defold documentation presented in a separate window, with cross references and tight integration with the various panels and features of the editor. It will happen at some point, it is on our radar, although not very high priority.

5 Likes

I want to point out two amazing features in Defold’s LSP/linter too:

The LSP will also pick up code annotations if you start them with ---

So this code:

--- Function Description
--- @param name number parameter 
--- @returns number return
---
--- It even supports links: https://defold.com
function func(name)
   return
end

Will get you something like this on hover:


(and the link to file:///path/to/thing would open thing on your computer, if it exists)

For example clicking on a function while pressing Ctrl could take the user to the definition of it.

For local code, you can do this with F12 (which will even show you the code in modules). And then SHIFT + F12 will show you where the symbol is used in the code.

EDIT: The other amazing feature is that Native Extensions can use the LSP. But I forgot to mention it

4 Likes

Thank you :slightly_smiling_face:

That function annotation is a great tip. :fire: I found a cleaner result from altering the keywords:

--- Serves no purpose, but that's okay because it is an example.
--- @param n number
--- @return number n
local function func(n)
   return n
end
1 Like