defold / lua-language-server

A language server that offers Lua language support - programmed in Lua
MIT License
16 stars 2 forks source link

What's the best way to update annotations? #10

Open astrochili opened 10 months ago

astrochili commented 10 months ago

The repository is currently using annotations from a year ago. The idea of updating the annotations manually with each release sounds bad. Is there any way to automate updating them in this repository?

I've created the annotation generator (https://github.com/astrochili/defold-annotations) that can be run on any server that has Lua. Also it automatically checks for Defold updates every day and makes a release of new annotations if needed. Is there any way this could help?

astrochili commented 10 months ago

There are also other options where updated annotations can be found:

vlaaad commented 10 months ago

Many thanks for your interest! We want to make a tighter integration of lua language server and defold, although we haven't decided yet on the details. Eventually, we want to bundle the language server in the editor, and perhaps make the editor prep the annotations from it's own engine docs and script_api files.

astrochili commented 10 months ago

That's a good idea. I guess the lua files will be available in the jar archive of the editor? All the time I'm in a hurry to implement something that is already planned :D

vlaaad commented 10 months ago

I guess the lua files will be available in the jar archive of the editor?

This is the part of the details we haven't decided upon yet :D Maybe it will be generated on the fly and communicated to the language server. script_api files can be added/removed when adding/removing dependencies or they can be edited as files in the project file tree, so there is a need for some dynamicity. Do you have a use case for annotation files other than to use in the editor for e.g. linting and code completion?

astrochili commented 10 months ago

Do you have a use case for annotation files other than to use in the editor for e.g. linting and code completion?

Of course the case is using in VSCode. It works like shooting fish in a barrel. Just install Lua Language Server extension for VSCode and add somewhere Defold lua annotations.

First I wrote an VSCode extension that parsed sdoc files from the editor's jar archive so that the annotations would always match the installed version of Defold and would not be downloaded from anywhere else.

But since sdoc was declared a bit outdated format, and it's easier to parse json, I went the way of downloading and parsing documentation in json files from editor releases. And want to place these annotations automaticaly somewhere in shared space of my VSCode extension (not ready yet) outside the game project.

astrochili commented 10 months ago

script_api files can be added/removed when adding/removing dependencies or they can be edited as files in the project file tree, so there is a need for some dynamicity.

That's a good point. Now I understand that not everything is so simple and obvious.