Commit Graph

6977 Commits

Author SHA1 Message Date
Edwin Cheng
db5f73d261 Add test 2020-01-12 19:24:34 +08:00
bors[bot]
21be386db8
Merge #2809
2809: Qualify paths in 'fill match arms' assist r=matklad a=flodiebold



Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2020-01-12 11:23:11 +00:00
Florian Diebold
2c11a9b42d Qualify paths in 'fill match arms' assist 2020-01-12 11:34:52 +01:00
Edwin Cheng
d7be1a4372 Use attr location for builtin macro goto-imp 2020-01-12 18:08:53 +08:00
Jeremy Kolb
38c3b02f96 Update crates 2020-01-11 20:16:35 -05:00
bors[bot]
86d2af9f7b
Merge #2803
2803: Fix various names, e.g. Iterator not resolving in core prelude r=matklad a=flodiebold

Basically, `Iterator` is re-exported via several steps, which happened to not be
resolved yet when we got to the prelude import, but since the name resolved to
the reexport from `core::iter` (just to no actual items), we gave up trying to
resolve it further.

Maybe part of the problem is that we can have
`PartialResolvedImport::Unresolved` or `PartialResolvedImport::Indeterminate`
with `None` in all namespaces, and handle them differently.

Fixes #2683.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2020-01-11 23:00:37 +00:00
bors[bot]
bcfd297f49
Merge #2727
2727: Qualify paths in 'add impl members' r=flodiebold a=flodiebold

This makes the 'add impl members' assist qualify paths, so that they should resolve to the same thing as in the definition. To do that, it adds an algorithm that finds a path to refer to any item from any module (if possible), which is actually probably the more important part of this PR 😄 It handles visibility, reexports, renamed crates, prelude etc.; I think the only thing that's missing is support for local items. I'm not sure about the performance, since it takes into account every location where the target item has been `pub use`d, and then recursively goes up the module tree; there's probably potential for optimization by memoizing more, but I think the general shape of the algorithm is necessary to handle every case in Rust's module system.

~The 'find path' part is actually pretty complete, I think; I'm still working on the assist (hence the failing tests).~

Fixes #1943.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
2020-01-11 22:42:39 +00:00
Florian Diebold
9dc1826cfa Fix various names, e.g. Iterator not resolving in core prelude
Basically, `Iterator` is re-exported via several steps, which happened to not be
resolved yet when we got to the prelude import, but since the name resolved to
the reexport from `core::iter` (just to no actual items), we gave up trying to
resolve it further.

Maybe part of the problem is that we can have
`PartialResolvedImport::Unresolved` or `PartialResolvedImport::Indeterminate`
with `None` in all namespaces, and handle them differently.

Fixes #2683.
2020-01-11 23:37:58 +01:00
Florian Diebold
ccb75f7c97 Use FxHashMap 2020-01-11 23:33:04 +01:00
Florian Diebold
4496e2a06a Apply review suggestions 2020-01-11 23:33:04 +01:00
Florian Diebold
15fc643e05 Fix ordering problem between qualifying paths and substituting params 2020-01-11 23:33:04 +01:00
Florian Diebold
12905e5b58 Some more refactoring 2020-01-11 23:33:04 +01:00
Florian Diebold
def124e932 Fix file ID when qualifying paths; add another failing test 2020-01-11 23:33:04 +01:00
Florian Diebold
4545f289a9 Handle type args 2020-01-11 23:33:04 +01:00
Florian Diebold
5cb1f71322 More failing tests 2020-01-11 23:33:04 +01:00
Florian Diebold
4d75430e91 Qualify some paths in 'add missing impl members' 2020-01-11 23:33:04 +01:00
Florian Diebold
460fa71c55 Use self 2020-01-11 23:33:04 +01:00
Florian Diebold
2906d188c2 Cleanup 2020-01-11 23:33:04 +01:00
Florian Diebold
38cd9f0c94 Handle cycles 2020-01-11 23:33:04 +01:00
Florian Diebold
b1325488ec Use query for importable locations 2020-01-11 23:33:04 +01:00
Florian Diebold
947eec7b87 Use super, don't use private imports 2020-01-11 23:33:04 +01:00
Florian Diebold
df9d3bd25e Use shortest path 2020-01-11 23:33:04 +01:00
Florian Diebold
1ea2b475a9 handle most cases 2020-01-11 23:33:04 +01:00
Florian Diebold
b62292e8f9 basics working 2020-01-11 23:33:04 +01:00
Florian Diebold
2c50f996b6 more WIP 2020-01-11 23:33:04 +01:00
Florian Diebold
22b412f1a9 find_path WIP 2020-01-11 23:33:04 +01:00
Florian Diebold
877fda04c5 Add test 2020-01-11 23:33:04 +01:00
bors[bot]
e90aa86fbf
Merge #2804
2804: Use lsp-seq-first in ra-emacs-lsp since that's more likely to exist r=flodiebold a=flodiebold



Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2020-01-11 22:32:14 +00:00
Florian Diebold
c0b5d59bd6 Use lsp-seq-first in ra-emacs-lsp since that's more likely to exist 2020-01-11 23:31:16 +01:00
bors[bot]
2e09a96f82
Merge #2800
2800: Stick to defaulter release profile r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-01-11 21:15:50 +00:00
Aleksey Kladov
dde64aa744 Stick to defaulter release profile 2020-01-11 22:15:27 +01:00
Aleksey Kladov
af0059a4d1
Merge pull request #2798 from matklad/release-process
Tweak release workflow
2020-01-11 22:04:13 +01:00
Aleksey Kladov
7e1a25f149 Tweak release workflow 2020-01-11 21:50:32 +01:00
bors[bot]
3924c7de50
Merge #2791
2791: Slightly more robust cargo watcher root search r=kiljacken a=kiljacken

