Commit graph

26 commits

Author SHA1 Message Date
David Kurilla
2dfbcb6a46 docs: create setup documentation 2024-10-18 14:58:43 -07:00
David Barsky
a5a4d1a95b internal: add JSON formatting for hprof 2024-10-04 11:26:15 -04:00
bors
4800a0eef7 Auto merge of #18167 - SomeoneToIgnore:fat-completions, r=Veykril
internal: Send less data during `textDocument/completion` if possible

Similar to https://github.com/rust-lang/rust-analyzer/pull/15522, stops sending extra data during `textDocument/completion` if that data was set in the client completions resolve capabilities, and sends those only during `completionItem/resolve` requests.
Currently, rust-analyzer sends back all fields (including potentially huge docs) for every completion item which might get large.

Same as the other one, this PR aims to keep the changes minimal and does not remove extra computations for such fields — instead, it just filters them out before sending to the client.

The PR omits primitive, boolean and integer, types such as `deprecated`, `preselect`, `insertTextFormat`, `insertTextMode`, etc.  AND `additionalTextEdits` — this one looks very dangerous to compute for each completion item (as the spec says we ought to if there's no corresponding resolve capabilities provided) due to the diff computations and the fact that this code had been in the resolution for some time.
It would be good to resolve this lazily too, please let me know if it's ok to do.

When tested with Zed which only defines `documentation` and `additionalTextEdits` in its client completion resolve capabilities, rust-analyzer starts to send almost 3 times less characters:

Request:
```json
{"jsonrpc":"2.0","id":104,"method":"textDocument/completion","params":{"textDocument":{"uri":"file:///Users/someonetoignore/work/rust-analyzer/crates/ide/src/inlay_hints.rs"},"position":{"line":90,"character":14},"context":{"triggerKind":1}}}
```

<img width="1338" alt="image" src="https://github.com/user-attachments/assets/104f19b5-7095-4fc1-b008-5d829623b2e2">

Before: 381944 characters
[before.json](https://github.com/user-attachments/files/17092385/before.json)

After: 140503 characters
[after.json](https://github.com/user-attachments/files/17092386/after.json)

After Zed's [patch](https://github.com/zed-industries/zed/pull/18212) to enable all resolving possible: 84452 characters
[after-after.json](https://github.com/user-attachments/files/17092755/after-after.json)
2024-09-30 08:36:54 +00:00
Noah Bright
7b757b3e17 Rename object_safety to dyn_compatibility
Up to a trait implemented by another package, linking to
$CARGO_HOME/registry/cache/index.crates.io-6f17d22bba15001f/
2024-09-29 07:26:45 -04:00
Noah Bright
99b26382d8 Update handlers.rs to handlers/requests.rs 2024-09-28 06:17:22 -04:00
Kirill Bulatov
b24723a5c7 Fix the test 2024-09-23 05:51:38 +03:00
Ali Bektas
81227a309c Better testing infra for ratoml 2024-09-08 23:40:38 +02:00
Lukas Wirth
be33a2e1bd Improve inlay hint resolution reliability 2024-08-30 15:57:52 +02:00
Lukas Wirth
234d383f5f internal: Reply to requests with defaults when vfs is still loading 2024-08-12 12:05:15 +02:00
bors
722f79d374 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
55964dad2a
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
f6e2fca74b Internal: Cleanup proc-macro error handling 2024-07-26 14:38:19 +02:00
David Barsky
06fe4e6b6e internal: remove UnindexedProject notification
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
2024-07-23 13:34:04 -04:00
David Barsky
2e582ad848 feature: move linked_projects discovery to the rust-analyzer server 2024-07-18 12:01:27 -04:00
Lukas Wirth
77bca5306c Fix stale reference in architecture.md 2024-07-07 09:19:09 +02:00
Lukas Wirth
070f95c12e Move capability querying out of the config module 2024-07-07 07:42:12 +02:00
Lukas Wirth
9959546c8a Flatten cargoExtraArgs away from the runnable lsp extension 2024-07-06 16:36:27 +02:00
Lukas Wirth
0859772dbe Add environment to runnable lsp extension 2024-07-06 16:20:25 +02:00
Joel Daniel Rico
5934eeda55 feat: add toggleLSPLogs command
add `toggleLSPLogs` command
update docs to reflect new command
2024-06-17 04:08:32 -07:00
Wilfred Hughes
1e9e86c655 feature: add build system info; runnables to rust-project.json 2024-06-11 11:55:17 -04:00
Lukas Wirth
59002b3828 Fix processing of ratoml files 2024-06-07 12:31:50 +02:00
roife
c10bda5577 Update docs 2024-05-24 03:53:36 +08:00
Lukas Wirth
f93256ca42 Allow sysroots to only consist of the source root dir 2024-05-23 20:12:31 +02:00
Lukas Wirth
001c387150 Don't retry position relient requests and version resolve data 2024-04-28 17:02:38 +02:00
Lukas Wirth
3bc103ad88 Show workspace info in the status bar 2024-04-26 11:28:33 +02:00
Laurențiu Nicola
8f2138102f Use josh for subtree syncs 2024-04-21 10:07:08 +03:00