Commit graph

1135 commits

Author SHA1 Message Date
Wilfred Hughes
e7d61e8f9c docs: Fix JSON example for rust-analyzer.workspace.discoverConfig
The user does not specify `{arg}` in their JSON, and be pedantic about
commas in JSON sample.
2024-07-31 16:10:42 -07:00
bors
a021b85be5 Auto merge of #17707 - Veykril:proc-macro-err-cleanup, r=Veykril
feat: Use spans for builtin and declarative macro expansion errors

This should generally improve some error reporting for macro expansion errors. Especially for `compile_error!` within proc-macros
2024-07-29 14:07:33 +00:00
Edward Jones
d10cdd25e7
docs: Reference cov_mark crate instead of test_utils/mark
Seems this was switched over in https://github.com/rust-lang/rust-analyzer/issues/7922
2024-07-26 22:49:11 -03:00
Lukas Wirth
7beac14cba Internal: Cleanup proc-macro error handling 2024-07-26 14:38:19 +02:00
David Barsky
2783aa7312 internal: remove UnindexedProject notification
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
2024-07-23 13:34:04 -04:00
PaulDotSH
49184a138c Remove lens.forceCustomCommands config 2024-07-23 03:27:28 -04:00
bors
52143a5ac0 Auto merge of #17246 - davidbarsky:david/move-rust-project-generation-to-server, r=Veykril
feature: teach rust-analyzer to discover `linked_projects`

This PR's been a long-time coming, but like the title says, it introduces server-side project discovery and removes the extension hooks I previously introduced. I don't think this PR is ready to land, but here are the things I'm feeling squishy about:
- I don't think I like the idea of introducing the `cargo-metadata` command-but-for-everything-else in the `flycheck` module, but the progress reporting infrastructure was too convenient to pass up. Happy to move it elsewhere.

Here are the things I _know_ I need to change:
- For progress reporting, I'm extracting from a `serde_json::Value` that corresponds to `tracing_subsciber::fmt::Layer`'s JSON output. I'd like to make this a bit more structured/documented than the current nonsense I wrote.
- The progress reporting currently hardcodes "Buck"; it should be deriving that from the previously mentioned more-structured-output.
- This doesn't handle *reloading* when a corresponding buildfile is changed. It should be doing that.

<details>
<summary>Anyway, here's a video of rust-analyzer discovering a Buck target.</summary>

https://github.com/rust-lang/rust-analyzer/assets/2067774/be6cd9b9-2c9a-402d-847f-05f860a91df1
</details>
2024-07-18 16:15:31 +00:00
David Barsky
db43a5a6e9 feature: move linked_projects discovery to the rust-analyzer server 2024-07-18 12:01:27 -04:00
bors
3fa78e113b Auto merge of #17616 - Veykril:config-param-hints, r=Veykril
Fix incorrect generic parameter hint defaults

Missed this in the review but we should show const param hints, not lifetime param hints by default
2024-07-17 06:54:06 +00:00
Lukas Wirth
8f044d9681 Fix incorrect generic parameter hint defaults 2024-07-17 08:52:23 +02:00
Laurențiu Nicola
f0c3cb3738 Add --keep-going to rust-analyzer.cargo.buildScripts.overrideCommand docs 2024-07-17 08:42:39 +03:00
Anita Hammer
70d20e1ca1
Update manual.adoc 2024-07-14 11:26:41 +01:00
Liao Junxuan
35b4957b80
feat: add inlay hints for generic parameters
fixes #11091

By default, only hints for const generic parameters are shown.
2024-07-08 19:11:41 +08:00
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