aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | | Merge #6030bors[bot]2020-09-186-166/+165
|\ \ \ \ \ \ \ | | |_|_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 6030: Small proc macro cleanup r=jonas-schievink a=jonas-schievink git got really confused, but all I did in the first commit was unindent a few lines Co-authored-by: Jonas Schievink <[email protected]>
| * | | | | | Rename `CustomDerive` to `ProcMacro`Jonas Schievink2020-09-186-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It handles fn-like macros too, and will handle attribute macros in the future
| * | | | | | Invert condition to unindent codeJonas Schievink2020-09-181-158/+157
|/ / / / / /
* | | | | | Merge #6025bors[bot]2020-09-172-1/+8
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 6025: Use `log::error!` in a few more places r=jonas-schievink a=jonas-schievink Co-authored-by: Jonas Schievink <[email protected]>
| * | | | | | Use `log::error!` in a few more placesJonas Schievink2020-09-172-1/+8
|/ / / / / /
* | | | | | Merge #6024bors[bot]2020-09-175-18/+11
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 6024: Give `ExternCrate` a `Name`, not a `ModPath` r=jonas-schievink a=jonas-schievink Simplifies things Co-authored-by: Jonas Schievink <[email protected]>
| * | | | | | Give `ExternCrate` a `Name`, not a `ModPath`Jonas Schievink2020-09-175-18/+11
|/ / / / / /
* | | | | | Merge #6017bors[bot]2020-09-172-4/+45
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 6017: Don't return any TextEdit if formatting is unchanged r=jonas-schievink a=cuviper I found that `textDocument/formatting` was always returning a full `TextEdit` replacement, even when there are no changes, which caused Vim (w/ vim-lsp) to always indicate a modified buffer after formatting. We can easily compare whether there were changes and return `null` if not, so the client knows there's nothing to do. Co-authored-by: Josh Stone <[email protected]>
| * | | | | | Don't return any TextEdit if formatting is unchangedJosh Stone2020-09-162-4/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I found that `textDocument/formatting` was always returning a full `TextEdit` replacement, even when there are no changes, which caused Vim (w/ vim-lsp) to always indicate a modified buffer after formatting. We can easily compare whether there were changes and return `null` if not, so the client knows there's nothing to do.
* | | | | | | Merge #6016bors[bot]2020-09-1711-77/+445
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 6016: Emit diagnostics for unresolved imports and extern crates r=jonas-schievink a=jonas-schievink AFAIK, we don't have any major bugs in name resolution that would cause a lot of false positives here (except procedural attribute macro support and some rare issues around `#[path]` on module files), so these are *not* marked as experimental diagnostics right now. I noticed that diagnostics in a file sometimes don't get displayed after opening, but require some edit to be performed. This seems like a preexisting issue though. Co-authored-by: Jonas Schievink <[email protected]>
| * | | | | | | Don't diagnose imports whose base crate is missingJonas Schievink2020-09-172-17/+64
| | | | | | | |
| * | | | | | | Add annotation-based nameres diagnostic testsJonas Schievink2020-09-164-38/+150
| | | | | | | |
| * | | | | | | Update testsJonas Schievink2020-09-161-5/+57
| | | | | | | |
| * | | | | | | Track import sources and emit diagnosticsJonas Schievink2020-09-162-21/+60
| | | | | | | |
| * | | | | | | Leave extern crate items unresolved if they areJonas Schievink2020-09-161-1/+5
| | | | | | | |
| * | | | | | | Add diagnostic types for unresolved crates/importsJonas Schievink2020-09-163-19/+128
| | | | | | | |
| * | | | | | | Store `Import` indices for later reconstructionJonas Schievink2020-09-163-4/+9
| |/ / / / / /
* | | | | | | Merge #6023bors[bot]2020-09-172-6/+6
|\ \ \ \ \ \ \ | | |/ / / / / | |/| | | / / | |_|_|_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | 6023: Fix LSP requests with no arguments r=kjeremy a=lnicola r? @kjeremy Co-authored-by: Laurențiu Nicola <[email protected]>
| * | | | | Fix LSP requests with no argumentsLaurențiu Nicola2020-09-172-6/+6
|/ / / / /
* | | | | Merge #5989bors[bot]2020-09-165-103/+292
|\ \ \ \ \ | |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5989: Rewrite import merging r=jonas-schievink a=Veykril Rewrites how import merging is being handled. It is now a recursive function to properly handle merging of intermediate levels in the import trees. With this ordering the imports is also now possible tho it doesn't quite order it the same way as `rustfmt` does yet, namely it orders lowercase identifiers after uppercase identifiers as that is the standard character order that rust uses. This also fixes a few weird behaviors that were visible in some of the `replace_qualified_name_with_use.rs` tests. This really took longer than I was hoping for, fighting with import trees is quite the exhausting task 😅 Co-authored-by: Lukas Wirth <[email protected]>
| * | | | Add make::glob_use_tree function to create star-only UseTreeLukas Wirth2020-09-162-11/+7
| | | | |
| * | | | Fix merge imports failing if the `self` module import is in the wrong treeLukas Wirth2020-09-121-22/+34
| | | | |
| * | | | Tidy up `recursive_merge` implementationLukas Wirth2020-09-121-60/+60
| | | | |
| * | | | Reimplement import merging by making it recursive properly nesting all levelsLukas Wirth2020-09-124-83/+264
| | | | |
* | | | | Merge #6013bors[bot]2020-09-162-7/+19
|\ \ \ \ \ | | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 6013: Add support for custom flycheck commands with JSON project workspaces r=jonas-schievink a=woody77 Enable flychecks with JSON project workspaces if an override command was provided as part of the client configuration: ``` "rust-analyzer.checkOnSave.enable": true, "rust-analyzer.checkOnSave.overrideCommand": ["custom_tool", "arg1", "arg2"], ``` Co-authored-by: Aaron Wood <[email protected]>
| * | | | Add support for custom flycheck commands with JSON project workspacesAaron Wood2020-09-162-7/+19
| | | | | | | | | | | | | | | | | | | | | | | | | Enable flychecks with JSON project workspaces if an override command was provided as part of the client configuration.
* | | | | Merge #5993bors[bot]2020-09-1615-44/+166
|\ \ \ \ \ | |_|_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5993: Update chalk to 0.27 and add support for extern opaque types. r=crlf0710 a=crlf0710 Co-authored-by: Charles Lew <[email protected]>
| * | | | Use Ty::apply instead of simple and fix method resolution.Charles Lew2020-09-163-8/+14
| | | | |
| * | | | Add a test.Charles Lew2020-09-161-0/+38
| | | | |
| * | | | Lower extern type alias as foreign opaque type.Charles Lew2020-09-162-2/+8
| | | | |
| * | | | Update chalk to 0.27 and adapt to chalk changes.Charles Lew2020-09-1511-41/+113
| | | | |
* | | | | Merge #6011bors[bot]2020-09-161-0/+4
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 6011: Document "consuming" semantic tokens modifier r=jonas-schievink a=Veetaha cc https://github.com/rust-analyzer/rust-analyzer/pull/5957/files Co-authored-by: Veetaha <[email protected]>
| * | | | | Document "consuming" semantic tokens modifierVeetaha2020-09-151-0/+4
|/ / / / /
* | | | | Merge #6010bors[bot]2020-09-151-33/+215
|\ \ \ \ \ | |_|/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 6010: Avoid checking all ancestors and fix mis-completion r=jonas-schievink a=oxalica Refactor the logic of `completion_match` to check deterministic number of ancestors instead of `token.ancestors().find_map()`. This should fix wrong completions (https://github.com/rust-analyzer/rust-analyzer/pull/5976#issuecomment-692332191) and hopefully make completion to be faster (#6004). More play and test? @jonas-schievink @hammypants If this patch works, we can avoid the revert #6005 . :disappointed: Co-authored-by: oxalica <[email protected]>
| * | | | Avoid checking all ancestors and fix mis-completionoxalica2020-09-151-33/+215
|/ / / /
* | | | Merge #6008bors[bot]2020-09-152-1/+30
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | 6008: inline parameters for a function description r=jonas-schievink a=bnjjj close #6002 Co-authored-by: Benjamin Coenen <[email protected]>
| * | | inline parameters for a function description #6002Benjamin Coenen2020-09-151-5/+6
| | | | | | | | | | | | | | | | Signed-off-by: Benjamin Coenen <[email protected]>
| * | | inline parameters for a function description #6002Benjamin Coenen2020-09-152-1/+29
| | | | | | | | | | | | | | | | Signed-off-by: Benjamin Coenen <[email protected]>
* | | | Merge #6006bors[bot]2020-09-151-1/+1
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | 6006: Fix delimiter in SSR example r=jonas-schievink a=lnicola Co-authored-by: Laurențiu Nicola <[email protected]>
| * | | Fix delimiter in SSR exampleLaurențiu Nicola2020-09-151-1/+1
| | | |
* | | | Merge #6001bors[bot]2020-09-141-1/+2
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 6001: Add GitHub Sponsors link to blog post template r=jonas-schievink a=jonas-schievink Co-authored-by: Jonas Schievink <[email protected]>
| * | | | Add GitHub Sponsors link to blog post templateJonas Schievink2020-09-141-1/+2
|/ / / /
* | | | Merge #5999bors[bot]2020-09-141-6/+7
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | 5999: Update crates r=kjeremy a=kjeremy Co-authored-by: kjeremy <[email protected]>
| * | | Update crateskjeremy2020-09-141-6/+7
|/ / /
* | | Merge #5976bors[bot]2020-09-141-56/+119
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5976: Complete trait impl immediately after type/const/fn r=jonas-schievink a=oxalica Currently, we can complete type/const/fn but only if we typed an identifier. That is, `impl .. { fn f<|> }` has completions with all trait fn including `f`, but `impl .. { fn <|> }` doesn't provide any suggestion (even if explicit trigger it). This PR tweak the logic of completion match to make it possible. However, we still need to explicit trigger suggestions (`Control + Space` by default) in vscode to show. Not sure if we can make it automatically triggered after typing the space after `fn`. Another question is that I cannot figure out why `BLOCK_EXPR` need to be checked. A block expr directly inside a impl block should be invalid, and nested items will failed to locate impl block in specific offset and skip the suggestion. Now I simply removed it and no tests are broken. https://github.com/rust-analyzer/rust-analyzer/blob/4f91478e50dc5c2a87235e9be8bd91e3f62de4b4/crates/ide/src/completion/complete_trait_impl.rs#L109 Co-authored-by: oxalica <[email protected]>
| * | | Complete trait impl immediately after type/const/fnoxalica2020-09-111-56/+119
| | | |
* | | | Merge #5985bors[bot]2020-09-149-17/+65
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5985: Make MergeBehaviour configurable r=jonas-schievink a=Veykril This should make the newly implemented `MergeBehaviour` for import insertion configurable as roughly outlined in https://github.com/rust-analyzer/rust-analyzer/pull/5935#issuecomment-685834257. For the config name and the like I just picked what came to mind so that might be up for bikeshedding. Co-authored-by: Lukas Wirth <[email protected]>
| * | | | Make MergeBehaviour configurableLukas Wirth2020-09-129-17/+65
| | |/ / | |/| |
* | | | Merge #5971bors[bot]2020-09-1312-55/+314
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5971: Implement async blocks r=flodiebold a=oxalica Fix #4018 @flodiebold already gave a generic guide in the issue. Here's some concern about implementation detail: - Chalk doesn't support generator type yet. - Adding generator type as a brand new type (ctor) can be complex and need to *re-introduced* builtin impls. (Like how we implement closures before native closure support of chalk, which is already removed in #5401 ) - The output type of async block should be known after type inference of the whole body. - We cannot directly get the type from source like return-positon-impl-trait. But we still need to provide trait bounds when chalk asking for `opaque_ty_data`. - During the inference, the output type of async block can be temporary unknown and participate the later inference. `let a = async { None }; let _: i32 = a.await.unwrap();` So in this PR, the type of async blocks is inferred as an opaque type parameterized by the `Future::Output` type it should be, like what we do with closure type. And it really works now. Well, I still have some questions: - The bounds `AsyncBlockImplType<T>: Future<Output = T>` is currently generated in `opaque_ty_data`. I'm not sure if we should put this code here. - Type of async block is now rendered as `impl Future<Output = OutputType>`. Do we need to special display to hint that it's a async block? Note that closure type has its special format, instead of `impl Fn(..) -> ..` or function type. Co-authored-by: oxalica <[email protected]>
| * | | | Fix type walking about type of async blockoxalica2020-09-113-14/+78
| | | | |