ci: add windows and macos test matrix#128
Merged
coder3101 merged 4 commits intoMay 16, 2026
Merged
Conversation
cd39b5f to
09a5a05
Compare
0124fda to
1eb9710
Compare
f9f5dc0 to
4233c94
Compare
Contributor
Author
Cross-Platform FixesThe extended CI uncovered a Windows-specific panic and several test regressions:
|
Owner
|
I’ll be taking a look at all these PRs over the weekend! Thanks for your contribution. |
- Use `floor_char_boundary` in `offset_to_position` to safely handle offsets inside multi-byte UTF-8 sequences. - Replace hardcoded byte offset with dynamic search in tests to account for potential line ending shifts. - Add `.gitattributes` to enforce LF line endings across all platforms. - Fixes CI panics on windows-latest runners.
- Use `Url::from_file_path` and `Url::from_directory_path` to ensure consistent URI formatting (slashes and drive letters) on Windows. - Replace manual path string concatenation with OS-native URI generation.
4233c94 to
880f300
Compare
coder3101
approved these changes
May 16, 2026
coder3101
added a commit
that referenced
this pull request
May 16, 2026
closes #126 ### Summary This PR implements a flexible transport layer for `protols`, significantly improving debugging capabilities and performance. ### Key Changes - **Multi-transport Support**: Fully implemented TCP (port/socket) and Pipe (Unix Domain Sockets / Named Pipes) transports in accordance with the [LSP specification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#implementationConsiderations). - **CLI Refactoring**: moved from `main.rs` to a separate file. - **Improved Performance**: Native async I/O support for socket/pipe transports. - Safety check for Unix sockets to prevent accidental overwriting of regular files. - **Debugging & DX**: - Added a dedicated TCP mode for easier debugging in Dev Containers. - Included VS Code `launch.json` and task configurations for a seamless debug workflow. - Added a `docs/debugging.md` guide. - **Testing**: Added unit tests for CLI parsing and cross-platform path normalization. - **Project Metadata**: Updated `Cargo.toml` description for better clarity. As i see from <https://github.com/coder3101/tree-sitter-proto>, the LSP supports `proto2`, `proto3`, and `editions`, rather than just `proto3`. The updated CLI `--help` output: <img width="1441" height="329" alt="image" src="https://github.com/user-attachments/assets/2dfe0a94-3d0f-48d0-8d71-00e21b41a658" /> ### Notes⚠️ I was unable to check the build on Windows. I'd suggest merging it after #128 to be confident about Windows-specific code. Support for [`--clientProcessId`](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#implementationConsiderations) is intentionally omitted from this PR: > To support the case that the editor starting a server crashes an editor should also pass its process id to the server. This allows the server to monitor the editor process and to shutdown itself if the editor process dies. The process id passed on the command line should be the same as the one passed in the initialize parameters. The command line argument to use is `--clientProcessId`. I'd proposed making it in a separate follow-up to keep the focus on the transport layer infrastructure. --------- Signed-off-by: Ashar <ashar786khan@gmail.com> Co-authored-by: Ashar <coder3101@users.noreply.github.com> Co-authored-by: Ashar <ashar786khan@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Resolves #115. This PR introduces a cross-platform testing matrix to ensure
protolsbuilds and runs correctly on Windows and macOS (both Intel and Apple Silicon), alongside the existing Linux Dev Container tests.Changes
test-cross-platformjob to.github/workflows/ci.yml.x86_64-pc-windows-msvc(Ensures binary links correctly on Windows).x86_64-apple-darwinandaarch64-apple-darwin.aarch64-unknown-linux-gnucompilation check.cargo buildon all targets to verify compilation and linking (critical for C-bindings like tree-sitter).cargo testexecution: Tests run on native architectures and macOS (via Rosetta 2), but are skipped for Linux ARM on x86 runners to prevent execution errors.Swatinem/rust-cachekeyed by target architecture to optimize build times across the matrix.Technical Notes
dtolnay/rust-toolchain@stable. While the project has arust-toolchain.toml, this action ensures the correct native targets are added for cross-compilation during the setup phase..exeand macOS binaries are properly generated, satisfying the requirement for build verification beyond just test harnesses.