Fixes #2780 (hopefully).

Use the already painstakingly found `workspaces` instead of naively using `folder_roots` from editor.

Co-authored-by: Emil Lauridsen <mine809@gmail.com>
2020-01-11 20:41:41 +00:00
Aleksey Kladov
7d4a62275d Don't be overly generic 2020-01-11 21:38:15 +01:00
Aleksey Kladov
8670812209
Merge pull request #2766 from gilescope/windows-build
Upload PR
2020-01-11 21:37:09 +01:00
Emil Lauridsen
8e778f9842 Clean up straggling mut 2020-01-11 21:37:01 +01:00
Emil Lauridsen
480c44918c Disable cargo checking in workspaces with no cargo projects 2020-01-11 21:32:40 +01:00
bors[bot]
7c1af25b22
Merge #2795
2795: Use dummy value for macro file in bulitin macros r=matklad a=edwin0cheng

This PR skip the actual line and column computation for `MacroFile` and return a dummy value instead.

Related to #2794



Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-01-11 20:13:48 +00:00
bors[bot]
7326608536
Merge #2796
2796: Fix lruCapacity config key in VSCode r=kjeremy a=marcogroppo

Closes #2789.

This simply adds `null` as a valid value for the configuration key. 

We could use the server-side default value (128) instead, but in that case every time we change its value on the server side we would have to update it on the client side too.

Co-authored-by: Marco Groppo <marco.groppo@gmail.com>
2020-01-11 16:56:11 +00:00
Marco Groppo
08fa0151ed Fix lruCapacity config setting type 2020-01-11 13:30:02 +01:00
Edwin Cheng
9f65ae20c2 Use dummy value for macro file in bulitin macros 2020-01-11 16:37:42 +08:00
bors[bot]
991b62a4f9
Merge #2790
2790: Add test for macro expansion in various expressions r=edwin0cheng a=flodiebold

cc @edwin0cheng 

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2020-01-11 03:51:04 +00:00
Emil Lauridsen
d6da18e99d Address nit 2020-01-10 22:41:52 +01:00
bors[bot]
a9ba32e2e6
Merge #2749
2749: Basic DocumentHighlightKind support for assignments r=matklad a=kjeremy

Wraps references per #2738 and adds limited support for DocumentHighlightKind Read/Write for simple binops assignments.

I think I need some help with determining reads/writes.

Towards #2560 

Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
Co-authored-by: kjeremy <kjeremy@gmail.com>
2020-01-10 21:40:57 +00:00
Emil Lauridsen
1d1eea217d Slightly more robust cargo watcher root search 2020-01-10 22:10:26 +01:00
Florian Diebold
dd6ec81d65 Add test for macro expansion in various expressions 2020-01-10 22:08:02 +01:00
kjeremy
a633a6275a Fix Write being sent down the wire.
Not sure what the deal is here but it wasn't sending Write.
2020-01-10 15:30:17 -05:00
kjeremy
32540abcb3 Add AccessMode to decls 2020-01-10 15:14:19 -05:00
kjeremy
49fd6a5228 Split Declaration out into it's own type 2020-01-10 15:14:19 -05:00