Commit Graph

25056 Commits

Author SHA1 Message Date
Ariel Davis
da5c63c8f9 Use boxed slice
As well as doing the shrink_to_fit, we also don't have to keep track of
the capacity anymore.
2023-05-06 00:49:23 -07:00
Ariel Davis
d9c88460e4 Use cur 2023-05-06 00:49:23 -07:00
Ariel Davis
4b7c759f2f Un-doc a comment 2023-05-06 00:49:23 -07:00
Ariel Davis
4a1922fd1a Depend on nohash-hasher individually 2023-05-06 00:49:23 -07:00
Ariel Davis
1d678cf6a0 Allow clippy 2023-05-06 00:49:23 -07:00
Ariel Davis
71c4a8968d Pub use TextRange, TextSize 2023-05-06 00:49:23 -07:00
Ariel Davis
5e2c68f4d4 Use less 2023-05-06 00:49:23 -07:00
Ariel Davis
39ef368e75 Remove pub(crate) 2023-05-06 00:49:23 -07:00
Ariel Davis
b26cded8d1 Swap 2023-05-06 00:49:23 -07:00
Ariel Davis
4b28ad92e9 Make text-size a workspace dep 2023-05-06 00:49:23 -07:00
Ariel Davis
85dd7b22b4 Use nohash_hasher, rm comment 2023-05-06 00:49:23 -07:00
Ariel Davis
7e1992a0d9 Make line-index an external lib 2023-05-06 00:49:23 -07:00
Ariel Davis
29256f22e4 Make non-hash an external lib 2023-05-06 00:49:23 -07:00
bors
a4966c9282 Auto merge of #14745 - rkstgr:rust-dependencies-sorted, r=HKalbasi
Sort rust dependencies in vscode tree view

Sorts alphabetically based on dependency name. Fixes #14729
2023-05-05 21:22:34 +00:00
Erik Steiger
91b4a169cd Fix formatting 2023-05-05 14:49:42 +02:00
Erik Steiger
06cfeb47b2 Sort rust dependencies in tree view 2023-05-05 14:41:03 +02:00
Lukas Wirth
abcdb4bc7d Fix test fixtures 2023-05-05 14:18:27 +02:00
Lukas Wirth
8081a654da feat: Closure capture inlay hints 2023-05-05 13:38:22 +02:00
bors
e461e53f01 Auto merge of #14739 - lowr:fix/type-with-leading-lifetime, r=Veykril
Parse bare dyn types with leading lifetime

TIL types may start with a lifetime identifier e.g. `type A = 'static + Trait;`. When parsing types, leading lifetime followed by a plus sign should be parsed as a bare dyn type rather than a generic lifetime argument or error type (which is what we produce today).

Although it's no longer accepted since Rust 2021, it wouldn't hurt to support this obsolete syntax.
2023-05-05 09:23:32 +00:00
hkalbasi
aafe9b1e06 Lazy evaluate consts in path_to_const 2023-05-05 01:17:11 +03:30
Ryo Yoshida
2a509d0eb2
Parse bare dyn types with leading lifetime 2023-05-05 04:30:37 +09:00
bors
0dd94d3b07 Auto merge of #14738 - Veykril:def-map-fix, r=Veykril
fix: Fix body lowering not using block def maps

Fixes the issue in the comment here https://github.com/rust-lang/rust-analyzer/issues/10084#issuecomment-1534320254, not the general issue unfortunately.
2023-05-04 18:47:04 +00:00
Lukas Wirth
9419fcb109 fix: Fix body lowering not using block def maps 2023-05-04 20:46:05 +02:00
bors
0d5773e04e Auto merge of #14725 - HKalbasi:derive-impls, r=HKalbasi
Emit function bodies in expanding builtin derives

fix #14235
2023-05-04 15:01:44 +00:00
bors
884835e397 Auto merge of #14732 - HKalbasi:pat-type-mismatch, r=HKalbasi
Fix pattern type mismatch in tuples

