Coder Social home page Coder Social logo

c3-vscode-extension's Introduction

Construct 3 Tools

This vscode extension is for working on Construct 3 projects locally in 'local folder' mode.

It features:

  • Specific typescript definition generation for your project
  • Basic code completion for non-typescript projects
  • Setup for easy remote debugging (even easier with VS Code Contruct 3 plugin)
  • Auto script reloading (with VS Code Construct 3 plugin)

Features

Typescript definition generation

Automatically creates a typescript definition file called c3.d.ts in the root of your project with a complete set of unique interfaces for your instances, instance variables, behaviors and global variavsce packagebles. This file also contains complete definitions for all available scipting features in Construct 3.

Generation will happen when you open the project, as well as when you select the Contruct 3 - Regenerate definitions from the command menu.

feature X

Javascript autocomplete

If you are not using Typescript you can still benefit from the definition file autocompletion where appropriate. VS Code will automatically pick up definitions for the runOnStartup method, as well as anything within globalThis.

Where this is not available, autocomplete will try it's best to work out what you're trying to do and provide helpful text suggestions:

feature X

For more advanced autocomplete you can also provide hints to vscode about which type a variable is using the jsdoc features by adding a comment above in the format: /** {TYPE} /* feature X

Remote debugging

This extension will automatically attempt to create a debug profile for you. Once you've set up remote debugging in Chrome on port 9222.

Add --remote-debugging-port=9222 to the shortcut of your chrome.exe, more info here.

when you press F5 it will attach to your running Construct 3 game and allow remote debugging.

If you have the Construct 3 VS Code plugin then running / stopping the debug instance from within VS Code will automatically start / stop your game for you. Note: The construct 3 window requires to be focused / visible periodically, otherwise the game window may not play automatically.

Auto script reloading

If you have the Construct 3 VS Code plugin then any time you save a file from within VS Code it will reload the script folder inside Construct 3.

Construct 3 Plugin

For some of these features you will need to install the "VS Code Plugin" addon from the construct website https://www.construct.net/en/make-games/addons/603/vs-code-plugin

Known Issues

None yet, let me know!

Release Notes

1.0.8

  • Fixed typo in definitions

1.0.7

  • Refactor for signficant speed improvements

1.0.6

  • Updated definitions

1.0.5

  • Updated definitions

1.0.4

  • Updated definitions

1.0.2

  • Added extra file required for debugging

1.0.1

  • Fixing generation issue
  • Added logo

1.0.0

  • Initial release

c3-vscode-extension's People

Contributors

edwardbonnett avatar getechg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

c3-vscode-extension's Issues

Source for 1.0.7 ?

Hello,

First thank you for your work on this extension and its companion addon, very useful to dev in a sane environment ;)

I noticed that the extension currently on VSCode Marketplace is ahead of what's on your repo. Is it possible to push your changes ? I'm thinking of maybe adding a couple of features as I work more with this extension. (and if you need help maintaining it, I'd be glad to!)

Typescript Definition Autogeneration doesn't work for C3 projects after the r309 update because Profect Files structure changed to add actual subfolders.

Construct 3 recently pushed an update that changed how Project Files are saved.
https://www.construct.net/fr/make-games/releases/beta/r309

The change to the project file format is that subfolders in the Project Bar are now represented with real subfolders in the project files.

So if I put an Obejct PlayerSprite in the subfolder "Entities" in My Projet Bar. It would be the case in my actual project files too.
As opposed to how it worked before : before r309 all the objectTypes were put under the root folder "objectTypes" no matter if they were put in subfolders inside the C3 Editor Project Bar.
(C3 calls previous way to handle stuff as "Flat mode" and the new one as "Folders mode" : Folders mode is now how all projects files saved after the r309 update are handled, you can't disable it)

Because of this change. As soon as a ObjectType or a Family is put in a subfolder in the project bar, the Typescript Definition Autogeneration doesn't work anymore at all. It writes the message "

It's because now it should look for all the files put in all subfolders of the "objectTypes" folder and not only files at the root of this folder.
Same logic applies for "families" for example.

CONSTRUCT 3 TOOLS UPDATE DEFINITION REQUEST

Hi
Recently, a number of apis for behavior and plug-ins have been added in construct3. Do you have time to add a new definition for the VSCODE plugin?
Thank you so much!
The plug-in is great!!!

Conflict with the constructor

I haven't been writing in typescript very long, but it should be so that it shades the main class.

declare var ISpriteInstance: undefined | { new(): ISpriteInstance };

And it gives a warning
Type '(new () => ISpriteInstance) | undefined' is not a constructor function type.ts(2507)
If so, how do I inherit from a class and get static fields for example.

class PlayerInstance extends ISpriteInstance
{
	constructor()
	{
		super();
	}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.