2873 Commits

Author SHA1 Message Date
Lukas Wirth
94915fbe48 Fix syntax highlightingg punct filtering ignoring mods 2025-03-05 15:02:44 +01:00
Lukas Wirth
27dc614627
Merge pull request #19274 from Veykril/push-pouwrwwrlrlt
Highlight unsafe operations as unsafe, not definitions
2025-03-05 12:57:25 +00:00
Lukas Wirth
9fc0ffe008 Use HIR unsafety information for unsafe syntax highlightng 2025-03-05 13:18:46 +01:00
Thalia Archibald
0811ca0a61 Use size_of from the prelude instead of imported
Use `std::mem::{size_of, size_of_val, align_of, align_of_val}` from the
prelude instead of importing or qualifying them.

These functions were added to all preludes in Rust 1.80.
2025-03-05 00:48:44 -08:00
Lukas Wirth
76567ee28d
Merge pull request #19251 from Veykril/push-tkmpqtzxynxk
Remove syntax editing from parenthesis computation
2025-03-01 17:46:07 +00:00
Lukas Wirth
570c6adcd3 Remove syntax editing from parenthesis computation 2025-03-01 18:32:04 +01:00
Lukas Wirth
716e9fdb8d Fix test_keyword_highlighting test 2025-03-01 18:29:47 +01:00
Lukas Wirth
8f319240b4 Cleanup string handling in syntax highlighting 2025-03-01 17:44:29 +01:00
Lukas Wirth
9200f77068 More precise macro modifiers for syntax highlighting 2025-03-01 17:23:51 +01:00
Lukas Wirth
487d682204 Cleanup highlighting macro-def handling 2025-03-01 16:54:40 +01:00
Lukas Wirth
e92dc3fd80 Have inline_local_variable use precedence calculation for parentheses 2025-02-28 11:03:33 +01:00
Lukas Wirth
2c4ef382d6
Merge pull request #19249 from Veykril/push-noosrywrsuvn
Fix prefix adjustment hints unnecessarily introducing parens
2025-02-28 09:33:36 +00:00
Lukas Wirth
f655062cb0 Fix prefix adjustment hints unnecessarily introducing parens 2025-02-28 10:18:10 +01:00
Nicholas Crothers
15207a0474 Add anchor for intra-doc links to associated items 2025-02-27 16:39:07 -06:00
BenjaminBrienen
bd7375a58f enable doctest 2025-02-27 14:58:46 +01:00
Lukas Wirth
93bd36dfb9
Merge pull request #18987 from ChayimFriedman2/drop-glue
feat: Calculate drop glue and show it on hover
2025-02-24 13:52:17 +00:00
andylokandy
03c24d7c28 feat: update insta inline snapshot when clicks 'Update Test' runnable 2025-02-21 21:18:20 +08:00
Mehul Arora
3a31741627 Use correct working directory for non-workspace proc-macro execution 2025-02-17 10:36:32 -05:00
Lukas Wirth
09db657439
Merge pull request #19127 from ChayimFriedman2/different-generic-args
feat: Refactor path lowering and serve a new path diagnostic
2025-02-17 08:30:10 +00:00
Chayim Refael Friedman
100e166bb1 Calculate drop glue and show it on hover
Also fix the `needs_drop()` intrinsic.

Unions also need this information (to err if they have a drop-needing field), but this will come in a follow-up PR.
2025-02-17 06:29:37 +02:00
Chayim Refael Friedman
353616be8b Fix sorting of runnables
There were two mistakes: first, tests were sorted before test modules, and second, we re-sorted based on the name only, which cancelled the sort based on the kind.
2025-02-17 03:03:29 +02:00
Chayim Refael Friedman
55c04ab371 Refactor path lowering
And add a new diagnostic for non-`Fn` parenthesized generic args.

