Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines +88 to +90
Copy link

Copilot AI May 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The run: value is split across multiple lines without using a block scalar (|/>), which will insert newlines into the command. That will break the -o <output> argument (and also splits the ${{ github.ref_name }} expression), likely causing the packaging step to fail. Keep the command on one line, or use a run: | block with proper line continuations so the output path stays part of the same command string.

Suggested change
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

Copilot uses AI. Check for mistakes.

- name: Upload Artifacts
uses: actions/upload-artifact@v7
Expand All @@ -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
Expand All @@ -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
Copy link

Copilot AI May 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For release reproducibility and to reduce supply-chain risk, consider pinning toml-cli to a specific version (and/or using --locked). Installing the latest toml-cli on every tag means a new upstream release could unexpectedly break this workflow at publish time.

Suggested change
run: cargo install toml-cli
run: cargo install toml-cli --version 0.2.3 --locked

Copilot uses AI. Check for mistakes.
- 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 }}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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/**"]
Copy link

Copilot AI May 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exclude = ["extensions/**", "assets/**", ...] will omit the demo GIFs referenced by README.md (./assets/demo-*.gif). On crates.io this typically results in broken images in the rendered README. Either include the required assets in the published package, or update the README to use absolute URLs (e.g., raw GitHub links) so crates.io rendering remains correct.

Suggested change
exclude = ["extensions/**", "assets/**", ".github/**", ".vscode/**"]
exclude = ["extensions/**", ".github/**", ".vscode/**"]

Copilot uses AI. Check for mistakes.

[features]
multi-thread = ["tokio/rt-multi-thread"]
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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.
Expand Down
8 changes: 8 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -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.
Copy link

Copilot AI May 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The crate-level docs read awkwardly/grammatically incorrect: "This crate is primarily designed to be distributed as a standalone binary. And has no intention to maintain as a library dependency..." Consider rewriting as a single sentence (or otherwise polishing) since this will be shown prominently on docs.rs/crates.io.

Suggested change
//! 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.
//! This crate is primarily intended to be distributed as a standalone binary and is not currently maintained as a library dependency for other projects.

Copilot uses AI. Check for mistakes.

mod client;
mod config;
mod document;
Expand All @@ -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};
5 changes: 5 additions & 0 deletions src/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)*) => {
Expand All @@ -32,13 +33,15 @@ macro_rules! lsp_debug {
};
}

#[doc(hidden)]
#[macro_export]
macro_rules! lsp_info {
($($arg:tt)*) => {
$crate::logger::__info(format!($($arg)*)) // do not print extra information for clarity
};
}

#[doc(hidden)]
#[macro_export]
macro_rules! lsp_warn {
($($arg:tt)*) => {
Expand All @@ -49,6 +52,7 @@ macro_rules! lsp_warn {
};
}

#[doc(hidden)]
#[macro_export]
macro_rules! lsp_error {
($($arg:tt)*) => {
Expand All @@ -59,6 +63,7 @@ macro_rules! lsp_error {
};
}

#[doc(hidden)]
#[macro_export]
macro_rules! to_sync {
($log_future:expr) => {
Expand Down