and yet the definition in `package.json` uses `char`. In practice this means trying to highlight `char` doesn’t have any effect, while `character` doesn’t have any hover documentation and doesn’t appear in autocomplete. The definition also defines the fallback semantic token type as `type`; luckily since it currently references the non-existent `char` this doesn’t have any effect, since it doesn’t really make sense to highlight character literals as types.
This PR fixes the definition in `package.json` to correctly reference `character`, and also defines the fallback type as `number`. I’d say character literals are closer to a shorthand for writing a number than a string, though this is debatable and I’d be happy to change it to `string`, or anything else.
bors [Wed, 11 May 2022 07:26:28 +0000 (07:26 +0000)]
Auto merge of #12212 - Elliot-Roberts:hint_typo, r=lnicola
Fix a typo in the `inlayHints.renderColons` option description
The description said the same thing twice: "trailing colons for parameter hints, and trailing colons for parameter hints".
I'm assuming one of those is supposed to be about the leading colon for type hints.
Also, I wasn't sure how to regenerate the generated file(s?) so I just manually updated them. Hopefully that isn't a problem. If how to do that is in the documentation somewhere I'd love to know.
This PR changes a lot of config names, and a few ones are being merged or split apart. The reason for this is that our configuration names currently are rather inconsistent and some where poorly chosen in regards to extensability. This PR plans to fix that.
We still allow the old config names by patching them to the new ones before deserializing to keep backwards compatability with other clients (the VSCode client will auto update the config) but ideally we will get rid of that layer in the future.
Here is a list of the changes:
These are simple renames `old_name | alias1 | alias2 ... -> new_name` (the vscode client will fix these up automagically):
```
assist_allowMergingIntoGlobImports -> imports_merge_glob
assist_exprFillDefault -> assist_expressionFillDefault
assist_importEnforceGranularity -> imports_granularity_enforce
assist_importGranularity | assist_importMergeBehavior | assist_importMergeBehaviour -> imports_granularity_group
assist_importGroup -> imports_group_enable
assist_importPrefix -> imports_prefix
bors [Mon, 9 May 2022 08:33:18 +0000 (08:33 +0000)]
Auto merge of #11983 - jhpratt:remove-rustc_deprecated, r=lnicola
Remove handling of `#[rustc_deprecated]`
This should be merged along with rust-lang/rust#95960.
Because the attribute still exists in rustc, I've left the definition here. With that said, any use of it is an error, so I've removed any handling of `#[rustc_deprecated]`.
The parser tells us to consume up to 3 tokens, but on the MBE side all float literals are a single `tt::Literal`, so make sure to only consume a single MBE leaf.
bors [Thu, 5 May 2022 15:35:10 +0000 (15:35 +0000)]
Auto merge of #12149 - jonas-schievink:literally-just-a-literal, r=jonas-schievink
fix: split float literal tokens at `.` to fix parsing of tuple field accesses
This introduces an `ast::FloatLiteral` node, changes the `FLOAT_LITERAL` token to `FLOAT_LITERAL_PART`, and splits any float literal at the `.` character, into a `FLOAT_LITERAL_PART`, and optional `DOT` and trailing `FLOAT_LITERAL_PART` token. The tokens are reassembled when passing them to a macro as a `tt::Literal`.
~~A slight regression is introduced in how float literals are highlighted: the `.` is now highlighted as an operator. I've tried to fix this but couldn't figure out how to highlight the whole `ast::FloatLiteral` node as a unit.~~ This is fixed
bors [Thu, 5 May 2022 04:54:12 +0000 (04:54 +0000)]
Auto merge of #12150 - rainy-me:feat/fix-doc-url-links, r=rainy-me
fix: doc url link type
fix: #12033
I did some debugging and found the cause looks like to be some doc links' `LinkType` are kept as `Shortcut` which don't make sense for url links.
This PR should resolve both problems in the origin issue, but aside this PR, more work are needed for doc_links.
bors [Wed, 4 May 2022 09:32:17 +0000 (09:32 +0000)]
Auto merge of #12143 - bnjjj:master, r=Veykril
improve the default constructor mode when filling fields
Instead of filling a boolean field with `bool::default()` it's not `false` and same for `Option` instead of using `Option::default()` it will be `None`
bors [Wed, 4 May 2022 09:08:22 +0000 (09:08 +0000)]
Auto merge of #12142 - WaffleLapkin:sort-items-by-trait-def, r=lnicola
feat: Sort items by trait definition assist
This PR replaces the "Sort **methods** by trait definition" assist with a "Sort **items** by trait definition" assist that sorts all items, not just methods.
bors [Tue, 3 May 2022 11:50:31 +0000 (11:50 +0000)]
Auto merge of #12086 - iDawer:infer.rpit, r=flodiebold
infer from RPIT bounds of _this_ function
Collect obligations from RPITs (Return Position `impl Trait`) of a function which is being inferred.
This allows inferring {unknown}s from RPIT bounds.
Collect obligations from RPITs (Return Position `impl Trait`) of a function which is being inferred.
This allows inferring {unknown}s from RPIT bounds.
bors [Mon, 2 May 2022 15:48:52 +0000 (15:48 +0000)]
Auto merge of #12136 - jonas-schievink:lexedstr-converter, r=jonas-schievink
internal: Add a `Converter` type for token conversion
Makes it easier to produce multiple tokens from a single rustc token, if that's how we want to approach https://github.com/rust-analyzer/rust-analyzer/issues/1109