WakaTime support request
Check for existing issues
- [X] Completed
Describe the feature
WakaTime is a plugin to static coding time of all IDEs together in a dashboard
I'm not sure whether it's possible to support it in zed?
Or support third party plugins?
If applicable, add mockups / screenshots to help present your vision of the feature
No response
this depends on zed-industries/zed#5269 WakaTime has listed a Zed extension as "not yet available" (at the bottom of this page)
+1 to the request
A minimal extension API was added in https://github.com/zed-industries/zed/issues/5269, but unfortunately it only supports themes and language extensions so it's not yet possible to build an extension like WakaTime. I've opened an issue to request a full extension API similar to other IDEs:
https://github.com/zed-industries/zed/issues/10795
I'm wondering if a wakatime "LSP" could work, it'd send requests to the server that would run the wakatime-cli.
The documentation on creating editor client plugins mentions running the cli:
- on init: corresponds to
initialized - on file focus change:
didOpenTextDocumentseems to match - on file content change:
didChangeTextDocumentseems to match - on file save:
didSaveTextDocument
So yeah it seems doable, and would even allow easily creating editor plugins for wakatime through LSP, I may start working on this if no one already is '^^
Ok I did create https://github.com/ewen-lbh/wakalsp, I'll try to get sth working by the end of the week
Welp, I should've searched before starting a repo lmao, seems like there's already exactly this: https://github.com/mrnossiom/wakatime-lsp
I'm gonna try and test this out @ewen-lbh as soon as I can. Nice find
I started a repo for the zed extension, but i'm waiting on https://github.com/mrnossiom/wakatime-lsp/issues/2
see https://github.com/ewen-lbh/zed-wakatime
Great!
I can't really test this on my setup, the file picker dialog never opens so i can't load a dev extension... imma go to sleep anyways it's past 2am in my tz lmao
I have a working PoC! Install instructions on the readme
I have a working PoC! Install instructions on the readme
I tried your method but it did not work, I was able to install it as a dev extension but coding time is not getting tracked on my dashboard Btw I am using Linux (fedora)
I have a working PoC! Install instructions on the readme
I tried your method but it did not work, I was able to install it as a dev extension but coding time is not getting tracked on my dashboard Btw I am using Linux (fedora)
Ooops ._. Please make an issue on the repo ;)
Hi, I published a plugin for wakatime. Please take a try. #1327
You can install it from extensions page:
And set it by .wakatime.cfg or zed settings:
A minimal extension API was added in zed-industries/zed#5269, but unfortunately it only supports themes and language extensions so it's not yet possible to build an extension like WakaTime. I've opened an issue to request a full extension API similar to other IDEs:
Hi, here is my repo: https://github.com/bestgopher/wakatime-zed
It works find to me:
@ewen-lbh is this (variation of) your code that has been published? I'm on the phone but still see way too many similarities.
@berkus You mean my code is similar with @ewen-lbh 's ? I can responsibly tell you that they have no relation whatsoever. My inspiration came from code-stats. Before I completed this plugin, I was not aware of the existence of this issue.
Okay then, just asking.
Okay then, just asking.
Okay
Also the desktop app can track Zed usage, but not detect project only app usage: https://wakatime.com/desktop
Also the desktop app can track Zed usage, but not detect project only app usage:
Hi, @alanhamlett .I recently recommended my plugin to you via email, but you didn’t reply. I’m not sure if you didn’t receive the email, but I’d still like to hear your thoughts.
Nice work both of you! I would like to merge the two into one repo under the WakaTime GitHub Org then give both of you write permission on the repo. First, we should decide what's best... bundling the LSP like @bestgopher or using the external wakatime-lsp like @ewen-lbh. I haven't fully read the whole source code of each plugin yet, are there any other differences?
First, we should decide what's best... bundling the LSP like @bestgopher or using the external wakatime-lsp like @ewen-lbh
I don't known which is the best, but for me, I could maintain them by myself. In my opinion, lsp is the part of plugin, it's better to bund them in one repo.
Yes bundling is less error-prone because there's no extra network requests. @bestgopher can you use the official instructions for transferring the repo to alanhamlett GitHub username (because orgs can't receive repos) then I'll transfer it to the WakaTime GitHub org, add you and @ewen-lbh as maintainers, and make it an official plugin on the website.
@bestgopher can you use the official instructions for transferring the repo to
alanhamlettGitHub username
Done!
@bestgopher I just noticed your version also downloads the LSP server even though it's bundled in the repo. Is that required? https://github.com/wakatime/zed-wakatime/blob/73ac872be7ebd87df3c409078f1867e1972ce9cb/src/lib.rs#L127
In that case it makes sense to use a shared wakatime-lsp repo like @ewen-lbh does.
Is that required?
The Zed extension consists of some WASM files, responsible for providing the startup commands and other initialization tasks for the language server. Currently, there are no other mechanisms for writing Zed extensions. If Zed's extension system is updated in the future, I will synchronize and update the related features accordingly.
Is that required?
The Zed extension consists of some WASM files, responsible for providing the startup commands and other initialization tasks for the language server. Currently, there are no other mechanisms for writing Zed extensions. If Zed's extension system is updated in the future, I will synchronize and update the related features accordingly.
So let's re-use the LSP instead of re-writing it, same as @ewen-lbh
So let's re-use the LSP instead of re-writing it, same as @ewen-lbh
I don't understand why there is a need to dwell on this. Before developing this plugin, I was not aware of the existence of the wakatime-lsp repository. I briefly looked at its code; its functionality is quite simple and doesn't implement requirements like rate limiting as mentioned in the Wakatime documentation. Furthermore, I don't know if this repository is still being maintained or if it might be deleted in the future. I believe the best solution would be for Wakatime to officially provide a language server. For example, they could develop a wakatime-cli lsp subcommand based on the wakatime-cli tool, which would allow extensions to be developed directly on top of it.
