about summary refs log tree commit diff
path: root/crates
AgeCommit message (Collapse)AuthorLines
2022-07-02Auto merge of #12627 - yue4u:fix/struct-variant-patterns, r=Veykrilbors-76/+140
fix: complete enum variants as patterns in pattern path close #12593
2022-07-02fix: typos in hir-tya-kenji-2/+2
2022-07-02Auto merge of #12678 - Veykril:flyimport, r=Veykrilbors-4/+28
fix: Trigger flyimport completions in item lists again Fixes https://github.com/rust-lang/rust-analyzer/issues/12656
2022-07-02fix: Trigger flyimport completions in item lists againLukas Wirth-4/+28
2022-07-02fix: escape for enum variantyue4u-3/+57
2022-07-02fix: variants rendering in pattern pathyue4u-73/+83
2022-07-01Fix case of ignored/broken proc macroFlorian Diebold-1/+12
2022-07-01Add tests for #12669Florian Diebold-0/+81
2022-07-01Auto merge of #12636 - xuhongxu96:fix-12148, r=Veykrilbors-60/+304
complete raw identifier with "r#" prefix Fix #12148 Escape Names and Paths used in `insert_text`/`insert_snippet` while rendering the completion items.
2022-07-01Auto merge of #12668 - Veykril:mac-source-map, r=Veykrilbors-128/+221
fix: Simplify macro statement expansion handling I only meant to fix https://github.com/rust-lang/rust-analyzer/issues/12644 but that somehow turned into a rewrite of the statement handling ... at least this fixes a few more issues in the IDE layer now
2022-07-01Fix blocks not considering stmt without semi as tailsLukas Wirth-5/+46
2022-07-01fix: Fix attribute macros on assoc items being discarded with disabled proc ↵Lukas Wirth-17/+23
macros
2022-07-01Fix Expr::MacroStmts using wrong scopesLukas Wirth-12/+13
2022-07-01Update hir-ty test outputsLukas Wirth-14/+20
2022-07-01fix: Simplify macro statement expansion handlingLukas Wirth-113/+158
2022-07-01Auto merge of #12650 - lowr:fix/12591, r=lnicolabors-4/+46
fix: improve whitespace insertion in pretty printer Fixes #12591 The `=>` token in the macro_rules! should be parsed as one fat arrow, but it ["requires a lot of changes in r-a"](https://github.com/rust-analyzer/ungrammar/commit/143cc528b11290bf2463de1fb5a97a15f9b2ed44), so I left it for the larger refactoring in the future and put a FIXME note.
2022-06-30fix: Fix flycheck sending cancel progress with no running processLukas Wirth-5/+3
2022-06-30Auto merge of #12634 - iDawer:match-check.witnesses, r=flodieboldbors-93/+330
feat: Show witnesses of non-exhaustiveness in `missing-match-arm` diagnostic Shamelessly copied from rustc. Thus reporting format is same. This extends public api `hir::diagnostics::MissingMatchArms` with `uncovered_patterns: String` field. It does not expose data for implementing a quick fix yet. ----- Worth to note: current implementation does not give a comprehensive list of missing patterns. Also mentioned in [paper](http://moscova.inria.fr/~maranget/papers/warn/warn.pdf): > One may think that algorithm I should make an additional effort to provide more > non-matching values, by systematically computing recursive calls on specialized > matrices when possible, and by returning a list of all pattern vectors returned by > recursive calls. We can first observe that it is not possible in general to supply the > users with all non-matching values, since the signature of integers is (potentially) > infinite.
2022-06-30Add static assertions for some unreachble pathsiDawer-16/+10
2022-06-30Correct wordingiDawer-1/+1
2022-06-30Auto merge of #12626 - CuriousCorrelation:fix/empty-reasons, r=flodieboldbors-1/+10
fix: trailing ':' on empty inactive reasons ## Description Fixes trailing ':' even when there is no explanation. e.g. ``` sh code is inactive due to #[cfg] directives: ``` ## Issue Fixes: #12615
2022-06-30Auto merge of #12428 - lowr:experimental/destructuring-assignment, r=flodieboldbors-68/+532
feat: implement destructuring assignment This is an attempt to implement destructuring assignments, or more specifically, type inference for [assignee expressions](https://doc.rust-lang.org/reference/expressions.html#place-expressions-and-value-expressions). I'm not sure if this is the right approach, so I don't even expect this to be merged (hence the branch name :wink:) but rather want to propose one direction we could choose. I don't mind getting merged if this is good enough though! Some notes on the implementation choices: - Assignee expressions are **not** desugared on HIR level unlike rustc, but are inferred directly along with other expressions. This matches the processing of other syntaxes that are desugared in rustc but not in r-a. I find this reasonable because r-a only needs to infer types and it's easier to relate AST nodes and HIR nodes, so I followed it. - Assignee expressions obviously resemble patterns, so type inference for each kind of pattern and its corresponding assignee expressions share a significant amount of logic. I tried to reuse the type inference functions for patterns by introducing `PatLike` trait which generalizes assignee expressions and patterns. - This is not the most elegant solution I suspect (and I really don't like the name of the trait!), but it's cleaner and the change is smaller than other ways I experimented, like making the functions generic without such trait, or making them take `Either<ExprId, PatId>` in place of `PatId`. in case this is merged: Closes #11532 Closes #11839 Closes #12322
2022-06-28fix: improve whitespace insertion in pretty printerRyo Yoshida-4/+46
2022-06-28fix: Report proc macro errors in expressions correctly as wellFlorian Diebold-69/+69
They didn't have a krate before, resulting in the generic "proc macro not found" error. Also improve error messages a bit more.
2022-06-27Auto merge of #12643 - Veykril:macro-compl, r=Veykrilbors-19/+45
fix: Fix completions for locals not working properly inside macro calls
2022-06-27fix: Fix completions for locals not working properly inside macro callsLukas Wirth-19/+45
2022-06-27Auto merge of #12635 - antogilbert:tgt_feat, r=Veykrilbors-4/+4
Correct target_feature completion I changed the `target_feature` to match the description given in #12616.
2022-06-27fix: deduplicate cfg completionsManas-1/+2
cfg completions are duplicated if they are set with multiple values. This patch deduplicates them.
2022-06-27Udate unit testsAntonello Palazzi-2/+2
2022-06-26WellFormed -> Holdsbitgaoshu-1/+27
2022-06-26add test for item same namebitgaoshu-1/+20
2022-06-26Fix typo in build.rsbuffet-1/+1
2022-06-26complete raw identifier with "r#" prefixHongxu Xu-60/+304
2022-06-26Correct target_feature completionAntonello Palazzi-2/+2
2022-06-25Reduce intermediate allocations while printing witnessesiDawer-14/+17
2022-06-25add test for suggest_namebitgaoshu-14/+35
2022-06-25restore sthbitgaoshu-1/+1
2022-06-24Auto merge of #12520 - Veykril:flycheck-cancel, r=Veykrilbors-68/+131
internal: Bring back JodChild into flychecking for cancellation cc https://github.com/rust-lang/rust-analyzer/pull/10517/files#r895241975
2022-06-25fix test in resolve_proc_macro: Foo is Ownerbitgaoshu-2/+2
2022-06-24rename "trait_def" to "def_in_trait"bitgaoshu-3/+6
2022-06-24highlight: trait pathbitgaoshu-13/+10
2022-06-24fix test in qualify_method: stay in trait pathbitgaoshu-11/+35
2022-06-24Auto merge of #12629 - flodiebold:proc-macro-error-improvement, r=Veykrilbors-170/+173
fix: Improve proc macro errors a bit Distinguish between - there is no build data (for some reason?) - there is build data, but the cargo package didn't build a proc macro dylib - there is a proc macro dylib, but it didn't contain the proc macro we expected - the name did not resolve to any macro (this is now an unresolved_macro_call even for attributes) I changed the handling of disabled attribute macro expansion to immediately ignore the macro and report an unresolved_proc_macro, because otherwise they would now result in loud unresolved_macro_call errors. I hope this doesn't break anything. Also try to improve error ranges for unresolved_macro_call / macro_error by reusing the code for unresolved_proc_macro. It's not perfect but probably better than before.
2022-06-24Improve commentsFlorian Diebold-7/+10
2022-06-24Improve proc macro errors a bitFlorian Diebold-163/+163
Distinguish between - there is no build data (for some reason?) - there is build data, but the cargo package didn't build a proc macro dylib - there is a proc macro dylib, but it didn't contain the proc macro we expected - the name did not resolve to any macro (this is now an unresolved_macro_call even for attributes) I changed the handling of disabled attribute macro expansion to immediately ignore the macro and report an unresolved_proc_macro, because otherwise they would now result in loud unresolved_macro_call errors. I hope this doesn't break anything. Also try to improve error ranges for unresolved_macro_call / macro_error by reusing the code for unresolved_proc_macro. It's not perfect but probably better than before.
2022-06-24fix some test due to resolve to where trait m implbitgaoshu-35/+41
2022-06-24functions resolve to implbitgaoshu-102/+50
2022-06-23Auto merge of #12605 - erhuve:fix/determine-doc-link-type-at-start, r=erhuvebors-5/+12
fix: doc_links link type - Determine link type at start (fixes #12601) fixes #12601 Looked like autolink/inline mismatch happened because end_link_type was parsed from the Text/Code events. I changed it to be determined from the Start event, which should hopefully remain accurate while staying true to the cases where link type may need to be changed, according to the comment ``` // normally link's type is determined by the type of link tag in the end event, // however in some cases we want to change the link type, for example, // `Shortcut` type doesn't make sense for url links ``` Hopefully this is the desired behavior? ![Untitled](https://user-images.githubusercontent.com/59463268/174696581-3b1140a5-cdf0-4eda-9a11-ec648e4e7d21.gif)
2022-06-23clarify comment and add autolink test caseRaymond Luo-1/+3
2022-06-23Auto merge of #12628 - Veykril:simplify, r=Veykrilbors-94/+75
internal: Simplify