GithubHelp home page GithubHelp logo

midouest / vscode-playdate-debug Goto Github PK

View Code? Open in Web Editor NEW
31.0 3.0 4.0 1.57 MB

Unofficial Playdate debug extension for Visual Studio Code on macOS, Windows and Ubuntu

Home Page: https://marketplace.visualstudio.com/items?itemName=midouest.playdate-debug

License: MIT License

TypeScript 99.05% Shell 0.95%
playdate playdate-console vscode vscode-extension debugger

vscode-playdate-debug's Introduction

Playdate Debug

tests

Unofficial Playdate debug extension for Visual Studio Code on macOS, Windows and Ubuntu

Features

  • Debug Lua code running in the Playdate Simulator
  • Compile games to .pdx using pdc
  • Problem matchers for pdc
  • Open the Playdate Simulator
  • Run and debug current Lua file in the Playdate Simulator from the editor toolbar

Requirements

Quick setup

Tasks and debug launcher

Copy the following .vscode/tasks.json and .vscode/launch.json configuration:

// .vscode/tasks.json
{
  "version": "2.0.0",
  "tasks": [
    {
      "type": "pdc",
      "problemMatcher": ["$pdc-lua", "$pdc-external"],
      "label": "Playdate: Build"
    },
    {
      "type": "playdate-simulator",
      "problemMatcher": ["$pdc-external"],
      "label": "Playdate: Run"
    },
    {
      "label": "Playdate: Build and Run",
      "dependsOn": ["Playdate: Build", "Playdate: Run"],
      "dependsOrder": "sequence",
      "problemMatcher": [],
      "group": {
        "kind": "build",
        "isDefault": true
      }
    }
  ]
}
// .vscode/launch.json
{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "playdate",
      "request": "launch",
      "name": "Playdate: Debug",
      "preLaunchTask": "${defaultBuildTask}"
    }
  ]
}

The debugger can be launched from the "Run and Debug view" by selecting the "Playdate: Debug" launch configuration and then clicking the "Start Debugging" button.

Run and Debug view

Start Debugging

A cookiecutter project template is available for quickly generating new projects with the above configuration from the command line.

See the basic configuration example for more information.

Run and debug current Lua file

NOTE: The "Run/Debug file in Playdate Simulator" command is intended to be a shortcut for prototyping and learning. It is recommended to use the task and launch configuration above.

The extension can build, run and debug the current Lua file in the editor with zero configuration as long the automatic configuration conditions are met.

When you open a Lua file in the editor after installing the extension, you will now see a launch icon and dropdown menu in the editor toolbar. Clicking the launch icon or selecting an item from the dropdown menu will build and run the current Lua file in the Playdate Simulator. The "Debug file in Playdate Simulator" option will enable breakpoints to be hit.

Tooltip

Dropdown Menu

Configuration

Automatic

The tasks and debugger will attempt to automatically resolve the correct configuration using the environment. One of the following conditions must be met for this to work:

  • The PLAYDATE_SDK_PATH environment variable is set to the Playdate SDK path
  • ~/.Playdate/config exists and the SDKRoot property is set to the Playdate SDK path (macOS only)

Workspace settings override

The default behavior can be overridden by setting the SDK path, game source path, compiled game path or game name in your workspace's settings.json file. The extension will fall back to the default behavior for any configuration fields that are not set.

// .vscode/settings.json
{
  "playdate-debug.sdkPath": "/path/to/PlaydateSDK",
  "playdate-debug.sourcePath": "/path/to/MyGame/source",
  "playdate-debug.outputPath": "/path/to/MyGame",
  "playdate-debug.productName": "My Game"
}

See the override configuration example for more information about these properties.

PDC task

See the pdc configuration example for additional pdc task properties.

Playdate Simulator task

See the playdate simulator configuration example for additional playdate-simulator task properties.

Debugger

See the debugger configuration example for additional playdate debugger properties.

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.