about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2022-06-10Auto merge of #12490 - yue4u:fix/show-enum-in-fresh-use-tree, r=Veykrilbors-8/+30
fix: complete non-std enum at the start of `use` completions close: #12421
2022-06-10Auto merge of #12464 - harpsword:fix-inline-variable-mismatched-type, r=Veykrilbors-2/+1
feat: fix inline variable produce mismatched type wrap reference for RefExpr initializer to fix #12453
2022-06-10Auto merge of #12477 - hasali19:auto-reload, r=Veykrilbors-6/+19
Restart server automatically on settings changes Closes #12476 I think this works quite well, but if you think it would be better to put it behind a setting I can do that.
2022-06-10Auto merge of #12473 - yue4u:fix/no-enum-parens-in-use, r=Veykrilbors-10/+43
fix: avoid adding enum parens in use path close #12420
2022-06-10Auto merge of #12502 - Veykril:deps, r=Veykrilbors-168/+181
internal: Bump Dependencies
2022-06-10internal: Bump DependenciesLukas Wirth-168/+181
2022-06-10Auto merge of #12501 - Veykril:dashmap, r=Veykrilbors-22/+19
internal: Update dashmap and freeze its version
2022-06-10internal: Update dashmap and freeze its versionLukas Wirth-22/+19
2022-06-09feat: append :: afteryue4u-14/+20
2022-06-08Auto merge of #12487 - lukechu10:master, r=lnicolabors-0/+8
minor: hide param inlay hint when argument is fn-like macro with similar name Closes #12486
2022-06-08Auto merge of #12493 - bjorn3:fix_warnings, r=lnicolabors-8/+3
Fix a couple of weak warnings found by rust-analyzer itself
2022-06-08Hide param inlay hint when argument is fn-like macro with similar nameLuke Chu-0/+8
2022-06-08Fix a couple of weak warnings found by rust-analyzer itselfbjorn3-8/+3
2022-06-08Auto merge of #12492 - bjorn3:proc_macro_abi_1_63, r=lnicolabors-1/+4293
feat: Add proc macro ABI for rustc 1.63 Fixes https://github.com/rust-lang/rust-analyzer/issues/12489 This bumps the MSRV to 1.61 due to usage of function pointers and `impl Trait` in const functions. <details> <summary>Diff from upstream proc_macro as of rust-lang/rust@e45d9973b2665897a768312e971b82cc62633103 (misses lib.rs as it got renamed to mod.rs)</summary> ```diff diff -u --recursive ../rust/library/proc_macro/src/bridge/client.rs crates/proc-macro-srv/src/abis/abi_1_63/proc_macro/bridge/client.rs --- ../rust/library/proc_macro/src/bridge/client.rs 2022-06-08 13:14:57.763123238 +0000 +++ crates/proc-macro-srv/src/abis/abi_1_63/proc_macro/bridge/client.rs 2022-06-08 13:33:23.378430287 +0000 `@@` -430,27 +430,27 `@@` buf } -impl Client<crate::TokenStream, crate::TokenStream> { - pub const fn expand1(f: impl Fn(crate::TokenStream) -> crate::TokenStream + Copy) -> Self { +impl Client<super::super::TokenStream, super::super::TokenStream> { + pub const fn expand1(f: impl Fn(super::super::TokenStream) -> super::super::TokenStream + Copy) -> Self { Client { get_handle_counters: HandleCounters::get, run: super::selfless_reify::reify_to_extern_c_fn_hrt_bridge(move |bridge| { - run_client(bridge, |input| f(crate::TokenStream(input)).0) + run_client(bridge, |input| f(super::super::TokenStream(input)).0) }), _marker: PhantomData, } } } -impl Client<(crate::TokenStream, crate::TokenStream), crate::TokenStream> { +impl Client<(super::super::TokenStream, super::super::TokenStream), super::super::TokenStream> { pub const fn expand2( - f: impl Fn(crate::TokenStream, crate::TokenStream) -> crate::TokenStream + Copy, + f: impl Fn(super::super::TokenStream, super::super::TokenStream) -> super::super::TokenStream + Copy, ) -> Self { Client { get_handle_counters: HandleCounters::get, run: super::selfless_reify::reify_to_extern_c_fn_hrt_bridge(move |bridge| { run_client(bridge, |(input, input2)| { - f(crate::TokenStream(input), crate::TokenStream(input2)).0 + f(super::super::TokenStream(input), super::super::TokenStream(input2)).0 }) }), _marker: PhantomData, `@@` -464,17 +464,17 `@@` CustomDerive { trait_name: &'static str, attributes: &'static [&'static str], - client: Client<crate::TokenStream, crate::TokenStream>, + client: Client<super::super::TokenStream, super::super::TokenStream>, }, Attr { name: &'static str, - client: Client<(crate::TokenStream, crate::TokenStream), crate::TokenStream>, + client: Client<(super::super::TokenStream, super::super::TokenStream), super::super::TokenStream>, }, Bang { name: &'static str, - client: Client<crate::TokenStream, crate::TokenStream>, + client: Client<super::super::TokenStream, super::super::TokenStream>, }, } `@@` -490,21 +490,21 `@@` pub const fn custom_derive( trait_name: &'static str, attributes: &'static [&'static str], - expand: impl Fn(crate::TokenStream) -> crate::TokenStream + Copy, + expand: impl Fn(super::super::TokenStream) -> super::super::TokenStream + Copy, ) -> Self { ProcMacro::CustomDerive { trait_name, attributes, client: Client::expand1(expand) } } pub const fn attr( name: &'static str, - expand: impl Fn(crate::TokenStream, crate::TokenStream) -> crate::TokenStream + Copy, + expand: impl Fn(super::super::TokenStream, super::super::TokenStream) -> super::super::TokenStream + Copy, ) -> Self { ProcMacro::Attr { name, client: Client::expand2(expand) } } pub const fn bang( name: &'static str, - expand: impl Fn(crate::TokenStream) -> crate::TokenStream + Copy, + expand: impl Fn(super::super::TokenStream) -> super::super::TokenStream + Copy, ) -> Self { ProcMacro::Bang { name, client: Client::expand1(expand) } } diff -u --recursive ../rust/library/proc_macro/src/bridge/mod.rs crates/proc-macro-srv/src/abis/abi_1_63/proc_macro/bridge/mod.rs --- ../rust/library/proc_macro/src/bridge/mod.rs 2022-06-08 13:14:57.763123238 +0000 +++ crates/proc-macro-srv/src/abis/abi_1_63/proc_macro/bridge/mod.rs 2022-06-08 13:33:39.694243060 +0000 `@@` -8,7 +8,7 `@@` #![deny(unsafe_code)] -use crate::{Delimiter, Level, LineColumn, Spacing}; +pub use super::{Delimiter, Level, LineColumn, Spacing}; use std::fmt; use std::hash::Hash; use std::marker; diff '--color=always' -u --recursive ../rust/library/proc_macro/src/bridge/server.rs crates/proc-macro-srv/src/abis/abi_1_63/proc_macro/bridge/server.rs --- ../rust/library/proc_macro/src/bridge/server.rs 2022-06-08 13:14:57.763123238 +0000 +++ crates/proc-macro-srv/src/abis/abi_1_63/proc_macro/bridge/server.rs 2022-06-08 13:33:54.306075391 +0000 `@@` -274,7 +274,7 `@@` Result::decode(&mut &buf[..], &mut dispatcher.handle_store) } -impl client::Client<crate::TokenStream, crate::TokenStream> { +impl client::Client<super::super::TokenStream, super::super::TokenStream> { pub fn run<S: Server>( &self, strategy: &impl ExecutionStrategy, `@@` -295,7 +295,7 `@@` } } -impl client::Client<(crate::TokenStream, crate::TokenStream), crate::TokenStream> { +impl client::Client<(super::super::TokenStream, super::super::TokenStream), super::super::TokenStream> { pub fn run<S: Server>( &self, strategy: &impl ExecutionStrategy, diff -u --recursive ../rust/library/proc_macro/src/diagnostic.rs crates/proc-macro-srv/src/abis/abi_1_63/proc_macro/diagnostic.rs --- ../rust/library/proc_macro/src/diagnostic.rs 2022-05-11 10:07:59.099909725 +0000 +++ crates/proc-macro-srv/src/abis/abi_1_63/proc_macro/diagnostic.rs 2022-06-08 13:35:01.169308145 +0000 `@@` -1,7 +1,6 `@@` -use crate::Span; +use super::Span; /// An enum representing a diagnostic level. -#[unstable(feature = "proc_macro_diagnostic", issue = "54140")] #[derive(Copy, Clone, Debug)] #[non_exhaustive] pub enum Level { `@@` -16,27 +15,23 `@@` } /// Trait implemented by types that can be converted into a set of `Span`s. -#[unstable(feature = "proc_macro_diagnostic", issue = "54140")] pub trait MultiSpan { /// Converts `self` into a `Vec<Span>`. fn into_spans(self) -> Vec<Span>; } -#[unstable(feature = "proc_macro_diagnostic", issue = "54140")] impl MultiSpan for Span { fn into_spans(self) -> Vec<Span> { vec![self] } } -#[unstable(feature = "proc_macro_diagnostic", issue = "54140")] impl MultiSpan for Vec<Span> { fn into_spans(self) -> Vec<Span> { self } } -#[unstable(feature = "proc_macro_diagnostic", issue = "54140")] impl<'a> MultiSpan for &'a [Span] { fn into_spans(self) -> Vec<Span> { self.to_vec() `@@` -45,7 +40,6 `@@` /// A structure representing a diagnostic message and associated children /// messages. -#[unstable(feature = "proc_macro_diagnostic", issue = "54140")] #[derive(Clone, Debug)] pub struct Diagnostic { level: Level, `@@` -56,7 +50,6 `@@` macro_rules! diagnostic_child_methods { ($spanned:ident, $regular:ident, $level:expr) => { - #[unstable(feature = "proc_macro_diagnostic", issue = "54140")] #[doc = concat!("Adds a new child diagnostics message to `self` with the [`", stringify!($level), "`] level, and the given `spans` and `message`.")] pub fn $spanned<S, T>(mut self, spans: S, message: T) -> Diagnostic `@@` -68,7 +61,6 `@@` self } - #[unstable(feature = "proc_macro_diagnostic", issue = "54140")] #[doc = concat!("Adds a new child diagnostic message to `self` with the [`", stringify!($level), "`] level, and the given `message`.")] pub fn $regular<T: Into<String>>(mut self, message: T) -> Diagnostic { `@@` -80,10 +72,8 `@@` /// Iterator over the children diagnostics of a `Diagnostic`. #[derive(Debug, Clone)] -#[unstable(feature = "proc_macro_diagnostic", issue = "54140")] pub struct Children<'a>(std::slice::Iter<'a, Diagnostic>); -#[unstable(feature = "proc_macro_diagnostic", issue = "54140")] impl<'a> Iterator for Children<'a> { type Item = &'a Diagnostic; `@@` -92,17 +82,14 `@@` } } -#[unstable(feature = "proc_macro_diagnostic", issue = "54140")] impl Diagnostic { /// Creates a new diagnostic with the given `level` and `message`. - #[unstable(feature = "proc_macro_diagnostic", issue = "54140")] pub fn new<T: Into<String>>(level: Level, message: T) -> Diagnostic { Diagnostic { level, message: message.into(), spans: vec![], children: vec![] } } /// Creates a new diagnostic with the given `level` and `message` pointing to /// the given set of `spans`. - #[unstable(feature = "proc_macro_diagnostic", issue = "54140")] pub fn spanned<S, T>(spans: S, level: Level, message: T) -> Diagnostic where S: MultiSpan, `@@` -117,59 +104,51 `@@` diagnostic_child_methods!(span_help, help, Level::Help); /// Returns the diagnostic `level` for `self`. - #[unstable(feature = "proc_macro_diagnostic", issue = "54140")] pub fn level(&self) -> Level { self.level } /// Sets the level in `self` to `level`. - #[unstable(feature = "proc_macro_diagnostic", issue = "54140")] pub fn set_level(&mut self, level: Level) { self.level = level; } /// Returns the message in `self`. - #[unstable(feature = "proc_macro_diagnostic", issue = "54140")] pub fn message(&self) -> &str { &self.message } /// Sets the message in `self` to `message`. - #[unstable(feature = "proc_macro_diagnostic", issue = "54140")] pub fn set_message<T: Into<String>>(&mut self, message: T) { self.message = message.into(); } /// Returns the `Span`s in `self`. - #[unstable(feature = "proc_macro_diagnostic", issue = "54140")] pub fn spans(&self) -> &[Span] { &self.spans } /// Sets the `Span`s in `self` to `spans`. - #[unstable(feature = "proc_macro_diagnostic", issue = "54140")] pub fn set_spans<S: MultiSpan>(&mut self, spans: S) { self.spans = spans.into_spans(); } /// Returns an iterator over the children diagnostics of `self`. - #[unstable(feature = "proc_macro_diagnostic", issue = "54140")] pub fn children(&self) -> Children<'_> { Children(self.children.iter()) } /// Emit the diagnostic. - #[unstable(feature = "proc_macro_diagnostic", issue = "54140")] pub fn emit(self) { - fn to_internal(spans: Vec<Span>) -> crate::bridge::client::MultiSpan { - let mut multi_span = crate::bridge::client::MultiSpan::new(); + fn to_internal(spans: Vec<Span>) -> super::bridge::client::MultiSpan { + let mut multi_span = super::bridge::client::MultiSpan::new(); for span in spans { multi_span.push(span.0); } multi_span } - let mut diag = crate::bridge::client::Diagnostic::new( + let mut diag = super::bridge::client::Diagnostic::new( self.level, &self.message[..], to_internal(self.spans), Only in ../rust/library/proc_macro/src/: lib.rs Only in crates/proc-macro-srv/src/abis/abi_1_63/proc_macro/: mod.rs diff -u --recursive ../rust/library/proc_macro/src/quote.rs crates/proc-macro-srv/src/abis/abi_1_63/proc_macro/quote.rs --- ../rust/library/proc_macro/src/quote.rs 2022-05-11 10:22:36.097429479 +0000 +++ crates/proc-macro-srv/src/abis/abi_1_63/proc_macro/quote.rs 2022-06-08 13:35:08.737221303 +0000 `@@` -4,7 +4,7 `@@` //! This quasiquoter uses macros 2.0 hygiene to reliably access //! items from `proc_macro`, to build a `proc_macro::TokenStream`. -use crate::{Delimiter, Group, Ident, Literal, Punct, Spacing, Span, TokenStream, TokenTree}; +use super::{Delimiter, Group, Ident, Literal, Punct, Spacing, Span, TokenStream, TokenTree}; macro_rules! quote_tt { (($($t:tt)*)) => { Group::new(Delimiter::Parenthesis, quote!($($t)*)) }; `@@` -59,10 +59,9 `@@` /// This is the actual implementation of the `quote!()` proc macro. /// /// It is loaded by the compiler in `register_builtin_macros`. -#[unstable(feature = "proc_macro_quote", issue = "54722")] pub fn quote(stream: TokenStream) -> TokenStream { if stream.is_empty() { - return quote!(crate::TokenStream::new()); + return quote!(super::TokenStream::new()); } let proc_macro_crate = quote!(crate); let mut after_dollar = false; `@@` -73,7 +72,7 `@@` after_dollar = false; match tree { TokenTree::Ident(_) => { - return Some(quote!(Into::<crate::TokenStream>::into( + return Some(quote!(Into::<super::TokenStream>::into( Clone::clone(&(@ tree))),)); } TokenTree::Punct(ref tt) if tt.as_char() == '$' => {} `@@` -86,33 +85,33 `@@` } } - Some(quote!(crate::TokenStream::from((@ match tree { - TokenTree::Punct(tt) => quote!(crate::TokenTree::Punct(crate::Punct::new( + Some(quote!(super::TokenStream::from((@ match tree { + TokenTree::Punct(tt) => quote!(super::TokenTree::Punct(super::Punct::new( (@ TokenTree::from(Literal::character(tt.as_char()))), (@ match tt.spacing() { - Spacing::Alone => quote!(crate::Spacing::Alone), - Spacing::Joint => quote!(crate::Spacing::Joint), + Spacing::Alone => quote!(super::Spacing::Alone), + Spacing::Joint => quote!(super::Spacing::Joint), }), ))), - TokenTree::Group(tt) => quote!(crate::TokenTree::Group(crate::Group::new( + TokenTree::Group(tt) => quote!(super::TokenTree::Group(super::Group::new( (@ match tt.delimiter() { - Delimiter::Parenthesis => quote!(crate::Delimiter::Parenthesis), - Delimiter::Brace => quote!(crate::Delimiter::Brace), - Delimiter::Bracket => quote!(crate::Delimiter::Bracket), - Delimiter::None => quote!(crate::Delimiter::None), + Delimiter::Parenthesis => quote!(super::Delimiter::Parenthesis), + Delimiter::Brace => quote!(super::Delimiter::Brace), + Delimiter::Bracket => quote!(super::Delimiter::Bracket), + Delimiter::None => quote!(super::Delimiter::None), }), (@ quote(tt.stream())), ))), - TokenTree::Ident(tt) => quote!(crate::TokenTree::Ident(crate::Ident::new( + TokenTree::Ident(tt) => quote!(super::TokenTree::Ident(super::Ident::new( (@ TokenTree::from(Literal::string(&tt.to_string()))), (@ quote_span(proc_macro_crate.clone(), tt.span())), ))), - TokenTree::Literal(tt) => quote!(crate::TokenTree::Literal({ + TokenTree::Literal(tt) => quote!(super::TokenTree::Literal({ let mut iter = (@ TokenTree::from(Literal::string(&tt.to_string()))) - .parse::<crate::TokenStream>() + .parse::<super::TokenStream>() .unwrap() .into_iter(); - if let (Some(crate::TokenTree::Literal(mut lit)), None) = + if let (Some(super::TokenTree::Literal(mut lit)), None) = (iter.next(), iter.next()) { lit.set_span((@ quote_span(proc_macro_crate.clone(), tt.span()))); `@@` -129,12 +128,11 `@@` panic!("unexpected trailing `$` in `quote!`"); } - quote!([(@ tokens)].iter().cloned().collect::<crate::TokenStream>()) + quote!([(@ tokens)].iter().cloned().collect::<super::TokenStream>()) } /// Quote a `Span` into a `TokenStream`. /// This is needed to implement a custom quoter. -#[unstable(feature = "proc_macro_quote", issue = "54722")] pub fn quote_span(proc_macro_crate: TokenStream, span: Span) -> TokenStream { let id = span.save_span(); quote!((@ proc_macro_crate ) ::Span::recover_proc_macro_span((@ TokenTree::from(Literal::usize_unsuffixed(id))))) ``` </details>
2022-06-08Add doc commentbjorn3-0/+5
2022-06-08Rustfmtbjorn3-5/+17
2022-06-08Add proc macro ABI for rustc 1.63bjorn3-1/+4276
2022-06-08fix: show non-std enum in a fresh use tree completionyue4u-4/+20
2022-06-07Auto merge of #12480 - KOLANICH-tools:unneeded_destr_assignment, ↵bors-2/+2
r=jonas-schievink Remove the unneeded destructuring assignment in `run` in `project-model/src/build_scripts.rs`
2022-06-06Remove the unneeded destructuring assignment in `run` in ↵KOLANICH-2/+2
`project-model/src/build_scripts.rs`
2022-06-06Add restartServerOnConfigChange settingHasan Ali-1/+21
2022-06-05Restart server automatically on settings changesHasan Ali-8/+1
2022-06-05Auto merge of #12475 - Veykril:trait-impl-completion, r=Veykrilbors-1/+22
fix: Fix trait impl completions using wrong insert position Fixes https://github.com/rust-lang/rust-analyzer/issues/12474
2022-06-05fix: Fix trait impl completions using wrong insert positionLukas Wirth-1/+22
2022-06-06fix: avoid adding enum parens in useyue4u-10/+43
2022-06-05Auto merge of #12472 - Veykril:output-ch, r=Veykrilbors-7/+29
internal: Keep output channels across restarts cc https://github.com/rust-lang/rust-analyzer/pull/12470
2022-06-05internal: Keep output channels across restartsLukas Wirth-7/+29
2022-06-05Auto merge of #12471 - Veykril:reload-restart, r=Veykrilbors-1/+1
fix: Restart the server instead of reloading the window when config changes cc https://github.com/rust-lang/rust-analyzer/issues/12469#event-6743447147
2022-06-05fix: Restart the server instead of reloading the window when config changesLukas Wirth-1/+1
2022-06-05Auto merge of #12470 - Veykril:output-ch, r=Veykrilbors-0/+2
fix: Cleanup output channels when restarting server Fixes https://github.com/rust-lang/rust-analyzer/issues/12469
2022-06-05fix: Cleanup output channels when restarting serverLukas Wirth-0/+2
2022-06-05Auto merge of #12466 - lnicola:worker-thread-stack, r=lnicolabors-1/+7
Increase worker thread stack and name them CC #11370
2022-06-04Auto merge of #12468 - Veykril:cancelled-diags, r=Veykrilbors-6/+1
minor: Don't log cancelled diagnostics Since we retry requests now we can actually hit this legitimately
2022-06-05minor: Don't log cancelled diagnosticsLukas Wirth-6/+1
2022-06-04Auto merge of #12467 - Veykril:assist-fix, r=Veykrilbors-0/+25
fix: Fix match to if let assist for wildcard pats
2022-06-05fix: Fix match to if let assist for wildcard patsLukas Wirth-0/+25
2022-06-04Increase worker thread stack and name themLaurențiu Nicola-1/+7
2022-06-04Auto merge of #12465 - Veykril:buildscripts, r=Veykrilbors-10/+10
internal: Only record build script outputs when the output has been changed Follow up to https://github.com/rust-lang/rust-analyzer/pull/12457
2022-06-04Only record build script outputs when the output has been changedLukas Wirth-10/+10
2022-06-04feat: fix inline variable produce mismatched typeharpsword-2/+1
wrap reference for RefExpr initializer
2022-06-03Auto merge of #12461 - Veykril:completions, r=Veykrilbors-437/+403
Move trait_impl completion analysis into CompletionContext
2022-06-03Remove some of the unnecessary helpfer functions from CompletionContextLukas Wirth-195/+151
2022-06-03SimplifyLukas Wirth-106/+113
2022-06-03Move trait_impl completion analysis into CompletionContextLukas Wirth-183/+186
2022-06-03Auto merge of #12459 - Veykril:completions, r=Veykrilbors-396/+291
internal: Clean up keyword completion handling https://github.com/rust-lang/rust-analyzer/issues/12144
2022-06-03Auto merge of #12457 - Veykril:logging, r=Veykrilbors-20/+29
internal: Don't log default build script outputs
2022-06-03Auto merge of #12460 - Veykril:move-guard, r=Veykrilbors-21/+25
minor: Reduce move-guard trigger range
2022-06-03minor: Reduce move-guard trigger rangeLukas Wirth-21/+25
2022-06-03internal: Don't log default build script outputsLukas Wirth-20/+29
2022-06-03DeduplicateLukas Wirth-70/+27