mapeditor / tiled-to-godot-export

Tiled plugins for exporting Tilemaps and Tilesets to Godot 3 format
149 stars 35 forks source link

Use tiled-api npm package #37

Closed bjorn closed 2 years ago

bjorn commented 2 years ago

Since a while we have an NPM package called tiled-api: https://www.npmjs.com/package/@mapeditor/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.

justdaft commented 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: @.***>

nerochiaro commented 2 years ago

Since a while we have an NPM package called tiled-api: https://www.npmjs.com/package/@mapeditor/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.

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 ?

bjorn commented 2 years ago

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 ?

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.

nerochiaro commented 2 years ago

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.

eleniums commented 2 years ago

Closed by PR #49

bjorn commented 2 years ago

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.