Skip to content

Commit

Permalink
chore: change name to wakatime-ls
Browse files Browse the repository at this point in the history
we're not doing a protocol here :)
  • Loading branch information
mrnossiom committed Nov 21, 2024
1 parent 552fbbc commit a48427b
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 29 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "wakatime-lsp"
name = "wakatime-ls"
version = "0.1.1"
edition = "2021"

description = "A dead-simple LSP around wakatime-cli to send code tracking heartbeats"
repository = "https://github.com/mrnossiom/wakatime-lsp"
keywords = ["lsp", "wakatime"]
description = "A dead-simple language server around wakatime-cli to send code tracking heartbeats"
repository = "https://github.com/mrnossiom/wakatime-ls"
keywords = ["wakatime", "language-server", "lsp"]
categories = ["development-tools"]
license = "CECILL-2.1"

Expand Down
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# Wakatime LSP
# Wakatime language server

<p align="center"><strong>
A dead-simple LSP around <code>wakatime-cli</code> to send code tracking heartbeats
A dead-simple language server around <code>wakatime-cli</code> to send code tracking heartbeats
</strong></p>

<p align="center">
<img alt="Nix Powered" src="https://img.shields.io/badge/Nix-Powered-blue?logo=nixos" />
<a href="https://mrnossiom.cachix.org">
<img alt="Cachix Cache" src="https://img.shields.io/badge/cachix-mrnossiom-blue.svg" />
</a>
<a href="https://wakatime.com/badge/github/mrnossiom/wakatime-lsp">
<img alt="Time spent on wakatime-lsp" src="https://wakatime.com/badge/github/mrnossiom/wakatime-lsp.svg" />
<a href="https://wakatime.com/badge/github/mrnossiom/wakatime-ls">
<img alt="Time spent on wakatime-ls" src="https://wakatime.com/badge/github/mrnossiom/wakatime-ls.svg" />
</a>
<a href="https://discord.gg/GrbpRNza5j">
<img alt="Join support Discord" src="https://img.shields.io/badge/Support-Join-3178C6?style=social&logo=Discord" />
</a>
</p>

I made this LSP wrapper implementation around `wakatime-cli` because I wanted support for WakaTime in [Helix](https://github.com/helix-editor/helix). That said, it's should be compatible with every LSP implementations.
I made this language server wrapper implementation around `wakatime-cli` because I wanted support for WakaTime in [Helix](https://github.com/helix-editor/helix). That said, it's should be compatible with every LSP implementations.

## Installation

Expand All @@ -27,7 +27,7 @@ I made this LSP wrapper implementation around `wakatime-cli` because I wanted su
Install from repository with cargo:

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

I don't plan on publishing pre-v1 versions on `crates.io`.
Expand All @@ -37,35 +37,35 @@ I don't plan on publishing pre-v1 versions on `crates.io`.
<details>
<summary>With <code>nix</code> flakes</summary><br />

A `flake.nix` is available which means that you can use `github:mrnossiom/wakatime-lsp` as a flake identifier. That way you can:
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

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

Add the package to your [NixOS](https://nixos.org/) or [Home Manager](https://github.com/nix-community/home-manager) packages depending on your installation.

- use with `nix shell` for temporary testing

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

- use with `nix profile` for imperative installation

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

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

</details>

<details>
<summary>Download binary from GitHub releases</summary><br />

Find the latest `wakatime-lsp` release on GitHub [here](https://github.com/mrnossiom/wakatime-lsp/releases).
Find the latest `wakatime-ls` release on GitHub [here](https://github.com/mrnossiom/wakatime-ls/releases).

You may download the compressed tarball corresponding to your OS.

Expand All @@ -78,7 +78,7 @@ For non-nixOS setups, you will also need `wakatime-cli` in path which you can do

## Configuration

Currently `wakatime-lsp` is not configurable cause it's more of a simple `wakatime-cli` wrapper which itself is configurable with [`$WAKATIME_HOME/.wakatime.cfg`](https://github.com/wakatime/wakatime-cli/blob/develop/USAGE.md#ini-config-file).
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`](https://github.com/wakatime/wakatime-cli/blob/develop/USAGE.md#ini-config-file).

Required configuration is to set your [WakaTime api key](https://wakatime.com/settings/api-key) in `$WAKATIME_HOME/.wakatime.cfg`, like so:

Expand All @@ -93,13 +93,13 @@ It might be already filled if you've used another wakatime plugin in the past.

### Helix

You can add `wakatime-lsp` to your `languages.toml` configuration. Though, it's currently possible to add global LSPs, you can add `wakatime` for significant languages. Adding global LSPs is blocking on [Helix's new config system](https://github.com/helix-editor/helix/pull/9318).
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](https://github.com/helix-editor/helix/pull/9318).

e.g.

```toml
[language-server.wakatime]
command = "wakatime-lsp"
command = "wakatime-ls"

[[language]]
name = "markdown"
Expand Down
8 changes: 4 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
formatter = forAllPkgs (pkgs: pkgs.nixpkgs-fmt);

packages = forAllPkgs (pkgs: rec {
default = wakatime-lsp;
wakatime-lsp = pkgs.callPackage ./package.nix { inherit gitignore; };
default = wakatime-ls;
wakatime-ls = pkgs.callPackage ./package.nix { inherit gitignore; };
});
apps = forAllSystems (system: rec {
default = wakatime-lsp;
wakatime-lsp = mkApp (pkgs.getExe self.packages.${system}.app);
default = wakatime-ls;
wakatime-ls = mkApp (pkgs.getExe self.packages.${system}.app);
});

devShells = forAllPkgs (pkgs:
Expand Down
4 changes: 2 additions & 2 deletions package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ rustPlatform.buildRustPackage {
buildInputs = [ ];

postFixup = ''
wrapProgram $out/bin/wakatime-lsp \
wrapProgram $out/bin/wakatime-ls \
--suffix PATH : ${makeBinPath [ wakatime ]}
'';

meta = {
inherit (cargoTOML.package) description homepage license;
maintainers = [ "mrnossiom" ];
mainProgram = "wakatime-lsp";
mainProgram = "wakatime-ls";
};
}
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Wakatime LSP
//! Wakatime LS
// TODO: check options for additional ideas <https://github.com/wakatime/wakatime-cli/blob/develop/USAGE.md#ini-config-file>

Expand Down Expand Up @@ -39,7 +39,7 @@ struct Backend {
/// Interface for sending LSP notifications to the client
client: Client,

/// Editor and LSP user agent for `wakatime-cli`
/// Editor and LS user agent for `wakatime-cli`
user_agent: RwLock<String>,
}

Expand Down Expand Up @@ -228,7 +228,7 @@ fn tracing_panic_hook(panic_info: &PanicInfo) {
async fn main() {
panic::set_hook(Box::new(tracing_panic_hook));

let file_appender = tracing_appender::rolling::never("/tmp", "wakatime-lsp.log");
let file_appender = tracing_appender::rolling::never("/tmp", "wakatime-ls.log");
let (non_blocking, _guard) = tracing_appender::non_blocking(file_appender);
tracing_subscriber::fmt()
.with_writer(non_blocking)
Expand Down

0 comments on commit a48427b

Please sign in to comment.