-
Notifications
You must be signed in to change notification settings - Fork 485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WakaTime support request #497
Comments
this depends on zed-industries/zed#5269 |
This comment was marked as spam.
This comment was marked as spam.
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: |
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 '^^ |
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 mrnossiom/wakatime-ls#2 |
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 |
Hi, I published a plugin for wakatime. Please take a try. #1327 |
Hi, here is my repo: https://github.com/bestgopher/wakatime-zed |
@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 |
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? |
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 |
Done! |
@bestgopher I just noticed your version also downloads the LSP server even though it's bundled in the repo. Is that required? In that case it makes sense to use a shared wakatime-lsp repo like @ewen-lbh does. |
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. |
1 similar comment
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 |
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. |
Yes an official wakatime-cli-lsp is the best solution, but in general code reuse means all users get benefits of bugs or improvements instead of having to copy those changes into multiple LSP repos. |
Hi all! First of all, thanks @alanhamlett for the invitation! I'm honored to be named maintainer on a wakatime repo ^^ Then, to clarify things, I don't mind at all the fact that someone else made another repo that does the same thing as mine. I mean this is bound to happen at some point (and I actually did the same before discovering @mrnossiom's wakatime-lsp). I also was pretty busy with other projects and didn't have the time to ask Wakatime for an official repo transfer as the project was not completely finished (it was more of a PoC) I also think that distributing a common wakatime-lsp would be nice, It'd lower the barrier to entry significantly for wakatime plugin creation, as LSP is really becoming a popular standard that most code editors support nowadays. (I'd even go as far as to say that most wakatime plugins should be rewritten to use a common lsp base, that would be bundled with the cli as @bestgopher mentions, but that's a lot of work for no end-user impact haha) There's still an issue with (ab)using the LSP standard: since it's made for language support, client extensions often declare a fixed list of languages that should activate the language server. This results in a maintenance burden on client extension implementors for wakatime: they have to maintain a list of all programming languages the editor supports, and as new ones inevitably get added, wakatime is bound to break and not report code stats for a less popular language. This is more of a Zed issue though. Also @mrnossiom has mentionned buidling wakatime-lsp for Helix initially, maybe the IDE could also receive a repo on the wakatime org? (idk where the plugin is in term of stability) I've gone ahead and announced this on my own repo, see gwennlbh/zed-wakatime#10. Will archive it sometime around next week |
For visibility, I've reached out to @mrnossiom about that in this comment |
Hi Alan, Ewen and I'd be glad to transfer the repository to the About abusing the LSP standard, I really think the LSP specification has grown enough to become more of a code editor plugin standard. I think IDEs would be kin to enable global LSPs (here's Helix tracking issue helix-editor/helix#9318). For extensions in general (and Zed's specifically), using To answer Last, about mrnossiom/wakatime-ls#5, after having a friend installing the Zed plugin, I understand that the experience is unclear. I intend to finish Ewen's automatic Tell me Alan when do you want to proceed to transfer the repository Hope I've answered everyone questions 😄 |
I think that bundling the lsp part as a subcommand of wakatime-cli would be better, it means less binaries to download and therefore much less work Now obviously wakatime-cli is in Go, so we wouldn't be able to reuse all that Rust code but I still think it's worth it, and making LSPs in Go is pretty feasible |
If Alan prefers to bundle the LSP in the official CLI, it's an option too. The LSP implementation is far from long. I don't know if the added binary weight is visible. |
Check for existing issues
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
The text was updated successfully, but these errors were encountered: