Skip to content

New Guide: crates and modules #15956

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 1 commit into from
Jul 29, 2014
Merged

Conversation

steveklabnik
Copy link
Member

Also fixes a couple of filesystem references that I forgot to change. 😅

# Lambdas
Rust features a strong module system, but it works a bit differently than in
other programming languages. Rust's module system has two main components:
**crate**s, and **module**s.
Copy link
Contributor

Choose a reason for hiding this comment

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

**crates**, and **module**s doesn't seem to be rendered at least in github's preview

Copy link
Member Author

Choose a reason for hiding this comment

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

I've used it elsewhere, so it does work.

Copy link
Contributor

Choose a reason for hiding this comment

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

Might be that it doesn't like star delimiters in the middle of a word.

Anyways, I'd suggest to embold the whole word. Bold makes the letters wider so having just a part emboldened seems just weird.

@steveklabnik
Copy link
Member Author

I've squashed this up, if we're happy with that last sentence, this is good to go.

@steveklabnik
Copy link
Member Author

Whoops. Fixed the one test failure.

bors added a commit that referenced this pull request Jul 29, 2014
Also fixes a couple of filesystem references that I forgot to change. 😅
@bors bors closed this Jul 29, 2014
@bors bors merged commit 456c449 into rust-lang:master Jul 29, 2014
}
```

When we include a module like this, we don't need to make the `mod` declaration,
Copy link
Member

Choose a reason for hiding this comment

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

"the mod declaration" is at best ambiguous here. It could be interpreted as referring to the mod decl in lib.rs, which of course cannot be omitted

bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 27, 2023
Improve completion label details display

This PR improves completion label details display by separating trait and alias info from the `label` LSP field to an additional existing `label_detail` field. Changes look like the following:

### Before

![Screenshot from 2023-11-24 12-03-08](https://github.com/rust-lang/rust-analyzer/assets/14666676/74066f0d-f1ac-4e99-8be5-c5141d513d23)

### After

![Screenshot from 2023-11-24 12-21-57](https://github.com/rust-lang/rust-analyzer/assets/14666676/45fca112-4612-40a3-81b9-07ff12de0962)

_All existing tests are passed without any changes in test themselves logic._
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 27, 2023
fix: add fallback for completion label details

This PR adds a fallback to a previous implementation in a case when the label detail field isn't supported by LSP client and the support isn't reported by the LSP initialize request. In this case additional info about trait and aliases would be merged into the label field as it was before the rust-lang#15956 PR.
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.

8 participants