Where find *.gd of API?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Emerson MX
:warning: Old Version Published before Godot 3 was released.

I’m using Godot with an external editor (vim), however every time I need to see a built-in function or class I have to search the online documentation. It would also be nice if autocomplete worked for such cases.

I’m thinking of making a converter that extracts from .rst files from the documentation to .gd files. Hence the .gd files would have only dummy classes and functions (Like some IDE helpers out there). And then I could use ctags to generate the index.

Before doing this, I come here to know the opinion of the community on the subject.
If you had something more structured to work with, the conversion would be easier.

Thanks for listening.

EDIT 1:
Yesterday when I was looking at the project repository I found an xml.
https://github.com/godotengine/godot/blob/master/doc/base/classes.xml

I did some quick tests and managed to generate some gdscripts :smiley:

EDIT 2:
GDScript generator

(Powered by google translator :D)

:bust_in_silhouette: Reply From: kidscancode

There has been discussion about ways to support this: Autocompletion Service Support for external text editors, although I’m not aware of anyone working on it currently.

Any solution to this is going to need to be tied directly into the engine. No offense, but your suggestion to use the .rst files is a bad one. First of all, the API docs are all autogenerated anyway, so it would be an unnecessary step - you should pull directly from the source. Secondly, any changes to the .rst formatting would break your tool, so it would be a huge pain to manage.

See here for how the documentation is generated/organized: Contributing to the documentation

Personally, I think integrating the Language Server Protocol or something similar is really going to be the best solution. It will be flexible and support a variety of editors. If you are able to contribute to that, I think it would be the best use of your time.

The GDNative API generator could be used as API data source, but that would still mean the external editor would need to rewrite all the completion logic.

Zylann | 2017-09-08 12:38

Yes using the .rst is really a bad idea, but it was what I had seen so far.

Yesterday when I was looking at the project repository I found an xml.
https://github.com/godotengine/godot/blob/master/doc/base/classes.xml

I did some quick tests and managed to generate some gdscripts :smiley:

I’ll take a look at this autocomplete server.

Emerson MX | 2017-09-08 15:24