]>
git.lizzy.rs Git - rust.git/log
bors[bot] [Sat, 29 Feb 2020 15:36:03 +0000 (15:36 +0000)]
Merge #3309
3309: Find cargo toml up the fs r=matklad a=not-much-io
Currently rust-analyzer will look for Cargo.toml in the root of the project and if failing that then go down the filesystem until root.
This unfortunately wouldn't work automatically with (what I imagine is) a fairly common project structure. As an example with multiple languages like:
```
js/
..
rust/
Cargo.toml
...
```
Added this small change so rust-analyzer would glance one level up if not found in root or down the filesystem.
## Why not go deeper?
Could be problematic with large project vendored dependencies etc.
## Why not add a Cargo.toml manual setting option?
Loosely related and a good idea, however the convenience of having this automated also is hard to pass up.
## Testing?
Build a binary with various logs and checked it in a project with such a structure:
```
[ERROR ra_project_model] find_cargo_toml()
[ERROR ra_project_model] find_cargo_toml_up_the_fs()
[ERROR ra_project_model] entities: ReadDir("/workspaces/my-project")
[ERROR ra_project_model] candidate: "/workspaces/my-project/rust/Cargo.toml", exists: true
```
## Edge Cases?
If you have multiple Cargo.toml files one level deeper AND not in the root, will get whatever comes first (order undefined), example:
```
crate1/
Cargo.toml
crate2/
Cargo.toml
... (no root Cargo.toml)
```
However this is quite unusual and wouldn't have worked before either. This is only resolvable via manually choosing.
Co-authored-by: nmio <kristo.koert@gmail.com>
bors[bot] [Sat, 29 Feb 2020 15:27:53 +0000 (15:27 +0000)]
Merge #3376
3376: Fix a common false-positive type mismatch r=matklad a=flodiebold
E.g. for `&{ some_string() }` in a context where a `&str` is expected, we
reported a mismatch inside the block. The problem is that we're passing an
expectation of `str` down, but the expectation is more of a hint in this case.
There's a long comment in rustc about this, which I just copied.
Also, fix reported location for type mismatches in macros.
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
Florian Diebold [Sat, 29 Feb 2020 14:31:07 +0000 (15:31 +0100)]
Fix a common false-positive type mismatch
E.g. for `&{ some_string() }` in a context where a `&str` is expected, we
reported a mismatch inside the block. The problem is that we're passing an
expectation of `str` down, but the expectation is more of a hint in this case.
There's a long comment in rustc about this, which I just copied.
Also, fix reported location for type mismatches in macros.
nmio [Sat, 29 Feb 2020 13:14:31 +0000 (13:14 +0000)]
lint warn fix
nmio [Sat, 29 Feb 2020 13:05:10 +0000 (13:05 +0000)]
keep one CargoTomlNotFoundError
bors[bot] [Sat, 29 Feb 2020 12:52:56 +0000 (12:52 +0000)]
Merge #3375
3375: Cleanup editing API a bit r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 29 Feb 2020 12:50:47 +0000 (13:50 +0100)]
Fix typo
Aleksey Kladov [Sat, 29 Feb 2020 12:49:43 +0000 (13:49 +0100)]
Cleanup editing API
bors[bot] [Sat, 29 Feb 2020 10:56:10 +0000 (10:56 +0000)]
Merge #3374
3374: More orthogonal API for building paths r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 29 Feb 2020 10:55:36 +0000 (11:55 +0100)]
More orthogonal API for building paths
bors[bot] [Fri, 28 Feb 2020 23:03:28 +0000 (23:03 +0000)]
Merge #3372
3372: vscode: migrate to more type-safe assert impl r=matklad a=Veetaha
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#assertion-functions
Co-authored-by: Veetaha <gerzoh1@gmail.com>
Veetaha [Fri, 28 Feb 2020 22:46:48 +0000 (00:46 +0200)]
vscode: simplify assert.eq() to assert() as per matklad
Veetaha [Fri, 28 Feb 2020 22:33:34 +0000 (00:33 +0200)]
vscode: add dat semicolon
Veetaha [Fri, 28 Feb 2020 22:26:22 +0000 (00:26 +0200)]
vscode: add equality assertion
Veetaha [Fri, 28 Feb 2020 22:07:29 +0000 (00:07 +0200)]
vscode: rename nodeAssert -> nativeAssert
Veetaha [Fri, 28 Feb 2020 22:02:19 +0000 (00:02 +0200)]
vscode: add error loging on failed assertion
Veetaha [Fri, 28 Feb 2020 21:56:17 +0000 (23:56 +0200)]
vscode: migrate to more type-safe assert impl
bors[bot] [Fri, 28 Feb 2020 21:44:07 +0000 (21:44 +0000)]
Merge #3371
3371: Simplify r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Fri, 28 Feb 2020 21:43:13 +0000 (22:43 +0100)]
Simplify
bors[bot] [Fri, 28 Feb 2020 20:54:21 +0000 (20:54 +0000)]
Merge #3370
3370: Move insert_use util to utils r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Fri, 28 Feb 2020 20:53:20 +0000 (21:53 +0100)]
Move insert_use util to utils
bors[bot] [Fri, 28 Feb 2020 16:28:53 +0000 (16:28 +0000)]
Merge #3369
3369: Reduce visibility r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Fri, 28 Feb 2020 16:27:49 +0000 (17:27 +0100)]
Reduce visibility
bors[bot] [Fri, 28 Feb 2020 15:56:07 +0000 (15:56 +0000)]
Merge #3367
3367: Fix highlighting of const patterns r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Fri, 28 Feb 2020 15:49:46 +0000 (16:49 +0100)]
Correctly flag 'lifetime definitions as definitions
Aleksey Kladov [Fri, 28 Feb 2020 15:36:14 +0000 (16:36 +0100)]
Fix highlighting of const patterns
bors[bot] [Fri, 28 Feb 2020 15:07:33 +0000 (15:07 +0000)]
Merge #3366
3366: Simpilfy original_range logic r=matklad a=edwin0cheng
This PR fixed another [bug](https://github.com/rust-analyzer/rust-analyzer/issues/3000#issuecomment-
592474844 ) which incorrectly map the wrong range of `punct` in macro_call and simplify the logic a little bit by introducing an `ascend_call_token` function.
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
Edwin Cheng [Fri, 28 Feb 2020 14:53:59 +0000 (22:53 +0800)]
Simpilfy origin_range logic
Aleksey Kladov [Fri, 28 Feb 2020 14:27:52 +0000 (15:27 +0100)]
Classify name takes const patterns into account
bors[bot] [Fri, 28 Feb 2020 14:04:46 +0000 (14:04 +0000)]
Merge #3364
3364: Fix union classification r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Fri, 28 Feb 2020 14:03:09 +0000 (15:03 +0100)]
Fix union classification
bors[bot] [Fri, 28 Feb 2020 13:48:42 +0000 (13:48 +0000)]
Merge #3363
3363: Cleanup highlighting tags r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Fri, 28 Feb 2020 13:47:33 +0000 (14:47 +0100)]
Fix highlighting test
bors[bot] [Fri, 28 Feb 2020 12:53:09 +0000 (12:53 +0000)]
Merge #3362
3362: removing ctrl+r key binding fixes #2733 r=matklad a=jasonwilliams
@matklad i didn't see this mentioned anywhere else in the features.md
Co-authored-by: Jason Williams <jwilliams720@bloomberg.net>
Jason Williams [Fri, 28 Feb 2020 12:50:11 +0000 (12:50 +0000)]
removing ctrl+r key binding fixes #2733
Aleksey Kladov [Fri, 28 Feb 2020 11:06:54 +0000 (12:06 +0100)]
Cleanup highlighting tags
bors[bot] [Fri, 28 Feb 2020 10:32:18 +0000 (10:32 +0000)]
Merge #3361
3361: Reset fontStyle for inlay hints r=matklad a=matklad
Otherwise, we get bold hints on `true` and `false`
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Fri, 28 Feb 2020 10:30:46 +0000 (11:30 +0100)]
Reset fontStyle for inlay hints
Otherwise, we get bold hints on `true` and `false`
Aleksey Kladov [Thu, 27 Feb 2020 18:00:10 +0000 (19:00 +0100)]
add more tags
bors[bot] [Fri, 28 Feb 2020 09:32:56 +0000 (09:32 +0000)]
Merge #3355
3355: vscode: added feature flags for better short-term ux r=matklad a=Veetaha
See [this zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/Feature.20flags) for more details.
Co-authored-by: Veetaha <gerzoh1@gmail.com>
bors[bot] [Fri, 28 Feb 2020 09:23:41 +0000 (09:23 +0000)]
Merge #3360
3360: Parse attribues in RHS of let statments r=matklad a=edwin0cheng
Fixed #3315
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
bors[bot] [Fri, 28 Feb 2020 07:53:19 +0000 (07:53 +0000)]
Merge #3359
3359: Remove AnalysisHost::type_of r=matklad a=edwin0cheng
This PR remove ` AnalysisHost::type_of` (It is subsume by hover now) and use `Semantics::type_of_x` to infer the type inside `hover` directly.
And this also solved a bug : Right now hovering on a string literal inside a macro will show up a `&str` popup correctly. (Except if that involved builtin macro, e.g. `println`)
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
Edwin Cheng [Fri, 28 Feb 2020 07:39:34 +0000 (15:39 +0800)]
Fix typo
bors[bot] [Fri, 28 Feb 2020 07:07:21 +0000 (07:07 +0000)]
Merge #3357
3357: introduce const visibility assist r=matklad a=qmx
this adds the same change visibility assist to `const` declarations too - as suggested by @matklad
Co-authored-by: Douglas Campos <qmx@qmx.me>
Edwin Cheng [Fri, 28 Feb 2020 05:08:47 +0000 (13:08 +0800)]
Parse attr in rhs of let stmts
Edwin Cheng [Fri, 28 Feb 2020 03:37:22 +0000 (11:37 +0800)]
Remove hover::type_of
Douglas Campos [Fri, 28 Feb 2020 01:15:17 +0000 (01:15 +0000)]
introduce const visibility assist
nmio [Thu, 27 Feb 2020 22:06:51 +0000 (22:06 +0000)]
remove code used for testing
nmio [Thu, 27 Feb 2020 22:03:29 +0000 (22:03 +0000)]
fix unneeded body
nmio [Thu, 27 Feb 2020 21:52:10 +0000 (21:52 +0000)]
fixes and improvements
Veetaha [Thu, 27 Feb 2020 20:04:57 +0000 (22:04 +0200)]
vscode: added feature flags for better short-term ux
bors[bot] [Thu, 27 Feb 2020 17:40:36 +0000 (17:40 +0000)]
Merge #3354
3354: Map builtin r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Thu, 27 Feb 2020 17:37:25 +0000 (18:37 +0100)]
Map builtin
bors[bot] [Thu, 27 Feb 2020 17:32:16 +0000 (17:32 +0000)]
Merge #3353
3353: Set attr scope r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Thu, 27 Feb 2020 17:31:54 +0000 (18:31 +0100)]
Set attr scope
bors[bot] [Thu, 27 Feb 2020 16:29:56 +0000 (16:29 +0000)]
Merge #3352
3352: Map unsafe keyword r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Thu, 27 Feb 2020 16:28:59 +0000 (17:28 +0100)]
Map unsafe keyword
bors[bot] [Thu, 27 Feb 2020 16:21:09 +0000 (16:21 +0000)]
Merge #3351
3351: Refactor string literals r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Thu, 27 Feb 2020 16:19:53 +0000 (17:19 +0100)]
Refactor string literals
Aleksey Kladov [Thu, 27 Feb 2020 15:48:22 +0000 (16:48 +0100)]
Merge pull request #3350 from edwin0cheng/give-up-hover-in-builtin-macro
Ignore hover on builtin macro
Aleksey Kladov [Thu, 27 Feb 2020 15:48:06 +0000 (16:48 +0100)]
Merge pull request #3349 from matklad/yo-dawg
Put syntax highlighting into syntax highlighting
Aleksey Kladov [Thu, 27 Feb 2020 15:35:00 +0000 (16:35 +0100)]
Merge pull request #3348 from matklad/single-line
Ensure that semantic tokens are single-line
Aleksey Kladov [Thu, 27 Feb 2020 15:05:35 +0000 (16:05 +0100)]
Basic injections
Aleksey Kladov [Thu, 27 Feb 2020 13:54:31 +0000 (14:54 +0100)]
Ensure that semantic tokens are single-line
Edwin Cheng [Thu, 27 Feb 2020 15:03:18 +0000 (23:03 +0800)]
Ignore hover on builtin macro
bors[bot] [Thu, 27 Feb 2020 13:20:46 +0000 (13:20 +0000)]
Merge #3346
3346: More cleanup r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Thu, 27 Feb 2020 13:15:32 +0000 (14:15 +0100)]
Move tests to a new file
Aleksey Kladov [Thu, 27 Feb 2020 13:00:51 +0000 (14:00 +0100)]
More cleanup
bors[bot] [Thu, 27 Feb 2020 11:26:17 +0000 (11:26 +0000)]
Merge #3344
3344: Split loop into orthogonal phases r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Thu, 27 Feb 2020 10:56:42 +0000 (11:56 +0100)]
Split loop into orthogonal phases
Aleksey Kladov [Thu, 27 Feb 2020 10:39:54 +0000 (11:39 +0100)]
Cleanup
Aleksey Kladov [Thu, 27 Feb 2020 10:37:21 +0000 (11:37 +0100)]
Minor cleanup
bors[bot] [Thu, 27 Feb 2020 10:15:01 +0000 (10:15 +0000)]
Merge #3343
3343: Fix style r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Thu, 27 Feb 2020 10:09:48 +0000 (11:09 +0100)]
Fix style
bors[bot] [Thu, 27 Feb 2020 10:07:51 +0000 (10:07 +0000)]
Merge #3342
3342: Some docs r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Thu, 27 Feb 2020 10:07:26 +0000 (11:07 +0100)]
Some docs
bors[bot] [Thu, 27 Feb 2020 09:56:41 +0000 (09:56 +0000)]
Merge #3341
3341: Make xtask install path-agnostic r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Thu, 27 Feb 2020 09:54:20 +0000 (10:54 +0100)]
Make xtask install path-agnostic
Aleksey Kladov [Thu, 27 Feb 2020 09:47:43 +0000 (10:47 +0100)]
Merge pull request #3340 from matklad/fix-lint
Actually gate CI on eslint
Aleksey Kladov [Thu, 27 Feb 2020 09:46:43 +0000 (10:46 +0100)]
Fix lint
Aleksey Kladov [Thu, 27 Feb 2020 09:40:53 +0000 (10:40 +0100)]
Actually gate CI on eslint
bors[bot] [Thu, 27 Feb 2020 09:25:34 +0000 (09:25 +0000)]
Merge #3339
3339: Fix flickering with new syntax highlighting r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Thu, 27 Feb 2020 09:19:56 +0000 (10:19 +0100)]
Fix flickering with new syntax highlighting
bors[bot] [Thu, 27 Feb 2020 09:00:31 +0000 (09:00 +0000)]
Merge #3308
3308: vscode: fix vscode-vim keybindings conflict r=matklad a=Veetaha
Closes #3013 I hope
vscode-vim extension overrides the `type` command so that it prevents
some keypresses to reach the text document editor.
It conflicts with our `onEnter` keybinding
that is used to support automatic doc comments extending and
indentation insertion.
The VSCode-native way to implement this would be
to use regular expressions, but as per matklad it is
considered not acceptable for the language server.
Thus we implement it via a `Enter` keybinding that
invokes our `onEnter` command which does it via the language-server.
At the end of the day we may only apply
ad hoc workarounds for conflicting extensions.
But vscode has another bug for that. You
either cannot use parantheses in `when` condition
of a keybinding or it just malfunctions.
See an issue about that here: https://github.com/microsoft/vscode/issues/91473
To get the ultimate context, follow this [zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/Enhanced.20typing)
Co-authored-by: Veetaha <gerzoh1@gmail.com>
bors[bot] [Thu, 27 Feb 2020 08:54:18 +0000 (08:54 +0000)]
Merge #3285
3285: Handle trivia in Structural Search and Replace r=matklad a=adamrk
Addresses the second point of https://github.com/rust-analyzer/rust-analyzer/issues/3186.
Structural search and replace will now match code that has varies from the pattern in whitespace or comments.
One issue is that it's not clear where comments in the matched code should go in the replacement. With this change they're just tacked on at the end, which can cause some unexpected moving of comments (see the last test example).
Co-authored-by: adamrk <ark.email@gmail.com>
bors[bot] [Thu, 27 Feb 2020 08:47:03 +0000 (08:47 +0000)]
Merge #3338
3338: Renam module r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Thu, 27 Feb 2020 08:46:34 +0000 (09:46 +0100)]
Renam module
bors[bot] [Thu, 27 Feb 2020 08:32:44 +0000 (08:32 +0000)]
Merge #3335
3335: Refactor highlighting a bit r=matklad a=matklad
bors r+
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 26 Feb 2020 22:16:57 +0000 (23:16 +0100)]
Color constants
Aleksey Kladov [Wed, 26 Feb 2020 22:13:48 +0000 (23:13 +0100)]
Move html highlightig to a separate module
Aleksey Kladov [Wed, 26 Feb 2020 22:09:55 +0000 (23:09 +0100)]
Fix html tests
Aleksey Kladov [Wed, 26 Feb 2020 18:39:32 +0000 (19:39 +0100)]
Better highlightign API
bors[bot] [Thu, 27 Feb 2020 06:44:44 +0000 (06:44 +0000)]
Merge #3337
3337: Remove unused dependencies r=matklad a=sinkuu
Co-authored-by: Shotaro Yamada <sinkuu@sinkuu.xyz>
Shotaro Yamada [Thu, 27 Feb 2020 04:33:03 +0000 (13:33 +0900)]
Remove unused dependencies
bors[bot] [Thu, 27 Feb 2020 02:08:19 +0000 (02:08 +0000)]
Merge #3336
3336: Use text_range::extend_to r=edwin0cheng a=edwin0cheng
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
Edwin Cheng [Thu, 27 Feb 2020 02:06:48 +0000 (10:06 +0800)]
Use text_range::extend_to
bors[bot] [Wed, 26 Feb 2020 21:53:29 +0000 (21:53 +0000)]
Merge #3334
3334: Update lsp-types r=matklad a=kjeremy
Uses the correct type for the currently unused `SemanticTokensEditsRequest::Return`
Co-authored-by: kjeremy <kjeremy@gmail.com>
kjeremy [Wed, 26 Feb 2020 21:50:47 +0000 (16:50 -0500)]
Update lsp-types
bors[bot] [Wed, 26 Feb 2020 21:10:44 +0000 (21:10 +0000)]
Merge #3332
3332: Fix r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 26 Feb 2020 21:10:23 +0000 (22:10 +0100)]
Fix