Commit graph

464 commits

Author SHA1 Message Date
Lukas Wirth
de7808bb71 internal: Don't serialize empty fields in completions and resolve payloads 2024-12-16 11:25:29 +01:00
Kirill Bulatov
4169926b3f Address the feedback from pascalkuthe
* Use Base64 to minify the hash representation in the JSON data
* Do hash checks only for items with similar labels
2024-12-10 13:01:23 +02:00
Kirill Bulatov
d348ffb480 Always compute the hash when r-a wants the imports to be resolved 2024-12-09 22:26:00 +02:00
Kirill Bulatov
62d97d9ba7 Draft completion hashing 2024-12-09 22:26:00 +02:00
Mark Murphy
9f73787b98
Update request entry point file path in architecture.md 2024-11-23 13:46:40 -05:00
Kirill Bulatov
4b621e030a Update the file hash 2024-11-11 16:06:55 +01:00
Sam Estep
6da2cc272f Replace with C-Architecture 2024-11-10 13:34:26 -05:00
Sam Estep
d1da09acf5 Delete design label from list 2024-11-07 11:49:22 -05:00
David Kurilla
0719432903 docs: remove unnecessary prerequisites setup.md 2024-10-22 08:48:09 -07:00
David Kurilla
9ee29f4254 style: fix typos 2024-10-18 14:58:43 -07:00
David Kurilla
df14c010be docs: create setup documentation 2024-10-18 14:58:43 -07:00
David Barsky
56c10ca981 internal: add JSON formatting for hprof 2024-10-04 11:26:15 -04:00
bors
dfe6d503b8 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
4255cae1bb 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
01aaa53ef2 Update handlers.rs to handlers/requests.rs 2024-09-28 06:17:22 -04:00
Kirill Bulatov
01ad453285 Fix the test 2024-09-23 05:51:38 +03:00
Ali Bektas
31ed8c9361 Better testing infra for ratoml 2024-09-08 23:40:38 +02:00
Lukas Wirth
5ca5d52697 Improve inlay hint resolution reliability 2024-08-30 15:57:52 +02:00
Lukas Wirth
da3f7d55eb internal: Reply to requests with defaults when vfs is still loading 2024-08-12 12:05:15 +02: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
David Barsky
db43a5a6e9 feature: move linked_projects discovery to the rust-analyzer server 2024-07-18 12:01:27 -04: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
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
Wilfred Hughes
71a78a9cdc feature: add build system info; runnables to rust-project.json 2024-06-11 11:55:17 -04: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
Lukas Wirth
367b82f68d Don't retry position relient requests and version resolve data 2024-04-28 17:02:38 +02:00
Lukas Wirth
18ca22a98e Show workspace info in the status bar 2024-04-26 11:28:33 +02:00
Laurențiu Nicola
c38295993b Use josh for subtree syncs 2024-04-21 10:07:08 +03:00
Lukas Wirth
189aba7943 minor: Carry inlay hint resolve hash as a string 2024-04-14 10:55:20 +02:00
Lukas Wirth
2c5c12acfe fix: Fix inlay hint resolution being broken 2024-04-14 08:27:24 +02:00
hkalbasi
beec6914c8 Resolve tests per file instead of per crate in test explorer 2024-03-29 05:34:43 +03:30
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
David Barsky
6330b028b3 feature: Add a UnindexedProject notification and a corresponding setting. 2024-02-08 14:23:00 -05:00
bors
66cec4d11a Auto merge of #16470 - Veykril:clippy-disallow, r=lnicola
internal: Lint debug prints and disallowed types with clippy
2024-02-05 17:20:43 +00:00
Young-Flash
ba2910a3a7 minor: correct some typos 2024-02-02 18:22:54 +08:00
Lukas Wirth
9e8a0fae0c Lint debug prints and disallowed types with clippy 2024-02-01 17:57:27 +01:00
Young-Flash
36cb518791 internal: add typos.toml as typo white list 2024-02-01 21:04:38 +08:00
Young-Flash
db9fd370ee minor: correct typos 2024-01-30 21:43:43 +08:00