Commit graph

133 commits

Author SHA1 Message Date
Lukas Wirth
bed4db3c62 Use workspace.dependencies to declare local dependencies 2023-01-17 10:52:26 +01:00
Lukas Wirth
e4858fe480 Specify authors, edition and license via workspace.package 2023-01-16 16:44:00 +01:00
Lukas Wirth
679df2adf1 Specify rust-version via workspace.package 2023-01-16 16:33:01 +01:00
Lukas Wirth
1ce3e820dc feat: Make unlinked_file diagnostic quickfixes work for inline modules 2023-01-11 22:39:05 +01:00
Daniel Eades
da7ce6f810 derive 'Hash' 2022-12-30 11:14:15 +00:00
Yuri Astrakhan
e16c76e3c3 Inline all format arguments where possible
This makes code more readale and concise,
moving all format arguments like `format!("{}", foo)`
into the more compact `format!("{foo}")` form.

The change was automatically created with, so there are far less change
of an accidental typo.

```
cargo clippy --fix -- -A clippy::all -W clippy::uninlined_format_args
```
2022-12-24 14:36:10 -05:00
Yuri Astrakhan
ec55dd1d7b Minor manual cleanu
* use default derive
* use `strip_prefix` where possible to avoid dup work
2022-12-23 03:11:53 -05:00
Lukas Wirth
ffd7bf8bf9 Bump Cargo rust-version fields to latest stable 2022-11-07 12:59:51 +01:00
Lukas Wirth
d025c5d8d6 Make use of NoHash hashing for FileId and CrateId 2022-08-25 20:41:49 +02:00
Dezhi Wu
23747419ca fix: a bunch of typos
This PR will fix some typos detected by [typos].

There are also some other typos in the function names, variable names, and file
names, which I leave as they are. I'm more certain that typos in comments
should be fixed.

[typos]: https://github.com/crate-ci/typos
2022-08-17 21:44:58 +08:00
Amos Wenger
23d25a3094 Enable extra warnings required by rust-lang/rust 2022-07-20 15:00:17 +02:00
Laurențiu Nicola
6669f388a2 Bump indexmap 2022-07-03 10:09:35 +03:00
Lukas Wirth
76ae5434fa internal: Bump Dependencies 2022-06-10 17:30:02 +02:00
Lukas Wirth
8e91bb7660 minor: Bump dependencies 2022-03-22 17:42:24 +01:00
iDawer
676744be6e Bump MSRV (1.57) 2021-12-16 01:56:12 +05:00
Lukas Wirth
92f7db447c minor: Lift out FxIndex{Map/Set} types into ide_db 2021-11-16 12:15:47 +01:00
Laurențiu Nicola
8457ae34bd Set MSRV 2021-10-23 15:07:11 +03:00
Lukas Wirth
1294bfce86 Migrate to edition 2021 2021-10-21 20:10:40 +02:00
bors[bot]
f185d1c533
Merge #10423
10423: Internal: refactor for mdbook plugin r=Veykril a=HKalbasi

This PR is for upstreaming changes that I made for mdbook plugin. Changes are adding inlay hints to `StaticIndex` and changing some functions for working around privacy of crates.

Aside this, is it okay if I bring the plugin in tree? It is a simple binary crate. I feel it will better maintained here and become resistant to api changes.

