Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-add rust-analyzer as a subtree #99465

Closed
wants to merge 10,000 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
10000 commits
Select commit Hold shift + click to select a range
6e9c963
internal: Lift out IdentContext from CompletionContext
Veykril Jun 20, 2022
a1ff3ca
Auto merge of #12594 - Veykril:completions, r=Veykril
bors Jun 20, 2022
1f02840
fix: Don't trigger pattern completions when typing a wildcard pattern
Veykril Jun 20, 2022
9fdfa9f
Auto merge of #12596 - Veykril:completions, r=Veykril
bors Jun 20, 2022
06ee4d6
fix: Fix auto-ref completions inserting into wrong locations
Veykril Jun 20, 2022
98a5811
Only apply `cfg(test)` for local crates
flodiebold Jun 20, 2022
46d2271
Remove pattern rendering hack
Veykril Jun 20, 2022
05ca0a2
Refactor a bit
flodiebold Jun 20, 2022
8b07898
Reimplement auto-ref completions for fields
Veykril Jun 20, 2022
439a513
Auto merge of #12597 - Veykril:completions, r=Veykril
bors Jun 20, 2022
07d78b6
Fix test
flodiebold Jun 20, 2022
312ac83
Auto merge of #12599 - flodiebold:no-test-deps, r=flodiebold
bors Jun 20, 2022
7a0774d
internal: Simplify some completions
Veykril Jun 20, 2022
6fc5c3c
Auto merge of #12604 - Veykril:completions, r=Veykril
bors Jun 20, 2022
c6f776c
determine doc link type from start instead of text or code
erhuve Jun 21, 2022
b7e3f52
handle autolink as edge case
erhuve Jun 21, 2022
f780145
apply suggestions
soruh Jun 22, 2022
f9379df
add use_trivial_contructor.rs
soruh Jun 22, 2022
817082c
add doc strings to use_trivial_contructor.rs
soruh Jun 22, 2022
96ff235
condense matches on autolink
erhuve Jun 23, 2022
1ef5e14
goto where trait method impl
bitgaoshu Jun 15, 2022
1064c75
reformat code
bitgaoshu Jun 21, 2022
29f01cd
Various cleanups
flodiebold Jun 23, 2022
f410fdf
Add two more tests
flodiebold Jun 23, 2022
36fadc4
Fix unstable feature use
flodiebold Jun 23, 2022
472ae16
fix: completes non exhaustive variant within the defining crate
yue4u Jun 23, 2022
19fad54
Auto merge of #12625 - yue4u:fix/non-exhaustive-variant, r=Veykril
bors Jun 23, 2022
e0c17e8
fix: trailing ':' on empty inactive reasons
CuriousCorrelation Jun 23, 2022
2642f64
internal: Simplify
Veykril Jun 23, 2022
32b40de
Auto merge of #12628 - Veykril:simplify, r=Veykril
bors Jun 23, 2022
21642a2
Try to publish releases to OpenVSX
lnicola Jun 23, 2022
5107123
clarify comment and add autolink test case
erhuve Jun 23, 2022
434e718
Auto merge of #12605 - erhuve:fix/determine-doc-link-type-at-start, r…
bors Jun 23, 2022
6ecabe3
functions resolve to impl
bitgaoshu Jun 24, 2022
9e6bff7
fix some test due to resolve to where trait m impl
bitgaoshu Jun 24, 2022
c80c348
Improve proc macro errors a bit
flodiebold Jun 24, 2022
45fd5e6
Improve comments
flodiebold Jun 24, 2022
401a71d
Auto merge of #12629 - flodiebold:proc-macro-error-improvement, r=Vey…
bors Jun 24, 2022
9ea8d58
fix test in qualify_method: stay in trait path
bitgaoshu Jun 24, 2022
353829f
highlight: trait path
bitgaoshu Jun 24, 2022
900b420
rename "trait_def" to "def_in_trait"
bitgaoshu Jun 24, 2022
e3b1303
fix test in resolve_proc_macro: Foo is Owner
bitgaoshu Jun 24, 2022
5bb123d
Auto merge of #12520 - Veykril:flycheck-cancel, r=Veykril
bors Jun 24, 2022
82c1b31
restore sth
bitgaoshu Jun 25, 2022
0dbc091
add test for suggest_name
bitgaoshu Jun 25, 2022
fb6278e
Reduce intermediate allocations while printing witnesses
iDawer Jun 25, 2022
e4e2a46
Correct target_feature completion
slackinghyena Jun 25, 2022
f536766
complete raw identifier with "r#" prefix
xuhongxu96 Jun 26, 2022
45b8960
Fix typo in build.rs
Jun 26, 2022
b74e96f
Auto merge of #12638 - buffet:fix-typo, r=flodiebold
bors Jun 26, 2022
408fa14
add test for item same name
bitgaoshu Jun 26, 2022
dcb4837
WellFormed -> Holds
bitgaoshu Jun 26, 2022
bef89e9
Udate unit tests
slackinghyena Jun 27, 2022
7f1fac7
fix: deduplicate cfg completions
weirdsmiley Jun 27, 2022
f6c0bf8
Auto merge of #12642 - weirdsmiley:master, r=Veykril
bors Jun 27, 2022
4c39546
Auto merge of #12635 - antogilbert:tgt_feat, r=Veykril
bors Jun 27, 2022
bdbffdd
fix: Fix completions for locals not working properly inside macro calls
Veykril Jun 27, 2022
9eaf96c
Auto merge of #12643 - Veykril:macro-compl, r=Veykril
bors Jun 27, 2022
8b3ec12
fix: Report proc macro errors in expressions correctly as well
flodiebold Jun 28, 2022
6407727
Auto merge of #12648 - flodiebold:proc-macro-errors-again, r=flodiebold
bors Jun 28, 2022
36d2b43
fix: improve whitespace insertion in pretty printer
lowr Jun 28, 2022
b0102bd
Auto merge of #12652 - lnicola:openvsx, r=lnicola
bors Jun 28, 2022
979d951
Ignore the `bin` artifact for `bench` targets
ChayimFriedman2 Jun 29, 2022
2ff505a
Auto merge of #12428 - lowr:experimental/destructuring-assignment, r=…
bors Jun 30, 2022
7f9c054
Auto merge of #12626 - CuriousCorrelation:fix/empty-reasons, r=flodie…
bors Jun 30, 2022
461c0cc
Correct wording
iDawer Jun 30, 2022
e417992
Add static assertions for some unreachble paths
iDawer Jun 30, 2022
6420840
Auto merge of #12634 - iDawer:match-check.witnesses, r=flodiebold
bors Jun 30, 2022
ce36446
Auto merge of #12655 - ChayimFriedman2:debug-bench-filter-bin-target,…
bors Jun 30, 2022
ddddca8
fix: Fix flycheck sending cancel progress with no running process
Veykril Jun 30, 2022
7d0e5ae
Auto merge of #12660 - Veykril:flycheck, r=Veykril
bors Jul 1, 2022
f8c416e
Auto merge of #12650 - lowr:fix/12591, r=lnicola
bors Jul 1, 2022
531e152
fix: Simplify macro statement expansion handling
Veykril Jul 1, 2022
9165e3b
Update hir-ty test outputs
Veykril Jul 1, 2022
58d5c69
Fix Expr::MacroStmts using wrong scopes
Veykril Jul 1, 2022
8e764a8
fix: Fix attribute macros on assoc items being discarded with disable…
Veykril Jul 1, 2022
e5e5a09
Fix blocks not considering stmt without semi as tails
Veykril Jul 1, 2022
8489cd7
Auto merge of #12670 - Veykril:assoc-attrs, r=Veykril
bors Jul 1, 2022
ed44fe5
Auto merge of #12668 - Veykril:mac-source-map, r=Veykril
bors Jul 1, 2022
994f3cf
Auto merge of #12636 - xuhongxu96:fix-12148, r=Veykril
bors Jul 1, 2022
e715195
Add tests for #12669
flodiebold Jul 1, 2022
9a12d0d
Fix case of ignored/broken proc macro
flodiebold Jul 1, 2022
ec78b6b
Auto merge of #12671 - flodiebold:test-for-12669, r=flodiebold
bors Jul 1, 2022
622b516
fix: variants rendering in pattern path
yue4u Jun 25, 2022
ea7ea70
fix: escape for enum variant
yue4u Jul 2, 2022
cd42b20
fix: Trigger flyimport completions in item lists again
Veykril Jul 2, 2022
d4b79ad
Auto merge of #12678 - Veykril:flyimport, r=Veykril
bors Jul 2, 2022
f2963cf
fix: typos in hir-ty
a-kenji Jul 2, 2022
30680df
Auto merge of #12679 - a-kenji:fix-typos-hir, r=lnicola
bors Jul 2, 2022
d101439
Auto merge of #12627 - yue4u:fix/struct-variant-patterns, r=Veykril
bors Jul 2, 2022
afdbd6c
fix: infer lhs first on ordinary assignment expressions
lowr Jul 2, 2022
649e1f5
fix: report type mismatch on identifier in destructuring assignments
lowr Jul 2, 2022
d1ac462
Auto merge of #12680 - lowr:fix/12428-regression, r=Veykril
bors Jul 2, 2022
0039d6f
fix: Extract Function produces duplicate fn names
DorianListens Jun 30, 2022
cc0bb71
Auto merge of #12662 - DorianListens:dscheidt/extract-function-duplic…
bors Jul 2, 2022
e394000
fix: Extract function from trait impl
DorianListens Jul 1, 2022
212f84a
Bump crossbeam-channel
lnicola Jul 2, 2022
416787d
Bump anyhow
lnicola Jul 2, 2022
c7c314d
Bump quote
lnicola Jul 2, 2022
e6fcb23
Bump either
lnicola Jul 3, 2022
2af61bc
Bump pulldown-cmark-to-cmark
lnicola Jul 3, 2022
791f2a0
Bump smallvec
lnicola Jul 3, 2022
87572be
Bump serde
lnicola Jul 3, 2022
b24ece5
Bump serde_json
lnicola Jul 3, 2022
6669f38
Bump indexmap
lnicola Jul 3, 2022
2d3f0b4
Bump semver
lnicola Jul 3, 2022
9e7ca80
Bump cargo_metadata
lnicola Jul 3, 2022
a3011e5
Bump arbitrary and derive_arbitrary
lnicola Jul 3, 2022
5381811
Bump tracing-subscriber
lnicola Jul 3, 2022
e05e6c6
Bump object
lnicola Jul 3, 2022
78beb4c
Bump chalk
lnicola Jul 3, 2022
993a19a
Bump the rest of the deps
lnicola Jul 3, 2022
75b2232
Auto merge of #12681 - lnicola:bump-deps, r=lnicola
bors Jul 3, 2022
ccf854b
Improve documentation for buildScripts.overrideCommand / checkOnSave.…
flodiebold Jul 4, 2022
5235732
Add back restartServerOnConfigChange option
flodiebold Jul 4, 2022
e1a8c0b
Auto merge of #12687 - flodiebold:override-docs, r=flodiebold
bors Jul 4, 2022
db49ac8
internal: Record all macro definitions in ItemScope
Veykril Jul 5, 2022
383ee6a
internal: Update inert attribute list
Veykril Jul 5, 2022
6edf624
Auto merge of #12690 - Veykril:inert-attrs, r=Veykril
bors Jul 5, 2022
976d07e
fix: Fix unresolved proc macro diagnostics pointing to macro expansions
Veykril Jul 5, 2022
2926ca0
Remove useless bors.toml
Rustin170506 Jul 5, 2022
0d9737a
Fix project root assert
Rustin170506 Jul 5, 2022
441e659
Complete associated type only in trait generic arg
xuhongxu96 Jul 5, 2022
fee5555
Auto merge of #12694 - hi-rustin:rustin-patch-bors, r=jonas-schievink
bors Jul 5, 2022
b9ba9fa
Add str_ref_to_string fix
Rustin170506 Jul 5, 2022
0f2eba5
Show only assoc type args in the correct arg pos
xuhongxu96 Jul 6, 2022
ad5a851
Code: use different schemes for the custom views
lnicola Jul 6, 2022
00194ad
Auto merge of #12702 - lnicola:vscode-schemes, r=lnicola
bors Jul 6, 2022
75fb3de
Handle generic args per arg index
xuhongxu96 Jul 6, 2022
0360ed5
check arg_idx >= n_params only if arg_idx >= n_required_params
xuhongxu96 Jul 6, 2022
d2fd137
Use `SmallVec` to slightly shrink `ModPath` size
Jul 6, 2022
c46570e
Auto merge of #12704 - jonas-schievink:smol-paths, r=jonas-schievink
bors Jul 6, 2022
3248601
fix default type param value position
xuhongxu96 Jul 6, 2022
c296e77
Auto merge of #12695 - xuhongxu96:fix-12140, r=jonas-schievink
bors Jul 6, 2022
f0af913
publish workflow: Fix names for existing crates
davidlattimore Jul 8, 2022
6f819e3
Remove unnecessary unsafe from format_args expansion
davidlattimore Jul 8, 2022
09abd76
Auto merge of #12716 - davidlattimore:fix-publish-crate-names, r=lnicola
bors Jul 8, 2022
6c6ae96
Update remaining GitHub URLs
Jul 8, 2022
df4ed94
Auto merge of #12722 - jonas-schievink:update-urls, r=jonas-schievink
bors Jul 8, 2022
7181a39
Auto merge of #12676 - DorianListens:dscheidt/extract-fun-trait-impl,…
bors Jul 8, 2022
c419aa9
Auto merge of #12719 - davidlattimore:format-args-no-unsafe, r=jonas-…
bors Jul 8, 2022
603b6fc
fix: Extract Function misses locals used in closures
DorianListens Jul 6, 2022
2836dd1
Auto merge of #12706 - DorianListens:dscheidt/closure-args, r=DorianL…
bors Jul 8, 2022
21062f9
fix: Improve suggested names for extracted variables
DorianListens Jul 8, 2022
638abba
Fix test
Rustin170506 Jul 9, 2022
666343b
Auto merge of #12727 - DorianListens:dscheidt/extract-var-field-name,…
bors Jul 9, 2022
03a62c1
Bump vscode-languageclient
lnicola Jul 9, 2022
b43708c
Bump d3 and d3-graphviz
lnicola Jul 9, 2022
1b138b1
Bump esbuild
lnicola Jul 9, 2022
7b1b711
Bump eslint
lnicola Jul 9, 2022
0e38961
Bump vsce
lnicola Jul 9, 2022
d03ed83
Bump @typescript-eslint
lnicola Jul 9, 2022
8e889ac
Bump prettier
lnicola Jul 9, 2022
2c9e395
Bump typescript and tslib
lnicola Jul 9, 2022
358d6c6
Bump @types/node to 16
lnicola Jul 9, 2022
a059e79
Bump @vscode/test-electron
lnicola Jul 9, 2022
cb38145
Bump transitive npm deps
lnicola Jul 9, 2022
5342f47
Auto merge of #12732 - lnicola:bump-npm, r=lnicola
bors Jul 9, 2022
4b3164f
fix: ignore renames for crate root
harpsword Jul 7, 2022
eaebead
Fix config keys regarding imports in docs
TonalidadeHidrica Jul 11, 2022
6e55716
Fix obsolete `loadOutDirsFromCheck` configs
TonalidadeHidrica Jul 11, 2022
195ceea
Fix obsolete `diagnostics.experimental.enable`
TonalidadeHidrica Jul 11, 2022
f0649f2
Fix `rustcSource` -> `rustc_source`
TonalidadeHidrica Jul 11, 2022
dfcbed0
Fix obsolete `enableRangeFormatting` config
TonalidadeHidrica Jul 11, 2022
e3bde57
Fix obsolete `completion.snippets` config
TonalidadeHidrica Jul 11, 2022
d9ab7f2
Fix typos
Rustin170506 Jul 11, 2022
f7bb932
Auto merge of #12744 - hi-rustin:rustin-patch-typos, r=lnicola
bors Jul 11, 2022
df66eb7
Implement `ignore` and `index` metavar expression
Jul 11, 2022
caf23f2
Auto merge of #12745 - jonas-schievink:metavar-exprs, r=jonas-schievink
bors Jul 11, 2022
ebfbb31
Update 1.63 proc macro ABI to match rustc
Jul 12, 2022
4cbf23c
Auto merge of #12747 - jonas-schievink:proc-macro-abi-1.63, r=jonas-s…
bors Jul 12, 2022
84a6bc9
Auto merge of #12742 - TonalidadeHidrica:fix-obsolete-config-keys, r=…
bors Jul 13, 2022
fc47ce5
Auto merge of #12696 - hi-rustin:rustin-patch-fix, r=Veykril
bors Jul 13, 2022
def89af
fix: Fix VSCode status bar tooltip not showing the error messages
Veykril Jul 13, 2022
90b5097
Auto merge of #12754 - Veykril:vscode-status, r=Veykril
bors Jul 13, 2022
ec51dcb
fix: Set server binary version when distributing
Veykril Jul 13, 2022
794ecd5
Auto merge of #12755 - Veykril:server-version, r=lnicola
bors Jul 13, 2022
a5ad4de
add tests
soruh Jul 13, 2022
075ab03
fix: Support generics in extract_function assist
DorianListens Apr 30, 2022
796641b
Make search for applicable generics more precise
DorianListens Jul 13, 2022
4cbde4e
fix(completion): `super::` completion at crate root and module depth
feniljain Jul 10, 2022
5af3ef5
Auto merge of #12735 - feniljain:fix-completions, r=feniljain
bors Jul 14, 2022
fbba1d7
Auto merge of #12691 - Veykril:proc-macro-diag, r=Veykril
bors Jul 14, 2022
073b325
Auto merge of #12556 - DorianListens:dscheidt/generic-extract, r=Veykril
bors Jul 14, 2022
6b823b0
fix: Fix imports being inserted before doc comments in inline modules
Veykril Jul 14, 2022
029184d
Auto merge of #12765 - Veykril:import-insert-fix, r=Veykril
bors Jul 14, 2022
7ff6c36
fix: Don't show qualified path completions for private items
Veykril Jul 14, 2022
f4fe2ea
Remove deprecate action
matklad Jul 14, 2022
248fa55
Update .github/workflows/release.yaml
matklad Jul 14, 2022
b49f2a2
Remove deprecate action
matklad Jul 14, 2022
4ad9185
Auto merge of #12764 - matklad:rustupaction, r=lnicola
bors Jul 16, 2022
25090f0
internal: Remove allocation in DefCollector::reseed_with_unresolved_a…
Veykril Jul 16, 2022
2e9d5b5
Auto merge of #12766 - Veykril:completion-vis, r=Veykril
bors Jul 16, 2022
d3796ad
Auto merge of #12772 - Veykril:nameres, r=Veykril
bors Jul 16, 2022
b96f8f1
fix: Improve self param completion applicability
Veykril Jul 16, 2022
96481b7
Auto merge of #12773 - Veykril:self-compl, r=Veykril
bors Jul 16, 2022
c205c62
try fixing spurious CI failures on windows
matklad Jul 16, 2022
f2c2c36
Auto merge of #12776 - matklad:nosu, r=matklad
bors Jul 16, 2022
0a4065d
Improve syntax fixup a bit, handle incomplete `if`
flodiebold Jul 16, 2022
3d7da51
Auto merge of #12775 - flodiebold:syntax-fixup-if, r=flodiebold
bors Jul 16, 2022
ac526e0
Auto merge of #12712 - harpsword:fix-rename-crate-root, r=Veykril
bors Jul 16, 2022
01d2517
Auto merge of #12539 - soruh:instanciate_empty_structs, r=Veykril
bors Jul 16, 2022
766c5f0
Auto merge of #12689 - Veykril:macro-rec, r=Veykril
bors Jul 16, 2022
b9b42e8
tests: add hover tests for const generics
Logarithmus Jul 13, 2022
a96f0aa
feat: support negative const generic parameters
Logarithmus Jul 17, 2022
a0fd58b
Check for local IDs belong to same definition
iDawer Jul 17, 2022
667fd25
Auto merge of #12781 - iDawer:hir_display.stack_overflow, r=lnicola
bors Jul 17, 2022
15f7300
refactor: inline some variables
Logarithmus Jul 17, 2022
83177a7
fix: address suggestions
Logarithmus Jul 17, 2022
db6a85d
Auto merge of #12778 - Logarithmus:feature/fix-negative-const-generic…
bors Jul 17, 2022
d9336a4
fix: un-inline `ConstScalarOrPath::from_expr_opt`
Logarithmus Jul 17, 2022
897a7ec
Auto merge of #12785 - Logarithmus:feature/fix-negative-const-generic…
bors Jul 17, 2022
ea19e70
Fix extract variable assist for subexpression in mutable borrow
hasali19 Jul 17, 2022
b5aa3b3
fix: “Generate constant” ignores the path prefix of the identifier
harpsword May 1, 2022
8e379ce
Auto merge of #12286 - harpsword:fix_generate_constant, r=Veykril
bors Jul 18, 2022
6cb0746
Support the 1.64 nightly proc macro ABI
Jul 18, 2022
ee2d5fe
Auto merge of #12795 - jonas-schievink:proc-macro-abi-1.64, r=jonas-s…
bors Jul 18, 2022
be30c4d
chore: change str_ref_to_string to str_ref_to_owned
mmirate Jul 18, 2022
e2eaa99
Auto merge of #12788 - hasali19:extract-var-mut, r=jonas-schievink
bors Jul 18, 2022
5ad981b
Remove outdated proc macro ABIs
Jul 18, 2022
e01de19
Auto merge of #12798 - jonas-schievink:trim-proc-macro-abis, r=jonas-…
bors Jul 18, 2022
188c0e4
Remove macro ABI version from doc comment
Jul 18, 2022
ea41617
Auto merge of #12802 - rust-lang:jonas-schievink-patch-1, r=jonas-sch…
bors Jul 18, 2022
ec1142c
Improve file watcher config
Jul 18, 2022
38c11be
Move `convert_to_def_in_trait` into `ide-db`
Veykril Jul 18, 2022
22e53f1
Auto merge of #12549 - bitgaoshu:goto_where_trait_m_impl, r=Veykril
bors Jul 18, 2022
fac6a64
Auto merge of #12804 - jonas-schievink:config-watcher, r=Veykril
bors Jul 18, 2022
530eb27
Auto merge of #11819 - rust-lang:dependabot/npm_and_yarn/editors/code…
bors Jul 18, 2022
d17a5ef
Add simple support for completion item details
Veykril Jul 18, 2022
dc05192
Auto merge of #12807 - Veykril:completion-item-details, r=Veykril
bors Jul 18, 2022
567a5e9
Auto merge of #12796 - mmirate:patch-1, r=Veykril
bors Jul 18, 2022
474f5ea
Work around Code bug with empty diagnostics
lnicola Jul 18, 2022
88515b9
Auto merge of #12809 - lnicola:empty-diagnostics, r=lnicola
bors Jul 19, 2022
1b41647
Upgrade to expect-test@1.4.0
fasterthanlime Jul 19, 2022
307be7c
Add CARGO_WORKSPACE_DIR env var in `.cargo/config.toml`
fasterthanlime Jul 19, 2022
7d20ff3
Auto merge of #12817 - fasterthanlime:expect-test-1-4-0, r=lnicola
bors Jul 19, 2022
0424e75
Remove rust-analyzer git submodule
fasterthanlime Jul 19, 2022
7a03bf4
Add 'src/tools/rust-analyzer/' from commit '7d20ff3ffbd30a89b7baa7cd9…
fasterthanlime Jul 19, 2022
0b33563
Add `./x.py test rust-analyzer`
fasterthanlime Jul 19, 2022
81597bd
Pass --locked when building proc-macro-test-impl
fasterthanlime Jul 19, 2022
b189b49
Add (and use) sysroot ABI when building rust-analyzer in-tree
fasterthanlime Jul 19, 2022
ba4b8b2
Allow required unstable features for RA sysroot ABI
fasterthanlime Jul 19, 2022
8990e37
Implement check::RustAnalyzer
fasterthanlime Jul 19, 2022
c213c23
Apply suggestions from @jyn514 re check tool
fasterthanlime Jul 19, 2022
6150a0a
Revert "Apply suggestions from @jyn514 re check tool"
fasterthanlime Jul 19, 2022
380eeaa
Start syncing with proc macro bridge changes
fasterthanlime Jul 19, 2022
378fc76
Handle bridge=>tt conversions
fasterthanlime Jul 19, 2022
a005294
Stub most of the new proc macro interface
fasterthanlime Jul 19, 2022
a6214e8
cargo fmt
fasterthanlime Jul 19, 2022
2582a1d
Add failing test for cloning literals
fasterthanlime Jul 20, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ impl server::FreeFunctions for Rustc {
&mut self,
_s: &str,
) -> Result<bridge::Literal<Self::Span, Self::Symbol>, ()> {
todo!("implement literal_from_str")
panic!("FIXME: implement literal_from_str")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this specifically shouldn't need to change I think, only the comments

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RA has a tidy check that caught this todo!.

I've switched strategies: I'm going to implement all that in the RA repository first (with cargo +stage1 test --features rust-analyzer/in-tree) - there's been too many bridge changes to just tackle them in this monster PR.

}
}

