Skip to content

A dead-simple language server around wakatime-cli to send code tracking heartbeats

License

Notifications You must be signed in to change notification settings

mrnossiom/wakatime-ls

Repository files navigation

Wakatime language server

A dead-simple language server around wakatime-cli to send code tracking heartbeats

Nix Powered Cachix Cache Time spent on wakatime-ls Join support Discord

I made this language server wrapper implementation around wakatime-cli because I wanted support for WakaTime in Helix. That said, it's should be compatible with every LSP implementations.

Installation

With cargo

Install from repository with cargo:

cargo install --git https://github.com/mrnossiom/wakatime-ls

I don't plan on publishing pre-v1 versions on crates.io.

With nix flakes

A flake.nix is available which means that you can use github:mrnossiom/wakatime-ls as a flake identifier. That way you can:

  • import this repository in your flake inputs

    {
      wakatime-ls.url = "github:mrnossiom/wakatime-ls";
      wakatime-ls.inputs.nixpkgs.follows = "nixpkgs";
    }

    Add the package to your NixOS or Home Manager packages depending on your installation.

  • use with nix shell for temporary testing

    e.g. nix shell github:mrnossiom/wakatime-ls

  • use with nix profile for imperative installation

    e.g. nix profile install github:mrnossiom/wakatime-ls

Package is reachable through packages.${system}.default or packages.${system}.wakatime-ls.

Download binary from GitHub releases

Find the latest wakatime-ls release on GitHub here.

You may download the compressed tarball corresponding to your OS.

For non-nixOS setups, you will also need wakatime-cli in path which you can download:

Configuration

Currently wakatime-ls is not configurable cause it's more of a simple wakatime-cli wrapper which itself is configurable with $WAKATIME_HOME/.wakatime.cfg.

Required configuration is to set your WakaTime api key in $WAKATIME_HOME/.wakatime.cfg, like so:

[settings]
api_key=waka_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

It might be already filled if you've used another wakatime plugin in the past.

Usage

Helix

You can add wakatime-ls to your languages.toml configuration. Though, it's currently possible to add global language servers, you can add wakatime for significant languages. Adding global language servers is blocking on Helix's new config system.

e.g.

[language-server.wakatime]
command = "wakatime-ls"

[[language]]
name = "markdown"
language-servers = ["marksman", "wakatime"]

[[language]]
name = "rust"
language-servers = ["rust-analyzer", "wakatime"]

[[language]]
name = "nix"
language-servers = ["nil", "wakatime"]

Work is licensed under CECILL-2.1, a French OSS license that allows modification and distribution of the software while requiring the same license for derived works.

About

A dead-simple language server around wakatime-cli to send code tracking heartbeats

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published