|
| 1 | +local M = {} |
| 2 | + |
| 3 | +function M.check() |
| 4 | + vim.health.start "System" |
| 5 | + |
| 6 | + local os = require "defold.service.os" |
| 7 | + |
| 8 | + vim.health.info(string.format("OS: %s / %s", os.name(), os.architecture())) |
| 9 | + |
| 10 | + vim.health.start "Sidecar" |
| 11 | + |
| 12 | + local sidecar_ok, sidecar = pcall(require, "defold.sidecar") |
| 13 | + if sidecar_ok then |
| 14 | + vim.health.ok(string.format("Sidecar Loaded Version: %s", sidecar.version)) |
| 15 | + else |
| 16 | + vim.health.error(string.format("Sidecar Not Available: %s", sidecar)) |
| 17 | + end |
| 18 | + |
| 19 | + vim.health.start "Bridge" |
| 20 | + |
| 21 | + local bridge_path_ok, bridge_path = pcall(sidecar.find_bridge_path, require("defold").plugin_root()) |
| 22 | + if bridge_path_ok then |
| 23 | + vim.health.ok(string.format("Bridge Path: %s", bridge_path)) |
| 24 | + else |
| 25 | + vim.health.error(string.format("Bridge Not Found: %s", bridge_path)) |
| 26 | + end |
| 27 | + |
| 28 | + vim.health.start "mobdap" |
| 29 | + |
| 30 | + local debugger = require "defold.service.debugger" |
| 31 | + local mobdap_path = debugger.mobdap_path() |
| 32 | + |
| 33 | + if mobdap_path ~= nil then |
| 34 | + vim.health.ok(string.format("mobdap Path: %s", mobdap_path)) |
| 35 | + else |
| 36 | + vim.health.warn(string.format("mobdap not available: %s, debugger disabled", mobdap_path)) |
| 37 | + end |
| 38 | + |
| 39 | + vim.health.start "Defold" |
| 40 | + |
| 41 | + local project = require "defold.project" |
| 42 | + |
| 43 | + if project.is_defold_project() then |
| 44 | + vim.health.ok "Current project is Defold project" |
| 45 | + |
| 46 | + local project_root = project.project_root(false) |
| 47 | + |
| 48 | + if project_root then |
| 49 | + vim.health.ok(string.format("Project Root: %s", project_root)) |
| 50 | + end |
| 51 | + else |
| 52 | + vim.health.warn "Current project is NOT a Defold project" |
| 53 | + end |
| 54 | + |
| 55 | + local editor_port = project.editor_port() |
| 56 | + |
| 57 | + if editor_port ~= nil then |
| 58 | + vim.health.ok(string.format("Editor Port found at: %d", editor_port)) |
| 59 | + else |
| 60 | + vim.health.warn "Could not find editor port, is the editor running?" |
| 61 | + end |
| 62 | +end |
| 63 | + |
| 64 | +return M |
0 commit comments