Commit graph

1122 commits

Author SHA1 Message Date
bors
a494aaba87 Auto merge of #17523 - wada314:master, r=Veykril
Add an option to use "::" for the external crate prefix.

Fixes #11823 .
Hi I'm very new to rust-analyzer and not sure how the review process are. Can somebody take a look at this PR? thanks!
2024-07-07 08:32:46 +00:00
Lukas Wirth
8a4b1fd96e Fix stale reference in architecture.md 2024-07-07 09:19:09 +02:00
Lukas Wirth
e4604c69ba Move capability querying out of the config module 2024-07-07 07:42:12 +02:00
Lukas Wirth
3d7ee9b4ea Flatten cargoExtraArgs away from the runnable lsp extension 2024-07-06 16:36:27 +02:00
Lukas Wirth
fcddcf2ee5 Add environment to runnable lsp extension 2024-07-06 16:20:25 +02:00
Shohei Wada
3725ab3146 squash. 2024-07-02 01:52:34 +09:00
bors
72f278b5be Auto merge of #17522 - Veykril:comptimes, r=Veykril
internal: Cut compiletimes slightly
2024-07-01 08:43:11 +00:00
Lukas Wirth
b60b27bd22 Remove serde flag from indexmap dependency 2024-06-30 18:14:53 +02:00
Tavo Annus
1389312871 Make borrow checking configurable for term search 2024-06-29 12:24:08 +03:00
Tavo Annus
51c3bd215a Fix suggestions of unstable constants 2024-06-22 21:33:58 +03:00
bors
87ee18da54 Auto merge of #17438 - jjoeldaniel:toggle_lsp_logs, r=Veykril
feat: add `toggleLSPLogs` command

Implement client-side command to toggle LSP logs in VSCode.

The command replaces the need to add/remove the `"rust-analyzer.trace.server": "verbose"` setting each time one wants to display logs. I've also updated the docs/ instances that reference the now outdated manual method.

The command labeled `rust-analyzer: Toggle LSP Logs` enables the setting project-wide and opens the relevant trace output channel.

Closes #8233
2024-06-19 08:39:42 +00:00
Joel Daniel Rico
2ebcf55ece feat: add toggleLSPLogs command
add `toggleLSPLogs` command
update docs to reflect new command
2024-06-17 04:08:32 -07:00
Lunaphied
16c2078c9f docs: fix manual generation instructions
To generate all the requisite files, you need to run `cargo xtask codegen` not
`cargo test -p xtask`.
2024-06-16 15:25:42 -06:00
bors
4af21ffb02 Auto merge of #16840 - Wilfred:shell_runnable, r=Veykril
Allow rust-project.json to include arbitrary shell commands for runnables

This is a follow-up on #16135, resolving the feedback raised :)

Allow rust-project.json to include shell runnables, of the form:

```
{
  "build_info": {
    "label": "//project/foo:my-crate",
    "target_kind": "bin",
    "shell_runnables": [
      {
        "kind": "run",
        "program": "buck2",
        "args": ["run", "//project/foo:my-crate"]
      },
      {
        "kind": "test_one",
        "program": "test_runner",
        "args": ["--name=$$TEST_NAME$$"]
      }
    ]
  }
}

```

If these runnable configs are present for the current crate in rust-project.json, offer them as runnables in VS Code.

This PR required some boring changes to APIs that previously only handled cargo situations. I've split out these changes as commits labelled 'refactor', so it's easy to see the interesting changes.
2024-06-11 16:13:10 +00:00
Wilfred Hughes
71a78a9cdc feature: add build system info; runnables to rust-project.json 2024-06-11 11:55:17 -04:00
Lukas Wirth
1dcb11be5d Simplify some config serialization stuff 2024-06-11 10:45:17 +02:00
Lukas Wirth
5a7bf1d147 Fix processing of ratoml files 2024-06-07 12:31:50 +02:00
roife
ef59b49f7e Update docs 2024-05-24 03:53:36 +08:00
Lukas Wirth
bd37e2790b Allow sysroots to only consist of the source root dir 2024-05-23 20:12:31 +02:00
Adam Szkoda
2cc2521996
Correct Neovim 0.10 inlay hints config example 2024-05-17 12:42:17 +02:00
Tavo Annus
ab18604309 Make term search fuel configurable 2024-05-08 19:46:33 +03:00
Wilfred Hughes
b1266405ef docs: Fix typo in VS Code setting description 2024-04-30 11:17:57 -07:00
bors
1e61ed723f Auto merge of #17144 - cbiffle:patch-1, r=Veykril
manual: remove suggestion of rust-project.json example

