├── .chglog
├── CHANGELOG.tpl.md
└── config.yml
├── .github
├── FUNDING.yml
├── ISSUE_TEMPLATE
│ ├── bug_report.yml
│ ├── config.yml
│ └── feature_request.yml
├── PULL_REQUEST_TEMPLATE.md
├── dependabot.yml
└── workflows
│ ├── build.yaml
│ ├── changelog.yml
│ ├── check.yaml
│ └── release.yaml
├── .gitignore
├── .luacheckrc
├── .stylua.toml
├── CHANGELOG.md
├── Cargo.lock
├── Cargo.toml
├── LICENSE
├── README.md
├── aur
├── PKGBUILD
└── PKGBUILD-GIT
├── build.rs
├── docs
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── SECURITY.md
├── assets
│ ├── readme-screenshot-2.png
│ ├── readme-screenshot-3.png
│ ├── readme-screenshot.png
│ ├── rustowl-logo-dark.svg
│ ├── rustowl-logo.svg
│ ├── vs-code-cursor-on-unwrap-visualized.png
│ ├── vs-code-cursor-on-unwrap.png
│ └── vs-code-progress.png
├── installation.md
├── lsp-spec.md
└── usage.md
├── ftplugin
└── rust.lua
├── lua
└── rustowl
│ ├── config.lua
│ ├── highlight.lua
│ ├── init.lua
│ ├── lsp.lua
│ └── show-on-hover.lua
├── rust-toolchain.toml
├── rustowl.el
├── scripts
└── bump.sh
├── src
├── bin
│ ├── core
│ │ ├── analyze.rs
│ │ └── mod.rs
│ ├── rustowl.rs
│ └── rustowlc.rs
├── cli.rs
├── lib.rs
├── lsp.rs
├── lsp
│ ├── backend.rs
│ ├── decoration.rs
│ └── progress.rs
├── models.rs
├── shells.rs
├── toolchain.rs
└── utils.rs
└── vscode
├── .gitignore
├── .vscode
├── extensions.json
├── launch.json
├── settings.json
└── tasks.json
├── .vscodeignore
├── .yarnrc
├── LICENSE
├── README.md
├── esbuild.js
├── eslint.config.mjs
├── package.json
├── rustowl-icon.png
├── src
├── bootstrap.ts
├── extension.ts
└── schemas.ts
├── tsconfig.json
└── yarn.lock
/.chglog/CHANGELOG.tpl.md:
--------------------------------------------------------------------------------
1 | {{ if .Versions -}}
2 |
3 | ## [Unreleased]
4 |
5 | {{ if .Unreleased.CommitGroups -}}
6 | {{ range .Unreleased.CommitGroups -}}
7 | ### {{ .Title }}
8 | {{ range .Commits -}}
9 | - {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
10 | {{ end }}
11 | {{ end -}}
12 | {{ end -}}
13 | {{ end -}}
14 |
15 | {{ range .Versions }}
16 |
17 | ## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }}
18 | {{ range .CommitGroups -}}
19 | ### {{ .Title }}
20 | {{ range .Commits -}}
21 | - {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
22 | {{ end }}
23 | {{ end -}}
24 |
25 | {{- if .RevertCommits -}}
26 | ### Reverts
27 | {{ range .RevertCommits -}}
28 | - {{ .Revert.Header }}
29 | {{ end }}
30 | {{ end -}}
31 |
32 | {{- if .MergeCommits -}}
33 | ### Pull Requests
34 | {{ range .MergeCommits -}}
35 | - {{ .Header }}
36 | {{ end }}
37 | {{ end -}}
38 |
39 | {{- if .NoteGroups -}}
40 | {{ range .NoteGroups -}}
41 | ### {{ .Title }}
42 | {{ range .Notes }}
43 | {{ .Body }}
44 | {{ end }}
45 | {{ end -}}
46 | {{ end -}}
47 | {{ end -}}
48 |
49 | {{- if .Versions }}
50 | [Unreleased]: {{ .Info.RepositoryURL }}/compare/{{ $latest := index .Versions 0 }}{{ $latest.Tag.Name }}...HEAD
51 | {{ range .Versions -}}
52 | {{ if .Tag.Previous -}}
53 | [{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}
54 | {{ end -}}
55 | {{ end -}}
56 | {{ end -}}
57 |
--------------------------------------------------------------------------------
/.chglog/config.yml:
--------------------------------------------------------------------------------
1 | style: github
2 | template: CHANGELOG.tpl.md
3 | info:
4 | title: CHANGELOG
5 | repository_url: https://github.com/cordx56/rustowl
6 | options:
7 | commits:
8 | filters:
9 | Type:
10 | - feat
11 | - fix
12 | - perf
13 | - refactor
14 | - chore
15 | commit_groups:
16 | title_maps:
17 | feat: 🚀 Features
18 | fix: 🐞 Bug Fixes
19 | perf: ⚡ Performance Improvements
20 | refactor: ♻️ Code Refactoring
21 | chore: 🎨 Chores
22 | header:
23 | pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$"
24 | pattern_maps:
25 | - Type
26 | - Scope
27 | - Subject
28 | notes:
29 | keywords:
30 | - 🚨 Breaking Changes
31 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github:
2 | - cordx56
3 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.yml:
--------------------------------------------------------------------------------
1 | name: Bug report
2 | description: Report a bug to help us improve RustOwl
3 | labels: bug
4 | body:
5 | - type: markdown
6 | attributes:
7 | value: |
8 | Thank you for reporting a bug!
9 |
10 | Before submitting, please search existing issues to avoid duplicates. If a similar issue exists, comment there instead of opening a new one.
11 |
12 | To help us resolve the issue efficiently, please provide the necessary details below.
13 |
14 | - type: textarea
15 | id: bug-description
16 | attributes:
17 | label: Bug Description
18 | description: Describe the issue you encountered.
19 | placeholder: Provide a clear and concise description of the problem, including what you expected to happen and what actually occurred.
20 | validations:
21 | required: true
22 |
23 | - type: textarea
24 | id: environment
25 | attributes:
26 | label: Environment
27 | description: Provide details about your setup.
28 | placeholder: |
29 | - OS: [e.g., Windows 11, macOS Sequoia 15.2, Ubuntu 24.04]
30 | - rustc Version: [e.g., 1.84.1 (e71f9a9a9 2025-01-27)]
31 | - rustup Version: [e.g., 1.27.1 (54dd3d00f 2024-04-24)]
32 | - RustOwl Version: [e.g., v0.1.1]
33 | - Editor: [e.g., VSCode 1.97, Neovim, Emacs]
34 | validations:
35 | required: true
36 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: true
2 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.yml:
--------------------------------------------------------------------------------
1 | name: Feature request
2 | description: Suggest an idea for RustOwl
3 | labels: enhancement
4 | body:
5 | - type: textarea
6 | attributes:
7 | label: What is the problem you're trying to solve
8 | description: |
9 | A clear and concise description of what the problem is.
10 | validations:
11 | required: true
12 |
13 | - type: textarea
14 | attributes:
15 | label: Describe the solution you'd like
16 | description: |
17 | A clear and concise description of what you'd like to happen.
18 | validations:
19 | required: true
20 |
21 | - type: textarea
22 | attributes:
23 | label: Additional context
24 | description: |
25 | Add any other context about the feature request here.
26 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ## Related Issue(s)
2 |
3 |
7 |
8 | ## Description
9 |
10 |
12 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: cargo
4 | directory: "/"
5 | schedule:
6 | interval: "daily"
7 | - package-ecosystem: github-actions
8 | directory: "/"
9 | schedule:
10 | interval: "daily"
11 | - package-ecosystem: npm
12 | directory: "/vscode"
13 | schedule:
14 | interval: daily
15 |
--------------------------------------------------------------------------------
/.github/workflows/build.yaml:
--------------------------------------------------------------------------------
1 | name: Build RustOwl
2 |
3 | on:
4 | workflow_call:
5 | outputs:
6 | run_id:
7 | description: Run ID of this workflow
8 | value: ${{ github.run_id }}
9 |
10 | jobs:
11 | check:
12 | uses: ./.github/workflows/check.yaml
13 |
14 | rustowl:
15 | needs:
16 | - check
17 | strategy:
18 | matrix:
19 | os:
20 | - ubuntu-24.04
21 | - ubuntu-24.04-arm
22 | - macos-15
23 | - macos-13
24 | - windows-2022
25 | - windows-11-arm
26 |
27 | runs-on: ${{ matrix.os }}
28 | permissions:
29 | contents: write
30 | defaults:
31 | run:
32 | shell: bash
33 | env:
34 | RUSTUP_TOOLCHAIN: 1.87.0
35 | RUSTC_BOOTSTRAP: rustowlc
36 |
37 | steps:
38 | - name: Checkout
39 | uses: actions/checkout@v4
40 |
41 | # Using fat LTO causes failure to link on Windows ARM
42 | - name: Set build profile
43 | run: |
44 | if [[ "${{ matrix.os }}" == "windows-11-arm" ]]; then
45 | echo "build_profile=arm-windows-release" >> $GITHUB_ENV
46 | else
47 | echo "build_profile=release" >> $GITHUB_ENV
48 | fi
49 |
50 | # We don't have rustup on the Windows 11 Arm64 runner yet, so manually installing it.
51 | - if: ${{ matrix.os == 'windows-11-arm' }}
52 | name: Install rustup
53 | run: |
54 | URL='https://static.rust-lang.org/rustup/dist/aarch64-pc-windows-msvc/rustup-init.exe'
55 | HASH="$(curl -sSL "${URL}.sha256")"
56 | curl -sSL -o ./rustup-init.exe "${URL}"
57 | if [ "$(sha256sum ./rustup-init.exe | cut -d' ' -f 1)" = "${HASH}" ]; then
58 | ./rustup-init.exe -y --no-update-default-toolchain
59 | echo "${USERPROFILE}\.cargo\bin" >> "${GITHUB_PATH}"
60 | else
61 | echo "::error::The SHA256 digest does not match."
62 | exit 1
63 | fi
64 |
65 | - name: Setup Rust
66 | run: |
67 | rustup install --profile minimal
68 | rustup component add rust-src rustc-dev llvm-tools
69 |
70 | - name: setup env
71 | run: |
72 | echo "host_tuple=$(rustc --print=host-tuple)" >> $GITHUB_ENV
73 | rustup show active-toolchain | awk '{ print "active_toolchain=" $1 }' >> $GITHUB_ENV
74 | ([[ "$(rustc --print=host-tuple)" == *msvc* ]] && echo "exec_ext=.exe" || echo "exec_ext=") >> $GITHUB_ENV
75 | ([[ "$(rustc --print=host-tuple)" == *windows* ]] && echo "is_windows=true" || echo "is_windows=false") >> $GITHUB_ENV
76 | ([[ "$(rustc --print=host-tuple)" == *linux* ]] && echo "is_linux=true" || echo "is_linux=false") >> $GITHUB_ENV
77 |
78 | - name: Install zig
79 | if: env.is_linux == 'true'
80 | uses: mlugg/setup-zig@v2
81 | with:
82 | version: 0.13.0
83 |
84 | - name: Build
85 | run: |
86 | if [[ "${{ env.is_linux }}" == "true" ]]; then
87 | cargo install --locked cargo-zigbuild
88 | cargo zigbuild --target ${{ env.host_tuple }}.2.17 --profile=${{ env.build_profile }}
89 | else
90 | cargo build --profile=${{ env.build_profile }}
91 | fi
92 |
93 | - name: Set archive name
94 | run: |
95 | if [[ "${{ env.is_windows }}" == "true" ]]; then
96 | echo "archive_name=rustowl-${{ env.host_tuple }}.zip" >> $GITHUB_ENV
97 | else
98 | echo "archive_name=rustowl-${{ env.host_tuple }}.tar.gz" >> $GITHUB_ENV
99 | fi
100 |
101 | - name: Setup archive artifacts
102 | run: |
103 | SYSROOT_PATH=sysroot/${{ env.active_toolchain }}
104 | rm -rf runtime && mkdir -p runtime/$SYSROOT_PATH
105 |
106 | rm -rf tmp && mkdir tmp
107 | RUSTC_NAME="rustc-${{ env.active_toolchain }}"
108 | STD_NAME="rust-std-${{ env.active_toolchain }}"
109 | curl -L "http://static.rust-lang.org/dist/${RUSTC_NAME}.tar.gz" | tar xzvf - -C tmp/
110 | curl -L "http://static.rust-lang.org/dist/${STD_NAME}.tar.gz" | tar xzvf - -C tmp/
111 |
112 | ./tmp/${RUSTC_NAME}/install.sh --destdir=runtime/$SYSROOT_PATH --prefix=
113 | ./tmp/${STD_NAME}/install.sh --destdir=runtime/$SYSROOT_PATH --prefix=
114 |
115 | if [[ "${{ env.is_linux }}" == "true" ]]; then
116 | cp target/${{ env.host_tuple }}/${{ env.build_profile }}/rustowl${{ env.exec_ext }} ./runtime
117 | cp target/${{ env.host_tuple }}/${{ env.build_profile }}/rustowlc${{ env.exec_ext }} ./runtime
118 | else
119 | cp target/${{ env.build_profile }}/rustowl${{ env.exec_ext }} ./runtime
120 | cp target/${{ env.build_profile }}/rustowlc${{ env.exec_ext }} ./runtime
121 | fi
122 |
123 | cp README.md ./runtime
124 | cp LICENSE ./runtime
125 |
126 | find target -type d | grep -E 'rustowl-build-time-out$' | xargs -I % cp -r % ./
127 | cp -r rustowl-build-time-out/completions ./runtime
128 | cp -r rustowl-build-time-out/man ./runtime
129 |
130 | rm -rf ${{ env.archive_name }}
131 | cd runtime
132 |
133 | if [[ "${{ env.is_windows }}" == "true" ]]; then
134 | powershell -c 'Compress-Archive -Path README.md, LICENSE, "rustowl${{ env.exec_ext }}", "rustowlc${{ env.exec_ext }}", "sysroot", "completions", "man" -DestinationPath "..\${{ env.archive_name }}" -CompressionLevel Optimal'
135 | else
136 | tar -czvf ../${{ env.archive_name }} README.md LICENSE rustowl${{ env.exec_ext }} rustowlc${{ env.exec_ext }} sysroot/ completions/ man/
137 | fi
138 |
139 | cp ./rustowl${{ env.exec_ext }} ../rustowl-${{ env.host_tuple }}${{ env.exec_ext }}
140 |
141 | - name: Upload
142 | uses: actions/upload-artifact@v4
143 | with:
144 | name: rustowl-runtime-${{ env.host_tuple }}
145 | path: |
146 | rustowl-${{ env.host_tuple }}${{ env.exec_ext }}
147 | ${{ env.archive_name }}
148 |
149 | vscode:
150 | needs:
151 | - check
152 | runs-on: ubuntu-latest
153 | permissions:
154 | contents: write
155 |
156 | steps:
157 | - name: Checkout
158 | uses: actions/checkout@v4
159 |
160 | - name: Setup Node.js
161 | uses: actions/setup-node@v4
162 | with:
163 | node-version: 20
164 |
165 | - name: Install dependencies
166 | run: yarn install --frozen-locked
167 | working-directory: ./vscode
168 |
169 | - name: Create VSIX
170 | run: yarn build
171 | working-directory: ./vscode
172 |
173 | - name: Upload
174 | uses: actions/upload-artifact@v4
175 | with:
176 | name: rustowl-vscode
177 | path: vscode/**/*.vsix
178 |
--------------------------------------------------------------------------------
/.github/workflows/changelog.yml:
--------------------------------------------------------------------------------
1 | name: Generate Changelog
2 |
3 | on:
4 | workflow_dispatch:
5 |
6 | jobs:
7 | changelogen:
8 | runs-on: ubuntu-latest
9 | permissions:
10 | contents: write
11 | pull-requests: write
12 | steps:
13 | - uses: actions/checkout@v4
14 | with:
15 | fetch-depth: 0
16 |
17 | - run: |
18 | docker pull quay.io/git-chglog/git-chglog:latest
19 | docker run -v "$PWD":/workdir quay.io/git-chglog/git-chglog --tag-filter-pattern '^v\d+\.\d+\.\d+$' -o CHANGELOG.md
20 |
21 | - name: Create Pull Request
22 | uses: peter-evans/create-pull-request@v7
23 | with:
24 | add-paths: |
25 | CHANGELOG.md
26 | author: github-actions[bot]
27 | base: main
28 | branch: create-pull-request/autogenerate-changelog
29 | commit-message: "chore: update changelog"
30 | title: "Update Changelog"
31 |
--------------------------------------------------------------------------------
/.github/workflows/check.yaml:
--------------------------------------------------------------------------------
1 | name: Check RustOwl
2 |
3 | on:
4 | workflow_call:
5 | pull_request:
6 | branches:
7 | - main
8 |
9 | jobs:
10 | cargo:
11 | strategy:
12 | matrix:
13 | os:
14 | - ubuntu-latest
15 | - windows-latest
16 | - macos-latest
17 | - ubuntu-24.04-arm
18 | runs-on: ${{ matrix.os }}
19 | env:
20 | RUSTUP_TOOLCHAIN: 1.87.0
21 | RUSTC_BOOTSTRAP: 1
22 | steps:
23 | - name: Checkout
24 | uses: actions/checkout@v4
25 |
26 | - name: Install Rust toolchain
27 | uses: dtolnay/rust-toolchain@stable
28 | with:
29 | toolchain: ${{ env.RUSTUP_TOOLCHAIN }}
30 | components: clippy,rustfmt,llvm-tools,rust-src,rustc-dev
31 |
32 | - run: cargo fmt --check
33 | - run: cargo clippy --all-targets --all-features -- -D warnings
34 |
35 | - name: Build
36 | run: cargo build --release
37 |
38 | - name: install binaries
39 | run: cargo install --path .
40 |
41 | - name: Run RustOwl
42 | run: rustowl check
43 |
44 |
45 | vscode:
46 | runs-on: ubuntu-latest
47 | steps:
48 | - name: Checkout
49 | uses: actions/checkout@v4
50 | - name: Setup Node.js
51 | uses: actions/setup-node@v4
52 | with:
53 | node-version: 20
54 | - run: yarn install --frozen-locked
55 | working-directory: ./vscode
56 | - run: yarn prettier -c src
57 | working-directory: ./vscode
58 | - run: yarn lint && yarn check-types
59 | working-directory: ./vscode
60 |
--------------------------------------------------------------------------------
/.github/workflows/release.yaml:
--------------------------------------------------------------------------------
1 | name: Release RustOwl
2 |
3 | on:
4 | push:
5 | tags:
6 | - v*
7 |
8 | permissions:
9 | actions: read
10 | contents: write
11 |
12 | jobs:
13 | build:
14 | uses: ./.github/workflows/build.yaml
15 |
16 | meta:
17 | runs-on: ubuntu-latest
18 | outputs:
19 | pre_release: ${{ steps.pre-release.outputs.pre_release }}
20 | steps:
21 | - name: Check pre-release
22 | id: pre-release
23 | run: |
24 | if [[ "${{ github.ref_name }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
25 | echo "pre_release=false" >> $GITHUB_OUTPUT
26 | else
27 | echo "pre_release=true" >> $GITHUB_OUTPUT
28 | fi
29 |
30 | crates-io-release:
31 | runs-on: ubuntu-latest
32 | needs:
33 | - build
34 | - meta
35 | steps:
36 | - uses: actions/checkout@v4
37 | - name: Release crates.io
38 | if: needs.meta.outputs.pre_release != 'true'
39 | run: |
40 | echo '${{ secrets.CRATES_IO_API_TOKEN }}' | cargo login
41 | cargo publish
42 |
43 | vscode-release:
44 | runs-on: ubuntu-latest
45 | needs:
46 | - build
47 | - meta
48 | steps:
49 | - uses: actions/checkout@v4
50 | - name: Setup Node.js
51 | uses: actions/setup-node@v4
52 | with:
53 | node-version: 20
54 | - name: Release vsce
55 | if: needs.meta.outputs.pre_release != 'true'
56 | run: |
57 | yarn install --frozen-locked
58 | yarn vsce publish
59 | working-directory: ./vscode
60 | env:
61 | VSCE_PAT: ${{ secrets.VSCE_PAT }}
62 |
63 | aur-release:
64 | runs-on: ubuntu-latest
65 | needs:
66 | - build
67 | - meta
68 | steps:
69 | - name: Checkout
70 | uses: actions/checkout@v4
71 | - name: AUR Release
72 | uses: KSXGitHub/github-actions-deploy-aur@v4.1.1
73 | if: needs.meta.outputs.pre_release != 'true'
74 | with:
75 | pkgname: rustowl-bin
76 | pkgbuild: ./aur/PKGBUILD
77 | updpkgsums: true
78 | commit_username: ${{ secrets.AUR_USERNAME }}
79 | commit_email: ${{ secrets.AUR_EMAIL }}
80 | ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
81 | commit_message: Update AUR package
82 | ssh_keyscan_types: rsa,ecdsa,ed25519
83 | env:
84 | AUR_USERNAME: ${{ secrets.AUR_USERNAME }}
85 | AUR_EMAIL: ${{ secrets.AUR_EMAIL }}
86 | AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
87 |
88 | github-release:
89 | runs-on: ubuntu-latest
90 | needs:
91 | - build
92 | - meta
93 | steps:
94 | - uses: actions/checkout@v4
95 | with:
96 | fetch-depth: 0
97 | - name: Setup Node.js
98 | uses: actions/setup-node@v4
99 | with:
100 | node-version: 20
101 | - name: Generate Release Notes
102 | run: |
103 | npx changelogithub@latest --contributors --output release.md
104 | env:
105 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
106 | - name: Download All Artifacts
107 | uses: actions/download-artifact@v4
108 | with:
109 | path: artifacts
110 | pattern: rustowl-*
111 | merge-multiple: true
112 | github-token: ${{ secrets.GITHUB_TOKEN }}
113 | run-ids: ${{ needs.build.outputs.run_id }}
114 | - name: Release
115 | uses: softprops/action-gh-release@v2
116 | with:
117 | files: artifacts/**/*
118 | draft: true
119 | body_path: release.md
120 | prerelease: ${{ needs.meta.outputs.pre_release == 'true' }}
121 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 |
3 | # Nix stuff can be ignored, see https://github.com/cordx56/rustowl/issues/59
4 | result*
5 | .envrc
6 | .luarc.json
7 |
8 | # Ignore completions and man dir, they are generated at build time
9 | completions/
10 | man/
11 |
--------------------------------------------------------------------------------
/.luacheckrc:
--------------------------------------------------------------------------------
1 | ignore = {
2 | "631", -- max_line_length
3 | "122", -- read-only field of global variable
4 | }
5 | read_globals = {
6 | "vim",
7 | }
8 |
--------------------------------------------------------------------------------
/.stylua.toml:
--------------------------------------------------------------------------------
1 | line_endings = "Unix"
2 | indent_type = "Spaces"
3 | indent_width = 2
4 | quote_style = "AutoPreferSingle"
5 | call_parentheses = "NoSingleTable"
6 | collapse_simple_statement = "Never"
7 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 |
2 | ## [Unreleased]
3 |
4 | ### 🎨 Chores
5 | - **aur:** bump rustup toolchain version ([#177](https://github.com/cordx56/rustowl/issues/177))
6 |
7 |
8 |
9 | ## [v0.3.4] - 2025-05-20
10 | ### 🎨 Chores
11 | - urgent release v0.3.4, fixes wrong visualization
12 | - update changelog ([#170](https://github.com/cordx56/rustowl/issues/170))
13 | - update changelog ([#168](https://github.com/cordx56/rustowl/issues/168))
14 |
15 | ### 🐞 Bug Fixes
16 | - **lsp-core:** fix actual lifetime range visualization for `Drop` variable.
17 |
18 |
19 |
20 | ## [v0.3.3] - 2025-05-17
21 | ### ♻️ Code Refactoring
22 | - split build action from release action
23 |
24 | ### 🎨 Chores
25 | - fix pre-release if statement
26 | - fix release case
27 | - regex in bash should not quoted
28 | - automate cargo publish
29 | - vsce auto publish
30 | - use official toolchain
31 | - Rewrite CLI using Derive API ([#153](https://github.com/cordx56/rustowl/issues/153))
32 | - update changelog ([#154](https://github.com/cordx56/rustowl/issues/154))
33 | - **cli:** Add help messages to options ([#159](https://github.com/cordx56/rustowl/issues/159))
34 |
35 | ### 🐞 Bug Fixes
36 | - support CRLF
37 | - GitHub Actions typo
38 | - use native ca certs by enabling native roots feature of reqwest ([#162](https://github.com/cordx56/rustowl/issues/162))
39 | - **pkgbuild:** use rustup instead of cargo ([#156](https://github.com/cordx56/rustowl/issues/156))
40 |
41 | ### 🚀 Features
42 | - update rustc to 1.87.0
43 |
44 |
45 |
46 | ## [v0.3.2] - 2025-05-09
47 | ### 🐞 Bug Fixes
48 | - support gsed (macOS)
49 | - version.sh removed and use ./scripts/bump.sh
50 | - specify pkg-fmt for binstall
51 | - restore current newest version
52 |
53 | ### 🚀 Features
54 | - v0.3.2 release
55 | - support RUSTOWL_SYSROOT_DIRS
56 | - add a bump.sh for bumping ([#148](https://github.com/cordx56/rustowl/issues/148))
57 | - documented binstall method
58 | - support single .rs file analyze and VS Code download progress
59 |
60 | ### Pull Requests
61 | - Merge pull request [#146](https://github.com/cordx56/rustowl/issues/146) from cordx56/dependabot/npm_and_yarn/vscode/types/node-22.15.14
62 |
63 |
64 |
65 | ## [v0.3.1] - 2025-05-07
66 | ### 🎨 Chores
67 | - Release v0.3.1
68 | - Don't check every main push
69 | - update changelog
70 | - update changelog
71 | - update changelog
72 | - update changelog ([#116](https://github.com/cordx56/rustowl/issues/116))
73 | - update changelog ([#112](https://github.com/cordx56/rustowl/issues/112))
74 | - update changelog ([#104](https://github.com/cordx56/rustowl/issues/104))
75 | - add comments to cargo.toml on next release changes
76 | - added build time env var description
77 | - update changelog
78 | - update changelog
79 | - update changelog
80 |
81 | ### 🐞 Bug Fixes
82 | - email
83 | - use target name in cp command
84 | - VS Code version check returns null
85 | - pr permission for changelog
86 | - dont use tar, use Compress-Archive instead
87 | - check before release and profile dir
88 | - add release on top of cp
89 | - change compress script to use sysroot dir ([#125](https://github.com/cordx56/rustowl/issues/125))
90 | - arm Windows build
91 | - avoid failure to find sysroot
92 | - rustowlc ext for Windows
93 | - **aur:** add cd lines as it errors
94 | - **binstall:** use archives instead of binaries
95 | - **changelogen:** only add normal releases, not alpha and others
96 | - **ci:** use powershell in windoes ci
97 | - **reqwest:** dont depend on openssl-sys, use rustls for lower system deps
98 | - **windows:** unzip
99 |
100 | ### 🚀 Features
101 | - better-release-notes
102 | - support multiple fallbacks
103 | - remove redundant rustc_driver
104 | - RustOwl version check for VS Code extension
105 | - add a pr template
106 | - add a code of conduct and security file
107 | - aur packages ([#105](https://github.com/cordx56/rustowl/issues/105))
108 | - aur packages
109 | - automatic updates with dependabot
110 | - use zip instead of tar in windows
111 | - auto release changelogs, changelog generation
112 | - **archive:** implement zipping for windows
113 |
114 | ### Reverts
115 | - move CONTRIBUTING.md
116 |
117 | ### Pull Requests
118 | - Merge pull request [#142](https://github.com/cordx56/rustowl/issues/142) from cordx56/feat/better-release-notes
119 | - Merge pull request [#140](https://github.com/cordx56/rustowl/issues/140) from MuntasirSZN/fix/changelogen
120 | - Merge pull request [#132](https://github.com/cordx56/rustowl/issues/132) from cordx56/create-pull-request/autogenerate-changelog
121 | - Merge pull request [#131](https://github.com/cordx56/rustowl/issues/131) from MuntasirSZN/fix/windows-unzip
122 | - Merge pull request [#130](https://github.com/cordx56/rustowl/issues/130) from MuntasirSZN/fix/pkgbuild-git
123 | - Merge pull request [#129](https://github.com/cordx56/rustowl/issues/129) from MuntasirSZN/feat/community-standards
124 | - Merge pull request [#128](https://github.com/cordx56/rustowl/issues/128) from MuntasirSZN/main
125 | - Merge pull request [#126](https://github.com/cordx56/rustowl/issues/126) from cordx56/create-pull-request/autogenerate-changelog
126 | - Merge pull request [#124](https://github.com/cordx56/rustowl/issues/124) from MuntasirSZN/main
127 | - Merge pull request [#123](https://github.com/cordx56/rustowl/issues/123) from MuntasirSZN/main
128 | - Merge pull request [#115](https://github.com/cordx56/rustowl/issues/115) from MuntasirSZN/main
129 | - Merge pull request [#114](https://github.com/cordx56/rustowl/issues/114) from MuntasirSZN/main
130 | - Merge pull request [#113](https://github.com/cordx56/rustowl/issues/113) from MuntasirSZN/main
131 | - Merge pull request [#111](https://github.com/cordx56/rustowl/issues/111) from MuntasirSZN/fix/archive-ci
132 | - Merge pull request [#103](https://github.com/cordx56/rustowl/issues/103) from MuntasirSZN/feat/dependabot
133 | - Merge pull request [#101](https://github.com/cordx56/rustowl/issues/101) from MuntasirSZN/feat/zig-linker
134 | - Merge pull request [#96](https://github.com/cordx56/rustowl/issues/96) from MuntasirSZN/main
135 | - Merge pull request [#97](https://github.com/cordx56/rustowl/issues/97) from MuntasirSZN/fix/binstall
136 | - Merge pull request [#99](https://github.com/cordx56/rustowl/issues/99) from Alex-Grimes/enhancment/78_Add-highlight-style-config-option
137 | - Merge pull request [#98](https://github.com/cordx56/rustowl/issues/98) from cordx56/fix/ci-changelogen
138 | - Merge pull request [#92](https://github.com/cordx56/rustowl/issues/92) from MuntasirSZN/main
139 | - Merge pull request [#94](https://github.com/cordx56/rustowl/issues/94) from mrcjkb/mj/push-mpkursvmrosw
140 | - Merge pull request [#91](https://github.com/cordx56/rustowl/issues/91) from MuntasirSZN/main
141 |
142 |
143 |
144 | ## [v0.3.0] - 2025-04-30
145 | ### 🚀 Features
146 | - shell completions and man pages
147 |
148 | ### Reverts
149 | - test workflow
150 |
151 | ### Pull Requests
152 | - Merge pull request [#88](https://github.com/cordx56/rustowl/issues/88) from yasuo-ozu/fix_build_canonical
153 | - Merge pull request [#85](https://github.com/cordx56/rustowl/issues/85) from MuntasirSZN/main
154 | - Merge pull request [#80](https://github.com/cordx56/rustowl/issues/80) from siketyan/ci/more-platform
155 |
156 |
157 |
158 | ## [v0.2.2] - 2025-04-18
159 | ### ♻️ Code Refactoring
160 | - streamline toolchain detection and correct cargo path
161 |
162 | ### 🚀 Features
163 | - **toolchain:** add support for RUSTOWL_TOOLCHAIN_DIR to bypass rustup
164 |
165 | ### Pull Requests
166 | - Merge pull request [#77](https://github.com/cordx56/rustowl/issues/77) from xBLACKICEx/flexible-toolchain
167 |
168 |
169 |
170 | ## [v0.2.1] - 2025-04-15
171 |
172 |
173 | ## [v0.2.0] - 2025-04-09
174 | ### ♻️ Code Refactoring
175 | - add prefix to functions with commonly used names
176 |
177 | ### 🎨 Chores
178 | - add require lsp
179 | - remove calling `enable-rustowlsp-cursor`
180 | - add `defgroup`
181 | - add `provide`
182 | - Migrate to Rust 2024
183 |
184 | ### 🐞 Bug Fixes
185 | - package-requires
186 |
187 | ### Reverts
188 | - messsage type
189 | - neovim plugin function
190 | - update install manual
191 |
192 | ### Pull Requests
193 | - Merge pull request [#72](https://github.com/cordx56/rustowl/issues/72) from mawkler/neovim-version
194 | - Merge pull request [#69](https://github.com/cordx56/rustowl/issues/69) from cordx56/feat/elim-rustup-call
195 | - Merge pull request [#48](https://github.com/cordx56/rustowl/issues/48) from mawkler/lua-api
196 | - Merge pull request [#62](https://github.com/cordx56/rustowl/issues/62) from Kyure-A/main
197 | - Merge pull request [#61](https://github.com/cordx56/rustowl/issues/61) from AIDIGIT/nvim-hl-priorities
198 | - Merge pull request [#60](https://github.com/cordx56/rustowl/issues/60) from AIDIGIT/main
199 | - Merge pull request [#55](https://github.com/cordx56/rustowl/issues/55) from sorairolake/migrate-to-2024-edition
200 |
201 |
202 |
203 | ## [v0.1.4] - 2025-02-22
204 | ### ♻️ Code Refactoring
205 | - simplify HashMap insertion by using entry API
206 |
207 | ### Pull Requests
208 | - Merge pull request [#54](https://github.com/cordx56/rustowl/issues/54) from uhobnil/main
209 |
210 |
211 |
212 | ## [v0.1.3] - 2025-02-20
213 | ### 🎨 Chores
214 | - remove duplicate code
215 |
216 | ### 🐞 Bug Fixes
217 | - install the newest version
218 |
219 | ### Pull Requests
220 | - Merge pull request [#53](https://github.com/cordx56/rustowl/issues/53) from uhobnil/main
221 | - Merge pull request [#47](https://github.com/cordx56/rustowl/issues/47) from robin-thoene/fix/update-install-script
222 |
223 |
224 |
225 | ## [v0.1.2] - 2025-02-19
226 | ### 🎨 Chores
227 | - add the description for duplication
228 | - add config.yaml
229 | - add issue templae for feature requesting
230 | - add labels to bug_report
231 | - add issue templae for bug reporing
232 |
233 | ### 🐞 Bug Fixes
234 | - s/enhancement/bug/
235 | - update the introduction
236 | - correct label
237 | - remove redundant textarea
238 | - update the information
239 | - update the file extension
240 | - s/rustowl/RustOwl/
241 | - kill process when the client/server is dead
242 |
243 | ### Pull Requests
244 | - Merge pull request [#35](https://github.com/cordx56/rustowl/issues/35) from chansuke/chore/add-issue-template
245 | - Merge pull request [#42](https://github.com/cordx56/rustowl/issues/42) from uhobnil/main
246 | - Merge pull request [#34](https://github.com/cordx56/rustowl/issues/34) from mtshiba/main
247 | - Merge pull request [#26](https://github.com/cordx56/rustowl/issues/26) from Toyo-tez/main
248 | - Merge pull request [#11](https://github.com/cordx56/rustowl/issues/11) from wx257osn2/clippy
249 | - Merge pull request [#24](https://github.com/cordx56/rustowl/issues/24) from mawkler/main
250 |
251 |
252 |
253 | ## [v0.1.1] - 2025-02-07
254 |
255 |
256 | ## [v0.1.0] - 2025-02-05
257 | ### Pull Requests
258 | - Merge pull request [#2](https://github.com/cordx56/rustowl/issues/2) from wx257osn2/support-windows
259 |
260 |
261 |
262 | ## [v0.0.5] - 2025-02-02
263 |
264 |
265 | ## [v0.0.4] - 2025-01-31
266 |
267 |
268 | ## [v0.0.3] - 2025-01-30
269 | ### Pull Requests
270 | - Merge pull request [#6](https://github.com/cordx56/rustowl/issues/6) from Jayllyz/build/enable-lto-codegen
271 | - Merge pull request [#5](https://github.com/cordx56/rustowl/issues/5) from mu001999-contrib/main
272 |
273 |
274 |
275 | ## [v0.0.2] - 2025-01-23
276 |
277 |
278 | ## v0.0.1 - 2024-11-13
279 |
280 | [Unreleased]: https://github.com/cordx56/rustowl/compare/v0.3.4...HEAD
281 | [v0.3.4]: https://github.com/cordx56/rustowl/compare/v0.3.3...v0.3.4
282 | [v0.3.3]: https://github.com/cordx56/rustowl/compare/v0.3.2...v0.3.3
283 | [v0.3.2]: https://github.com/cordx56/rustowl/compare/v0.3.1...v0.3.2
284 | [v0.3.1]: https://github.com/cordx56/rustowl/compare/v0.3.0...v0.3.1
285 | [v0.3.0]: https://github.com/cordx56/rustowl/compare/v0.2.2...v0.3.0
286 | [v0.2.2]: https://github.com/cordx56/rustowl/compare/v0.2.1...v0.2.2
287 | [v0.2.1]: https://github.com/cordx56/rustowl/compare/v0.2.0...v0.2.1
288 | [v0.2.0]: https://github.com/cordx56/rustowl/compare/v0.1.4...v0.2.0
289 | [v0.1.4]: https://github.com/cordx56/rustowl/compare/v0.1.3...v0.1.4
290 | [v0.1.3]: https://github.com/cordx56/rustowl/compare/v0.1.2...v0.1.3
291 | [v0.1.2]: https://github.com/cordx56/rustowl/compare/v0.1.1...v0.1.2
292 | [v0.1.1]: https://github.com/cordx56/rustowl/compare/v0.1.0...v0.1.1
293 | [v0.1.0]: https://github.com/cordx56/rustowl/compare/v0.0.5...v0.1.0
294 | [v0.0.5]: https://github.com/cordx56/rustowl/compare/v0.0.4...v0.0.5
295 | [v0.0.4]: https://github.com/cordx56/rustowl/compare/v0.0.3...v0.0.4
296 | [v0.0.3]: https://github.com/cordx56/rustowl/compare/v0.0.2...v0.0.3
297 | [v0.0.2]: https://github.com/cordx56/rustowl/compare/v0.0.1...v0.0.2
298 |
--------------------------------------------------------------------------------
/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "rustowl"
3 | version = "0.3.4"
4 | edition = "2024"
5 | authors = ["cordx56 "]
6 | description = "Visualize Ownership and Lifetimes in Rust"
7 | documentation = "https://github.com/cordx56/rustowl/blob/main/README.md"
8 | readme = "README.md"
9 | repository = "https://github.com/cordx56/rustowl"
10 | license = "MPL-2.0"
11 | keywords = ["visualization", "ownership", "lifetime", "lsp"]
12 | categories = ["development-tools", "visualization"]
13 |
14 | [dependencies]
15 | serde = { version = "1.0.210", features = ["derive"] }
16 | serde_json = "1.0.135"
17 | log = "0.4.22"
18 | simple_logger = { version = "5.0.0", features = ["stderr"] }
19 | tokio = { version = "1.45.1", features = ["rt", "rt-multi-thread", "macros", "sync", "time", "io-std", "io-util", "process", "fs"] }
20 | tower-lsp = "0.20.0"
21 | process_alive = "0.1.1"
22 | cargo_metadata = "0.20.0"
23 | uuid = { version = "1", features = ["v4"] }
24 | clap = { version = "4.5.39", features = ["cargo", "derive"] }
25 | tar = "0.4.44"
26 | flate2 = "1.1.1"
27 | reqwest = { version = "0.12.18", default-features = false, features = ["http2", "rustls-tls-native-roots"] }
28 | clap_complete_nushell = "4.5.6"
29 | clap_complete = "4.5.52"
30 | zip = "4.0.0"
31 |
32 | [build-dependencies]
33 | clap_complete_nushell = "4.5.6"
34 | clap_complete = "4.5.52"
35 | clap_mangen = "0.2.26"
36 | clap = { version = "4.5.39", features = ["derive"] }
37 |
38 | [target.'cfg(unix)'.dependencies]
39 | libc = "0.2.169"
40 |
41 | # This is cited from [rustc](https://github.com/rust-lang/rust/blob/1.86.0/compiler/rustc/Cargo.toml).
42 | # MIT License
43 | [target.'cfg(unix)'.dependencies.tikv-jemalloc-sys]
44 | version = "0.6.0"
45 | optional = true
46 | features = ['unprefixed_malloc_on_supported_platforms']
47 |
48 | [features]
49 | default = ["jemalloc"]
50 | jemalloc = ['dep:tikv-jemalloc-sys']
51 |
52 | [profile.release]
53 | opt-level = 3
54 | lto = "fat"
55 | codegen-units = 1
56 |
57 | [profile.arm-windows-release]
58 | inherits = "release"
59 | lto = "off"
60 |
61 | [package.metadata.rust-analyzer]
62 | rustc_private = true
63 |
64 | [package.metadata.binstall]
65 | pkg-url = "{ repo }/releases/download/v{ version }/rustowl-{ target }{ archive-suffix }"
66 | pkg-fmt = "tgz"
67 | disabled-strategies = ["quick-install", "compile"]
68 |
69 | [package.metadata.binstall.overrides.x86_64-pc-windows-msvc]
70 | pkg-fmt = "zip"
71 |
72 | [package.metadata.binstall.overrides.aarch64-pc-windows-msvc]
73 | pkg-fmt = "zip"
74 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Mozilla Public License Version 2.0
2 | ==================================
3 |
4 | 1. Definitions
5 | --------------
6 |
7 | 1.1. "Contributor"
8 | means each individual or legal entity that creates, contributes to
9 | the creation of, or owns Covered Software.
10 |
11 | 1.2. "Contributor Version"
12 | means the combination of the Contributions of others (if any) used
13 | by a Contributor and that particular Contributor's Contribution.
14 |
15 | 1.3. "Contribution"
16 | means Covered Software of a particular Contributor.
17 |
18 | 1.4. "Covered Software"
19 | means Source Code Form to which the initial Contributor has attached
20 | the notice in Exhibit A, the Executable Form of such Source Code
21 | Form, and Modifications of such Source Code Form, in each case
22 | including portions thereof.
23 |
24 | 1.5. "Incompatible With Secondary Licenses"
25 | means
26 |
27 | (a) that the initial Contributor has attached the notice described
28 | in Exhibit B to the Covered Software; or
29 |
30 | (b) that the Covered Software was made available under the terms of
31 | version 1.1 or earlier of the License, but not also under the
32 | terms of a Secondary License.
33 |
34 | 1.6. "Executable Form"
35 | means any form of the work other than Source Code Form.
36 |
37 | 1.7. "Larger Work"
38 | means a work that combines Covered Software with other material, in
39 | a separate file or files, that is not Covered Software.
40 |
41 | 1.8. "License"
42 | means this document.
43 |
44 | 1.9. "Licensable"
45 | means having the right to grant, to the maximum extent possible,
46 | whether at the time of the initial grant or subsequently, any and
47 | all of the rights conveyed by this License.
48 |
49 | 1.10. "Modifications"
50 | means any of the following:
51 |
52 | (a) any file in Source Code Form that results from an addition to,
53 | deletion from, or modification of the contents of Covered
54 | Software; or
55 |
56 | (b) any new file in Source Code Form that contains any Covered
57 | Software.
58 |
59 | 1.11. "Patent Claims" of a Contributor
60 | means any patent claim(s), including without limitation, method,
61 | process, and apparatus claims, in any patent Licensable by such
62 | Contributor that would be infringed, but for the grant of the
63 | License, by the making, using, selling, offering for sale, having
64 | made, import, or transfer of either its Contributions or its
65 | Contributor Version.
66 |
67 | 1.12. "Secondary License"
68 | means either the GNU General Public License, Version 2.0, the GNU
69 | Lesser General Public License, Version 2.1, the GNU Affero General
70 | Public License, Version 3.0, or any later versions of those
71 | licenses.
72 |
73 | 1.13. "Source Code Form"
74 | means the form of the work preferred for making modifications.
75 |
76 | 1.14. "You" (or "Your")
77 | means an individual or a legal entity exercising rights under this
78 | License. For legal entities, "You" includes any entity that
79 | controls, is controlled by, or is under common control with You. For
80 | purposes of this definition, "control" means (a) the power, direct
81 | or indirect, to cause the direction or management of such entity,
82 | whether by contract or otherwise, or (b) ownership of more than
83 | fifty percent (50%) of the outstanding shares or beneficial
84 | ownership of such entity.
85 |
86 | 2. License Grants and Conditions
87 | --------------------------------
88 |
89 | 2.1. Grants
90 |
91 | Each Contributor hereby grants You a world-wide, royalty-free,
92 | non-exclusive license:
93 |
94 | (a) under intellectual property rights (other than patent or trademark)
95 | Licensable by such Contributor to use, reproduce, make available,
96 | modify, display, perform, distribute, and otherwise exploit its
97 | Contributions, either on an unmodified basis, with Modifications, or
98 | as part of a Larger Work; and
99 |
100 | (b) under Patent Claims of such Contributor to make, use, sell, offer
101 | for sale, have made, import, and otherwise transfer either its
102 | Contributions or its Contributor Version.
103 |
104 | 2.2. Effective Date
105 |
106 | The licenses granted in Section 2.1 with respect to any Contribution
107 | become effective for each Contribution on the date the Contributor first
108 | distributes such Contribution.
109 |
110 | 2.3. Limitations on Grant Scope
111 |
112 | The licenses granted in this Section 2 are the only rights granted under
113 | this License. No additional rights or licenses will be implied from the
114 | distribution or licensing of Covered Software under this License.
115 | Notwithstanding Section 2.1(b) above, no patent license is granted by a
116 | Contributor:
117 |
118 | (a) for any code that a Contributor has removed from Covered Software;
119 | or
120 |
121 | (b) for infringements caused by: (i) Your and any other third party's
122 | modifications of Covered Software, or (ii) the combination of its
123 | Contributions with other software (except as part of its Contributor
124 | Version); or
125 |
126 | (c) under Patent Claims infringed by Covered Software in the absence of
127 | its Contributions.
128 |
129 | This License does not grant any rights in the trademarks, service marks,
130 | or logos of any Contributor (except as may be necessary to comply with
131 | the notice requirements in Section 3.4).
132 |
133 | 2.4. Subsequent Licenses
134 |
135 | No Contributor makes additional grants as a result of Your choice to
136 | distribute the Covered Software under a subsequent version of this
137 | License (see Section 10.2) or under the terms of a Secondary License (if
138 | permitted under the terms of Section 3.3).
139 |
140 | 2.5. Representation
141 |
142 | Each Contributor represents that the Contributor believes its
143 | Contributions are its original creation(s) or it has sufficient rights
144 | to grant the rights to its Contributions conveyed by this License.
145 |
146 | 2.6. Fair Use
147 |
148 | This License is not intended to limit any rights You have under
149 | applicable copyright doctrines of fair use, fair dealing, or other
150 | equivalents.
151 |
152 | 2.7. Conditions
153 |
154 | Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
155 | in Section 2.1.
156 |
157 | 3. Responsibilities
158 | -------------------
159 |
160 | 3.1. Distribution of Source Form
161 |
162 | All distribution of Covered Software in Source Code Form, including any
163 | Modifications that You create or to which You contribute, must be under
164 | the terms of this License. You must inform recipients that the Source
165 | Code Form of the Covered Software is governed by the terms of this
166 | License, and how they can obtain a copy of this License. You may not
167 | attempt to alter or restrict the recipients' rights in the Source Code
168 | Form.
169 |
170 | 3.2. Distribution of Executable Form
171 |
172 | If You distribute Covered Software in Executable Form then:
173 |
174 | (a) such Covered Software must also be made available in Source Code
175 | Form, as described in Section 3.1, and You must inform recipients of
176 | the Executable Form how they can obtain a copy of such Source Code
177 | Form by reasonable means in a timely manner, at a charge no more
178 | than the cost of distribution to the recipient; and
179 |
180 | (b) You may distribute such Executable Form under the terms of this
181 | License, or sublicense it under different terms, provided that the
182 | license for the Executable Form does not attempt to limit or alter
183 | the recipients' rights in the Source Code Form under this License.
184 |
185 | 3.3. Distribution of a Larger Work
186 |
187 | You may create and distribute a Larger Work under terms of Your choice,
188 | provided that You also comply with the requirements of this License for
189 | the Covered Software. If the Larger Work is a combination of Covered
190 | Software with a work governed by one or more Secondary Licenses, and the
191 | Covered Software is not Incompatible With Secondary Licenses, this
192 | License permits You to additionally distribute such Covered Software
193 | under the terms of such Secondary License(s), so that the recipient of
194 | the Larger Work may, at their option, further distribute the Covered
195 | Software under the terms of either this License or such Secondary
196 | License(s).
197 |
198 | 3.4. Notices
199 |
200 | You may not remove or alter the substance of any license notices
201 | (including copyright notices, patent notices, disclaimers of warranty,
202 | or limitations of liability) contained within the Source Code Form of
203 | the Covered Software, except that You may alter any license notices to
204 | the extent required to remedy known factual inaccuracies.
205 |
206 | 3.5. Application of Additional Terms
207 |
208 | You may choose to offer, and to charge a fee for, warranty, support,
209 | indemnity or liability obligations to one or more recipients of Covered
210 | Software. However, You may do so only on Your own behalf, and not on
211 | behalf of any Contributor. You must make it absolutely clear that any
212 | such warranty, support, indemnity, or liability obligation is offered by
213 | You alone, and You hereby agree to indemnify every Contributor for any
214 | liability incurred by such Contributor as a result of warranty, support,
215 | indemnity or liability terms You offer. You may include additional
216 | disclaimers of warranty and limitations of liability specific to any
217 | jurisdiction.
218 |
219 | 4. Inability to Comply Due to Statute or Regulation
220 | ---------------------------------------------------
221 |
222 | If it is impossible for You to comply with any of the terms of this
223 | License with respect to some or all of the Covered Software due to
224 | statute, judicial order, or regulation then You must: (a) comply with
225 | the terms of this License to the maximum extent possible; and (b)
226 | describe the limitations and the code they affect. Such description must
227 | be placed in a text file included with all distributions of the Covered
228 | Software under this License. Except to the extent prohibited by statute
229 | or regulation, such description must be sufficiently detailed for a
230 | recipient of ordinary skill to be able to understand it.
231 |
232 | 5. Termination
233 | --------------
234 |
235 | 5.1. The rights granted under this License will terminate automatically
236 | if You fail to comply with any of its terms. However, if You become
237 | compliant, then the rights granted under this License from a particular
238 | Contributor are reinstated (a) provisionally, unless and until such
239 | Contributor explicitly and finally terminates Your grants, and (b) on an
240 | ongoing basis, if such Contributor fails to notify You of the
241 | non-compliance by some reasonable means prior to 60 days after You have
242 | come back into compliance. Moreover, Your grants from a particular
243 | Contributor are reinstated on an ongoing basis if such Contributor
244 | notifies You of the non-compliance by some reasonable means, this is the
245 | first time You have received notice of non-compliance with this License
246 | from such Contributor, and You become compliant prior to 30 days after
247 | Your receipt of the notice.
248 |
249 | 5.2. If You initiate litigation against any entity by asserting a patent
250 | infringement claim (excluding declaratory judgment actions,
251 | counter-claims, and cross-claims) alleging that a Contributor Version
252 | directly or indirectly infringes any patent, then the rights granted to
253 | You by any and all Contributors for the Covered Software under Section
254 | 2.1 of this License shall terminate.
255 |
256 | 5.3. In the event of termination under Sections 5.1 or 5.2 above, all
257 | end user license agreements (excluding distributors and resellers) which
258 | have been validly granted by You or Your distributors under this License
259 | prior to termination shall survive termination.
260 |
261 | ************************************************************************
262 | * *
263 | * 6. Disclaimer of Warranty *
264 | * ------------------------- *
265 | * *
266 | * Covered Software is provided under this License on an "as is" *
267 | * basis, without warranty of any kind, either expressed, implied, or *
268 | * statutory, including, without limitation, warranties that the *
269 | * Covered Software is free of defects, merchantable, fit for a *
270 | * particular purpose or non-infringing. The entire risk as to the *
271 | * quality and performance of the Covered Software is with You. *
272 | * Should any Covered Software prove defective in any respect, You *
273 | * (not any Contributor) assume the cost of any necessary servicing, *
274 | * repair, or correction. This disclaimer of warranty constitutes an *
275 | * essential part of this License. No use of any Covered Software is *
276 | * authorized under this License except under this disclaimer. *
277 | * *
278 | ************************************************************************
279 |
280 | ************************************************************************
281 | * *
282 | * 7. Limitation of Liability *
283 | * -------------------------- *
284 | * *
285 | * Under no circumstances and under no legal theory, whether tort *
286 | * (including negligence), contract, or otherwise, shall any *
287 | * Contributor, or anyone who distributes Covered Software as *
288 | * permitted above, be liable to You for any direct, indirect, *
289 | * special, incidental, or consequential damages of any character *
290 | * including, without limitation, damages for lost profits, loss of *
291 | * goodwill, work stoppage, computer failure or malfunction, or any *
292 | * and all other commercial damages or losses, even if such party *
293 | * shall have been informed of the possibility of such damages. This *
294 | * limitation of liability shall not apply to liability for death or *
295 | * personal injury resulting from such party's negligence to the *
296 | * extent applicable law prohibits such limitation. Some *
297 | * jurisdictions do not allow the exclusion or limitation of *
298 | * incidental or consequential damages, so this exclusion and *
299 | * limitation may not apply to You. *
300 | * *
301 | ************************************************************************
302 |
303 | 8. Litigation
304 | -------------
305 |
306 | Any litigation relating to this License may be brought only in the
307 | courts of a jurisdiction where the defendant maintains its principal
308 | place of business and such litigation shall be governed by laws of that
309 | jurisdiction, without reference to its conflict-of-law provisions.
310 | Nothing in this Section shall prevent a party's ability to bring
311 | cross-claims or counter-claims.
312 |
313 | 9. Miscellaneous
314 | ----------------
315 |
316 | This License represents the complete agreement concerning the subject
317 | matter hereof. If any provision of this License is held to be
318 | unenforceable, such provision shall be reformed only to the extent
319 | necessary to make it enforceable. Any law or regulation which provides
320 | that the language of a contract shall be construed against the drafter
321 | shall not be used to construe this License against a Contributor.
322 |
323 | 10. Versions of the License
324 | ---------------------------
325 |
326 | 10.1. New Versions
327 |
328 | Mozilla Foundation is the license steward. Except as provided in Section
329 | 10.3, no one other than the license steward has the right to modify or
330 | publish new versions of this License. Each version will be given a
331 | distinguishing version number.
332 |
333 | 10.2. Effect of New Versions
334 |
335 | You may distribute the Covered Software under the terms of the version
336 | of the License under which You originally received the Covered Software,
337 | or under the terms of any subsequent version published by the license
338 | steward.
339 |
340 | 10.3. Modified Versions
341 |
342 | If you create software not governed by this License, and you want to
343 | create a new license for such software, you may create and use a
344 | modified version of this License if you rename the license and remove
345 | any references to the name of the license steward (except to note that
346 | such modified license differs from this License).
347 |
348 | 10.4. Distributing Source Code Form that is Incompatible With Secondary
349 | Licenses
350 |
351 | If You choose to distribute Source Code Form that is Incompatible With
352 | Secondary Licenses under the terms of this version of the License, the
353 | notice described in Exhibit B of this License must be attached.
354 |
355 | Exhibit A - Source Code Form License Notice
356 | -------------------------------------------
357 |
358 | This Source Code Form is subject to the terms of the Mozilla Public
359 | License, v. 2.0. If a copy of the MPL was not distributed with this
360 | file, You can obtain one at https://mozilla.org/MPL/2.0/.
361 |
362 | If it is not possible or desirable to put the notice in a particular
363 | file, then You may include the notice in a location (such as a LICENSE
364 | file in a relevant directory) where a recipient would be likely to look
365 | for such a notice.
366 |
367 | You may add additional accurate notices of copyright ownership.
368 |
369 | Exhibit B - "Incompatible With Secondary Licenses" Notice
370 | ---------------------------------------------------------
371 |
372 | This Source Code Form is "Incompatible With Secondary Licenses", as
373 | defined by the Mozilla Public License, v. 2.0.
374 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Visualize ownership and lifetimes in Rust for debugging and optimization
10 |
11 |
12 |
13 |
14 |
15 |
16 | RustOwl visualizes ownership movement and lifetimes of variables.
17 | When 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.
18 |
19 | RustOwl visualizes those by using underlines:
20 |
21 | - 🟩 green: variable's actual lifetime
22 | - 🟦 blue: immutable borrowing
23 | - 🟪 purple: mutable borrowing
24 | - 🟧 orange: value moved / function call
25 | - 🟥 red: lifetime error
26 | - diff of lifetime between actual and expected, or
27 | - invalid overlapped lifetime of mutable and shared (immutable) references
28 |
29 | Detailed usage is described [here](docs/usage.md).
30 |
31 | Currently, we offer VSCode extension, Neovim plugin and Emacs package.
32 | For 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.
33 | We implemented LSP server with an extended protocol.
34 | So, RustOwl can be used easily from other editor.
35 |
36 | ## Support
37 |
38 | If 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!
39 |
40 | ## Quick Start
41 |
42 | Here we describe how to start using RustOwl with VS Code.
43 |
44 | ### Prerequisite
45 |
46 | - `cargo` installed
47 | - You can install `cargo` using `rustup` from [this link](https://rustup.rs/).
48 | - Visual Studio Code (VS Code) installed
49 |
50 | We tested this guide on macOS Sequoia 15.3.2 on arm64 architecture with VS Code 1.99.3 and `cargo` 1.87.0.
51 |
52 | ### VS Code
53 |
54 | You can install VS Code extension from [this link](https://marketplace.visualstudio.com/items?itemName=cordx56.rustowl-vscode).
55 | RustOwl will be installed automatically when the extension is activated.
56 |
57 | After installation, the extension will automatically run RustOwl when you save any Rust program in cargo workspace.
58 | The initial analysis may take some time, but from the second run onward, compile caching is used to reduce the analysis time.
59 |
60 | ## Other editor support
61 |
62 | We support Neovim and Emacs.
63 | You have to [install RustOwl](docs/installation.md) before using RustOwl with other editors.
64 |
65 | You can also create your own LSP client.
66 | If you would like to implement a client, please refer to the [The RustOwl LSP specification](docs/lsp-spec.md).
67 |
68 | ### Neovim
69 |
70 | Minimal setup with [lazy.nvim](https://github.com/folke/lazy.nvim):
71 |
72 | ```lua
73 | {
74 | 'cordx56/rustowl',
75 | version = '*', -- Latest stable version
76 | build = 'cargo binstall rustowl',
77 | lazy = false, -- This plugin is already lazy
78 | opts = {},
79 | }
80 | ```
81 |
82 |
83 | Recommended configuration: Click to expand
84 |
85 | ```lua
86 | {
87 | 'cordx56/rustowl',
88 | version = '*', -- Latest stable version
89 | build = 'cargo binstall rustowl',
90 | lazy = false, -- This plugin is already lazy
91 | opts = {
92 | client = {
93 | on_attach = function(_, buffer)
94 | vim.keymap.set('n', 'o', function()
95 | require('rustowl').toggle(buffer)
96 | end, { buffer = buffer, desc = 'Toggle RustOwl' })
97 | end
98 | },
99 | },
100 | }
101 | ```
102 |
103 |
104 |
105 | Default options:
106 |
107 | ```lua
108 | {
109 | auto_attach = true, -- Auto attach the RustOwl LSP client when opening a Rust file
110 | auto_enable = false, -- Enable RustOwl immediately when attaching the LSP client
111 | idle_time = 500, -- Time in milliseconds to hover with the cursor before triggering RustOwl
112 | client = {}, -- LSP client configuration that gets passed to `vim.lsp.start`
113 | highlight_style = 'undercurl', -- You can also use 'underline'
114 | }
115 | ```
116 |
117 | When opening a Rust file, the Neovim plugin creates the `Rustowl` user command:
118 |
119 | ```vim
120 | :Rustowl {subcommand}
121 | ```
122 |
123 | where `{subcommand}` can be one of:
124 |
125 | - `start_client`: Start the rustowl LSP client.
126 | - `stop_client`: Stop the rustowl LSP client.
127 | - `restart_client`: Restart the rustowl LSP client.
128 | - `enable`: Enable rustowl highlights.
129 | - `disable`: Disable rustowl highlights.
130 | - `toggle`: Toggle rustowl highlights.
131 |
132 |
133 | ### Emacs
134 |
135 | Elpaca example:
136 |
137 | ```elisp
138 | (elpaca
139 | (rustowlsp
140 | :host github
141 | :repo "cordx56/rustowl"))
142 | ```
143 |
144 | You have to install RustOwl LSP server manually.
145 |
146 | ### RustRover / IntelliJ IDEs
147 |
148 | There is a [third-party repository](https://github.com/siketyan/intellij-rustowl) that supports IntelliJ IDEs.
149 | You have to install RustOwl LSP server manually.
150 |
151 | ## Architecture / OS / package repositories
152 |
153 | ### Archlinux
154 |
155 | We have an AUR package. Run:
156 |
157 | ```sh
158 | yay -S rustowl-bin
159 | ```
160 |
161 | Replace `yay` with your AUR helper of choice.
162 |
163 | We also have a git version, that builds from source:
164 |
165 | ```sh
166 | yay -S rustowl-git
167 | ```
168 |
169 | ### Nix flake
170 |
171 | There is a [third-party Nix flake repository](https://github.com/nix-community/rustowl-flake) in the Nix community.
172 |
173 | ## Build manually
174 |
175 | Here, we describe manual install instructions from source code.
176 |
177 | ### RustOwl
178 |
179 | #### Prerequisite
180 |
181 | - `rustup` installed
182 | - You can install `rustup` from [this link](https://rustup.rs/).
183 | - You need to set up the `PATH` environment variable. To do this, follow the instructions provided by the `rustup` installer.
184 |
185 | Building RustOwl requires nightly build of `rustc`. It will automatically installed by `rustup`.
186 |
187 | RustOwl has been tested on macOS Sequoia 15.3.2 on arm64 architecture with `rustup` 1.28.1.
188 | We have not tested the installation of dependencies from other package repositories, such as Homebrew.
189 | You may need to uninstall any Rust-related packages installed through those repositories first.
190 | Other dependencies are locked in the configuration files and will be installed automatically.
191 |
192 | We have also tested this on Ubuntu 24.04.2 on amd64 architecture and on Windows 11 Education 23H2 on amd64 architecture.
193 | Additional dependencies may be required.
194 | We have confirmed that running `apt install build-essential` is necessary on a freshly installed Ubuntu for linking.
195 |
196 | #### Build & Run
197 |
198 | ```bash
199 | cargo install --path . --locked
200 | ```
201 |
202 | You can add runtime directory paths to the search paths by specifying `RUSTOWL_RUNTIME_DIRS` or `RUSTOWL_SYSROOTS`.
203 |
204 | ### VSCode extension
205 |
206 | #### Prerequisite
207 |
208 | - VS Code installed
209 | - You can install VS Code from [this link](https://code.visualstudio.com/).
210 | - Node.js installed
211 | - `yarn` installed
212 | - After installing Node.js, You can install `yarn` by running `npm install -g yarn`.
213 |
214 | VS 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.
215 | Other dependencies are locked in the configuration files and will be installed automatically.
216 |
217 | #### Build & Run
218 |
219 | First, install the dependencies.
220 |
221 | ```bash
222 | cd vscode
223 | yarn install --frozen-lockfile
224 | ```
225 |
226 | Then open `vscode` directory in VS Code.
227 |
228 | A notification to install the recommended VS Code extension will appear in the bottom right corner of VS Code.
229 | Click the install button, wait for the installation to finish, and then restart VS Code.
230 |
231 | Open `vscode` directory again, and press the `F5` key in the VS Code window.
232 | A new VS Code window with the extension enabled will appear.
233 |
234 | Open cargo workspace directory in the new VS Code window.
235 |
236 | When you save Rust files, decoration indicating the movement of ownership and lifetimes will appear in the editor.
237 |
238 |
239 | ## Note
240 |
241 | In 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.
242 | Additionally, we observed that the `println!` macro sometimes produces extra output, though this does not affect usability in any significant way.
243 |
--------------------------------------------------------------------------------
/aur/PKGBUILD:
--------------------------------------------------------------------------------
1 | # Maintainer: MuntasirSZN
2 | # Maintainer: cordx56
3 |
4 | pkgname=rustowl-bin
5 | pkgver=0.3.4
6 | pkgrel=1
7 | pkgdesc='Visualize Ownership and Lifetimes in Rust'
8 | url='https://github.com/cordx56/rustowl'
9 | license=('MPL-2.0')
10 | makedepends=('rustup' 'zig=0.13.0')
11 | depends=()
12 | conflicts=('rustowl-git')
13 | arch=('any')
14 | source=("https://github.com/cordx56/rustowl/archive/refs/tags/v${pkgver}.tar.gz")
15 | sha256sums=('fa120643aeb48061eb32a7c993dabff88aa4e9d0b32f8ab0f3289b3fb2cf5744')
16 |
17 | prepare() {
18 | cd rustowl-${pkgver}
19 | export RUSTC_BOOTSTRAP=1
20 | export RUSTUP_TOOLCHAIN=1.87.0
21 | rustup component add rust-src rustc-dev llvm-tools
22 | cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
23 | cargo install --locked cargo-zigbuild
24 | }
25 |
26 | build() {
27 | cd rustowl-${pkgver}
28 | export CARGO_TARGET_DIR=target
29 | export RUSTC_BOOTSTRAP=1
30 | export RUSTUP_TOOLCHAIN=1.87.0
31 | export RUSTOWL_RUNTIME_DIRS=/opt/rustowl
32 | cargo zigbuild --frozen --release --all-features --target $(rustc --print=host-tuple).2.17
33 | }
34 |
35 | check() {
36 | cd rustowl-${pkgver}
37 | export RUSTC_BOOTSTRAP=1
38 | export RUSTUP_TOOLCHAIN=1.87.0
39 | cargo test --frozen --all-features
40 | }
41 |
42 | package() {
43 | cd rustowl-${pkgver}
44 | find target -type d | grep -E 'rustowl-build-time-out$' | xargs -I % cp -r % ./
45 | mkdir sysroot
46 | ACTIVE_TOOLCHAIN="$(rustup show active-toolchain | awk '{ print $1 }')"
47 | cp -r "$(rustc --print=sysroot)" sysroot/$ACTIVE_TOOLCHAIN
48 | find sysroot -type f | grep -v -E '\.(rlib|so|dylib|dll)$' | xargs rm -rf
49 | find sysroot -depth -type d -empty -exec rm -rf {} \;
50 | install -d -m 755 "$pkgdir/opt/rustowl"
51 | cp -a sysroot/ "$pkgdir/opt/rustowl/"
52 | install -Dm0755 -t "$pkgdir/usr/bin/" "target/$(rustc --print=host-tuple)/release/rustowl"
53 | install -Dm0755 -t "$pkgdir/usr/bin/" "target/$(rustc --print=host-tuple)/release/rustowlc"
54 | install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/rustowl/LICENSE"
55 | install -Dm644 rustowl-build-time-out/man/rustowl.1 "$pkgdir/usr/share/man/man1/rustowl.1"
56 | install -Dm644 "rustowl-build-time-out/completions/rustowl.bash" "${pkgdir}/usr/share/bash-completion/completions/rustowl"
57 | install -Dm644 "rustowl-build-time-out/completions/_rustowl" "${pkgdir}/usr/share/zsh/site-functions/_rustowl"
58 | install -Dm644 "rustowl-build-time-out/completions/rustowl.fish" "${pkgdir}/usr/share/fish/vendor_completions.d/rustowl.fish"
59 | install -Dm644 "rustowl-build-time-out/completions/rustowl.elv" "${pkgdir}/usr/share/elvish/completions/rustowl.elv"
60 | install -Dm644 "rustowl-build-time-out/completions/_rustowl.ps1" "${pkgdir}/usr/share/powershell/Modules/Rustowl/_rustowl.ps1"
61 | }
62 |
63 |
--------------------------------------------------------------------------------
/aur/PKGBUILD-GIT:
--------------------------------------------------------------------------------
1 | # Maintainer: MuntasirSZN
2 | # Maintainer: cordx56
3 |
4 | pkgname=rustowl-git
5 | pkgver=r1.0
6 | pkgrel=1
7 | pkgdesc='Visualize Ownership and Lifetimes in Rust'
8 | url='https://github.com/cordx56/rustowl'
9 | license=('MPL-2.0')
10 | makedepends=('git' 'rustup' 'zig=0.13.0')
11 | arch=('any')
12 | source=("git+https://github.com/cordx56/rustowl.git")
13 | sha256sums=('SKIP')
14 | conflicts=('rustowl-bin')
15 |
16 | pkgver() {
17 | cd "$srcdir/rustowl"
18 | printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
19 | }
20 |
21 | prepare() {
22 | cd "$srcdir/rustowl"
23 | export RUSTC_BOOTSTRAP=1
24 | export RUSTUP_TOOLCHAIN=1.87.0
25 | rustup component add rust-src rustc-dev llvm-tools
26 | cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
27 | cargo install --locked cargo-zigbuild
28 | }
29 |
30 | build() {
31 | cd "$srcdir/rustowl"
32 | export CARGO_TARGET_DIR=target
33 | export RUSTC_BOOTSTRAP=1
34 | export RUSTUP_TOOLCHAIN=1.87.0
35 | export RUSTOWL_RUNTIME_DIRS=/opt/rustowl
36 | cargo zigbuild --frozen --release --all-features --target $(rustc --print=host-tuple).2.17
37 | }
38 |
39 | check() {
40 | cd "$srcdir/rustowl"
41 | export RUSTC_BOOTSTRAP=1
42 | export RUSTUP_TOOLCHAIN=1.87.0
43 | cargo test --frozen --all-features
44 | }
45 |
46 | package() {
47 | cd "$srcdir/rustowl"
48 | find target -type d | grep -E 'rustowl-build-time-out$' | xargs -I % cp -r % ./
49 | mkdir sysroot
50 | ACTIVE_TOOLCHAIN="$(rustup show active-toolchain | awk '{ print $1 }')"
51 | cp -r "$(rustc --print=sysroot)" sysroot/$ACTIVE_TOOLCHAIN
52 | find sysroot -type f | grep -v -E '\.(rlib|so|dylib|dll)$' | xargs rm -rf
53 | find sysroot -depth -type d -empty -exec rm -rf {} \;
54 | install -d -m 755 "$pkgdir/opt/rustowl"
55 | cp -a sysroot/ "$pkgdir/opt/rustowl/"
56 | install -Dm0755 -t "$pkgdir/usr/bin/" "target/$(rustc --print=host-tuple)/release/rustowl"
57 | install -Dm0755 -t "$pkgdir/usr/bin/" "target/$(rustc --print=host-tuple)/release/rustowlc"
58 | install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/rustowl/LICENSE"
59 | install -Dm644 rustowl-build-time-out/man/rustowl.1 "$pkgdir/usr/share/man/man1/rustowl.1"
60 | install -Dm644 "rustowl-build-time-out/completions/rustowl.bash" "${pkgdir}/usr/share/bash-completion/completions/rustowl"
61 | install -Dm644 "rustowl-build-time-out/completions/_rustowl" "${pkgdir}/usr/share/zsh/site-functions/_rustowl"
62 | install -Dm644 "rustowl-build-time-out/completions/rustowl.fish" "${pkgdir}/usr/share/fish/vendor_completions.d/rustowl.fish"
63 | install -Dm644 "rustowl-build-time-out/completions/rustowl.elv" "${pkgdir}/usr/share/elvish/completions/rustowl.elv"
64 | install -Dm644 "rustowl-build-time-out/completions/_rustowl.ps1" "${pkgdir}/usr/share/powershell/Modules/Rustowl/_rustowl.ps1"
65 | }
66 |
--------------------------------------------------------------------------------
/build.rs:
--------------------------------------------------------------------------------
1 | use clap::CommandFactory;
2 | use clap_complete::generate_to;
3 | use std::env;
4 | use std::fs;
5 | use std::io::Error;
6 | use std::process::Command;
7 |
8 | include!("src/cli.rs");
9 | include!("src/shells.rs");
10 |
11 | fn main() -> Result<(), Error> {
12 | println!("cargo::rustc-env=RUSTOWL_TOOLCHAIN={}", get_toolchain());
13 |
14 | #[cfg(not(windows))]
15 | let tarball_name = format!("rustowl-{}.tar.gz", get_host_tuple().unwrap());
16 |
17 | #[cfg(windows)]
18 | let tarball_name = format!("rustowl-{}.zip", get_host_tuple().unwrap());
19 |
20 | println!("cargo::rustc-env=RUSTOWL_ARCHIVE_NAME={tarball_name}");
21 |
22 | let sysroot = get_sysroot().unwrap();
23 | set_rustc_driver_path(&sysroot);
24 |
25 | let out_dir = Path::new(&env::var("OUT_DIR").expect("OUT_DIR unset. Expected path."))
26 | .join("rustowl-build-time-out");
27 | let mut cmd = Cli::command();
28 | let completion_out_dir = out_dir.join("completions");
29 | fs::create_dir_all(&completion_out_dir)?;
30 |
31 | for shell in Shell::value_variants() {
32 | generate_to(*shell, &mut cmd, "rustowl", &completion_out_dir)?;
33 | }
34 | let man_out_dir = out_dir.join("man");
35 | fs::create_dir_all(&man_out_dir)?;
36 | let man = clap_mangen::Man::new(cmd);
37 | let mut buffer: Vec = Default::default();
38 | man.render(&mut buffer)?;
39 |
40 | std::fs::write(man_out_dir.join("rustowl.1"), buffer)?;
41 |
42 | Ok(())
43 | }
44 |
45 | // get toolchain
46 | fn get_toolchain() -> String {
47 | env::var("RUSTUP_TOOLCHAIN").expect("RUSTUP_TOOLCHAIN unset. Expected version.")
48 | }
49 | fn get_host_tuple() -> Option {
50 | match Command::new(env::var("RUSTC").unwrap_or("rustc".to_string()))
51 | .arg("--print=host-tuple")
52 | .output()
53 | {
54 | Ok(v) => Some(String::from_utf8(v.stdout).unwrap().trim().to_string()),
55 | Err(_) => None,
56 | }
57 | }
58 | // output rustc_driver path
59 | fn get_sysroot() -> Option {
60 | match Command::new(env::var("RUSTC").expect("RUSTC unset. Expected rustc path."))
61 | .arg("--print=sysroot")
62 | .output()
63 | {
64 | Ok(v) => Some(String::from_utf8(v.stdout).unwrap().trim().to_string()),
65 | Err(_) => None,
66 | }
67 | }
68 | use std::fs::read_dir;
69 | use std::path::PathBuf;
70 | fn recursive_read_dir(path: impl AsRef) -> Vec {
71 | let mut paths = Vec::new();
72 | for entry in read_dir(path).unwrap() {
73 | let entry = entry.unwrap();
74 | let path = entry.path();
75 | if path.is_dir() {
76 | paths.extend_from_slice(&recursive_read_dir(&path));
77 | } else {
78 | paths.push(path);
79 | }
80 | }
81 | paths
82 | }
83 | fn set_rustc_driver_path(sysroot: &str) {
84 | for file in recursive_read_dir(sysroot) {
85 | if let Some(ext) = file.extension().and_then(|e| e.to_str()) {
86 | if matches!(ext, "rlib" | "so" | "dylib" | "dll") {
87 | let rel_path = file.strip_prefix(sysroot).unwrap();
88 | let file_name = rel_path.file_name().unwrap().to_string_lossy();
89 | if file_name.contains("rustc_driver-") {
90 | println!("cargo::rustc-env=RUSTC_DRIVER_NAME={file_name}");
91 | }
92 | }
93 | }
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/docs/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | We as members, contributors, and leaders pledge to make participation in our
6 | community a harassment-free experience for everyone, regardless of age, body
7 | size, visible or invisible disability, ethnicity, sex characteristics, gender
8 | identity and expression, level of experience, education, socio-economic status,
9 | nationality, personal appearance, race, caste, color, religion, or sexual
10 | identity and orientation.
11 |
12 | We pledge to act and interact in ways that contribute to an open, welcoming,
13 | diverse, inclusive, and healthy community.
14 |
15 | ## Our Standards
16 |
17 | Examples of behavior that contributes to a positive environment for our
18 | community include:
19 |
20 | - Demonstrating empathy and kindness toward other people
21 | - Being respectful of differing opinions, viewpoints, and experiences
22 | - Giving and gracefully accepting constructive feedback
23 | - Accepting responsibility and apologizing to those affected by our mistakes,
24 | and learning from the experience
25 | - Focusing on what is best not just for us as individuals, but for the overall
26 | community
27 |
28 | Examples of unacceptable behavior include:
29 |
30 | - The use of sexualized language or imagery, and sexual attention or advances of
31 | any kind
32 | - Trolling, insulting or derogatory comments, and personal or political attacks
33 | - Public or private harassment
34 | - Publishing others' private information, such as a physical or email address,
35 | without their explicit permission
36 | - Other conduct which could reasonably be considered inappropriate in a
37 | professional setting
38 |
39 | ## Enforcement Responsibilities
40 |
41 | Community leaders are responsible for clarifying and enforcing our standards of
42 | acceptable behavior and will take appropriate and fair corrective action in
43 | response to any behavior that they deem inappropriate, threatening, offensive,
44 | or harmful.
45 |
46 | Community leaders have the right and responsibility to remove, edit, or reject
47 | comments, commits, code, wiki edits, issues, and other contributions that are
48 | not aligned to this Code of Conduct, and will communicate reasons for moderation
49 | decisions when appropriate.
50 |
51 | ## Scope
52 |
53 | This Code of Conduct applies within all community spaces, and also applies when
54 | an individual is officially representing the community in public spaces.
55 | Examples of representing our community include using an official email address,
56 | posting via an official social media account, or acting as an appointed
57 | representative at an online or offline event.
58 |
59 | ## Enforcement
60 |
61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
62 | reported to the community leaders responsible for enforcement at
63 | [cordx56@cordx.cx](mailto:cordx56@cordx.cx).
64 | All complaints will be reviewed and investigated promptly and fairly.
65 |
66 | All community leaders are obligated to respect the privacy and security of the
67 | reporter of any incident.
68 |
69 | ## Enforcement Guidelines
70 |
71 | Community leaders will follow these Community Impact Guidelines in determining
72 | the consequences for any action they deem in violation of this Code of Conduct:
73 |
74 | ### 1. Correction
75 |
76 | **Community Impact**: Use of inappropriate language or other behavior deemed
77 | unprofessional or unwelcome in the community.
78 |
79 | **Consequence**: A private, written warning from community leaders, providing
80 | clarity around the nature of the violation and an explanation of why the
81 | behavior was inappropriate. A public apology may be requested.
82 |
83 | ### 2. Warning
84 |
85 | **Community Impact**: A violation through a single incident or series of
86 | actions.
87 |
88 | **Consequence**: A warning with consequences for continued behavior. No
89 | interaction with the people involved, including unsolicited interaction with
90 | those enforcing the Code of Conduct, for a specified period of time. This
91 | includes avoiding interactions in community spaces as well as external channels
92 | like social media. Violating these terms may lead to a temporary or permanent
93 | ban.
94 |
95 | ### 3. Temporary Ban
96 |
97 | **Community Impact**: A serious violation of community standards, including
98 | sustained inappropriate behavior.
99 |
100 | **Consequence**: A temporary ban from any sort of interaction or public
101 | communication with the community for a specified period of time. No public or
102 | private interaction with the people involved, including unsolicited interaction
103 | with those enforcing the Code of Conduct, is allowed during this period.
104 | Violating these terms may lead to a permanent ban.
105 |
106 | ### 4. Permanent Ban
107 |
108 | **Community Impact**: Demonstrating a pattern of violation of community
109 | standards, including sustained inappropriate behavior, harassment of an
110 | individual, or aggression toward or disparagement of classes of individuals.
111 |
112 | **Consequence**: A permanent ban from any sort of public interaction within the
113 | community.
114 |
115 | ## Attribution
116 |
117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118 | version 2.1, available at
119 | [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120 |
121 | Community Impact Guidelines were inspired by
122 | [Mozilla's code of conduct enforcement ladder][mozilla coc].
123 |
124 | For answers to common questions about this code of conduct, see the FAQ at
125 | [https://www.contributor-covenant.org/faq][faq]. Translations are available at
126 | [https://www.contributor-covenant.org/translations][translations].
127 |
128 | [faq]: https://www.contributor-covenant.org/faq
129 | [homepage]: https://www.contributor-covenant.org
130 | [mozilla coc]: https://github.com/mozilla/diversity
131 | [translations]: https://www.contributor-covenant.org/translations
132 | [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
133 |
134 |
--------------------------------------------------------------------------------
/docs/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contribution guide
2 |
3 | _This document is under construction_.
4 |
5 | Thank you for considering to contribute RustOwl!
6 |
7 | In this document we describe how to contribute our project, as follows:
8 |
9 | - How to setup development environment
10 | - Checklist before submitting PR
11 |
12 | ## Set up your environment
13 |
14 | Here we describe how to set up your development environment.
15 |
16 | ### Rust code
17 |
18 | In the Rust code, we utilize nightly compiler features, which require some tweaks.
19 | Before starting this section, you might be required to install `rustup` since our project requires nightly compiler.
20 |
21 | #### Build and test using the nightly environment
22 |
23 | For building, testing, or installing, you can do the same as any common Rust project using the `cargo` command.
24 | Here, `cargo` must be a `rustup`-proxied command, which is usually installed with `rustup`.
25 |
26 | #### Build with stable Rust compiler
27 |
28 | To distribute release binary, we use stable Rust compiler to ship RustOwl with stable Rust compiler for users.
29 |
30 | The executable binary named `rustowlc`, which is one of the components of RustOwl, behaves like a Rust compiler.
31 | So we would like to compile `rustowlc`, which uses nightly features, with the stable Rust compiler.
32 |
33 | Note: Using this method is strongly discouraged officially. See [Unstable Book](doc.rust-lang.org/nightly/unstable-book/compiler-flags/rustc-bootstrap.html).
34 |
35 | To compile `rustowlc` with stable compiler, you should set environment variable as `RUSTC_BOOTSTRAP=1`.
36 |
37 | For example building with stable 1.87.0 Rust compiler:
38 |
39 | ```bash
40 | RUSTC_BOOTSTRAP=1 rustup run 1.87.0 cargo build --release
41 | ```
42 |
43 | Note that by using normal `cargo` command RustOwl will be built with nightly compiler since there is a `rust-toolchain.toml` which specifies nightly compiler for development environment.
44 |
45 | ### VS Code extension
46 |
47 | For VS Code extension, we use `yarn` to setup environment.
48 | To get started, you have to install dependencies by running following command inside `vscode` directory:
49 |
50 | ```bash
51 | yarn install
52 | ```
53 |
54 | ## Before submitting PR
55 |
56 | Before submitting PR, you have to check below:
57 |
58 | ### Rust code
59 |
60 | - Correctly formatted by `cargo fmt`
61 | - Linted using Clippy by `cargo clippy`
62 |
63 | ### VS Code extension
64 |
65 | - Correctly formatted by `yarn fmt`
66 |
--------------------------------------------------------------------------------
/docs/SECURITY.md:
--------------------------------------------------------------------------------
1 | # Security Reporting
2 |
3 | If you wish to report a security vulnerability but not in a public issue -- thank you! -- we ask that you follow the following process.
4 |
5 | Please report security vulnerabilities by filling out the following template:
6 |
7 | - PUBLIC: Please let us know if this vulnerability has been made or discussed publicly already, and if so, please let us know where.
8 | - DESCRIPTION: Please provide precise description of the security vulnerability you have found with as much information as you are able and willing to provide.
9 |
10 | Please send the above info, along with any other information you feel is pertinent to: .
11 |
12 | In addition, you may request that the project provide you a patched release in advance of the release announcement, however, we can not guarantee that such information will be provided to you in advance of the public release and announcement.
13 |
14 | However, I will email you at the same time the public announcement is made.
15 | We will let you know within a few weeks whether or not your report has been accepted or rejected.
16 | We ask that you please keep the report confidential until we have made a public announcement.
17 |
18 |
--------------------------------------------------------------------------------
/docs/assets/readme-screenshot-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cordx56/rustowl/78ccb89b94a431cf76fd998f1811442553738916/docs/assets/readme-screenshot-2.png
--------------------------------------------------------------------------------
/docs/assets/readme-screenshot-3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cordx56/rustowl/78ccb89b94a431cf76fd998f1811442553738916/docs/assets/readme-screenshot-3.png
--------------------------------------------------------------------------------
/docs/assets/readme-screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cordx56/rustowl/78ccb89b94a431cf76fd998f1811442553738916/docs/assets/readme-screenshot.png
--------------------------------------------------------------------------------
/docs/assets/rustowl-logo-dark.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/docs/assets/rustowl-logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/docs/assets/vs-code-cursor-on-unwrap-visualized.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cordx56/rustowl/78ccb89b94a431cf76fd998f1811442553738916/docs/assets/vs-code-cursor-on-unwrap-visualized.png
--------------------------------------------------------------------------------
/docs/assets/vs-code-cursor-on-unwrap.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cordx56/rustowl/78ccb89b94a431cf76fd998f1811442553738916/docs/assets/vs-code-cursor-on-unwrap.png
--------------------------------------------------------------------------------
/docs/assets/vs-code-progress.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cordx56/rustowl/78ccb89b94a431cf76fd998f1811442553738916/docs/assets/vs-code-progress.png
--------------------------------------------------------------------------------
/docs/installation.md:
--------------------------------------------------------------------------------
1 | # Installation
2 |
3 | Here we describe how to install RustOwl command line tools.
4 |
5 | ## Using [cargo-binstall](https://github.com/cargo-bins/cargo-binstall)
6 |
7 | One of the easiest way to install RustOwl is using cargo-binstall.
8 |
9 | ```bash
10 | cargo binstall rustowl
11 | ```
12 |
13 | Toolchain is automatically Downloaded and unpacked.
14 |
15 | ## Donwload binary from release page
16 |
17 | Download only `rustowl` executable from [release page](https://github.com/cordx56/rustowl/releases/latest) and place it into the place you desire.
18 | Toolchain is automatically Downloaded and unpacked.
19 |
20 | ## Build from source
21 |
22 | Installing from source requires some tweaks and not recommended.
23 | There are bugs in executing the binary which is installed from source code.
24 |
--------------------------------------------------------------------------------
/docs/lsp-spec.md:
--------------------------------------------------------------------------------
1 | # The RustOwl LSP specification
2 |
3 | `rustowl`, is an LSP server which provides RustOwl information.
4 | To display various types of decorations, RustOwl supports some custom methods from the client.
5 |
6 | Here, we describe the specifications of those custom methods.
7 |
8 | ## Types
9 |
10 | Here, we describe the types we will use in this document.
11 |
12 | ### `OprType`
13 |
14 | ```typescript
15 | "lifetime" | "imm_borrow" | "mut_borrow" | "move" | "call" | "outlive" | "shared_mut"
16 | ```
17 |
18 | ### `Decoration`
19 |
20 |
27 |
28 | `overlapped` field indicates that the decoration is overlapped and should be hidden.
29 |
30 | ## Methods
31 |
32 | We describe the custom methods used in RustOwl.
33 |
34 | ### `rustowl/cursor`
35 |
36 | #### Request payload
37 |
38 |