Commit graph

1100 commits

Author SHA1 Message Date
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
Young-Flash
d81148a009 expose config for hover struct field display 2024-03-25 19:55:19 +08:00
Lukas Wirth
4a93368590 Use a hash to find the correct inlay hint when resolving 2024-03-18 09:51:51 +01:00
hkalbasi
eeff20d172 Show compilation progress in test explorer 2024-03-15 16:28:59 +03:30
hkalbasi
dc99ad912a Some minor changes in the test explorer lsp extension 2024-03-09 01:21:27 +03:30
Lukas Wirth
1c6d1b4f2a fix: Add config and capability for test explorer 2024-03-06 19:20:58 +01:00
hkalbasi
44be2432f5 Add test explorer 2024-03-06 00:05:29 +03:30
Lukas Wirth
8844640c6f fix: Put style lints behind disabled-by-default config 2024-03-05 11:43:23 +01:00
bors
ce3216e0ae Auto merge of #15938 - Young-Flash:display_trait_item_when_hover, r=Veykril
feat: add hover display for trait assoc items

This PR enable preview assoc items when hover on `trait`

![image](https://github.com/rust-lang/rust-analyzer/assets/71162630/d9c3949c-33cf-4a32-aa97-3af46b28033a)

inspired by https://github.com/rust-lang/rust-analyzer/pull/15847
2024-03-05 08:26:53 +00:00
Young-Flash
dba67b46a1 update for review 2024-03-02 10:01:04 +08:00
Lukas Wirth
ed7e9aa5d8 Simplify 2024-03-01 13:25:24 +01:00
Rik Huijzer
4060377c07 Add note 2024-02-25 18:05:52 +01:00
Rik Huijzer
ea837d181e Document nvim 0.10 inlay_hint 2024-02-25 17:59:19 +01:00
Young-Flash
2e87f31fe9 add HoverDisplayConfig 2024-02-22 17:37:40 +08:00
Young-Flash
35ec5955eb add config item for hover display 2024-02-21 11:08:45 +08:00
Lukas Wirth
ead369117a CrateOrigin::Local means local to the project workspace, not cargo workspace 2024-02-16 16:28:17 +01:00
Lukas Wirth
1e6cef94df fix: Fix build scripts not being rebuilt in some occasions 2024-02-14 15:20:45 +01:00
bors
1811210339 Auto merge of #15476 - Wilfred:implement-saved-file3, r=Veykril
Substitute $saved_file in custom check commands

If the custom command has a $saved_file placeholder, and we know the file being saved, replace the placeholder and run a check command.

If there's a placeholder and we don't know the saved file, do nothing.

This is a simplified version of #15381, which I hope is easier to review.
2024-02-12 14:59:37 +00:00
Wilfred Hughes
cdbf54f4bd flycheck: initial implementation of $saved_file
If the custom command has a $saved_file placeholder, and we know the
file being saved, replace the placeholder and then run a check command.

If there's a placeholder and we don't know the saved file, do nothing.
2024-02-12 15:45:48 +01:00
Tavo Annus
125791386d Cleanup term search related changes 2024-02-11 14:35:54 +02:00
Tavo Annus
88964c0b6a Optionally disable term search for autocompletion 2024-02-11 13:33:29 +02:00
bors
13707845f7 Auto merge of #15863 - davidbarsky:davidbarsky/start-of-monorepo-mode, r=Veykril
feature: Create `UnindexedProject` notification to be sent to the client

(Note that this branch contains commits from https://github.com/rust-lang/rust-analyzer/pull/15830, which I'll rebase atop of as needed.)

Based on the discussion in https://github.com/rust-lang/rust-analyzer/issues/15837, I've added a notification and off-by-default toggle to send that notification from `handle_did_open_text_document`. I'm happy to rename/tweak this as needed.

I've been using this for a little bit, and it does seem to cause a little bit more indexing/work in rust-analyzer, but it's something that I'll profile as needed, I think.
2024-02-08 19:36:09 +00:00
David Barsky
6330b028b3 feature: Add a UnindexedProject notification and a corresponding setting. 2024-02-08 14:23:00 -05:00