Closed bjorn closed 2 years ago
Hi, thats a great Idea, I will have a look at that.
Thanks
On Thu, 24 Mar 2022 at 15:27, Thorbjørn Lindeijer @.***> wrote:
Since a while we have an NPM package called tiled-api: @.***/tiled-api
Using it in an extension enables code completion and API documentation to show up in a JS editor, like VS Code. It would be nice to set this up for this extension as well.
— Reply to this email directly, view it on GitHub https://github.com/mapeditor/tiled-to-godot-export/issues/37, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALQ4B5IHZJIYU6UPTPTWF3VBSCV3ANCNFSM5RRQRH2Q . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Since a while we have an NPM package called
tiled-api
: https://www.npmjs.com/package/@mapeditor/tiled-apiUsing it in an extension enables code completion and API documentation to show up in a JS editor, like VS Code. It would be nice to set this up for this extension as well.
Could you please elaborate a bit on what would you consider "setting this up" for the extension ?
Just having a package.json
for the project with the types package appearing in the devDependencies
?
Could you please elaborate a bit on what would you consider "setting this up" for the extension ? Just having a
package.json
for the project with the types package appearing in thedevDependencies
?
Yes, and for the source files to be modified to take advantage of it where necessary. In JS files, you often need type annotations in comments to tell VS Code the type of variables, function parameters and return values.
Right. I have always found specifying types as JSDoc comments a bit painful, and much prefer the type annotation syntax of typescript. But I guess since we are dealing with the QT JS engine, there's no other way to do it since we don't want to have to rebuild the extension every time something changes.
Closed by PR #49
But I guess since we are dealing with the QT JS engine, there's no other way to do it since we don't want to have to rebuild the extension every time something changes.
Right, some extensions are written in TypeScript and just deal with the compilation step somehow, like https://github.com/sponge/keen-tiled. Anyway I'm not advocating to port this extension to TypeScript.
Since a while we have an NPM package called
tiled-api
: https://www.npmjs.com/package/@mapeditor/tiled-apiUsing it in an extension enables code completion and API documentation to show up in a JS editor, like VS Code. It would be nice to set this up for this extension as well.