Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit 3efe567

Browse files
committed
Enhanced hover tooltips
Hover tooltips now extract documentation and declarations from source based on the the file and span information that comes out of the save-analysis. If the save-analysis data is missing (i.e. there is no `Def` available), racer is used as fallback and the `Def` is sythesized from the racer `Match` if one is found. Function and object declarations are formatted using rustfmt and context for local variables is also included in the tooltips. All documentation that is discovered is now post-processed in order to clean up code blocks so that syntax coloring works in in editors that support markdown. The racer fallback can be disabled via the `racer_completion` configuration flag.
1 parent a528e2f commit 3efe567

File tree

90 files changed

+3594
-29
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+3594
-29
lines changed

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,13 @@ os:
1111
- osx
1212
rust:
1313
- nightly
14-
install:
14+
install: |
1515
# Required for Racer autoconfiguration
1616
rustup component add rust-src
17+
rustup component add rust-analysis
1718
script: |
1819
#!/bin/bash
1920
set -e
20-
2121
cargo build -v
2222
cargo test -v
23-
2423
set +e

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ Currently we accept the following options:
114114
* `no_default_features` (`bool`, defaults to `false`) disables default Cargo
115115
features
116116
* `racer_completion` (`bool`, defaults to `true`) enables code completion using
117-
racer (which is, at the moment, our only code completion backend)
117+
racer (which is, at the moment, our only code completion backend). Also enables
118+
hover tooltips to fall back to racer when save-analysis data is unavailable.
118119
* `clippy_preference` (`String`, defaults to `"opt-in"`) controls eagerness of clippy
119120
diagnostics when available. Valid values are _(case-insensitive)_:
120121
- `"off"` Disable clippy lints.
@@ -131,6 +132,14 @@ and the following unstable options:
131132
* `cfg_test` (`bool`, defaults to `false`) checks the project as if you were
132133
running `cargo test` rather than `cargo build`. I.e., compiles (but does not
133134
run) test code.
135+
* `full_docs` (`bool`, defaults to `false`) instructs rustc to populate the
136+
save-analysis data with full source documentation. When set to `false`, only the
137+
first paragraph is recorded. This option _currently_ has little to no effect on
138+
hover tooltips. The save-analysis docs are only used if source extraction fails.
139+
This option has no effect on the standard library.
140+
* `show_hover_context` show additional context in hover tooltips when available.
141+
This is often the local variable declaration. When set to false the content is
142+
only availabe when holding the `ctrl` key in some editors.
134143

135144

136145
## Troubleshooting

appveyor.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ install:
2222
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
2323
# Required for Racer autoconfiguration
2424
- rustup component add rust-src
25+
- rustup component add rust-analysis
2526
# Print version info
2627
- rustc -Vv
2728
- cargo -V

0 commit comments

Comments
 (0)