Commit graph

273984 commits

Author SHA1 Message Date
Lukas Wirth
1ae0258c6a
Merge pull request #18825 from Veykril/push-sllokkprznkq
minor: Encode TraitData bools as bitflags
2025-01-03 12:01:08 +00:00
Lukas Wirth
b763a97a6c minor: Encode TraitData bools as bitflags 2025-01-03 12:46:07 +01:00
Lukas Wirth
70ba3b56ff
Merge pull request #18822 from bryceberger/targetdir-absolute
allow targetDir to be an absolute path
2025-01-03 11:33:57 +00:00
Lukas Wirth
954efa9ddd
Merge pull request #18327 from ChayimFriedman2/flat-tt
Store token trees in contiguous `Vec` instead of as a tree
2025-01-03 11:31:58 +00:00
Bryce Berger
369a6546c7
allow targetDir to be an absolute path 2025-01-02 15:51:54 -05:00
Chayim Refael Friedman
acb3490b09 Store token trees in contiguous Vec instead of as a tree
I expected this to be faster (due to less allocations and better cache locality), but benchmarked it is not (neither it is slower). Memory usage, however, drops by ~50mb (of `analysis-stats .`). I guess tt construction is just not hot.

This also simplifies using even less memory for token trees by compressing equal span, which I plan to do right after.

Some workflows are more easily expressed with a flat tt, while some are better expressed with a tree. With the right helpers, though (which was mostly a matter of trial and error), even the worst workflows become very easy indeed.
2025-01-02 19:21:46 +02:00
Lukas Wirth
b4f865a701
Merge pull request #18820 from dfireBird/fix-space-char-on-literal-render
Fix no space insert before and after if value is only spaces
2025-01-02 11:15:08 +00:00
dfireBird
ac9e28031c
fix no space insert before and after if value is only spaces 2025-01-02 16:28:25 +05:30
Lukas Wirth
bd33815d44
Merge pull request #18819 from ChayimFriedman2/i128-max
fix: Fix overflow detection in MIR evaluation
2025-01-02 10:06:09 +00:00
Chayim Refael Friedman
d93ab14a77 Fix overflow detection in MIR evaluation
With a bit of higher-order macros everything sorts out well.

And also fix a discovered bug when comparing long strings.
2025-01-02 11:51:12 +02:00
Lukas Wirth
ec46a15284
Merge pull request #18817 from Veykril/push-zzkkotwuyqzt
fix: Fix flycheck cancellations leaving stale errors
2025-01-02 08:52:30 +00:00
Lukas Wirth
efbbf570a0 fix: Fix flycheck cancellations leaving stale errors 2025-01-02 09:36:54 +01:00
Lukas Wirth
74d0d4e050
Merge pull request #18179 from ChayimFriedman2/omit-trait-completion
feat: Allow excluding specific traits from completion
2025-01-01 14:34:56 +00:00
Lukas Wirth
c15e36a8de Cleanup 2025-01-01 15:21:54 +01:00
Lukas Wirth
c84d09a7c3 Revamp auto-import exclude config 2025-01-01 15:06:44 +01:00
Lukas Wirth
786056cb82 Simplify completion config path resolutions 2025-01-01 14:32:45 +01:00
Lukas Wirth
13af22df98 Reduce the default autoimport exclusion list 2025-01-01 14:32:45 +01:00
Lukas Wirth
24699bd4d1
Merge pull request #18809 from Veykril/push-ktwrzsmzlplw
internal: Do not render closure ids in hover messages
2025-01-01 12:55:37 +00:00
Chayim Refael Friedman
528ed6bd01 Allow flyimporting excluded trait items if there is an exact match in the name
I.e. with `fn foo()`, don't complete at `x.fo|`, but complete (with imports) for `x.foo|`, since this is less likely to have false positives.

I opted to only do that for flyimport, even though for basic imports there can also be snippet completion (completing the params list for a method), since this is less universally applicable and seems not so useful.
2025-01-01 13:54:23 +01:00
Chayim Refael Friedman
bd6ea14002 Allow excluding specific traits from completion
To be accurate, only their methods are excluded, the trait themselves are still available.

