{"id":25483070,"url":"https://github.com/cordx56/rustowl","last_synced_at":"2025-05-13T15:13:30.598Z","repository":{"id":261201008,"uuid":"873824041","full_name":"cordx56/rustowl","owner":"cordx56","description":"Visualize Ownership and Lifetimes in Rust","archived":false,"fork":false,"pushed_at":"2025-05-08T11:00:20.000Z","size":3899,"stargazers_count":4417,"open_issues_count":20,"forks_count":96,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-05-08T12:19:20.466Z","etag":null,"topics":["lifetime","ownership","rust","visualization"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cordx56.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"docs/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"docs/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["cordx56"]}},"created_at":"2024-10-16T19:28:48.000Z","updated_at":"2025-05-08T11:00:20.000Z","dependencies_parsed_at":"2024-11-05T09:24:27.455Z","dependency_job_id":"0c1b3986-468c-42b4-bdb9-f29babfee97b","html_url":"https://github.com/cordx56/rustowl","commit_stats":null,"previous_names":["cordx56/rustowl"],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cordx56%2Frustowl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cordx56%2Frustowl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cordx56%2Frustowl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cordx56%2Frustowl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cordx56","download_url":"https://codeload.github.com/cordx56/rustowl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253969267,"owners_count":21992265,"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":["lifetime","ownership","rust","visualization"],"created_at":"2025-02-18T17:01:34.287Z","updated_at":"2025-05-13T15:13:25.584Z","avatar_url":"https://github.com/cordx56.png","language":"Rust","funding_links":["https://github.com/sponsors/cordx56"],"categories":["Rust","Programming","Static Checkers","Development Tooling"],"sub_categories":["Rust 🦀"],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003ch1\u003e\n      \u003cpicture\u003e\n        \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"docs/assets/rustowl-logo-dark.svg\"\u003e\n        \u003cimg alt=\"RustOwl\" src=\"docs/assets/rustowl-logo.svg\" width=\"400\"\u003e\n      \u003c/picture\u003e\n    \u003c/h1\u003e\n    \u003cp\u003e\n        Visualize ownership and lifetimes in Rust for debugging and optimization\n    \u003c/p\u003e\n    \u003cp\u003e\n        \u003cimg src=\"docs/assets/readme-screenshot-3.png\" /\u003e\n    \u003c/p\u003e\n\u003c/div\u003e\n\nRustOwl visualizes ownership movement and lifetimes of variables.\nWhen you save Rust source code, it is analyzed, and the ownership and lifetimes of variables are visualized when you hover over a variable or function call.\n\nRustOwl visualizes those by using underlines:\n\n- 🟩 green: variable's actual lifetime\n- 🟦 blue: immutable borrowing\n- 🟪 purple: mutable borrowing\n- 🟧 orange: value moved / function call\n- 🟥 red: lifetime error\n    - diff of lifetime between actual and expected, or\n    - invalid overlapped lifetime of mutable and shared (immutable) references\n\nDetailed usage is described [here](docs/usage.md).\n\nCurrently, we offer VSCode extension, Neovim plugin and Emacs package.\nFor these editors, move the text cursor over the variable or function call you want to inspect and wait for 2 seconds to visualize the information.\nWe implemented LSP server with an extended protocol.\nSo, RustOwl can be used easily from other editor.\n\n## Support\n\nIf you're looking for support, please consider checking all issues, existing discussions, and [starting a discussion](https://github.com/cordx56/rustowl/discussions/new?category=q-a) first!\n\n## Quick Start\n\nHere we describe how to start using RustOwl with VS Code.\n\n### Prerequisite\n\n- `cargo` installed\n    - You can install `cargo` using `rustup` from [this link](https://rustup.rs/).\n- Visual Studio Code (VS Code) installed\n\nWe tested this guide on macOS Sequoia 15.3.2 on arm64 architecture with VS Code 1.99.3 and `cargo` 1.86.0.\n\n### VS Code\n\nYou can install VS Code extension from [this link](https://marketplace.visualstudio.com/items?itemName=cordx56.rustowl-vscode).\nRustOwl will install automatically when the extension is activated.\n\nAfter installation, the extension will automatically run RustOwl when you save any Rust program in cargo workspace.\nThe initial analysis may take some time, but from the second run onward, compile caching is used to reduce the analysis time.\n\n## Other editor support\n\nWe support Neovim and Emacs.\nYou can also create your own LSP client.\nIf you would like to implement a client, please refer to the [The RustOwl LSP specification](docs/lsp-spec.md).\n\n### Neovim\n\nMinimal setup with [lazy.nvim](https://github.com/folke/lazy.nvim):\n\n```lua\n{\n  'cordx56/rustowl',\n  version = '*', -- Latest stable version\n  build = 'cd rustowl \u0026\u0026 cargo install --path . --locked',\n  lazy = false, -- This plugin is already lazy\n  opts = {},\n}\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eRecommended configuration: \u003cb\u003eClick to expand\u003c/b\u003e\u003c/summary\u003e\n\n```lua\n{\n  'cordx56/rustowl',\n  version = '*', -- Latest stable version\n  build = 'cd rustowl \u0026\u0026 cargo install --path . --locked',\n  lazy = false, -- This plugin is already lazy\n  opts = {\n    client = {\n      on_attach = function(_, buffer)\n        vim.keymap.set('n', '\u003cleader\u003eo', function()\n          require('rustowl').toggle(buffer)\n        end, { buffer = buffer, desc = 'Toggle RustOwl' })\n      end\n    },\n  },\n}\n```\n\n\u003c/details\u003e\n\nDefault options:\n\n```lua\n{\n  auto_attach = true, -- Auto attach the RustOwl LSP client when opening a Rust file\n  auto_enable = false, -- Enable RustOwl immediately when attaching the LSP client\n  idle_time = 500, -- Time in milliseconds to hover with the cursor before triggering RustOwl\n  client = {}, -- LSP client configuration that gets passed to `vim.lsp.start`\n}\n```\n\nWhen opening a Rust file, the Neovim plugin creates the `Rustowl` user command:\n\n```vim\n:Rustowl {subcommand}\n```\n\nwhere `{subcommand}` can be one of:\n\n- `start_client`: Start the rustowl LSP client.\n- `stop_client`: Stop the rustowl LSP client.\n- `restart_client`: Restart the rustowl LSP client.\n- `enable`: Enable rustowl highlights.\n- `disable`: Disable rustowl highlights.\n- `toggle`: Toggle rustowl highlights.\n\n\n### Emacs\n\nElpaca example:\n\n```elisp\n(elpaca\n  (rustowlsp\n    :host github\n    :repo \"cordx56/rustowl\"\n    :files (:defaults \"emacs/*\")))\n```\n\nYou have to install RustOwl LSP server manually.\n\n### RustRover / IntelliJ IDEs\n\nThere is a [third-party repository](https://github.com/siketyan/intellij-rustowl) that supports IntelliJ IDEs.\nYou have to install RustOwl LSP server manually.\n\n## Architecture / OS / package repositories\n\n### Nix flake\n\nThere is a [third-party Nix flake repository](https://github.com/nix-community/rustowl-flake) in the Nix community.\n\n## Build manually\n\nHere, we describe manual install instructions from source code.\n\n### RustOwl\n\n#### Prerequisite\n\n- `rustup` installed\n    - You can install `rustup` from [this link](https://rustup.rs/).\n    - You need to set up the `PATH` environment variable. To do this, follow the instructions provided by the `rustup` installer.\n\nRustOwl has been tested on macOS Sequoia 15.3.2 on arm64 architecture with `rustup` 1.28.1.\nWe have not tested the installation of dependencies from other package repositories, such as Homebrew.\nYou may need to uninstall any Rust-related packages installed through those repositories first.\nOther dependencies are locked in the configuration files and will be installed automatically.\n\nWe have also tested this on Ubuntu 24.04.2 on amd64 architecture and on Windows 11 Education 23H2 on amd64 architecture.\nAdditional dependencies may be required.\nWe have confirmed that running `apt install build-essential` is necessary on a freshly installed Ubuntu for linking.\n\n#### Build \u0026 Run\n\n```bash\ncd rustowl\ncargo install --path . --locked\n```\n\n\n### VSCode extension\n\n#### Prerequisite\n\n- VS Code installed\n    - You can install VS Code from [this link](https://code.visualstudio.com/).\n- Node.js installed\n- `yarn` installed\n    - After installing Node.js, You can install `yarn` by running `npm install -g yarn`.\n\nVS Code extension has been tested on macOS Sequoia 15.3.2 on arm64 architecture with Visual Studio Code 1.99.3, Node.js v20.16.0, and `yarn` 1.22.22.\nOther dependencies are locked in the configuration files and will be installed automatically.\n\n#### Build \u0026 Run\n\nFirst, install the dependencies.\n\n```bash\ncd vscode\nyarn install --frozen-lockfile\n```\n\nThen open `vscode` directory in VS Code.\n\nA notification to install the recommended VS Code extension will appear in the bottom right corner of VS Code.\nClick the install button, wait for the installation to finish, and then restart VS Code.\n\nOpen `vscode` directory again, and press the `F5` key in the VS Code window.\nA new VS Code window with the extension enabled will appear.\n\nOpen cargo workspace directory in the new VS Code window.\n\nWhen you save Rust files, decoration indicating the movement of ownership and lifetimes will appear in the editor.\n\n\n## Note\n\nIn this tool, due to the limitations of VS Code's decoration specifications, characters with descenders, such as g or parentheses, may occasionally not display underlines properly.\nAdditionally, we observed that the `println!` macro sometimes produces extra output, though this does not affect usability in any significant way.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcordx56%2Frustowl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcordx56%2Frustowl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcordx56%2Frustowl/lists"}