The manual has been linking to the repo

https://github.com/rust-analyzer/rust-project.json-example/tree/master

This repo does not contain a rust-project.json, does not appear to have _ever_ contained a rust-project.json, and my bug report about this has gone untouched: https://github.com/rust-analyzer/rust-project.json-example/issues/4

Since I can't figure out an example, this commit removes the link pending better documentation.
2024-04-29 08:16:11 +00:00
Lukas Wirth
367b82f68d Don't retry position relient requests and version resolve data 2024-04-28 17:02:38 +02:00
Cliff L. Biffle
898d466c2d
manual: remove suggestion of rust-project.json example
The manual has been linking to the repo

https://github.com/rust-analyzer/rust-project.json-example/tree/master

This repo does not contain a rust-project.json, does not appear to have _ever_ contained a rust-project.json, and my bug report about this has gone untouched: https://github.com/rust-analyzer/rust-project.json-example/issues/4

Since I can't figure out an example, this commit removes the link pending better documentation.
2024-04-26 08:23:50 -07:00
Lukas Wirth
18ca22a98e Show workspace info in the status bar 2024-04-26 11:28:33 +02:00
bors
65eda41e65 Auto merge of #17021 - roife:add-hover-limits-for-adts, r=Veykril
Support hovering limits for adts

Fix #17009

1. Currently, r-a supports limiting the number of struct fields displayed when hovering. This PR extends it to support enum variants and union fields. Since the display of these three (ADTs) is similar, this PR extends 'hover_show_structFields' to 'hover_show_adtFieldsOrVariants'.
2. This PR also resolved the problem that the layout of ADT was not restricted by display limitations when hovering on the Self type.
3. Additionally, this PR changes the default value of display limitations to `10` (instead of the original `null`), which helps users discover this feature.
2024-04-25 07:23:27 +00:00
bors
47a901b9bf Auto merge of #17025 - lnicola:josh, r=lnicola
internal: Use josh for subtree syncs
2024-04-21 16:39:18 +00:00
Lukas Wirth
a2ed6837bc Allow rust files to be used linkedProjects 2024-04-21 16:26:55 +02:00
Laurențiu Nicola
c38295993b Use josh for subtree syncs 2024-04-21 10:07:08 +03:00
roife
43576989a1 Add hovering limitations support for variants 2024-04-20 09:14:00 +08:00
bors
50bdeaad07 Auto merge of #17108 - Veykril:rustc-ws-hacks, r=Veykril
internal: Cleanup cfg and env handling in project-model

Fixes https://github.com/rust-lang/rust-analyzer/issues/16122#issuecomment-2065794340

`miri` and `debug_assertions` are now enabled via the `cargo.cfgs` config by default, allowing them to be disabled by overwriting the config.
2024-04-19 16:00:54 +00:00
roife
e0e28ec856 fix: add a separate setting for enum variants 2024-04-19 21:45:56 +08:00
Lukas Wirth
0485a85ee2 Set debug_assertions and miri cfgs as config defaults, allowing them to be overwritten 2024-04-19 11:06:55 +02:00
bors
eea61bd4d1 Auto merge of #16726 - Veykril:rustc-ws-hacks, r=Veykril
internal: Remove rustc core test cfg hacks

