Commit Graph

24991 Commits

Author SHA1 Message Date
oxalica
300f3a1b43 Impl ExactSizeIterator for IdxRange 2023-05-06 21:15:57 +08: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
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
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
bors
4ecd7e6c0d Auto merge of #14720 - Veykril:boxed-slices, r=Veykril
internal: Use boxed slices instead ovecs in decl macros

saves another 10 mb on self (since we didn't shrink the vecs)
2023-05-02 15:05:28 +00:00
Lukas Wirth
90499d4390 Use boxed slices instead ovecs in decl macros 2023-05-02 17:04:53 +02:00
bors
a48e0e14e1 Auto merge of #11557 - bruno-ortiz:rust-dependencies, r=bruno-ortiz
Creating rust dependencies tree explorer

Hello!

I tried to implement a tree view that shows the dependencies of a project.

It allows to see all dependencies to the project and it uses `cargo tree` for it. Also it allows to click and open the files, the viewtree tries its best to follow the openned file in the editor.

Here is an example:
![image](https://user-images.githubusercontent.com/5748995/155822183-1e227c7b-7929-4fc8-8eed-29ccfc5e14fe.png)

Any feedback is welcome since i have basically no professional experience with TS.
2023-05-02 14:49:38 +00:00
Bruno Ortiz
ecfe7c0488 last fixes after rebase 2023-05-02 11:24:08 -03:00
Bruno Ortiz
0aed507f16 fixing TS linting, removing import 2023-05-02 11:06:28 -03:00
Bruno Ortiz
bcb21311ea Accepting review suggestions 2023-05-02 11:06:25 -03:00
Bruno Ortiz
800b3b6323 adding doc and simplifying function 2023-05-02 11:03:32 -03:00
Bruno Ortiz
072f69e4c1 fixing ts linting and rust test 2023-05-02 11:01:53 -03:00
Bruno Ortiz
bd2160f014 final rabasing fixes 2023-05-02 11:01:53 -03:00
Bruno Ortiz
66fe84d936 accepting review suggestions 2023-05-02 11:01:41 -03:00
Bruno Ortiz
c372fb3495 fixing tests for windows 2023-05-02 10:59:31 -03:00
Bruno Ortiz
fe7874af90 reveal only when tree is visible 2023-05-02 10:59:31 -03:00
Bruno Ortiz
a3081a6774 Adding crate_root_path to crate_graph 2023-05-02 10:59:31 -03:00
Bruno Ortiz
8e687f7afb improving code to work with multi-workspaces 2023-05-02 10:59:31 -03:00
Bruno Ortiz
1b8288ff96 Fixing naming from graph to list 2023-05-02 10:59:29 -03:00