wakatime / vscode-wakatime

Visual Studio Code plugin for automatic time tracking and metrics generated from your programming activity.
https://wakatime.com/vs-code
BSD 3-Clause "New" or "Revised" License
1.21k stars 134 forks source link

Reports all time as "building" when running `npm start` #305

Closed Maxim-Mazurok closed 1 year ago

Maxim-Mazurok commented 1 year ago

I have a typical use-case for npm start - it runs vue-cli-service serve which automatically rebuilds the project and serves it. This is an infinitely-running task. So it reports all the time as "building", which isn't correct. I write code, it re-compiles, I check the result, and go back to code. I do realize that this plugin probably has no way of knowing if I'm waiting for build to finish or just running the server script. Probably the easiest thing to do would be to check if the code editor is active and/or if the terminal is shown/hidden. However, these are pretty weak indicators... The best solution would be to somehow integrate with vue-cli-service... For now, as a workaround, I'll probably resort to running npm start manually in the terminal instead of using npm scripts feature of VS Code.

GlutenBoy commented 1 year ago

I have the same problem running my API (dotnet run --watch) and running vite continually in VS Code terminals. Wakatime reports 99% of building time instead of coding. Maybe there's a work around, but I didn't find anything useful in the documentation.

Jaeiya commented 1 year ago

I have the same problem. I use the built-in build task for watching my typescript file changes and waka time reports basically an infinite build time if I leave my vscode running in the background. Makes this extension worthless to me.

Uninstalling until this issue is addressed. I'm actually surprised more people aren't reporting this. I would imagine that a large amount of projects use some kind of automated build/transpiling task.

alanhamlett commented 1 year ago

Would a config in your ~/.wakatime.cfg file to disable tracking builds fix it for you?

alanhamlett commented 1 year ago

Possibly fixed with 02a4eaa7ca3e4c3b6f42f400445ea513d1635b96. I'll comment here after the next plugin release when it's ready to test.

alanhamlett commented 1 year ago

Released with v24.0.0.