{"id":13484751,"url":"https://github.com/ebkalderon/tower-lsp","last_synced_at":"2025-05-14T11:10:30.368Z","repository":{"id":37821273,"uuid":"205765900","full_name":"ebkalderon/tower-lsp","owner":"ebkalderon","description":"Language Server Protocol implementation written in Rust","archived":false,"fork":false,"pushed_at":"2024-08-15T02:07:57.000Z","size":652,"stargazers_count":1144,"open_issues_count":39,"forks_count":67,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-14T03:58:02.153Z","etag":null,"topics":["language-server-protocol","lsp","rust","service","tower"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ebkalderon.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-09-02T02:54:56.000Z","updated_at":"2025-04-10T10:25:58.000Z","dependencies_parsed_at":"2024-01-05T05:24:21.519Z","dependency_job_id":"a93439fe-a500-43c8-860e-195e0832bd61","html_url":"https://github.com/ebkalderon/tower-lsp","commit_stats":{"total_commits":527,"total_committers":22,"mean_commits":"23.954545454545453","dds":"0.15939278937381407","last_synced_commit":"e96d8ca822e63218dab8bae8825a7f8a4537fea0"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebkalderon%2Ftower-lsp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebkalderon%2Ftower-lsp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebkalderon%2Ftower-lsp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebkalderon%2Ftower-lsp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ebkalderon","download_url":"https://codeload.github.com/ebkalderon/tower-lsp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254116165,"owners_count":22017540,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["language-server-protocol","lsp","rust","service","tower"],"created_at":"2024-07-31T17:01:32.460Z","updated_at":"2025-05-14T11:10:30.298Z","avatar_url":"https://github.com/ebkalderon.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# tower-lsp\n\n[![Build Status][build-badge]][build-url]\n[![Crates.io][crates-badge]][crates-url]\n[![Documentation][docs-badge]][docs-url]\n\n[build-badge]: https://github.com/ebkalderon/tower-lsp/workflows/rust/badge.svg\n[build-url]: https://github.com/ebkalderon/tower-lsp/actions\n[crates-badge]: https://img.shields.io/crates/v/tower-lsp.svg\n[crates-url]: https://crates.io/crates/tower-lsp\n[docs-badge]: https://docs.rs/tower-lsp/badge.svg\n[docs-url]: https://docs.rs/tower-lsp\n\n[Language Server Protocol] implementation for Rust based on [Tower].\n\n[language server protocol]: https://microsoft.github.io/language-server-protocol\n[tower]: https://github.com/tower-rs/tower\n\nTower is a simple and composable framework for implementing asynchronous\nservices in Rust. Central to Tower is the [`Service`] trait, which provides the\nnecessary abstractions for defining request/response clients and servers.\nExamples of protocols implemented using the `Service` trait include\n[`hyper`] for HTTP and [`tonic`] for gRPC.\n\n[`service`]: https://docs.rs/tower-service/\n[`hyper`]: https://docs.rs/hyper/\n[`tonic`]: https://docs.rs/tonic/\n\nThis library (`tower-lsp`) provides a simple implementation of the Language\nServer Protocol (LSP) that makes it easy to write your own language server. It\nconsists of three parts:\n\n- The `LanguageServer` trait which defines the behavior of your language server.\n- The asynchronous `LspService` delegate which wraps your language server\n  implementation and defines the behavior of the protocol.\n- A `Server` which spawns the `LspService` and processes requests and responses\n  over `stdio` or TCP.\n\n## Example\n\n```rust\nuse tower_lsp::jsonrpc::Result;\nuse tower_lsp::lsp_types::*;\nuse tower_lsp::{Client, LanguageServer, LspService, Server};\n\n#[derive(Debug)]\nstruct Backend {\n    client: Client,\n}\n\n#[tower_lsp::async_trait]\nimpl LanguageServer for Backend {\n    async fn initialize(\u0026self, _: InitializeParams) -\u003e Result\u003cInitializeResult\u003e {\n        Ok(InitializeResult::default())\n    }\n\n    async fn initialized(\u0026self, _: InitializedParams) {\n        self.client\n            .log_message(MessageType::INFO, \"server initialized!\")\n            .await;\n    }\n\n    async fn shutdown(\u0026self) -\u003e Result\u003c()\u003e {\n        Ok(())\n    }\n}\n\n#[tokio::main]\nasync fn main() {\n    let stdin = tokio::io::stdin();\n    let stdout = tokio::io::stdout();\n\n    let (service, socket) = LspService::new(|client| Backend { client });\n    Server::new(stdin, stdout, socket).serve(service).await;\n}\n```\n\n## Using runtimes other than tokio\n\nBy default, `tower-lsp` is configured for use with `tokio`.\n\nUsing `tower-lsp` with other runtimes requires disabling `default-features` and\nenabling the `runtime-agnostic` feature:\n\n```toml\n[dependencies.tower-lsp]\nversion = \"*\"\ndefault-features = false\nfeatures = [\"runtime-agnostic\"]\n```\n\n## Using proposed features\n\nYou can use enable proposed features in the\n[LSP Specification version 3.18](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/)\nby enabling the `proposed` Cargo crate feature. Note that there are no semver\nguarantees to the `proposed` features so there may be breaking changes between\nany type of version in the `proposed` features.\n\n## Ecosystem\n\n- [tower-lsp-boilerplate](https://github.com/IWANABETHATGUY/tower-lsp-boilerplate) - Useful GitHub project template which makes writing new language servers easier.\n\n## License\n\n`tower-lsp` is free and open source software distributed under the terms of\neither the [MIT](LICENSE-MIT) or the [Apache 2.0](LICENSE-APACHE) license, at\nyour option.\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Febkalderon%2Ftower-lsp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Febkalderon%2Ftower-lsp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Febkalderon%2Ftower-lsp/lists"}