Co-authored-by: hamidreza kalbasi <hamidrezakalbasi@protonmail.com>
2021-10-12 18:35:03 +00:00
hamidreza kalbasi
0f49c97e93 internal changes for mdbook 2021-10-12 11:54:00 +03:30
Aramis Razzaghipour
eff195852d
Fix miscellaneous Clippy lints 2021-10-03 23:53:30 +11:00
Aramis Razzaghipour
55c0b86cde
Add semicolons for consistency
`clippy::semicolon_if_nothing_returned`
2021-10-03 23:39:43 +11:00
龙方淞
51b1f7707b Update crates/vfs/src/vfs_path.rs
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-09-28 10:20:35 +08:00
longfangsong
0049b5b0bc initial commit 2021-09-28 10:20:29 +08:00
Aleksey Kladov
629c68e80d internal: document that ascription is preferred to a turbo fish 2021-08-11 14:16:15 +03:00
Basti Ortiz
0986632c04
Fix: revert strange usage of ? operator 2021-08-10 22:44:15 +08:00
Basti Ortiz
27605b402e
Fix: prefer the usage of for loops over fold 2021-08-10 22:40:04 +08:00
Basti Ortiz
0e480a6e9c
Chore: add comments to explicitly express two-step check
See https://github.com/rust-analyzer/rust-analyzer/pull/9836#discussion_r685953381
2021-08-10 22:30:08 +08:00
Basti Ortiz
ae1288eeed
Fix: revert complex conditional in Directories::contains_file
This reverts commit 6d0336b2e4.
2021-08-10 22:25:43 +08:00
Basti Ortiz
7ee6cca3d7
Refactor: use iterator methods over for loops 2021-08-10 17:51:11 +08:00
Basti Ortiz
6d0336b2e4
Refactor: simplify logic for Directories::contains_file
The logic was simply inverted to accomodate for the short-circuiting `&&` operator.
2021-08-10 16:32:00 +08:00
Basti Ortiz
0765c9713b
Refactor: use filter_map when iterating over stored IDs and 2021-08-10 15:56:16 +08:00
Basti Ortiz
e912d6507f
Chore: use short-circuiting for file ID getter 2021-08-10 15:43:51 +08:00
Aleksey Kladov
9318c643f1 internal: make it easier to isolate IO 2021-07-17 17:55:16 +03:00
Aleksey Kladov
86720f2953 minor: drop dummy authors field 2021-07-05 14:19:41 +03:00
Lukas Wirth
95c8c65139 Nest all the or-patterns! 2021-06-17 17:37:14 +02:00
Maan2003
c9b4ac5be4
clippy::redudant_borrow 2021-06-13 09:24:16 +05:30
Alexandru Macovei
4e2a6ac7ea Avoid duplicating VfsPath in vfs::path_interner::PathInterner by using an IndexSet 2021-04-06 16:03:57 +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
Arnaud
4b71c8332d Document vfs private items 2021-01-12 18:01:47 +01:00
Arnaud
311ec70d03 Document vfs public items 2021-01-12 18:01:36 +01:00
Arnaud
d216d718bf Use file_set::FileSet and FileSet consistently in doc
The first occurrence of `FileSet` has the full path (`file_set::FileSet`),
while every other is simply `FileSet`.
2021-01-07 12:18:25 +01:00
Arnaud
f80f4ff223 Use intra-doc links in vfs crate documentation 2021-01-07 12:17:38 +01:00
Arnaud
b6669b1c9b Remove the reference to WalkdirLoaderHandle in vfs documentation
This structure was deleted in commit #dad1333
2021-01-07 12:10:02 +01:00
bors[bot]
243ba330dd
Merge #6785
6785: Fix "no value set for FileTextQuery(FileId(..))" r=jonas-schievink a=jonas-schievink

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/6622