cc https://github.com/rust-lang/rust-analyzer/issues/16538
2024-04-19 07:28:50 +00:00
Lukas Wirth
2e54c0af40 Remove rustc core test cfg hacks 2024-04-19 09:27:05 +02:00
Kevin Reid
db292bd89e Make test harness arguments configurable and not --nocapture.
* Added config `runnables.extraTestBinaryArgs` to control the args.
* The default is `--show-output` rather than `--nocapture` to prevent
  unreadable output when 2 or more tests fail or print output at once.
* Renamed variables in `CargoTargetSpec::runnable_args()` for clarity.

Fixes <https://github.com/rust-lang/rust-analyzer/issues/12737>.
2024-04-18 18:37:09 -07:00
roife
6bb85985d7 fix: adjust the limitation for ADTs' fields to 5 2024-04-16 16:28:23 +08:00
roife
01c3559bf3 Update tests and docs for hover_show_adtFieldsOrVariants 2024-04-16 16:27:56 +08:00
bors
1179c3ee83 Auto merge of #16639 - alibektas:13529/config_restruct, r=Veykril
internal : redesign rust-analyzer::config

This PR aims to cover the infrastructural requirements for the `rust-analyzer.toml` ( #13529 ) issue. This means, that

1. We no longer have a single config base. The once single `ConfigData` has been divided into 4 : A tree of `.ratoml` files, a set of configs coming from the client ( this is what was called before the `CrateData` except that now values do not default to anything when they are not defined) , a set of configs that will reflect what the contents of a `ratoml` file defined in user's config directory ( e.g `~/.config/rust-analyzer/.rust-analyzer.toml` and finally a tree root that is populated by default values only.
2. Configs have also been divided into 3 different blocks : `global` , `local` , `client`. The current status of a config may change until #13529 got merged.

Once again many thanks to `@cormacrelf` for doing all the serde work.
2024-04-16 07:52:07 +00:00
Ali Bektas
67d8d2d4a0 Make ConfigData Ser and TOML De
This commit makes rust-analyzer::config module TOML ser and de.

Co-Authored-By: Cormac Relf <web@cormacrelf.net>
2024-04-15 14:14:23 +02:00
bors
f3c7bd0c90 Auto merge of #17064 - Veykril:inlay-hints-fix, r=Veykril
minor: Carry inlay hint resolve hash as a string
2024-04-14 10:27:40 +00:00
Lukas Wirth
189aba7943 minor: Carry inlay hint resolve hash as a string 2024-04-14 10:55:20 +02:00
bors
7dad0a231e Auto merge of #17063 - Veykril:inlay-hints-fix, r=Veykril
fix: Fix inlay hint resolution being broken

So, things broke because we now store a hash (u64) in the resolution payload, but javascript and hence JSON only support integers of up to 53 bits (anything beyond gets truncated in various ways) which caused almost all hashes to always differ when resolving them. This masks the hash to 53 bits to work around that.

Fixes https://github.com/rust-lang/rust-analyzer/issues/16962
2024-04-14 06:28:40 +00:00
Lukas Wirth
2c5c12acfe fix: Fix inlay hint resolution being broken 2024-04-14 08:27:24 +02:00
Colin Kinloch
81ef59f6ff Document enabling the flatpak rust SDK extension 2024-04-08 18:00:29 +01:00
Lukas Wirth
ff279f1e91 Fix allFeatures config docs 2024-04-01 14:16:36 +02:00
bors
2678660880 Auto merge of #16924 - poliorcetics:ab/push-kxwqvtypvlsq, r=Veykril
feat: Add `rust-analyzer.cargo.allTargets` to configure passing `--all-targets` to cargo invocations

Closes #16859

## Unresolved question:

Should this be a setting for build scripts only ? All the other `--all-targets` I found where already covered by `checkOnSave.allTargets`
2024-04-01 10:30:15 +00:00
hkalbasi
beec6914c8 Resolve tests per file instead of per crate in test explorer 2024-03-29 05:34:43 +03:30
Alexis (Poliorcetics) Bourget
174af88e76
feat: Add rust-analyzer.cargo.allTargets to configure passing --all-targets to cargo invocations 2024-03-27 01:57:41 +01:00