Commit graph

927 commits

Author SHA1 Message Date
Lukas Wirth
f021ec3b96 Disable pipe on typing handler 2024-12-09 15:52:04 +01:00
Lukas Wirth
54dbf1b446 Add typing handler for param list pipe 2024-12-06 15:49:36 +01:00
Lukas Wirth
bac0ed579f Make bracket typing handler work on more things 2024-12-06 12:47:32 +01:00
Lukas Wirth
d71e41dba6 Disable < typing handler again 2024-12-05 09:46:23 +01:00
Tarek
9aff46632e chore: deprecate typing.autoClosingAngleBrackets configuration
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-03 22:38:51 +02:00
Tarek
d6b701e251 internal: Make exclude characters for typing assists configurable, default to None
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-03 22:38:51 +02:00
David Richey
cf80dddb59 Only show status bar item in relevant files 2024-12-03 14:40:26 +00:00
David Richey
3c98b98ca7 Re-add rust-analyzer.cargo.sysrootQueryMetadata 2024-11-18 16:29:33 -06:00
Master-Hash
bbd565f5a0
editors/code: Match supported debug engines in config with actual supported ones 2024-11-08 08:33:32 +01:00
Wilfred Hughes
6c7b5025ca editors/code: Change minimum VS Code from 1.78 to 1.83
It's been a year since we last bumped this (see #15904), and VS Code
1.83 is the first version that supports LSP 3.17.5 (via
vscode-languageclient 9.0.1).

https://code.visualstudio.com/updates/v1_83#_language-server-protocol
2024-11-06 15:00:59 -08:00
Lukas Wirth
78f3112626 Allow interpreting consts and statics with interpret function command 2024-11-03 15:35:45 +01:00
HackerVole
d2e856ccc4 editors/code: Add md for walkthrough setup example
Add a separate markdown file containing the settings.json snippet from
the "Useful Setup Tips". This fixes the rendering and also makes the
text selectable.

Also use double-backticks for `code` rendering.
2024-10-24 23:20:40 -04:00
bors
b0b5d38768 Auto merge of #18359 - Daanoz:support-initializeStopped, r=Veykril
feat: support initializeStopped setting

See #18356

Add option to start rust-analyzer in "stopped" state when the extension activates.
2024-10-21 14:11:33 +00:00
Lukas Wirth
70d0b57cf0 Update ide tests 2024-10-21 11:28:19 +02:00
Daan Sieben
928ea2e8fb
feat: support initializeStopped setting 2024-10-21 10:58:54 +02:00
David Barsky
cfc5a0ea30 vscode: update some dependencies 2024-10-18 08:43:14 -04:00
roife
b7ed8150a3 feat: respect references.exclude_tests in call-hierarchy 2024-10-13 05:19:28 +08:00
Chayim Refael Friedman
4ea09dd9f6 Provide an config option to not set cfg(test) 2024-09-30 00:12:45 +03:00
bors
62649a57be Auto merge of #17923 - basvandriel:feature/build-before-restart-debug, r=Veykril
Building before a debugging session was restarted

# Background
Resolves #17901. It adds support for rebuilding after debugging a test was restarted. This means the test doesn't have to be aborted and manually re-ran again.

# How this is tested
First, all the Visual Studio Code extensions are loaded into an Extension Host window. Then, a sample test like below was ran and restarted to see if it was correctly rebuild.

```rust
#[test]
fn test_x() {
    assert_eq!("1.1.1", "1.1.0");
}
```
2024-09-27 11:06:21 +00:00
Bas van Driel
b4f278b463
Changes for debug restarting 2024-09-25 15:02:36 +02:00
Chayim Refael Friedman
779a7cb0e3 Automatically add semicolon when completing unit-returning functions
But provide a config to suppress that.

