diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a3b1024..baecfbb 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -85,7 +85,9 @@ jobs: - name: Package VS Code Extension working-directory: ./extensions/vscode - run: npm run build -- --target ${{ matrix.vscode_target }} -o ../../dist/path-server_vscode_${{ matrix.vscode_target }}_${{ github.ref_name }}.vsix + run: npm run build -- --target ${{ matrix.vscode_target }} -o + ../../dist/path-server_vscode_${{ matrix.vscode_target }}_${{ + github.ref_name }}.vsix - name: Upload Artifacts uses: actions/upload-artifact@v7 @@ -94,7 +96,7 @@ jobs: path: dist/* # Step 3: Create Release on GitHub - release: + release-github: name: Create GitHub Release needs: build runs-on: ubuntu-latest @@ -120,3 +122,24 @@ jobs: prerelease: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # Step 4: Release to crates.io + release-crates-io: + name: Release to crates.io + needs: build + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + + - name: Install toml-cli + run: cargo install toml-cli + - name: Check version + run: test "v$(toml get -r Cargo.toml package.version)" = "${{github.ref_name}}" + - name: Publish to crates.io + run: cargo publish + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 8214e68..4e02173 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to the Path Server will be documented in this file. +## [Unreleased] +Path Server is now published to crates.io! You can now install it via `cargo install path-server`. + +### Added +- Added new step to release workflow to publish to crates.io. + ## [1.1.2] - 2026-04-26 ### Fixed - **Core**: Fixed the missing latency log for hover LSP requests. diff --git a/Cargo.toml b/Cargo.toml index 43c5cf6..db823e6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,9 +3,12 @@ name = "path-server" version = "1.1.2" edition = "2024" description = "A fast and lightweight language server for path completion." -license = "Apache-2.0" repository = "https://github.com/kunlinglio/path-server" +homepage = "https://github.com/kunlinglio/path-server" +keywords = ["lsp", "language-server", "path", "path-completion"] +license = "Apache-2.0" readme = "README.md" +exclude = ["extensions/**", "assets/**", ".github/**", ".vscode/**"] [features] multi-thread = ["tokio/rt-multi-thread"] diff --git a/README.md b/README.md index 16122a4..353125b 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,14 @@ Search for `Path Server` in the Zed extensions catalog and click install. > **Note**: Document Links (path underline highlight) is not yet supported in Zed as it does not implement the LSP Document Link feature. +### Other Editors (Helix, Neovim, etc.) +For other editors that support LSP, Path Server should be compatible as well. You can follow the instructions below to get started: + +1. Install Path Server binary via `cargo install path-server`. +2. Configure your editor to start the Path Server language server with the command `path-server` and set the communication to use STDIN/STDOUT. + +*If there is any issue with the compatibility, please feel free to open an issue or contribute a PR to fix it.* + ## Configuration Path Server support custom configuration via LSP workspace configuration. You can customize Path Server's behavior through your editor. @@ -121,6 +129,7 @@ Run `zed: open settings file` from the command palette to edit user settings jso - [GitHub Repository](https://github.com/kunlinglio/path-server) - [VS Code Extension](https://marketplace.visualstudio.com/items?itemName=LKL.path-server) - [Path Server Icon](https://pictogrammers.com/library/mdi/icon/slash-forward-box/) +- [Crates.io](https://crates.io/crates/path-server) ## TODO - [x] Support relative and absolute path completion. diff --git a/src/lib.rs b/src/lib.rs index d953c60..0d5095e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,9 @@ +//! **Path Server** is an LSP server for path completion. +//! +//! **⚠️ WARNING: Internal API** +//! +//! This crate is primarily designed to be distributed as a standalone binary. And has no intention to maintain as a library dependency for other projects for now. + mod client; mod config; mod document; @@ -8,5 +14,7 @@ mod parser; mod providers; mod resolver; mod server; +#[doc(hidden)] pub use crate::server::PathServer; +#[doc(hidden)] pub use config::{Completion, Config, Highlight}; diff --git a/src/logger.rs b/src/logger.rs index ac333e7..f59487b 100644 --- a/src/logger.rs +++ b/src/logger.rs @@ -9,6 +9,7 @@ pub fn init(client: &tower_lsp_server::Client) { let _ = LSP_CLIENT.set(client.clone()); // ignore multi init error } +#[doc(hidden)] #[macro_export] macro_rules! lsp_debug { ($($arg:tt)*) => { @@ -32,6 +33,7 @@ macro_rules! lsp_debug { }; } +#[doc(hidden)] #[macro_export] macro_rules! lsp_info { ($($arg:tt)*) => { @@ -39,6 +41,7 @@ macro_rules! lsp_info { }; } +#[doc(hidden)] #[macro_export] macro_rules! lsp_warn { ($($arg:tt)*) => { @@ -49,6 +52,7 @@ macro_rules! lsp_warn { }; } +#[doc(hidden)] #[macro_export] macro_rules! lsp_error { ($($arg:tt)*) => { @@ -59,6 +63,7 @@ macro_rules! lsp_error { }; } +#[doc(hidden)] #[macro_export] macro_rules! to_sync { ($log_future:expr) => {