]>
git.lizzy.rs Git - rust.git/log
bors [Tue, 10 May 2022 14:55:59 +0000 (14:55 +0000)]
Auto merge of #12208 - jonas-schievink:assoc-ty-signature-info, r=jonas-schievink
feat: include associated types in trait signature help
Fixes https://github.com/rust-lang/rust-analyzer/issues/12141
![screenshot-2022-05-10-16:55:19](https://user-images.githubusercontent.com/
1786438 /
167658642 -
8df42fba -523a-46fe-a0f6-
e0e041b3659d .png)
Jonas Schievink [Tue, 10 May 2022 14:54:31 +0000 (16:54 +0200)]
Include assoc. types in trait signature help
Jonas Schievink [Tue, 10 May 2022 14:54:13 +0000 (16:54 +0200)]
Fix inverted signature help setting
bors [Tue, 10 May 2022 13:08:27 +0000 (13:08 +0000)]
Auto merge of #12204 - Veykril:completions, r=Veykril
internal: Move keyword expressions to expr completions module
Lukas Wirth [Tue, 10 May 2022 13:00:58 +0000 (15:00 +0200)]
Move keyword expressions to expr completions module
bors [Tue, 10 May 2022 12:36:46 +0000 (12:36 +0000)]
Auto merge of #12203 - Veykril:completions, r=Veykril
internal: Simplify
Lukas Wirth [Tue, 10 May 2022 12:31:43 +0000 (14:31 +0200)]
Don't parse files in module completion
Lukas Wirth [Tue, 10 May 2022 12:31:28 +0000 (14:31 +0200)]
Simplify
bors [Tue, 10 May 2022 12:28:34 +0000 (12:28 +0000)]
Auto merge of #12202 - iDawer:ide.sig_help-fix, r=lnicola
fix: don't panic at fully qualified call syntax in signature help
Closes #12200
Regressed from #12082
iDawer [Tue, 10 May 2022 12:18:42 +0000 (17:18 +0500)]
`signature_help`: detect fully qualified call syntax for parameter fallback
bors [Tue, 10 May 2022 12:07:24 +0000 (12:07 +0000)]
Auto merge of #12010 - Veykril:r-a-config, r=Veykril
Config revamp
Fixes https://github.com/rust-lang/rust-analyzer/issues/11790
Fixes https://github.com/rust-lang/rust-analyzer/issues/12115
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
cache_warmup -> primeCaches_enable
cargo_loadOutDirsFromCheck -> cargo_buildScripts_enable
cargo_runBuildScripts | cargo_runBuildScriptsCommand -> cargo_runBuildScripts_overrideCommand
cargo_useRustcWrapperForBuildScripts -> cargo_runBuildScripts_useRustcWrapper
completion_snippets -> completion_snippets_custom
diagnostics_enableExperimental -> diagnostics_experimental_enable
experimental_procAttrMacros -> procMacro_attributes_enable
highlighting_strings -> semanticHighlighting_strings_enable
highlightRelated_breakPoints -> semanticHighlighting_breakPoints_enable
highlightRelated_exitPoints -> semanticHighlighting_exitPoints_enable
highlightRelated_yieldPoints -> semanticHighlighting_yieldPoints_enable
highlightRelated_references -> semanticHighlighting_references_enable
hover_documentation -> hover_documentation_enable
hover_linksInHover | hoverActions_linksInHover -> hover_links_enable
hoverActions_debug -> hoverActions_debug_enable
hoverActions_enable -> hoverActions_enable_enable
hoverActions_gotoTypeDef -> hoverActions_gotoTypeDef_enable
hoverActions_implementations -> hoverActions_implementations_enable
hoverActions_references -> hoverActions_references_enable
hoverActions_run -> hoverActions_run_enable
inlayHints_chainingHints -> inlayHints_chainingHints_enable
inlayHints_closureReturnTypeHints -> inlayHints_closureReturnTypeHints_enable
inlayHints_hideNamedConstructorHints -> inlayHints_typeHints_hideNamedConstructorHints
inlayHints_parameterHints -> inlayHints_parameterHints_enable
inlayHints_reborrowHints -> inlayHints_reborrowHints_enable
inlayHints_typeHints -> inlayHints_typeHints_enable
lruCapacity -> lru_capacity
runnables_cargoExtraArgs -> runnables_extraArgs
runnables_overrideCargo -> runnables_command
rustcSource -> rustc_source
rustfmt_enableRangeFormatting -> rustfmt_rangeFormatting_enable
```
These are configs that have been merged or split apart, which have to be manually updated by the user:
```
callInfo_full -> signatureInfo_detail, signatureInfo_documentation_enable
cargo_allFeatures, cargo_features -> cargo_features
checkOnSave_allFeatures, checkOnSave_features -> checkOnSave_features
completion_addCallArgumentSnippets completion_addCallParenthesis -> completion_callable_snippets
```
bors [Tue, 10 May 2022 11:44:06 +0000 (11:44 +0000)]
Auto merge of #12201 - Veykril:inlay-hide, r=Veykril
fix: Add cast expressions to param name inlay hint heuristics
Lukas Wirth [Tue, 10 May 2022 11:43:43 +0000 (13:43 +0200)]
fix: Add cast expressions to param name inlay hint heuristics
bors [Mon, 9 May 2022 16:12:47 +0000 (16:12 +0000)]
Auto merge of #12199 - jonas-schievink:no-invalid-assoc-ty-completions, r=jonas-schievink
fix: Don't show assoc. type binding completions when invalid
Fixes https://github.com/rust-lang/rust-analyzer/issues/12165
Jonas Schievink [Mon, 9 May 2022 16:12:12 +0000 (18:12 +0200)]
Don't show assoc. type binding completions when invalid
bors [Mon, 9 May 2022 15:40:45 +0000 (15:40 +0000)]
Auto merge of #12198 - jonas-schievink:ide-resolve-supertrait-assoc-types, r=jonas-schievink
fix: Resolve assoc. types of supertraits in the IDE layer
Fixes https://github.com/rust-lang/rust-analyzer/issues/12166
Jonas Schievink [Mon, 9 May 2022 15:39:13 +0000 (17:39 +0200)]
Make completion work too
Jonas Schievink [Mon, 9 May 2022 15:30:49 +0000 (17:30 +0200)]
Resolve assoc. types of supertraits in the IDE layer
bors [Mon, 9 May 2022 10:13:08 +0000 (10:13 +0000)]
Auto merge of #12197 - Veykril:insert-use-fix, r=Veykril
fix: Fix import insertion inserting after last comment in a file
Lukas Wirth [Mon, 9 May 2022 09:52:49 +0000 (11:52 +0200)]
fix: Fix import insertion inserting after last comment in a file
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]`.
bors [Sat, 7 May 2022 14:25:12 +0000 (14:25 +0000)]
Auto merge of #12187 - Veykril:completion-rev, r=Veykril
internal: More completion context refactoring
bors [Sat, 7 May 2022 14:16:00 +0000 (14:16 +0000)]
Auto merge of #12188 - Veykril:auto-import, r=Veykril
fix: Allow auto importing starting segments of use items
Lukas Wirth [Sat, 7 May 2022 13:23:25 +0000 (15:23 +0200)]
fix: Allow auto importing starting segments of use items
Lukas Wirth [Sat, 7 May 2022 13:08:33 +0000 (15:08 +0200)]
fix unreachable pub
Lukas Wirth [Sat, 7 May 2022 13:05:43 +0000 (15:05 +0200)]
Merge the different identifier contexts into one enum
Lukas Wirth [Sat, 7 May 2022 12:16:03 +0000 (14:16 +0200)]
Split namelike into the corresponding completion contexts
Lukas Wirth [Sat, 7 May 2022 11:46:43 +0000 (13:46 +0200)]
Introduce NameRefContext
bors [Sat, 7 May 2022 11:00:29 +0000 (11:00 +0000)]
Auto merge of #12186 - Veykril:completion-rev, r=Veykril
minor: Move inferred type completions
Lukas Wirth [Sat, 7 May 2022 10:59:26 +0000 (12:59 +0200)]
minor: Move inferred type completions
bors [Sat, 7 May 2022 10:53:37 +0000 (10:53 +0000)]
Auto merge of #12185 - Veykril:parse-fix, r=Veykril
fix: Remap float parts as integers when parsed as indices
cc https://github.com/rust-lang/rust-analyzer/pull/12149
Lukas Wirth [Sat, 7 May 2022 10:52:15 +0000 (12:52 +0200)]
fix: Remap float parts as integers when parsed as indices
bors [Fri, 6 May 2022 16:39:43 +0000 (16:39 +0000)]
Auto merge of #12178 - jonas-schievink:fix-tt-conv-panic, r=jonas-schievink
fix: Fix panic when a macro passes a float token to another macro
Fixes https://github.com/rust-lang/rust-analyzer/issues/12170 (num-traits no longer causes a panic)
Jonas Schievink [Fri, 6 May 2022 16:29:43 +0000 (18:29 +0200)]
Fix conversion of float literals in `TtTreeSink`
bors [Fri, 6 May 2022 14:12:29 +0000 (14:12 +0000)]
Auto merge of #12177 - jonas-schievink:mbe-output-float-literals, r=jonas-schievink
fix: fix macro expansion with float tokens
Fixes https://github.com/rust-lang/rust-analyzer/issues/12170
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.
Jonas Schievink [Fri, 6 May 2022 14:10:54 +0000 (16:10 +0200)]
Skip only the `tt::Literal` when consuming float tokens
bors [Fri, 6 May 2022 13:45:12 +0000 (13:45 +0000)]
Auto merge of #12175 - Veykril:completion-rev, r=Veykril
fix: Fix snippets triggering where they shouldn't
Fixes https://github.com/rust-lang/rust-analyzer/issues/12169
Lukas Wirth [Fri, 6 May 2022 13:44:41 +0000 (15:44 +0200)]
fix: Fix snippets triggering where they shouldn't
bors [Fri, 6 May 2022 11:12:29 +0000 (11:12 +0000)]
Auto merge of #12174 - Veykril:completion-rev, r=Veykril
internal: Improve completion tests by checking that the offset is included in the source_range of items
Lukas Wirth [Fri, 6 May 2022 11:11:50 +0000 (13:11 +0200)]
internal: Improve completion tests by checking that the offset is included in the source_range of items
bors [Fri, 6 May 2022 10:14:05 +0000 (10:14 +0000)]
Auto merge of #12171 - lnicola:proc-macros-dont-invalidate-state, r=Veykril
fix: Try not to invalidate state when the proc macro preference didn't change
This appears to fix #12027, but I'm not sure.
bors [Fri, 6 May 2022 10:06:06 +0000 (10:06 +0000)]
Auto merge of #12173 - Veykril:completion-rev, r=Veykril
internal: completion PathKind is not optional
Lukas Wirth [Fri, 6 May 2022 10:04:41 +0000 (12:04 +0200)]
internal: completion PathKind is not optional
Laurențiu Nicola [Fri, 6 May 2022 06:46:02 +0000 (09:46 +0300)]
Try not to invalidate our state when the proc macro preference didn't change
bors [Thu, 5 May 2022 20:22:30 +0000 (20:22 +0000)]
Auto merge of #12168 - Veykril:completion-rev, r=Veykril
internal: Remove unqualified_path completions module
Lukas Wirth [Thu, 5 May 2022 20:21:42 +0000 (22:21 +0200)]
internal: Remove unqualified_path completions module
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
Fixes https://github.com/rust-lang/rust-analyzer/issues/1109
Fixes https://github.com/rust-lang/rust-analyzer/issues/10492
Fixes https://github.com/rust-lang/rust-analyzer/issues/12107
Fixes https://github.com/rust-lang/rust-analyzer/issues/10560
Fixes https://github.com/rust-lang/rust-analyzer/issues/11487
Jonas Schievink [Thu, 5 May 2022 14:35:07 +0000 (16:35 +0200)]
Fix rebase fallout
Jonas Schievink [Thu, 5 May 2022 14:26:16 +0000 (16:26 +0200)]
Maybe everything else *should* have to deal with it
Jonas Schievink [Thu, 5 May 2022 14:06:44 +0000 (16:06 +0200)]
Indicate the number of float tokens in the first token
Jonas Schievink [Wed, 4 May 2022 17:25:32 +0000 (19:25 +0200)]
Wrap floats in token trees in `FLOAT_LITERAL` node
Jonas Schievink [Wed, 4 May 2022 15:10:53 +0000 (17:10 +0200)]
Add completion test
Jonas Schievink [Wed, 4 May 2022 14:58:02 +0000 (16:58 +0200)]
Add tests
Jonas Schievink [Wed, 4 May 2022 14:51:05 +0000 (16:51 +0200)]
Split float literal tokens at the `.`
Jonas Schievink [Tue, 3 May 2022 17:56:10 +0000 (19:56 +0200)]
Wrap float literals in their own node
Jonas Schievink [Tue, 3 May 2022 14:47:33 +0000 (16:47 +0200)]
Remove `ast::Literal::token`
bors [Thu, 5 May 2022 13:51:22 +0000 (13:51 +0000)]
Auto merge of #12164 - Veykril:completion-rev, r=Veykril
internal: Remove `unqualified_path` completions module
cc https://github.com/rust-lang/rust-analyzer/issues/12144
Lukas Wirth [Thu, 5 May 2022 13:49:03 +0000 (15:49 +0200)]
internal: Remove unqualified_path completions module
bors [Thu, 5 May 2022 10:20:30 +0000 (10:20 +0000)]
Auto merge of #12161 - Veykril:completion-rev, r=Veykril
internal: Lift out item list path completions from (un)qualified_path
cc https://github.com/rust-lang/rust-analyzer/issues/12144
Lukas Wirth [Thu, 5 May 2022 10:08:40 +0000 (12:08 +0200)]
internal: Lift out item list path completions from (un)qualified_path
bors [Thu, 5 May 2022 09:03:23 +0000 (09:03 +0000)]
Auto merge of #12160 - Veykril:completions-rev, r=Veykril
minor: Sort ide-completions test outputs for less disruptive diffs
Lukas Wirth [Thu, 5 May 2022 08:49:43 +0000 (10:49 +0200)]
minor: Sort ide-completions test outputs for less disruptive diffs
bors [Thu, 5 May 2022 08:51:18 +0000 (08:51 +0000)]
Auto merge of #12159 - Veykril:completions-rev, r=Veykril
internal: Lift out macro bang property from completion PathKind enum
Lukas Wirth [Thu, 5 May 2022 08:34:57 +0000 (10:34 +0200)]
internal: Lift out macro bang property from PathKind enum
bors [Thu, 5 May 2022 07:35:41 +0000 (07:35 +0000)]
Auto merge of #12157 - lnicola:lower-char-byte-literals, r=Veykril
feat: Lower values of char and byte literals
Closes #12137
Laurențiu Nicola [Thu, 5 May 2022 05:10:07 +0000 (08:10 +0300)]
Lower values of char and byte literals
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.
about `LinkType`: https://github.com/raphlinus/pulldown-cmark/blob/
f29bd1e228913690e5092c9594e4e607423ff0aa /src/lib.rs#L191-L210
rainy-me [Thu, 5 May 2022 04:41:33 +0000 (13:41 +0900)]
fix: add docs and remove unnecessary check
Jacob Pratt [Thu, 14 Apr 2022 06:12:33 +0000 (02:12 -0400)]
Remove handling of `#[rustc_deprecated]`
rainy-me [Wed, 4 May 2022 15:41:29 +0000 (00:41 +0900)]
fix: doc url link type
Lukas Wirth [Wed, 4 May 2022 13:19:00 +0000 (15:19 +0200)]
Implement old to new config patching
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.
![sort-items-by-trait-def-showcase](https://user-images.githubusercontent.com/
38225716 /
166491828 -
0bc10dbd -91be-408f-9fe0-
636ef5e99377 .gif)
Benjamin Coenen [Tue, 3 May 2022 16:27:25 +0000 (18:27 +0200)]
improve the default constructor mode when filling fields
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
Maybe Waffle [Tue, 3 May 2022 20:55:00 +0000 (00:55 +0400)]
Remove "Sort methods by trait definition" assist
It was replaced by the "Sort items by trait definition" assist.
Maybe Waffle [Tue, 3 May 2022 15:41:33 +0000 (19:41 +0400)]
Add "Sort items by trait definition"
Maybe Waffle [Tue, 3 May 2022 15:41:07 +0000 (19:41 +0400)]
Fix some typos in `ide-assists/src/lib.rs`
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.
Closes #8403
bors [Tue, 3 May 2022 11:01:26 +0000 (11:01 +0000)]
Auto merge of #12139 - matklad:depsdeps, r=matklad
:arrow_up: deps
iDawer [Tue, 26 Apr 2022 14:25:10 +0000 (19:25 +0500)]
'inference': collect RPIT obligations
Collect obligations from RPITs (Return Position `impl Trait`) of a function which is being inferred.
This allows inferring {unknown}s from RPIT bounds.
Aleksey Kladov [Tue, 3 May 2022 10:57:40 +0000 (11:57 +0100)]
:arrow_up: deps
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
Jonas Schievink [Mon, 2 May 2022 15:47:12 +0000 (17:47 +0200)]
Add a `Converter` type for token conversion
bors [Mon, 2 May 2022 12:29:49 +0000 (12:29 +0000)]
Auto merge of #12123 - rainy-me:feat/impl-self-completion, r=Veykril
feat: provide Self in record literal completion
close #12106
bors [Mon, 2 May 2022 12:21:42 +0000 (12:21 +0000)]
Auto merge of #12093 - nico-abram:uwu, r=Veykril
Reload project on .cargo/config[.toml] changes
Fixes #11024
Not adding tests as discussed in the issue
bors [Mon, 2 May 2022 12:13:16 +0000 (12:13 +0000)]
Auto merge of #12120 - iDawer:ide.sig_help, r=Veykril
fix: Don't show signature help after closing bracket
Stop showing signature help after closing angle/round brackets.
Fixes #11624
bors [Mon, 2 May 2022 10:52:29 +0000 (10:52 +0000)]
Auto merge of #12135 - Veykril:hirdisp, r=Veykril
minor: Add a test for display rendering record variants
Lukas Wirth [Mon, 2 May 2022 10:51:00 +0000 (12:51 +0200)]
minor: Add a test for display rendering record variants
bors [Mon, 2 May 2022 10:40:19 +0000 (10:40 +0000)]
Auto merge of #12134 - Veykril:hirdisp, r=Veykril
fix: Fix uncorrect use of double braces in HirDisplay implementations
Lukas Wirth [Mon, 2 May 2022 10:38:33 +0000 (12:38 +0200)]
fix: Fix uncorrect use of double braces in HirDisplay implementations
bors [Mon, 2 May 2022 08:42:28 +0000 (08:42 +0000)]
Auto merge of #12133 - lnicola:crate-dashes, r=lnicola
internal: Fix crate names for release
Laurențiu Nicola [Mon, 2 May 2022 08:41:06 +0000 (11:41 +0300)]
Fix crate names
Lukas Wirth [Fri, 29 Apr 2022 13:48:48 +0000 (15:48 +0200)]
Fix up config docs
Lukas Wirth [Fri, 29 Apr 2022 12:06:43 +0000 (14:06 +0200)]
Fix untagged enum deserialization
Lukas Wirth [Fri, 29 Apr 2022 11:34:03 +0000 (13:34 +0200)]
auto update old configurations to newer ones
Lukas Wirth [Fri, 29 Apr 2022 08:56:32 +0000 (10:56 +0200)]
Final fixups
Lukas Wirth [Wed, 27 Apr 2022 16:25:12 +0000 (18:25 +0200)]
Update config usage in slow tests
Lukas Wirth [Wed, 27 Apr 2022 15:51:44 +0000 (17:51 +0200)]
Adjust signature info and enum variant lenses
Lukas Wirth [Tue, 26 Apr 2022 12:39:06 +0000 (14:39 +0200)]
Update docs and config
Lukas Wirth [Tue, 26 Apr 2022 12:39:01 +0000 (14:39 +0200)]
Implement boolean aliases