I also excluded a bunch of std traits by default. Some less opinionated, like `AsRef`, which should never be used directly except in generic scenarios (and won't be excluded there), some more opinionated, like the ops traits, which I know some users sometimes want to use directly. Either way it's configurable.

It should be pretty easy to extend support to excluding only specific methods, but I didn't do that currently.

Traits configured to be excluded are resolved in each completion request from scratch. If this proves too expensive, it is easy enough to cache them in the DB.
2025-01-01 13:49:35 +01:00
Lukas Wirth
854caf37d6
Merge pull request #18757 from roife/fix-17812
feat: support updating snapshot tests with codelens/hovering/runnables
2025-01-01 12:44:55 +00:00
Lukas Wirth
c95aa86d30 internal: Do not render closure ids in hover messages
They are not useful
2025-01-01 13:41:07 +01:00
Chayim Refael Friedman
1334961586
Merge pull request #18797 from profetia/issue10583
Fix replace-if-let-with-match generates non-exhausive match
2024-12-31 15:40:55 +00:00
yanglsh
258823daa9 Fix replace-if-let-with-match generates non-exhausive match 2024-12-31 07:40:45 -07:00
Lukas Wirth
87c733c31e
Merge pull request #18807 from Veykril/push-vxopsoummyzx
fix: Populate cargo config env vars for crates
2024-12-31 14:06:36 +00:00
Lukas Wirth
204c8d704a Base relative cargo configs onto the manifest
This is not correct, but should be equivalent in most cases
2024-12-31 14:52:00 +01:00
Lukas Wirth
551a91aeaa fix: Populate cargo config env vars for crates 2024-12-31 14:32:35 +01:00
Lukas Wirth
88e630b859
Merge pull request #18802 from roife/fix-18800
fix: incorrect file_id used for ranges in outgoing calls
2024-12-31 12:33:51 +00:00
Lukas Wirth
fd7ef275f6
Merge pull request #18805 from Veykril/push-pzurvxvoolxs
internal: Implement `<RaSpanServer as SourceFile>::eq`
2024-12-31 12:15:38 +00:00
roife
8860d073f3 fix: incorrect file_id used for ranges in outgoing calls 2024-12-31 20:10:22 +08:00
Lukas Wirth
7468106726 Implement <RaSpanServer as SourceFile>::eq 2024-12-31 13:00:46 +01:00
Lukas Wirth
b8fdfcc227 Remove recursion_limit special casing in tests 2024-12-31 13:00:23 +01:00
Lukas Wirth
8bb0fab904
Merge pull request #18758 from mgsloan/scip-unique-symbols
Improve SCIP symbols
2024-12-31 09:25:30 +00:00
Lukas Wirth
1524ab1473
Merge pull request #18801 from roife/fix-18799
feat: show go-to-type-def actions for subst when hovering
2024-12-31 09:09:23 +00:00
roife
f581774e23 feat: show go-to-type-def actions for subst when hovering 2024-12-31 13:05:29 +08:00
Michael Sloan
8a032e4d50 Move container_to_definition function into enclosing_definition 2024-12-30 13:52:09 -07:00
Michael Sloan
96fc18a3ce Remove erroneous omit of inherent impls
Should have been included in 34dc94bb2d05def8b88739a9382b127feb1a35a0
2024-12-30 13:51:41 -07:00
Michael Sloan
2d434dd767 TODO -> FIXME 2024-12-30 13:51:32 -07:00
Michael Sloan
b7cdd64690 Make impl HirDisplay for TraitRef provide just the trait type 2024-12-30 13:34:02 -07:00
yanglsh
8b66221e81 Add test cases for #10583 2024-12-30 12:07:35 -07:00
roife
dbf07bab76 refactor snapshot-tests detection in runnables 2024-12-30 23:56:31 +08:00
Lukas Wirth
65bf7f790b
Merge pull request #18795 from dfireBird/fix-hover-render
Fix render of literal to be rendered in codeblock
2024-12-30 14:46:45 +00:00
dfireBird
a0acb233e1
Fix render of literal to be rendered in codeblock 2024-12-30 20:03:10 +05:30
Lukas Wirth
20a7bf12eb
Merge pull request #18790 from ChayimFriedman2/proper-make
internal: Create a quoting mechanism instead of textual AST make
2024-12-30 11:39:29 +00:00
Lukas Wirth
56e05dc2bc
Merge pull request #18794 from 1hakusai1/fix_fill_match_arm_in_tokio_main
Fix bug of "fill match arm" action in tokio::main macro
2024-12-30 11:30:32 +00:00
Lukas Wirth
39ba498c8c
Merge pull request #18793 from ChayimFriedman2/fixup
minor: Remove unneeded conversions
2024-12-30 11:20:49 +00:00
1hakusai1
6fa3b3f85b Fix bug of "fill match arm" action in tokio::main macro
https://github.com/rust-lang/rust-analyzer/issues/18027
2024-12-30 20:06:17 +09:00
Chayim Refael Friedman
b4ad30deaa Remove unneeded conversions 2024-12-30 13:04:19 +02:00
Lukas Wirth
4a1c7d1719
Merge pull request #18792 from Veykril/push-wonkvzozmmwz
Decouple proc-macro server protocol from the server implementation
2024-12-30 11:00:08 +00:00
Lukas Wirth
a081215f40
Merge pull request #18791 from roife/fix-18786
fix: avoid generating colliding names in extract_variable
2024-12-30 10:52:53 +00:00