Commit Graph

13253 Commits

Author SHA1 Message Date
Igor Aleksanov
15b16917fc Add TypeAliasRender 2020-11-03 10:16:35 +03:00
Igor Aleksanov
944ccf6075 Add ConstRender 2020-11-03 10:16:35 +03:00
Igor Aleksanov
fc8a1cd800 Introduce render module 2020-11-03 10:16:35 +03:00
bors[bot]
245e1b533b
Merge #6445
6445: Fix coalescing of prime_caches updates r=jonas-schievink a=jonas-schievink

The previous implementation could try to create a progress bar when one
was already registered.

bors r+ 🤖 

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2020-11-02 17:54:01 +00:00
Jonas Schievink
285960aa6b Fix coalescing of prime_caches updates
The previous implementation could try to create a progress bar when one
was  already registered
2020-11-02 18:49:54 +01:00
bors[bot]
173e45f872
Merge #6365
6365: Do insertion lookahead in algo::diff r=matklad a=Veykril

This is the last blocker for #6287 after this I can update that PR to properly fix things through using `SyntaxRewriter`.

This PR also shuffles tests around a bit and adds some more.

Ideally this is just a hack until we implement a "proper" diff algorithm that approximates a minimal diff. Maybe something like [gumtree](https://github.com/GumTreeDiff/gumtree)?

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-11-02 17:47:08 +00:00
bors[bot]
d021dbeb4f
Merge #6393 #6399
6393: Remove repetitive inlay hints (take 2) r=matklad a=lnicola



6399: Keep generic annotations when qualifying things r=matklad a=Veykril

The `qualify_path` assists currently eats up already annotated generics in all but one cases which can be annoying if one already pre-fills generics of a type before it's been qualified.

Co-authored-by: Matthew Sanetra <matthewsanetra@gmail.com>
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-11-02 17:40:47 +00:00
bors[bot]
2bd26e6afc
Merge #6443
6443: Remove unnecessary clone r=jonas-schievink a=jonas-schievink

bors r+ 🤖

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2020-11-02 17:34:41 +00:00
Jonas Schievink
58e3fd8e8e Remove unnecessary clone 2020-11-02 18:33:46 +01:00
bors[bot]
eb4e84ff51
Merge #6441
6441: Coalesce prime_caches updates r=matklad a=jonas-schievink

This reduces the number of progress bar updates we send to the client by collapsing subsequent updates into one. This doesn't work as well as I'd hoped (which is that we end up sending *no* updates, or only `start` and `end`, when the cache is already fresh), but it does reduce the number considerably: instead of ~720 updates on the rust-analyzer codebase, we now only send ~60.

It uses the same approach that is already in use for coalescing VFS events.

Hopefully this is enough to fix https://github.com/rust-analyzer/rust-analyzer/issues/6413.

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2020-11-02 17:12:08 +00:00
bors[bot]
4e80002ace
Merge #6442
6442: Bump chalk and lexer r=kjeremy a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
2020-11-02 17:02:21 +00:00
kjeremy
0403e82d91 Bump chalk and lexer 2020-11-02 12:00:58 -05:00
Jonas Schievink
a968cb6aef Remove debug print 2020-11-02 17:24:35 +01:00
Jonas Schievink
6e8ddac165 Coalesce prime_caches updates 2020-11-02 17:24:35 +01:00
bors[bot]
cb04f0c019
Merge #6440
6440: Deny unreachable pub r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-11-02 16:01:38 +00:00
Aleksey Kladov
f5e7f07838 Update crates
This is to bust the caches
2020-11-02 17:00:05 +01:00
Aleksey Kladov
ba8d6d1e4e Remove more unreachable pubs 2020-11-02 16:58:33 +01:00
bors[bot]
731b38fa3c
Merge #6438
6438: Deny unreachable-pub r=matklad a=matklad

It's very useful when `pub` is equivalent to "this is crate's public
API", let's enforce this!

Ideally, we should enforce it for local `cargo test`, and only during
CI, but that needs https://github.com/rust-lang/cargo/issues/5034.


Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-11-02 13:08:53 +00:00
Aleksey Kladov
b610118453 Deny unreachable-pub
It's very useful when `pub` is equivalent to "this is crate's public
API", let's enforce this!

Ideally, we should enforce it for local `cargo test`, and only during
CI, but that needs https://github.com/rust-lang/cargo/issues/5034.
2020-11-02 14:07:08 +01:00
bors[bot]
6507877e70
Merge #6437
6437: Document doer object anti-pattern r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-11-02 11:18:03 +00:00
Aleksey Kladov
412d6b3db5
Update docs/dev/style.md
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-11-02 12:17:34 +01:00
Aleksey Kladov
4318828f21 Document doer object anti-pattern 2020-11-02 12:13:59 +01:00
bors[bot]
e7f90866bc
Merge #6436
6436: Textmate grammar: allow comments in attributes r=dustypomerleau a=dustypomerleau

Fixes #6419

Co-authored-by: Dusty Pomerleau <dustypomerleau@users.noreply.github.com>
2020-11-02 04:46:09 +00:00
Dusty Pomerleau
79598f55b0 fix: allow comments in attributes 2020-11-02 15:33:11 +11:00
bors[bot]
86d3b78407
Merge #6423
6423: cargo update r=kjeremy a=kjeremy



Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2020-10-31 14:22:36 +00:00
Jeremy Kolb
5fccb72dd5 cargo update 2020-10-31 10:20:25 -04:00
bors[bot]
28b1cd32b3
Merge #6420
6420: Update Cargo.toml r=flodiebold a=pksunkara

This was blocking the automated publishing.

Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
2020-10-31 09:00:26 +00:00
Pavan Kumar Sunkara
c070146a83
Update Cargo.toml 2020-10-31 08:49:57 +01:00
bors[bot]
dd84b7a24d
Merge #6416
6416: Respond with JSON-RPC error if we failed to deserialize request r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-10-30 19:07:29 +00:00
Aleksey Kladov
3b9548e163 Respond with JSON-RPC error if we failed to deserialize request
Historically, we intentinally violated JSON-RPC spec here by hard
crashing. The idea was to poke both the clients and servers to fix
stuff.

However, this is confusing for server implementors, and falls down in
one important place -- protocol extension are not always backwards
compatible, which causes crashes simply due to version mismatch. We
had once such case with our own extension, and one for semantic
tokens.

So let's be less adventerous and just err on the err side!
2020-10-30 19:57:52 +01:00
bors[bot]
590fdba284
Merge #6415
6415: Upgrade Chalk to 0.36 r=flodiebold a=flodiebold

Quite a few changes, because Chalk got rid of the `ApplicationTy` nesting.

Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
2020-10-30 18:22:03 +00:00
Florian Diebold
bca51e3519 Upgrade Chalk to 0.36
Quite a few changes, because Chalk got rid of the `ApplicationTy` nesting.
2020-10-30 18:57:55 +01:00
bors[bot]
e7c8c600b7
Merge #6411
6411: remove FIXME after rust 1.47 comes out r=lnicola a=qy3u

Remove 'FIXME' after rust 1.47 comes out.  And for compatibility with versions before 1.47, did't remove 'src'.

Co-authored-by: yuqing <yuqing@ipfsforce.com>
2020-10-30 07:10:31 +00:00
yuqing
6c4bb30e95 remove FIXME after rust 1.47 comes out 2020-10-30 14:58:59 +08:00
bors[bot]
1b7e350e80
Merge #6403
6403: docs: Update Neovim nvim-lspconfig repository link r=lnicola a=rockerBOO

`nvim-lsp` updated their repository to `nvim-lspconfig` to lessen confusion about what it does. 

Co-authored-by: Dave Lage <rockerboo@gmail.com>
2020-10-29 15:16:22 +00:00
Dave Lage
e6419350de
docs: Update Neovim nvim-lspconfig repository link 2020-10-29 11:08:12 -04:00
Lukas Wirth
042413c35f Keep generic annotations when qualifying things 2020-10-29 10:25:15 +01:00
bors[bot]
173e971e82
Merge #6398
6398: cargo update r=kjeremy a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
2020-10-28 19:38:57 +00:00
kjeremy
e7e58b08ac cargo update 2020-10-28 15:37:40 -04:00
bors[bot]
e77ac8d79c
Merge #6396
6396: refactor(hir_ty): do not override DisplayTarget in hir_fmt r=flodiebold a=bnjjj

Linked to bug discovery from #6387

The main goal is to not use `display()` method inside `hir_fmt` to not override any parameters (like `DisplayTarget`). 
cc @flodiebold 

Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-10-28 17:06:25 +00:00
Benjamin Coenen
7322a69cf6 refactor(hir_ty): do not override DisplayTarget in hir_fmt
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-10-28 17:58:16 +01:00
bors[bot]
93fca7556a
Merge #6394
6394: Smaller inlay hints r=SomeoneToIgnore a=kjeremy

This makes things a lot more readable but isn't officially supported by vscode: https://github.com/Microsoft/vscode/issues/9078

Inspired by Visual Studio, IntelliJ and Resharper.

Co-authored-by: kjeremy <kjeremy@gmail.com>
2020-10-28 15:00:25 +00:00
bors[bot]
e34183218c
Merge #6387
6387: do not use associated types placeholder for inlay hint  r=flodiebold a=bnjjj


close #6191

Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-10-28 14:54:00 +00:00
Benjamin Coenen
ec3638adb9 do not use associated types placeholder for inlay hint
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-10-28 15:42:51 +01:00
Benjamin Coenen
0aca7b78de do not use associated types placeholder for inlay hint
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-10-28 15:23:23 +01:00
kjeremy
77ffe137f2 Smaller inlay hints
This makes things a lot more readable but isn't officially supported by vscode: https://github.com/Microsoft/vscode/issues/9078

Inspired by Visual Studio, IntelliJ and Resharper.
2020-10-28 09:52:23 -04:00
bors[bot]
85cda15b62
Merge #6384
6384: add doctest runnables on struct r=lnicola a=bnjjj

I will check for how to do the same on trait implementation on another PR.

#6356

Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-10-28 13:15:28 +00:00
Benjamin Coenen
ef2f7bb243 do not use associated types placeholder for inlay hint
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-10-28 14:07:12 +01:00
Matthew Sanetra
05723cb50d Add check if param name is similar to fn name 2020-10-28 14:45:45 +02:00
bors[bot]
a9b60b8478
Merge #6392
6392: Also set textDecoration: none on inlay hints r=SomeoneToIgnore a=lnicola

Closes #6380

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2020-10-28 12:36:51 +00:00