Let's hope I got it right this time, but I feel like I slowly begin to understand the main loop logic.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-12-09 16:32:03 +00:00
Jonas Schievink
6857989f6f Fix "no value set for FileTextQuery(FileId(..))" 2020-12-09 17:30:46 +01:00
Aleksey Kladov
5e3891c255 . 2020-12-09 18:42:07 +03:00
Daiki Ihara
59bd6e2eea Extract tests module to file in vfs crate 2020-12-01 00:10:12 +09:00
Aleksey Kladov
ba8d6d1e4e Remove more unreachable pubs 2020-11-02 16:58:33 +01: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
Kirill Bulatov
9863798480 Rename the method to avoid false promises 2020-09-10 01:45:49 +03:00
Kirill Bulatov
f4ee885b3b Add VirtualPath tests 2020-09-10 01:42:20 +03:00
Kirill Bulatov
33179a0ae1 Move rust-related logic from vfs to base_db level 2020-09-10 01:42:20 +03:00
Kirill Bulatov
b2bcc5278d Properly handle special cases (binaries, mod.rs) 2020-09-10 01:42:20 +03:00
Kirill Bulatov
897a4c702e Implement file name & extension retrieval method for VirtualPath 2020-09-10 01:42:20 +03:00
Kirill Bulatov
d163f9f114 Small refactoring 2020-09-10 01:42:20 +03:00
Kirill Bulatov
8aa740dab4 Happy path implemented 2020-09-10 01:42:20 +03:00
Kirill Bulatov
0de71f7bc9 Properly use FileSet API 2020-09-10 01:42:20 +03:00
Kirill Bulatov
17870a3e2c Better API 2020-09-10 01:42:20 +03:00
Kirill Bulatov
4bed588001 First steps for mod<|> completion 2020-09-10 01:42:20 +03:00
Pavan Kumar Sunkara
335add49db Add description for crates that will be published 2020-08-24 13:07:22 +02:00
Pavan Kumar Sunkara
a8fa5cd42e Add version to deps in cargo.toml 2020-08-24 11:10:41 +02:00
Armin Sander
8fc254597f Sophisticate Windows path encoding 2020-08-14 02:03:54 +02:00
Aleksey Kladov
1b0c7701cc Rename ra_ide -> ide 2020-08-13 17:58:27 +02:00
Aleksey Kladov
da65cff18b Add one more test 2020-07-26 11:05:28 +02:00
Aleksey Kladov
39a2bc5e3c Expose package roots more directly 2020-07-21 12:52:51 +02:00
Aleksey Kladov
3e688d2a93 Simplify 2020-07-20 18:01:42 +02:00
Aleksey Kladov
46ac9ff5e3 Simplify exclusion logic 2020-07-18 16:40:10 +02:00
Aleksey Kladov
dc2094cfa5 Minor, push allocations down 2020-07-14 15:57:10 +02:00
Yuki Okushi
6f423466d1
Add a license field to all the crates 2020-07-14 10:57:26 +09:00
Aleksey Kladov
847135495f no doctests 2020-07-11 13:31:02 +02:00
Aleksey Kladov
a1ef6cc553 Optimize VFS processing 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
69b79e3a73 Replace ad hocery with science 2020-07-07 23:28:48 +02:00
Aleksey Kladov
5d2225f4bc Fix symbol search in salsa
Previous solution for binning paths into disjoint directories was
simple and fast -- just a single binary search.

Unfortunatelly, it wasn't coorrect: if the ditr are

  /d
  /d/a
  /d/c

then partitioning the file /d/b/lib.rs won't pick /d as a correct
directory.

The correct solution here is a trie, but it requires exposing path
components.

So, we use a poor man's substitution -- a *vector* of sorted paths,
such that each bucket is prefix-free

closes #5246
2020-07-07 17:38:02 +02:00
Aleksey Kladov
e336a96998 FileSetConfig works with empty set of roots
Closes #5139
2020-07-01 09:06:51 +02:00
Jonas Schievink
72fe70f2f8 Make VFS join methods fallible 2020-06-26 16:30:50 +02:00
Aleksey Kladov
6937bcb67d Less error-prone naming 2020-06-24 16:59:15 +02:00
Aleksey Kladov
e6c61d5072 Cleanup project.json deserialization 2020-06-24 16:16:52 +02:00
Laurențiu Nicola
c15c22139f Make Debug less verbose for VfsPath and use Display in analysis-stats 2020-06-24 14:07:03 +03:00
Aleksey Kladov
dad1333b48 New VFS 2020-06-23 17:51:06 +02:00
Aleksey Kladov
b9f3c5d585 Speedup VFS::partition
The task of `partition` function is to bin the flat list of paths into
disjoint filesets. Ideally, it should be incremental -- each new file
should be added to a specific fileset.

However, preliminary measurnments show that it is actually fast enough
if we just optimize this to use a binary search instead of a linear
scan.
2020-06-19 15:07:32 +02:00
Aleksey Kladov
c002322bde New VFS API 2020-06-16 13:42:29 +02:00