Expand Down Expand Up @@ -319,7 +319,7 @@ impl server::TokenStream for Rustc {
}

bridge::TokenTree::Ident(ident) => {
// TODO: what about raw idents?
// FIXME: handle raw idents?
let text = SYMBOL_INTERNER.lock().unwrap().get(&ident.sym).clone();
let ident: tt::Ident = tt::Ident { text, id: ident.span };
let leaf = tt::Leaf::from(ident);
Expand Down Expand Up @@ -400,14 +400,14 @@ impl server::TokenStream for Rustc {
tt::TokenTree::Leaf(tt::Leaf::Ident(ident)) => {
bridge::TokenTree::Ident(bridge::Ident {
sym: SYMBOL_INTERNER.lock().unwrap().intern(&ident.text),
// TODO: handle raw idents
// FIXME: handle raw idents
is_raw: false,
span: ident.id,
})
}
tt::TokenTree::Leaf(tt::Leaf::Literal(lit)) => {
bridge::TokenTree::Literal(bridge::Literal {
// TODO: implement literal_from_str
// FIXME: implement literal_from_str
kind: bridge::LitKind::Err,
symbol: SYMBOL_INTERNER.lock().unwrap().intern(&lit.text),
suffix: None,
Expand Down Expand Up @@ -711,7 +711,7 @@ impl server::MultiSpan for Rustc {

impl server::Symbol for Rustc {
fn normalize_and_validate_ident(&mut self, _string: &str) -> Result<Self::Symbol, ()> {
todo!()
panic!("FIXME: normalize and validate ident")
}
}

Expand Down
13 changes: 13 additions & 0 deletions src/tools/rust-analyzer/crates/proc-macro-srv/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,19 @@ fn test_fn_like_macro2() {
);
}

#[test]
fn test_fn_like_clone_literal() {
assert_expand(
"fn_like_clone_tokens",
r#"42_u64"#,
expect![[r#"
SUBTREE $
IDENT ident 4294967295
PUNCH , [alone] 4294967295
SUBTREE [] 4294967295"#]],
);
}

#[test]
fn test_attr_macro() {
// Corresponds to
Expand Down
8 changes: 6 additions & 2 deletions src/tools/rust-analyzer/crates/proc-macro-test/imp/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Exports a few trivial procedural macros for testing.

use proc_macro::{Group, Ident, Punct, TokenStream, TokenTree};
use proc_macro::{Group, Ident, Punct, TokenStream, TokenTree, Literal};

#[proc_macro]
pub fn fn_like_noop(args: TokenStream) -> TokenStream {
Expand Down Expand Up @@ -69,6 +69,10 @@ fn clone_tree(t: TokenTree) -> TokenTree {
new.set_span(orig.span());
TokenTree::Punct(new)
}
TokenTree::Literal(_orig) => unimplemented!(),
TokenTree::Literal(orig) => {
let mut lit: Literal = orig.to_string().parse().unwrap();
lit.set_span(orig.span());
TokenTree::Literal(lit)
},
}
}