Commit graph

99 commits

Author SHA1 Message Date
o0Ignition0o
331d1db317 Add crate versions when running cargo -p commands.
Until now cargo commands with the -p flag would pass the package name only.
It doesn't play super well with the toml Renaming dependencies feature.
This commit specifies the package name and version when a cargo command is run with the -p flag,
to avoid ambiguities.
2020-03-31 14:43:39 +02:00
Aleksey Kladov
6b2f02fdfd Ignore createProgress request in tests
closes #3783
2020-03-31 12:02:47 +02:00
kjeremy
d4c317320d Simplify SemanticTokensBuilder build method
This matches the next stable vscode api
2020-03-30 12:07:27 -04:00
Kirill Bulatov
8e78371222 Rebase fixes 2020-03-30 13:39:14 +03:00
Kirill Bulatov
2a19459ee9 Avoid failing on incorrect settings response 2020-03-30 13:39:14 +03:00
Kirill Bulatov
fbef0127ba Small style fix 2020-03-30 13:39:14 +03:00
Kirill Bulatov
b892a48740 Code review fixes
Co-Authored-By: Veetaha <veetaha2@gmail.com>
2020-03-30 13:39:14 +03:00
Kirill Bulatov
590af37bff Small style fix
Co-Authored-By: Veetaha <veetaha2@gmail.com>
2020-03-30 13:39:14 +03:00
Kirill Bulatov
392eb74b5f Remove an obsolete fixme 2020-03-30 13:39:14 +03:00
Kirill Bulatov
bbe59c7197 Reload watcher configuration 2020-03-30 13:39:14 +03:00
Kirill Bulatov
8a23bec2cd Style fixes 2020-03-30 13:39:14 +03:00
Kirill Bulatov
332799d914 Reload only the properties that do not affect vfs 2020-03-30 13:39:14 +03:00
Kirill Bulatov
2feaef91bd Read new config on the server side 2020-03-30 13:39:14 +03:00
Kirill Bulatov
019f269a0a Process configuration response draft 2020-03-30 13:39:14 +03:00
Kirill Bulatov
8c4aab0c80 Client side draft 2020-03-30 13:39:14 +03:00
Aleksey Kladov
4c9272583c Pull options outwards 2020-03-30 11:46:04 +02:00
Aleksey Kladov
12297ab675 Fix race in the tests 2020-03-30 11:33:01 +02:00
Edwin Cheng
36812b9d7b Fix review comments 2020-03-30 02:39:03 +08:00
Edwin Cheng
dc0076de12 Move roots_to_scan to LoopState 2020-03-29 06:33:16 +08:00
Aleksey Kladov
311cbbdad5 Remove some unwraps 2020-03-28 12:27:54 +01:00
Aleksey Kladov
6596e7cddf Nice string formatting 2020-03-28 12:27:54 +01:00
Edwin Cheng
d0b6ed4441 Add ProcMacroClient 2020-03-26 03:29:45 +08:00
Aleksey Kladov
b3665fccfb Preserve relative ordering of grouped assists 2020-03-25 15:45:52 +01:00
Matt Hooper
a197abbc7a Added new inlay hint kind and rules for method chaining 2020-03-24 23:18:42 +01:00
Josh Mcguigan
df58ab8963 update itertools version to 0.9.0 2020-03-23 16:22:46 -07:00
Aleksey Kladov
516fe293a8 More direct CargoWorkspace 2020-03-19 17:53:31 +01:00
Emil Lauridsen
f84deffd72 Support loading OUT_DIR for CLI runs 2020-03-17 14:47:05 +01:00
Emil Lauridsen
f5a2fcf8f5 Change existing OUT_DIR override config to make use of new infrastructure 2020-03-17 14:47:05 +01:00
Emil Lauridsen
33c6c7abc6 Support loading OUT_DIR from cargo check at launch 2020-03-17 14:47:05 +01:00
bors[bot]
5bdc249b2c
Merge #3587
3587: Use WorkDoneProgress LSP API for initial load r=matklad a=slyngbaek

Addresses #3283

Rather than using custom UI for showing the loaded state. Rely
on the WorkDoneProgress API in 3.15.0
https://microsoft.github.io/language-server-protocol/specification#workDoneProgress.

No client-side work was necessary. The UI is not exactly what is
described in the issue but afaict that's how VS Code implements the LSP
API.

- The WorkDoneProgressEnd does not appear to display its message
  contents (controlled by vscode)

Co-authored-by: Steffen Lyngbaek <steffenlyngbaek@gmail.com>
2020-03-16 11:48:46 +00:00
bors[bot]
a99cac671c
Merge #3540
3540: Swtches to rust SSR query check r=matklad a=mikhail-m1

related to #3186 

