Godot: Embed or link to function definitions in the engine source code from Help screen

Created on 18 Feb 2019  路  16Comments  路  Source: godotengine/godot

Godot version:

OS/device including version:

Issue description:

Steps to reproduce:

Minimal reproduction project:

archived documentation feature proposal editor

All 16 comments

Could you be more specific..?

Could you be more specific..?

I'm talking about this :
fdback

I wish I could still click on the function to check its prototype. It would help better understand how the engine work...

Well, this is the function prototype. What more info do you want?

Well, this is the function prototype. What more info do you want?

Function definition, function prototype, body of a function... I'm looking for its skeleton, or if you want,
its algorithm...

So you mean a link to the function's definition in the engine source code, i.e. https://github.com/godotengine/godot/blob/2.1/scene/2d/physics_body_2d.cpp#L1039 ?
Or embed this source code directly in the help?

Function definition, function prototype, body of a function...

Something like this?

optimized

The source code of the engine is bigger than the engine itself. It's too big to include.

Any suggestions?

Generating a link to github wouldn't work because it doesn't happen in the offline case and may change.

If the binary was in the godot-git/bin/ folder it could work, but isn't compiling the engine unusual?

[edited] Maybe do with diff viewers do and supply file name, folder and line number?
[edited] Maybe add a copy of all the headers?

The source code of the engine is bigger than the engine itself. It's too big to include.

Any suggestions?

Generating a link to github wouldn't work because it doesn't happen in the offline case and may change.

If the binary was in the godot-git/bin/ folder it could work, but isn't compiling the engine unusual?

[edited] Maybe do with diff viewers do and supply file name, folder and line number?
[edited] Maybe add a copy of all the headers?

It's fine by me. It's not like if the source code weighs more than a hundred megs...
And, in any case, how could you say it's too big to include ? Why the idea ?

@Steph155: Godot's big selling point is the fact that it's less than 100 MB. Adding 100+ MB (yes, the source is a bit over a hundred) to it is not a good idea.

@Zireael07

In that case I suggest the option to link the source is added. You would just need to setup the docs by giving a path in the engine. That way the source isn't added to the engine, but still you can check functions algorithms from it...

The source code of the engine is bigger than the engine itself. It's too big to include.

Source code in tar.xz is about 16 MB, it is already available as part of any release downloads and can be downloaded on demand in the same way export templates are.

But searching for relevant code wouldn't be easy, Godot uses tons of wrappers for gdscript.
e.g. OS::xxx should point to core/bind/core_bind.cpp, core/os/os.cpp or /platform/YY/os_YY.cpp for current platform, for all platforms?

Another way is to generate a json compilation database. This will make it platform specific but that is intended. Then write a tool that queries it for the exact function prototype.

Another way is to generate a json compilation database.

AFAIK scons doesn't support compilation db generation out of the box. Last time I needed one from a scons project I was using this tool https://github.com/rizsotto/Bear.

My thought was more using ninja to generate json compilation databases like https://github.com/RedBeard0531/mongo_module_ninja.

We could implement this feature partially by adding a reference to the file name that defines the class in the generated documentation XML (e.g. AnimatedSprite is defined in scene/2d/animated_sprite.cpp). This can be used to generate a GitHub link to the file in question in the current branch (3.1 if using a stable build, master if using a development build). This link would be added as a button at the top of the editor help (near Search Help and Request Docs).

It's not as good as having per-method links, but it's a start.

Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine.

The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker.

If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance!

Was this page helpful?
0 / 5 - 0 ratings