Path lowering started to look like a mess, with each function carrying additional parameters for the diagnostic callback (since paths can occur both in type and in expression/pattern position, and their diagnostic handling is different) and the segment index, for the diagnostics report. So I refactored it from stateless functions on `TyLoweringContext` into stateful struct, `PathLoweringContext`, that tracks the process of lowering a path from resolution til assoc types selection.
2025-02-16 19:44:50 +02:00
Lukas Wirth
2b485d7f23
Merge pull request #19137 from asuto15/highlight-extern-crate
fix: highlight `extern crate` in doc comments
2025-02-16 14:07:07 +00:00
Lukas Wirth
1afbc220bc fix: Stabilize sort order of related_tests 2025-02-16 13:18:47 +01:00
Lukas Wirth
e0d1fba739 fix: Stabilize sort order of runnables 2025-02-16 12:22:26 +01:00
asuto15
c14140ab8b
fix: remove unnecessary conversion 2025-02-15 13:18:18 +09:00
asuto15
24a778f6c1
Delete library modifier to highlighting for extern crate 2025-02-15 12:06:21 +09:00
asuto15
22b1977840
Delete useless comma 2025-02-13 04:33:08 +09:00
asuto15
535338d8bb
Add modifiers to highlighting for extern crate 2025-02-13 03:58:20 +09:00
Lukas Wirth
8e81cc0772
Merge pull request #19109 from Veykril/push-nzpuuqommpnq
fix: Do not show safety hints for extern items lacking semantics
2025-02-12 13:58:56 +00:00
Lukas Wirth
e0814742f0 fix: Do not show safety hints for extern items lacking semantics 2025-02-12 14:43:51 +01:00
gohome001
d3d455d4fb minor: don't show drop hints for other pattern 2025-02-12 17:18:42 +08:00
Chayim Refael Friedman
8aa4ae5e69
Merge pull request #19117 from gohome001/implicit-drop-inlay-hints-bug
Fix: don't emit implicit drop inlay hints for macro
2025-02-11 13:18:04 +00:00
gohome001
42f11d49ee add test case for ignoring inlay hint for macro call 2025-02-11 15:27:34 +08:00
gohome001
55dbf3949d don't emit implicit drop inlay hints for macro 2025-02-11 15:24:46 +08:00
asuto15
de77d7f661
Fix highlighting for extern crate in doc comments 2025-02-11 15:06:56 +09:00
Hayashi Mikihiro
c84cec1547 Shadowing BuiltinType by Module
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-02-10 17:46:43 +09:00
jnyfah
7d1fedc4f3 minor changes 2025-02-07 10:50:45 +01:00
jnyfah
6b328750e5 collapsing if statement 2025-02-06 16:18:15 +01:00
jnyfah
4522bf42ca closure parameter inlay hints 2025-02-06 15:55:56 +01:00
Chayim Refael Friedman
bffc169925 Fix a failing test
The reason this test passed previously is not because it was working as intended, but because prior to the previous commit we did not resolve the `use` at all!

Now, `use self as _` is invalid code anyway (it prints E0429), and because we fallback to the value namespace if we can't resolve in the type namespace (which is a reasonable behavior), this test now actually fails.

I don't think we want to change the fallback, so I removed `use self as _` and instead added a new test, where the value can be resolved in the type namespace.
2025-02-04 19:10:04 +02:00
Chayim Refael Friedman
134b6f2228 Fix IDE resolution of use inside a body
We stopped the expression search too early because `use` is an item.
2025-02-04 18:30:50 +02:00
Lukas Wirth
0fd4fc3522
Merge pull request #19084 from Veykril/push-muworpzpzqup
Split cache priming into distinct phases
2025-02-04 13:57:39 +00:00
Lukas Wirth
ab5e821d97 Expose symbol of CrateName 2025-02-04 14:38:58 +01:00
Lukas Wirth
b7b09d2acb
Merge pull request #19062 from darichey/scip-fix-module-names
Fix scip indexing of module names
2025-02-03 10:05:19 +00:00
Lukas Wirth
7fd6f72007
Merge pull request #19070 from Veykril/push-wpqzmznymtrn
Remove mutable syntax tree shenanigans from adjustment hints
2025-01-29 13:58:18 +00:00
Lukas Wirth
f61d31b144 Remove mutable syntax tree shenanigans from adjustment hints 2025-01-29 14:42:37 +01:00
Lukas Wirth
07a09c154e
Merge pull request #19015 from Wilfred/mdbook
manual: Convert to mdbook
2025-01-28 16:19:37 +00:00
David Richey
9462322f20 Fix scip symbols for implicit modules 2025-01-28 10:14:04 -06:00
David Richey
a329b6ac2c Fix scip crate symbol name 2025-01-28 09:34:23 -06:00