Co-authored-by: Mikhail Modin <mikhailm1@gmail.com>
2020-03-16 09:48:09 +00:00
Steffen Lyngbaek
b6dec2eb1f Fix tests part 2... 2020-03-15 23:32:28 -07:00
Steffen Lyngbaek
70ccda3941 Fix broken tests
- Handle case of no projects. The notification still needs to be posted
2020-03-15 21:44:27 -07:00
Steffen Lyngbaek
e3db4f3716 Rely on the safer workspace_loaded check 2020-03-15 20:48:39 -07:00
Mikhail Modin
b150965ed7 Swtches to rust SSR query check 2020-03-15 21:23:18 +00:00
Steffen Lyngbaek
5a1e531176 Fix broken tests
- Properly wait for workspace loading to be done
2020-03-13 22:06:49 -07:00
Steffen Lyngbaek
f0b58fd1fa Use idiomatic way of defining floats 2020-03-13 16:27:39 -07:00
Steffen Lyngbaek
083035fd06 Use WorkDoneProgress LSP API for initial load
Addresses #3283

Rather than using custom UI for showing the loaded state. Rely
on the WorkDoneProgress API in 3.15.0
https://microsoft.github.io/language-server-protocol/specification#workDoneProgress.

No client-side work was necessary. The UI is not exactly what is
described in the issue but afaict that's how VS Code implements the LSP
API.

- The WorkDoneProgressEnd does not appear to display its message
  contents (controlled by vscode)
2020-03-13 16:03:02 -07:00
bors[bot]
4c85e53531
Merge #3561 #3577
3561: feat: add debug code lens r=matklad a=hdevalke

Refs #3539

3577: Protect against infinite macro expansion in def collector r=edwin0cheng a=flodiebold

Something I noticed while trying to make macro expansion more resilient against errors.

There was a test for this, but it wasn't actually working because the first recursive expansion failed. (The comma...)

Even with this limit, that test (when fixed) still takes some time to pass because of the exponential growth of the expansions, so I disabled it and added a different one without growth.

CC @edwin0cheng 

Co-authored-by: Hannes De Valkeneer <hannes@de-valkeneer.be>
Co-authored-by: hdevalke <2261239+hdevalke@users.noreply.github.com>
Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
2020-03-13 14:01:29 +00:00
Hannes De Valkeneer
39c92b3872 fixup! feat: add debug code lens
autodetect vscode-lldb
2020-03-12 22:31:47 +01:00
Hannes De Valkeneer
e9d025b618 fixup! feat: add debug code lens
avoid repetition of `--no-run`
2020-03-12 21:28:26 +01:00
hdevalke
60b154ff92
Update crates/rust-analyzer/src/main_loop/handlers.rs
use `Vec::new` instead of `Vec::with_capacity(0)`

Co-Authored-By: Veetaha <veetaha2@gmail.com>
2020-03-12 20:56:34 +01:00
Aleksey Kladov
b3fa7312a7 Simpler deserialization 2020-03-12 18:01:36 +01:00
Aleksey Kladov
fd3ece2b73 Make naming more uniform 2020-03-12 17:38:48 +01:00
bors[bot]
d98a5fab46
Merge #3543
3543: Parameter inlay hint separate from variable type inlay? #2876 r=matklad a=slyngbaek

Add setting to allow enabling either type inlay hints or parameter
inlay hints or both. Group the the max inlay hint length option
into the object.

- Add a new type for the inlayHint options.
- Add tests to ensure the inlays don't happen on the server side

Co-authored-by: Steffen Lyngbaek <steffenlyngbaek@gmail.com>
2020-03-12 16:02:55 +00:00
Steffen Lyngbaek
58248e24cd Switch from Vec<InlayKind> to object with props
- Instead of a single object type, use several individual nested types
  to allow toggling from the settings GUI
- Remove unused struct definitions
- Install and test that the toggles work
2020-03-11 20:14:39 -07:00
Hannes De Valkeneer
e903fd0d97 feat: add debug code lens
Refs #3539
2020-03-11 22:26:47 +01:00
bors[bot]
c48dcf7411
Merge #3549
3549: Implement env! macro r=matklad a=edwin0cheng

This PR implements `env!` macro by adding following things:

1. Added `additional_outdirs` settings in vscode. (naming to be bikeshed)
2. Added `ExternSourceId` which is a wrapping for SourceRootId but only used in extern sources. It is because `OUT_DIR` is not belonged to any crate and we have to access it behind an `AstDatabase`.
3. This PR does not implement the `OUT_DIR` parsing from `cargo check`. I don't have general design about this,  @kiljacken could we reuse some cargo watch code for that ?

~~Block on [#3536]~~

PS: After this PR , we (kind of) completed the `include!(concat!(env!('OUT_DIR'),  "foo.rs")` macro call combo. [Exodia Obliterate!](https://www.youtube.com/watch?v=RfqNH3FoGi0)

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-03-11 10:51:07 +00:00
Steffen Lyngbaek
974ed7155a Deduplicate some Inlay definitions
- Remove match conversion for InlayKind since we're using remote
2020-03-10 18:59:49 -07:00
Steffen Lyngbaek
cfb48df149 Address Issues from Github
- Updated naming of config
- Define struct in ra_ide and use remote derive in rust-analyzer/config
- Make inlayConfig type more flexible to support more future types
- Remove constructor only used in tests
2020-03-10 14:36:01 -07:00