Commit graph

990 commits

Author SHA1 Message Date
prez
b6f31f0fee docs: Add example on how to change configuration options in Kate 2023-07-20 11:47:41 +02:00
Adenine
add9056c32
Merge branch 'rust-lang:master' into master 2023-07-09 16:10:40 -04:00
Laurențiu Nicola
8befd920d6 Remove old section about downloading the server from the manual 2023-07-09 09:26:05 +03:00
Adenine
1dd54eb44a change viewMemoryLayoutParams to be textPositionParams 2023-07-08 12:25:54 -04:00
Adenine
514bab504e
Merge branch 'rust-lang:master' into master 2023-07-08 12:21:38 -04:00
Ali Bektas
2e5d431dfc
Update docs/user/manual.adoc
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
2023-07-08 16:15:08 +02:00
Ali Bektas
655dd188d6 Remind user to check $PATH after installation. 2023-07-08 11:59:46 +02:00
Adenine
4d5c66986e cleanup + docs + tests 2023-07-07 23:12:09 -04:00
Mohsen Alizadeh
6c3e15aaa0 13583 rename runnable env to runnables extra env 2023-06-25 17:26:04 -07:00
Laurențiu Nicola
8589a8100a Neovim, not NeoVim 2023-06-23 20:00:53 +02:00
Alex Kladov
6303551cb8 internal: use consistent style for error handling 2023-06-19 13:01:47 +01:00
MysticNebula70
8cc55bfee6 doc: remove duplicated words 2023-06-16 18:22:43 +08:00
Wilfred Hughes
5da14237eb Document the sysroot field in JsonProject
rust-analyzer supports both `sysroot` and `sysroot_src` in
`rust-project.json`. Document `sysroot` and show example values for
both fields.
2023-06-08 14:56:37 -07:00
Lukas Wirth
3c862507b9 Add render configs for memory layout hovers 2023-05-30 18:36:06 +02:00
bors
e8dbb8e2e0 Auto merge of #14911 - Veykril:config-cfg, r=Veykril
Allow setting cfgs

Fixes https://github.com/rust-lang/rust-analyzer/issues/14365
2023-05-30 12:00:14 +00:00
Lukas Wirth
cea84427e0 Allow setting cfgs 2023-05-28 13:43:21 +02:00
Mason Shuler
05d63eff9c Make rustup heading title match other titles 2023-05-26 16:41:51 -04:00
Mason Shuler
def3b5d7dd Remove outdated rustup installation issue description 2023-05-26 16:40:30 -04:00
Lukas Wirth
91d5a689c7 Add config for disabling non standard lsp highlight tokens 2023-05-11 10:01:38 +02:00
bors
d3ce333ec8 Auto merge of #14742 - Veykril:closure-capture-inlays, r=Veykril
feat: Closure capture inlay hints

