Tatsh / kate-wakatime

Kate plugin to interface with WakaTime
https://tatsh.github.io/kate-wakatime/
11 stars 9 forks source link

Complete path to edited source code file should not be sent to wakatime #31

Open wizzardx opened 5 months ago

wizzardx commented 5 months ago

If I have a project over here:

/tmp/x/y/z/my_project

And within there, I edit test.py.

Then over in the Wakatime dashboard, it shows correctly that I spent time in the "my_project" project. However, time is logged over under this file within that project:

/tmp/x/y/z/my_project/test.py

But rather it should be relative to the project root directory (the one with .git in it), so in this case, just test.py

That would make things more consistent with other IDE integrations into Wakatime.

PS: It looks like there is a wakatime config file option for only sending relative paths, documented over here:

https://wakatime.com/faq#relative-paths

I've tried using that setting, but it looks like it has no effect in this plugin.

(to be more precise - it looks like what's immediately visible in the dashboard is a relative path, but if you mouse over the path, you see the complete path to the file that was edited).

alanhamlett commented 5 months ago

It's because this plugin sends heartbeats directly to the API without using wakatime-cli. We should instead send the current file to wakatime-cli to fix this bug.