I didn't check whether we are in statement expression position, because this is hard in completion (due to the natural incompleteness of source code when completion is invoked), and anyway using function returning unit as an argument to something seems... dubious.
2024-09-08 23:41:16 +03:00
Chayim Refael Friedman
01cc847158 Provide an option to hide deprecated items from completion 2024-09-01 01:04:21 +03:00
Lukas Wirth
3c4cdbbd1a Improve documentation for InvocationStrategy 2024-08-19 14:23:05 +02:00
Victor Song
b0f20c7deb chore(config): remove invocationLocation in favor of invocationStrategy
These flags were added to help rust-analyzer integrate with repos
requiring non-Cargo invocations. The consensus is that having two
independent settings are no longer needed. This change removes
`invocationLocation` in favor of `invocationStrategy` and changes
the internal representation of `InvocationStrategy::Once` to hold
the workspace root.
2024-08-19 02:25:40 -05:00
David Richey
ac6a3f82cd Remove rust-analyzer.workspace.discoverProjectRunner 2024-08-16 09:50:45 -05:00
Ali Bektas
2426649661 Allow rust-project.json to be hidden 2024-08-07 03:27:03 +02:00
Lukas Wirth
f053b1aa6a feat: Load sysroot library via cargo metadata 2024-08-05 12:18:19 +02:00
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
Josh McKinney
45a881313a
feat: use vscode log format for client logs
This change updates the log format to use the vscode log format instead
of the custom log format, by replacing the `OutputChannel` with a
`LogOutputChannel` and using the `debug`, `info`, `warn`, and `error`
methods on it. This has the following benefits:

- Each log level now has its own color and the timestamp is in a more
  standard format
- Inspect output (e.g. the log of the config object) is now colored
- Error stack traces are now shown in the output
- The log level is now controlled on the output tab by clicking the gear
  icon and selecting "Debug" or by passing the `--log` parameter to
  vscode. The `trace.extension` setting has been marked as deprecated.
2024-07-27 21:43:35 -07: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
b333f85a9d Auto merge of #17639 - Veykril:salsa-perf, r=Veykril
Some more small salsa memory improvements

This does limit our lru limits to 2^16 but if you want to set them higher than that you might as well not set them at all. Also makes `LRU` opt-in per query now, allowing us to drop all the unnecessary LRU stuff for most queries
2024-07-19 18:45:16 +00:00
Lukas Wirth
89bcc79b5d Regenerate files 2024-07-19 18:39:42 +02:00
Joel Daniel Rico
430768064f remove rust-analyzer.openFAQ 2024-07-19 08:11:16 -07: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
Lukas Wirth
ef462ca88e Update test fixtures 2024-07-18 09:09:31 +02: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
Lukas Wirth
7fa20cbb04 Remove faq landing page, improve main one 2024-07-10 19:05:32 +02: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
bors
1adb52cde6 Auto merge of #17549 - Veykril:runnables-fix, r=Veykril
fix: Fix runnables being incorrectly constructed

I've misunderstood parts of the code here which caused runnables to arbitrarily break :) (I have yet to understand the conditions that made them break though, there is some odd caching involved I feel like ...)
Fixes https://github.com/rust-lang/rust-analyzer/issues/17402
2024-07-06 18:24:30 +00:00
Lukas Wirth
bb9678ea3b fix: Fix runnables being incorrectly constructed 2024-07-06 20:23:14 +02:00
bors
78d5f05e70 Auto merge of #17508 - jjoeldaniel:landing-page, r=Veykril
feat: Add landing/faq walkthrough pages

This is a basic implementation of a landing and FAQ page; I've included the bare-bones information as well as a [recommended section on inlay hints](https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/Landing.20Page/near/446135321).

I've also added `rust-analyzer: Open Walkthrough` and `rust-analyzer: Open FAQ` commands for ease of access.

I am hoping to create a small list of FAQ to include that might be useful as well as any other information I may have missed in the landing page. Feel free to share any suggestions!

![landing/faq page demo](https://github.com/rust-lang/rust-analyzer/assets/100006388/4644e4f0-4555-4b29-83c1-b048084ad63d)

cc #13351
2024-07-06 13:59:36 +00: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