Skip to content

Hover: Show documentation #196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 7, 2018
Merged

Hover: Show documentation #196

merged 4 commits into from
Nov 7, 2018

Conversation

kjeremy
Copy link
Contributor

@kjeremy kjeremy commented Nov 5, 2018

Closes #186

impl FileSymbol {
pub fn docs(&self, file: &File) -> Option<String> {
file.syntax().descendants()
.filter(|node| node.kind() == self.kind && node.range() == self.node_range)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels like we probably should move FileSymbols to ra_analysis, and use SyntaxPtr

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like a good idea. I can tackle that in a separate PR.

@matklad
Copy link
Member

matklad commented Nov 6, 2018

LGTM

@kjeremy
Copy link
Contributor Author

kjeremy commented Nov 7, 2018

@matklad is this good to go?

@matklad
Copy link
Member

matklad commented Nov 7, 2018

Ci's failing, otherwise LGTM!

@kjeremy
Copy link
Contributor Author

kjeremy commented Nov 7, 2018

It looks like it failed on the format check so I rebased and ran cargo fmt.

@matklad
Copy link
Member

matklad commented Nov 7, 2018

check so I rebased and ran cargo fmt.

The right command is cargo format: it'll run our own wrapper of rustfmt, wihc pins a specific version.

@matklad
Copy link
Member

matklad commented Nov 7, 2018

bors r+

Thanks!

bors bot added a commit that referenced this pull request Nov 7, 2018
196: Hover: Show documentation r=matklad a=kjeremy

Closes #186 

Co-authored-by: Jeremy A. Kolb <[email protected]>
@bors
Copy link
Contributor

bors bot commented Nov 7, 2018

Build failed

@matklad
Copy link
Member

matklad commented Nov 7, 2018

bors retry

bors bot added a commit that referenced this pull request Nov 7, 2018
196: Hover: Show documentation r=matklad a=kjeremy

Closes #186 

Co-authored-by: Jeremy A. Kolb <[email protected]>
@matklad
Copy link
Member

matklad commented Nov 7, 2018

bors r+

@bors
Copy link
Contributor

bors bot commented Nov 7, 2018

Not awaiting review

@matklad
Copy link
Member

matklad commented Nov 7, 2018

bors or travis are having a bad day it seems, merging manually.

@matklad matklad merged commit c29f158 into rust-lang:master Nov 7, 2018
@kjeremy kjeremy deleted the hover branch November 7, 2018 15:45
@bors
Copy link
Contributor

bors bot commented Nov 7, 2018

Timed out

meliache added a commit to meliache/rust-analyzer that referenced this pull request Jan 25, 2023
Emacs has now two LSP clients, the more minimalistic and lightweight Eglot and
the extensive though a bit bloated LSP-Mode. Eglot will soon be
shipped with Emacs29. Both have rust-analyzer enabled by default and require
no further setup then just being installed and enabled. `lsp-rust.el` is not
required anymore.

The base-installation for each of those modes is so easy now that I don't think
an enumerated list is necessary, both package can be installed via the standard
`M-x package-install` and the installation is a one-liner that I provide.

Configuration mostly comes into play for support the rust-analyzer extensions to
the LSP protocol, which are built into LSP mode and require an extension-package
for Eglot.

But for the configuration beyond the base configuration I link against official
documentation, quickstart guides and documentation for the lsp extensions, to
avoid showing outdated information here.

This commit is mostly a duplicate of a PR [1] that I made against the
rust-analyzer github project.

[1]: rust-analyzer/rust-analyzer.github.io#197,
     rust-analyzer/rust-analyzer.github.io@7ff0113

ma
Resolves Issue rust-lang#196:
rust-analyzer/rust-analyzer.github.io#196
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants