Aleksey Kladov
29d5f29932
fix: don't spam repeated error messages when cargo check
fails
...
Conceptually, using a *message* here is wrong, because this is a
"status", rather than "point in time" thing. But statuses are an LSP
extension, while messages are stable. As a compromise, send message only
for more critical `metadata` failures, and only once per state change.
2021-04-12 16:19:36 +03:00
Aleksey Kladov
de33702784
feat: show errors from cargo metadata
and initial cargo check
in the status bar
...
closes #3155
2021-04-06 18:08:05 +03:00
Aleksey Kladov
8fe20b19d4
More robust status notifications
2021-04-06 15:45:31 +03:00
Aleksey Kladov
e3c47ccefc
Use autoreload config to gate execution rather that staleness
2021-04-06 13:10:50 +03:00
Aleksey Kladov
9ca59733e3
Improve readability
...
It's better to order functions in the order they are called, if there's
ordering between them.
2021-04-06 12:35:40 +03:00
Aleksey Kladov
aaa8c208b1
internal: do not drop errors from cargo metadata/check
...
Work towards #3155
2021-04-06 12:33:19 +03:00
Aleksey Kladov
7099438e0c
internal: prepare to store OpQueue results in the queue itself
2021-04-05 20:49:00 +03:00
Matthias Krüger
202b51bc7b
a lot of clippy::style fixes
2021-03-21 16:15:41 +01:00
Aleksey Kladov
3d80e0a154
Migrate to user-centric config name for cargo check
stuff
2021-03-04 15:38:53 +03:00
Florian Diebold
a7387cae2c
Fix slow tests sometimes failing
...
In some situations we reloaded the workspace in the tests after having reported
to be ready. There's two fixes here:
1. Add a version to the VFS config and include that version in progress reports,
so that we don't think we're done prematurely;
2. Delay status transitions until after changes are applied. Otherwise the last
change during loading can potentially trigger a workspace reload, if it contains
interesting changes.
2021-02-12 16:31:16 +01:00
Edwin Cheng
4adf13e2ef
Only allow one proc-macro process
2021-02-02 04:55:17 +08:00
Edwin Cheng
dd47f8bac6
bug fix
2021-01-29 01:19:09 +08:00
Edwin Cheng
9358eecc04
Async Loading outdir and proc-macro
2021-01-29 01:04:14 +08:00
Aleksey Kladov
4b59c3a538
Make logger-based debugging more pleasant
2021-01-28 17:07:53 +03:00
Aleksey Kladov
2870e70163
Add config option to ignore directories
2021-01-26 16:45:54 +03:00
Aleksey Kladov
add87f5424
Avoid blocking the main loop when editing Cargo.toml
...
I've noticed a bunch of "main loop too long" warnings in console when
typing in Cargo.toml. Profiling showed that the culprit is `rustc
--print cfg` call.
I moved it to the background project loading phase, where it belongs.
This highlighted a problem: we generally use single `cfg`, while it
really should be per crate.
2021-01-18 14:52:12 +03:00
Aleksey Kladov
e13065b8ac
Add profile call
2021-01-18 13:30:12 +03:00
Aleksey Kladov
bb453edebe
Honor client's dynamic registration caps
...
cc https://github.com/rust-analyzer/rust-analyzer/pull/5516#issuecomment-757520828
2021-01-10 22:38:35 +03:00
Aleksey Kladov
2ed258ba42
Fix progress token is already registered crash
...
After we started reporting progress when running cargo check during
loading, it is possible to crash the client with two identical progress
tokens.
This points to a deeper issue: we might be running several cargo checks
concurrently, which doesn't make sense.
This commit linearizes all workspace fetches, making sure no updates are
lost.
As an additional touch, it also normalizes progress & result reporting,
to make sure they stand in sync.
2021-01-10 18:02:02 +03:00
Edwin Cheng
2b2d699b35
Report progress for cargo metadata and output-dir
2021-01-08 01:18:58 +08:00
Aleksey Kladov
66ed821e18
Speed up snapshoting
...
Config can be fairly big, no need to deep clone it frequently
2021-01-06 15:46:31 +03:00
Aleksey Kladov
f7a15b5cd1
More maintainable config
...
Rather than eagerly converting JSON, we losslessly keep it as is, and
change the shape of user-submitted data at the last moment.
This also allows us to remove a bunch of wrong Defaults
2021-01-06 15:39:28 +03:00
Aleksey Kladov
624eb1ee54
More maintainable caps config
...
The idea here is that we preserve client's config as is, without
changes. This gets rid of state!
2021-01-05 17:46:57 +03:00
Jonas Schievink
2b2318e695
Remove dummy ProcMacroClient in favor of Option
2020-12-07 17:16:50 +01:00
Jonas Schievink
e49ba0d1df
Downgrade "failed to load" error to warning
2020-11-27 18:35:22 +01:00
Aleksey Kladov
0d19ee1d70
Simplify
2020-11-17 15:25:57 +01:00
Aleksey Kladov
4dfda64b39
Cleanup workspace loading a tiny bit
2020-11-13 17:38:26 +01:00
Xavier Denis
8716087919
Add support for loading rustc private crates
2020-11-11 12:45:40 +01:00
Igor Aleksanov
19cce08662
Re-export base_db from ide_db
2020-10-24 11:39:57 +03:00
Aleksey Kladov
8716c4cec3
Move ide::AnalysisChange -> base_db::Change
...
This seems like a better factoring logically; ideally, clients shouldn't touch
`set_` methods of the database directly. Additionally, I think this
should remove the unfortunate duplication in fixture code.
2020-10-02 16:45:08 +02:00
Jonas Schievink
1a28f30ba4
Spawn a flycheck instance per workspace
2020-09-27 19:41:54 +02:00
bors[bot]
e70cf706bb
Merge #6018
...
6018: Correct project_root path for ProjectJson. r=jonas-schievink a=woody77
It was already the folder containing the rust-project.json file, not the file itself. This also removes the Option-ness of it, since it's now an infallible operation to set the member value.
Co-authored-by: Aaron Wood <aaronwood@google.com>
2020-09-20 19:25:09 +00:00
Laurențiu Nicola
5a0bad7754
Don't re-read open files from disk when reloading a workspace
2020-09-18 22:15:44 +03:00
Aaron Wood
2fbb09a73f
Correct project_root path for ProjectJson.
...
It was already the folder containing the rust-project.json file, not the file itself.
2020-09-16 12:09:44 -07:00
Aaron Wood
74c26a785a
Add support for custom flycheck commands with JSON project workspaces
...
Enable flychecks with JSON project workspaces if an override command was provided as part
of the client configuration.
2020-09-15 18:51:57 -07:00
Jonas Schievink
681ac6294a
Report better errors in project.json/sysroot
2020-09-11 14:48:56 +02:00
Aleksey Kladov
3a72afed8c
Improve logging
2020-08-25 11:43:21 +02:00
bors[bot]
6826dd044a
Merge #5782
...
5782: Fix StatusNotification r=matklad a=vsrs
This PR fixes the following:
As per specification `params` property in [NotificationMessage ](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#notificationMessage ) should be `array | object` while RA uses `"loading" | "ready" | "invalid" | "needsReload"`.
Co-authored-by: vsrs <vit@conrlab.com>
2020-08-17 14:23:03 +00:00
vsrs
1eed036a6e
Fix StatusNotification
2020-08-17 14:56:27 +03:00
Aleksey Kladov
1b0c7701cc
Rename ra_ide -> ide
2020-08-13 17:58:27 +02:00
Aleksey Kladov
ed20a857f4
Rename ra_db -> base_db
2020-08-13 16:29:33 +02:00
Pavan Kumar Sunkara
eac24d52e6
Rename ra_project_model -> project_model
2020-08-13 12:05:30 +02:00
Pavan Kumar Sunkara
349e6c62ad
Rename ra_proc_macro_srv -> proc_macro_srv
2020-08-13 03:18:19 +02:00
Aleksey Kladov
208b7bd7ba
Rename ra_prof -> profile
2020-08-12 16:35:29 +02:00
Aleksey Kladov
39a2bc5e3c
Expose package roots more directly
2020-07-21 12:52:51 +02:00
Jeremy Kolb
17f4d27f12
Minor perf tweaks per clippy
2020-07-19 14:26:24 -04:00
Aleksey Kladov
a40e05dd5d
Don't drop flycheck messages during restart
...
closes #5386
2020-07-15 14:37:44 +02:00
Aleksey Kladov
e6ea395fb0
Don't show error when speculatively reloading workspace
2020-07-11 01:39:06 +02:00
Aleksey Kladov
a425d7d871
Simplify
2020-07-10 23:57:10 +02:00
Aleksey Kladov
dac9a4cebd
Don't spawn notify unnecessary
2020-07-10 23:45:07 +02:00
Aleksey Kladov
be679a02ab
Add profiling calls
2020-07-10 22:30:24 +02:00
Aleksey Kladov
86bc4d20b3
Also reload when adding new examples, tests, etc
2020-07-10 22:30:24 +02:00
Aleksey Kladov
d0a8f6a3eb
Automatically reload project info on Cargo.toml changes
2020-07-10 15:35:15 +02:00
Aleksey Kladov
6c7578bd7a
Move cargo metadata off the main loop
2020-07-02 17:39:51 +02:00
bors[bot]
83f3cdca4f
Merge #5191
...
5191: Minor r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-07-02 14:10:13 +00:00
Aleksey Kladov
6a694ad047
Minor
2020-07-02 16:06:00 +02:00
Aleksey Kladov
4f26a3734e
Indicate when project needs a reload
2020-07-02 15:34:12 +02:00
Aleksey Kladov
a03cfa4926
Automatically reload project on config change
2020-07-01 16:42:14 +02:00
Aleksey Kladov
5a18734338
Fix config switching
2020-06-26 17:28:04 +02:00
Aleksey Kladov
9d15e8fc4f
Type safer requests
2020-06-26 17:07:14 +02:00
Aleksey Kladov
1893289e5c
Move progress reporting to utils
2020-06-26 16:33:57 +02:00
Aleksey Kladov
e70f7dc10c
Minor
2020-06-26 00:27:57 +02:00
Aleksey Kladov
72fb712dff
Add new module for project loading stuff
2020-06-26 00:27:57 +02:00