Skip to content

Latest commit

 

History

History
130 lines (84 loc) · 4.62 KB

README.md

File metadata and controls

130 lines (84 loc) · 4.62 KB

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. Package is reachable through packages.${system}.default or packages.${system}.wakatime-ls. 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

Download binary from GitHub releases

Find the latest wakatime-ls release on GitHub here.

You may download the compressed tarball corresponding to your OS.

You will also need wakatime-cli in your $PATH for setups others than Nix, which already bundles it. You can download wakatime-cli:

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 (see docs). ($WAKATIME_HOME defaults to $HOME)

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

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

Usage

Helix

You need to add wakatime-ls to your languages.toml configuration (see docs). Though, it's not currently possible to add global language servers, you can add wakatime for your most significant languages.

Helix does not merge values, you also need to specify the original language servers defined for the language. You can find them in the default languages.toml

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"]

# add as many entries as the number of the languages you use

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.