mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-29 06:23:25 +00:00
e87e1bc33d
While VSCode [uses it's own implementation for URIs](https://github.com/microsoft/vscode-uri) which notably doesn't have any limits of URI size, the renderer itself relies on Web platform engine, that limits the length of the URLs and bails out when the attribute length of an `href` inside `a` tag is too long. Command URIs have a form of `command:command-name?arguments`, where `arguments` is a percent-encoded array of data we want to pass along to the command function. For "Show References" this is a list of all file URIs with locations of every reference, and it can get quite long. This PR introduces another intermediary `linkToCommand` command. When we render a command link, a reference to a command with all its arguments is stored in a map, and instead a `linkToCommand` link is rendered with the key to that map. For now the map is cleaned up periodically (I've set it to every 10 minutes). In general case we'll probably need to introduce TTLs or flags to denote ephemeral links (like these in hover popups) and persistent links and clean those separately. But for now simply keeping the last few links in the map should be good enough. Likewise, we could add code to remove a target command from the map after the link is clicked, but assuming most links in hover sheets won't be clicked anyway this code won't change the overall memory use much. Closes #9926 |
||
---|---|---|
.. | ||
src | ||
tests | ||
.eslintignore | ||
.eslintrc.js | ||
.gitignore | ||
.prettierignore | ||
.prettierrc.js | ||
.vscodeignore | ||
icon.png | ||
language-configuration.json | ||
LICENSE | ||
package-lock.json | ||
package.json | ||
ra_syntax_tree.tmGrammar.json | ||
README.md | ||
tsconfig.eslint.json | ||
tsconfig.json |
rust-analyzer
This extension provides support for the Rust programming language.
It is recommended over and replaces rust-lang.rust
.
Features
- code completion with imports insertion
- go to definition, implementation, type definition
- find all references, workspace symbol search, symbol renaming
- types and documentation on hover
- inlay hints for types and parameter names
- semantic syntax highlighting
- a lot of assists (code actions)
- apply suggestions from errors
- ... and many more, check out the manual to see them all
Quick start
- Install rustup.
- Install the rust-analyzer extension.
Configuration
This extension provides configurations through VSCode's configuration settings. All configurations are under rust-analyzer.*
.
See the manual for more information on VSCode specific configurations.
Communication
For usage and troubleshooting requests, please use the "IDEs and Editors" category of the Rust forum.
Documentation
See rust-analyzer.github.io for more information.