Reduces pattern type mismatches on self to 4
2023-05-04 14:25:41 +00:00
hkalbasi
36c9d5ce17 Fix pattern type mismatch in tuples 2023-05-04 16:03:36 +03:30
bors
60f4b3e26e Auto merge of #14726 - Veykril:cistuff, r=lnicola
minor: Lock paths-filter action to a specific commit
2023-05-03 11:46:48 +00:00
Lukas Wirth
928a378c6d Lock paths-filter action to a specific commit 2023-05-03 13:36:04 +02:00
hkalbasi
d9f4cbbe8f Emit function bodies in expanding builtin derives 2023-05-03 14:14:47 +03:30
bors
9811a3af5f Auto merge of #14718 - lnicola:triomphe, r=Veykril
internal: Use `triomphe::Arc`

Closes #14717
2023-05-02 21:21:56 +00:00
Laurențiu Nicola
7197a27028 Use triomphe Arc 2023-05-02 20:02:43 +03:00
bors
a7168a8c6f Auto merge of #14712 - Veykril:metadata-extra-args, r=Veykril
fix: Only pass unstable flags to cargo metadata from extra args config
2023-05-02 16:34:39 +00:00
bors
c9b4116a5e Auto merge of #14662 - Ddystopia:open_locally_built_documentatin_instead_of_docs_dot_rs, r=Ddystopia
Provide links to locally built documentation for `experimental/externalDocs`

This pull request addresses issue #12867, which requested the ability to provide links to locally built documentation when using the "Open docs for symbol" feature. Previously, rust-analyzer always used docs.rs for this purpose. With these changes, the feature will provide both web (docs.rs) and local documentation links without verifying their existence.

Changes in this PR:

   - Added support for local documentation links alongside web documentation links.
   - Added `target_dir` path argument for external_docs and other related methods.
   - Added `sysroot` argument for external_docs.
   - Added `target_directory` path to `CargoWorkspace`.

API Changes:

   - Added an experimental client capability `{ "localDocs": boolean }`. If this capability is set, the `Open External Documentation` request returned from the server will include both web and local documentation links in the `ExternalDocsResponse` object.

Here's the `ExternalDocsResponse` interface:

```typescript
interface ExternalDocsResponse {
    web?: string;
    local?: string;
}
```

By providing links to both web-based and locally built documentation, this update improves the developer experience for those using different versions of crates, git dependencies, or local crates not available on docs.rs. Rust-analyzer will now provide both web (docs.rs) and local documentation links, leaving it to the client to open the desired link. Please note that this update does not perform any checks to ensure the validity of the provided links.
2023-05-02 15:57:19 +00:00
Lukas Wirth
16b3febcf5 Only pass unstable flags to cargo metadata from extra args config 2023-05-02 17:33:58 +02:00
Ddystopia
2025f17ac3
Workspace without sysroot could be possible 2023-05-02 17:24:00 +02:00
Ddystopia
7e19d99d4f
Add a localDocs capability 2023-05-02 17:13:21 +02:00
Ddystopia
4ac39f0c98
Propagating sysroot down + Refactoring 2023-05-02 17:08:56 +02:00
Ddystopia
67e58c5ba6
Add sysroot 2023-05-02 17:08:56 +02:00
Ddystopia
396934860c
Getting cargo workspace from file_id and refactoring 2023-05-02 17:08:56 +02:00
Oleksandr Babak
0913809ac8
Update crates/ide/src/doc_links.rs
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2023-05-02 17:08:55 +02:00
Ddystopia
8317c8db1a
Test for Builtin Type 2023-05-02 17:08:55 +02:00
Ddystopia
b74b9797bc
Update hash in lsp-extensions.md 2023-05-02 17:08:54 +02:00
Ddystopia
b64c31c40a
Solve platform-specific issues 2023-05-02 17:06:39 +02:00
Ddystopia
12292e445a
Tests for externalDocs 2023-05-02 17:06:39 +02:00
Ddystopia
da0ffe79d0
Change signature of externalDocs in lsp-extensions 2023-05-02 17:06:39 +02:00
Ddystopia
2503fbefde
Small improvements and fixes 2023-05-02 17:06:39 +02:00
Ddystopia
3fbb48907e
Add doc strings 2023-05-02 17:06:39 +02:00
Ddystopia
c47a34fddc
Add target_dir path argument for external_docs and other methods 2023-05-02 17:06:38 +02:00
Ddystopia
f2d933ecaf
Add support for local documentation links alongside web documentation links, pending for target_dir path and tests 2023-05-02 17:06:38 +02:00
Ddystopia
fc888b583d
Add target_directory path to CargoWorkspace 2023-05-02 17:06:31 +02:00