extensions icon indicating copy to clipboard operation
extensions copied to clipboard

WakaTime support request

Open dupeiran001 opened this issue 2 years ago • 37 comments

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

dupeiran001 avatar May 19 '23 06:05 dupeiran001

this depends on zed-industries/zed#5269 WakaTime has listed a Zed extension as "not yet available" (at the bottom of this page)

PineappleRind avatar May 19 '23 13:05 PineappleRind

+1 to the request

clarkezone avatar Feb 22 '24 01:02 clarkezone

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

alanhamlett avatar Apr 20 '24 06:04 alanhamlett

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:

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 '^^

gwennlbh avatar Jul 08 '24 23:07 gwennlbh

Ok I did create https://github.com/ewen-lbh/wakalsp, I'll try to get sth working by the end of the week

gwennlbh avatar Jul 08 '24 23:07 gwennlbh

Welp, I should've searched before starting a repo lmao, seems like there's already exactly this: https://github.com/mrnossiom/wakatime-lsp

gwennlbh avatar Jul 08 '24 23:07 gwennlbh

I'm gonna try and test this out @ewen-lbh as soon as I can. Nice find

guilhermeabel avatar Jul 08 '24 23:07 guilhermeabel

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

gwennlbh avatar Jul 09 '24 00:07 gwennlbh

Great!

guilhermeabel avatar Jul 09 '24 00:07 guilhermeabel

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

gwennlbh avatar Jul 09 '24 00:07 gwennlbh

image

I have a working PoC! Install instructions on the readme

gwennlbh avatar Jul 09 '24 08:07 gwennlbh

image

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)

volfiros avatar Jul 14 '24 18:07 volfiros

image

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 ;)

gwennlbh avatar Jul 14 '24 19:07 gwennlbh

Hi, I published a plugin for wakatime. Please take a try. #1327 You can install it from extensions page: image And set it by .wakatime.cfg or zed settings:

bestgopher avatar Sep 03 '24 00:09 bestgopher

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:

zed-industries/zed#10795

Hi, here is my repo: https://github.com/bestgopher/wakatime-zed It works find to me: image

bestgopher avatar Sep 03 '24 00:09 bestgopher

@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 avatar Sep 18 '24 08:09 berkus

@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.

bestgopher avatar Sep 18 '24 08:09 bestgopher

Okay then, just asking.

berkus avatar Sep 18 '24 08:09 berkus

Okay then, just asking.

Okay

bestgopher avatar Sep 18 '24 09:09 bestgopher

Also the desktop app can track Zed usage, but not detect project only app usage: https://wakatime.com/desktop

alanhamlett avatar Sep 18 '24 10:09 alanhamlett

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.

bestgopher avatar Sep 18 '24 10:09 bestgopher

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?

alanhamlett avatar Sep 18 '24 19:09 alanhamlett

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.

bestgopher avatar Sep 19 '24 01:09 bestgopher

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.

alanhamlett avatar Sep 19 '24 05:09 alanhamlett

@bestgopher can you use the official instructions for transferring the repo to alanhamlett GitHub username

Done!

bestgopher avatar Sep 19 '24 06:09 bestgopher

@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.

alanhamlett avatar Sep 19 '24 06:09 alanhamlett

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.

bestgopher avatar Sep 19 '24 07:09 bestgopher

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.

bestgopher avatar Sep 19 '24 07:09 bestgopher

So let's re-use the LSP instead of re-writing it, same as @ewen-lbh

alanhamlett avatar Sep 19 '24 09:09 alanhamlett

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.

bestgopher avatar Sep 19 '24 09:09 bestgopher