Kode / Kha

Ultra-portable, high performance, open source multimedia framework.
http://kha.tech
zlib License
1.48k stars 174 forks source link

Reuse ide completion server for faster builds #1391

Closed RblSb closed 2 years ago

RblSb commented 2 years ago

I think we can read vshaxe.displayPort in Kha vscode extension and pass it to khamake binary as some argument. Then, if build/project-target.hxml is not changed and completion target equals compilation target, use incremental compilation instead of basic compilation. As example, using generated hxml task instead of khamake compiles basic Kha project in 0.01s instead of 1.7s for me in html5.

Also some hack to reproduce this if someone interested:

sh-dave commented 2 years ago

Run khamake with the --watch argument?

RblSb commented 2 years ago

Thanks, there is v2 setup, tasks.json:

{
      "type": "shell",
      "command": "node ${command:kha.findKha}/make html5 --watch",
      "isBackground": false,
      "problemMatcher": {
        "pattern": [
          {
            "regexp": ".",
            "file": 1,
            "location": 2,
            "message": 3
          }
        ],
        "background": {
          "activeOnStart": true,
          "beginsPattern": "Haxe compilation...",
          "endsPattern": "Haxe compile end."
        }
      },
      "group": {
                "kind": "build",
                "isDefault": true
            },
      "label": "HTML5-watch"
    },

Lets keep this open and add some watched setups to vscode in future, i think.

RblSb commented 2 years ago
        {
            "name": "HTML5-watch",
            "request": "launch",
            "type": "pwa-node",
            "program": "${command:kha.findKha}/make",
            "args": [
                "html5",
                "--watch",
                "--server",
                "--port",
                "4200",
                "--livereload"
            ],
            "killBehavior": "polite"
        },