I opted for a fictional `move(foo, &bar, &mut qux)` syntax here, disabled by default as these are not correct rust syntax and hence could cause confusion.
![image](https://user-images.githubusercontent.com/3757771/236447484-649a4ea6-ad61-496e-bad8-765a5236150e.png)
2023-05-08 09:52:29 +00:00
Yury Ivanou
98a4c5049f Rename hover memory layout config key 2023-05-07 18:37:56 +03:00
Yury Ivanou
4ed0fa8414 Add config for disabling hover memory layout data 2023-05-07 18:21:07 +03:00
Lukas Wirth
8081a654da feat: Closure capture inlay hints 2023-05-05 13:38:22 +02:00
Ddystopia
7e19d99d4f
Add a localDocs capability 2023-05-02 17:13:21 +02:00
Ddystopia
b74b9797bc
Update hash in lsp-extensions.md 2023-05-02 17:08:54 +02:00
Ddystopia
da0ffe79d0
Change signature of externalDocs in lsp-extensions 2023-05-02 17:06:39 +02:00
Bruno Ortiz
ecfe7c0488 last fixes after rebase 2023-05-02 11:24:08 -03:00
Bruno Ortiz
66fe84d936 accepting review suggestions 2023-05-02 11:01:41 -03:00
Bruno Ortiz
1b8288ff96 Fixing naming from graph to list 2023-05-02 10:59:29 -03:00
Bruno Ortiz
e2535926e9 Fixing tests 2023-05-02 10:56:50 -03:00
Lukas Wirth
a64626d99e Highlight closure captures when cursor is on pipe 2023-05-02 08:59:40 +02:00
hkalbasi
6312fbf521 MIR episode 4 2023-05-01 23:23:10 +03:30
wtj
c533ac3573 minor: fix typos 2023-04-28 18:49:05 +08:00
Lukas Wirth
c21860bd6a Remove proc-macro server command from the rust-analyzer binary 2023-04-26 08:19:28 +02:00
Josh Soref
bc7d84c3ce Spelling
* a rule
* access
* after
* amount
* annotations
* assignment
* assist
* associated
* attribute
* borrowed
* built-in type
* clarification
* command
* const
* constructor
* corresponding
* counterparts
* curlies
* dependencies
* deterministic
* diagnostic
* duplicates
* edge
* edited
* efficient
* elsewhere
* execution
* expression
* extensions
* extracted
* fill
* github
* helper
* heuristic
* incomplete
* indent end
* inlay
* invocation
* lifetime
* looking
* maybe
* move
* mutability
* mutable
* necessarily
* necessary
* negative
* nonexistent
* occurred
* offsets
* offsetted
* overridden
* parameters
* params
* params_and_where_preds_in_scope
* paredit
* parent
* parentheses
* prepended if
* punctuation
* receive
* receiver
* referring
* repeated
* representing
* semantically
* separately
* shouldnot
* siblings
* similar
* something's
* statement
* struct
* structure
* surprise
* the
* this
* transparent
* unimplemented
* unnamed
* unnecessary
* unneeded
* unreachable
* unterminated
* utilities
* variant
* variants
* visibility
* work around (v)
* workaround

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-19 09:45:55 -04:00
Lukas Wirth
0286e46e5f internal: Skip code lens resolution for mismatched document versions 2023-04-13 10:55:28 +02:00
hkalbasi
59b6f2d9f2 Compute closure captures 2023-04-10 23:04:34 +03:30
bors
fc8c5139fa Auto merge of #14410 - Veykril:query-lru-capacities, r=Veykril
internal: Add config to specifiy lru capacities for all queries

Might help figuring out what queries should be limited by LRU by default, as currently we only limit `parse`, `parse_macro_expansion` and `macro_expand`.
2023-03-30 12:20:24 +00:00
Lukas Wirth
5616d91b73 internal: Add config to specifiy lru capacities for all queries 2023-03-30 12:52:28 +02:00
Lukas Wirth
ee02213e65 Handle proc macro fetching via OpQueue 2023-03-26 09:33:41 +02:00
Lukas Wirth
586db0790c minor: Add user facing command for reloading proc-macros in VSCode 2023-03-25 20:54:24 +01:00
Lukas Wirth
607375dc20 Load proc-macros asynchronously 2023-03-25 18:06:06 +01:00
Laurențiu Nicola
c3864eb511 Add and use rust-analyzer.cargo.extraArgs setting 2023-03-12 13:04:24 +02:00
hkalbasi
ac04bfd7a7 Add View Mir command and fix some bugs 2023-03-06 21:09:09 +03:30
bors
a0be16b0b2 Auto merge of #14040 - HKalbasi:mir, r=HKalbasi
Beginning of MIR

This pull request introduces the initial implementation of MIR lowering and interpreting in Rust Analyzer.

The implementation of MIR has potential to bring several benefits:
- Executing a unit test without compiling it: This is my main goal. It can be useful for quickly testing code changes and print-debugging unit tests without the need for a full compilation (ideally in almost zero time, similar to languages like python and js). There is a probability that it goes nowhere, it might become slower than rustc, or it might need some unreasonable amount of memory, or we may fail to support a common pattern/function that make it unusable for most of the codes.
- Constant evaluation: MIR allows for easier and more correct constant evaluation, on par with rustc. If r-a wants to fully support the type system, it needs full const eval, which means arbitrary code execution, which needs MIR or something similar.
- Supporting more diagnostics: MIR can be used to detect errors, most famously borrow checker and lifetime errors,  but also mutability errors and uninitialized variables, which can be difficult/impossible to detect in HIR.
- Lowering closures: With MIR we can find out closure capture modes, which is useful in detecting if a closure implements the `FnMut` or `Fn` traits, and calculating its size and data layout.

But the current PR implements no diagnostics and doesn't support closures. About const eval, I removed the old const eval code and it now uses the mir interpreter. Everything that is supported in stable rustc is either implemented or is super easy to implement. About interpreting unit tests, I added an experimental config, disabled by default, that shows a `pass` or `fail` on hover of unit tests (ideally it should be a button similar to `Run test` button, but I didn't figured out how to add them). Currently, no real world test works, due to missing features including closures, heap allocation, `dyn Trait` and ... so at this point it is only useful for me selecting what to implement next.

The implementation of MIR is based on the design of rustc, the data structures are almost copy paste (so it should be easy to migrate it to a possible future stable-mir), but the lowering and interpreting code is from me.
2023-02-28 09:12:19 +00:00
hkalbasi
cd67589f63 beginning of MIR 2023-02-27 23:45:54 +03:30
Laurențiu Nicola
563bd9c24a Try to improve the rustfmt.overrideCommand docs 2023-02-21 12:43:22 +02:00
Ethan-000
936bac31d4
fix link 2023-02-16 21:45:56 +00:00
Aleksey Kladov
0da27376cf Support UTF-32 position encoding
Looks like this is a native encoding for Emacs at least!
2023-02-14 01:09:50 +00:00
bors
646f973857 Auto merge of #14134 - lnicola:clippy-manual, r=Veykril
feat: Add clippy configuration section to the manual and update some old keys

Closes #14132

I don't think this is supposed to be under `Diagnostics`, but it does make sense in a way 🤷 (it's probably where someone might look).
2023-02-12 09:53:15 +00:00