vscode-compatibility.rst 1.5 KB

123456789101112131415161718192021222324252627282930
  1. .. include:: ../_header.rst
  2. Visual Studio Code compatibility
  3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  4. The |vscode|_ editor is prefect for writing the code of the |PhaserEditor|_ games. First, t is extremely popular and powerful. Second, cause the projects created by |PhaserEditor|_ contains the files needed by |vscode|_ to provide a good coding experience with Phaser_.
  5. Project structure
  6. `````````````````
  7. The JavaScript project templates include these files:
  8. .. image:: ../images/code-editor-vscode-js-05012020.webp
  9. :alt: JavaScript project.
  10. #. The file ``lib/phaser.js``. It is the Phaser_ runtime.
  11. #. The Phaser_ type definition files: ``types/phaser.d.ts`` and ``types/matter.d.ts``. Those files are provided by Phaser_ and are used by the |vscode|_ to "understand" the |PhaserAPI|_.
  12. #. The `project configuration <https://code.visualstudio.com/docs/languages/jsconfig>`_ file: ``jsconfig.json``.
  13. If it is a TypeScript project, then it includes the `tsconfig.json file <https://www.typescriptlang.org/docs/handbook/tsconfig-json.html>`_, instead of the ``jsconfig.json`` file.
  14. Code Server
  15. ```````````
  16. If you are using a remote instance of |PhaserEditor|_, you can try `Code Server <https://github.com/cdr/code-server/>`_. It allows to run VS Code in the same |PhaserEditor|_ server and edit the game code in your local browser.
  17. Also, you can use cloud services like GitHub Codespace or Gitpod. In both cases you can install Phaser Editor 2D Core as a project dependency and run it alongside with VS Code.