@@ -268,12 +268,12 @@ pub struct TokenStreamIter {
268
268
}
269
269
270
270
#[ derive( Default ) ]
271
- pub struct Rustc {
271
+ pub struct RustAnalyzer {
272
272
ident_interner : IdentInterner ,
273
273
// FIXME: store span information here.
274
274
}
275
275
276
- impl server:: Types for Rustc {
276
+ impl server:: Types for RustAnalyzer {
277
277
type FreeFunctions = FreeFunctions ;
278
278
type TokenStream = TokenStream ;
279
279
type TokenStreamBuilder = TokenStreamBuilder ;
@@ -288,15 +288,15 @@ impl server::Types for Rustc {
288
288
type MultiSpan = Vec < Span > ;
289
289
}
290
290
291
- impl server:: FreeFunctions for Rustc {
291
+ impl server:: FreeFunctions for RustAnalyzer {
292
292
fn track_env_var ( & mut self , _var : & str , _value : Option < & str > ) {
293
293
// FIXME: track env var accesses
294
294
// https://github.com/rust-lang/rust/pull/71858
295
295
}
296
296
fn track_path ( & mut self , _path : & str ) { }
297
297
}
298
298
299
- impl server:: TokenStream for Rustc {
299
+ impl server:: TokenStream for RustAnalyzer {
300
300
fn new ( & mut self ) -> Self :: TokenStream {
301
301
Self :: TokenStream :: new ( )
302
302
}
@@ -354,7 +354,7 @@ impl server::TokenStream for Rustc {
354
354
}
355
355
}
356
356
357
- impl server:: TokenStreamBuilder for Rustc {
357
+ impl server:: TokenStreamBuilder for RustAnalyzer {
358
358
fn new ( & mut self ) -> Self :: TokenStreamBuilder {
359
359
Self :: TokenStreamBuilder :: new ( )
360
360
}
@@ -366,7 +366,7 @@ impl server::TokenStreamBuilder for Rustc {
366
366
}
367
367
}
368
368
369
- impl server:: TokenStreamIter for Rustc {
369
+ impl server:: TokenStreamIter for RustAnalyzer {
370
370
fn next (
371
371
& mut self ,
372
372
iter : & mut Self :: TokenStreamIter ,
@@ -415,7 +415,7 @@ fn spacing_to_external(spacing: Spacing) -> bridge::Spacing {
415
415
}
416
416
}
417
417
418
- impl server:: Group for Rustc {
418
+ impl server:: Group for RustAnalyzer {
419
419
fn new ( & mut self , delimiter : bridge:: Delimiter , stream : Self :: TokenStream ) -> Self :: Group {
420
420
Self :: Group { delimiter : delim_to_internal ( delimiter) , token_trees : stream. token_trees }
421
421
}
@@ -449,7 +449,7 @@ impl server::Group for Rustc {
449
449
}
450
450
}
451
451
452
- impl server:: Punct for Rustc {
452
+ impl server:: Punct for RustAnalyzer {
453
453
fn new ( & mut self , ch : char , spacing : bridge:: Spacing ) -> Self :: Punct {
454
454
tt:: Punct {
455
455
char : ch,
@@ -471,7 +471,7 @@ impl server::Punct for Rustc {
471
471
}
472
472
}
473
473
474
- impl server:: Ident for Rustc {
474
+ impl server:: Ident for RustAnalyzer {
475
475
fn new ( & mut self , string : & str , span : Self :: Span , _is_raw : bool ) -> Self :: Ident {
476
476
IdentId ( self . ident_interner . intern ( & IdentData ( tt:: Ident { text : string. into ( ) , id : span } ) ) )
477
477
}
@@ -486,7 +486,7 @@ impl server::Ident for Rustc {
486
486
}
487
487
}
488
488
489
- impl server:: Literal for Rustc {
489
+ impl server:: Literal for RustAnalyzer {
490
490
fn debug_kind ( & mut self , _literal : & Self :: Literal ) -> String {
491
491
// r-a: debug_kind and suffix are unsupported; corresponding client code has been changed to not call these.
492
492
// They must still be present to be ABI-compatible and work with upstream proc_macro.
@@ -597,7 +597,7 @@ impl server::Literal for Rustc {
597
597
}
598
598
}
599
599
600
- impl server:: SourceFile for Rustc {
600
+ impl server:: SourceFile for RustAnalyzer {
601
601
// FIXME these are all stubs
602
602
fn eq ( & mut self , _file1 : & Self :: SourceFile , _file2 : & Self :: SourceFile ) -> bool {
603
603
true
@@ -610,7 +610,7 @@ impl server::SourceFile for Rustc {
610
610
}
611
611
}
612
612
613
- impl server:: Diagnostic for Rustc {
613
+ impl server:: Diagnostic for RustAnalyzer {
614
614
fn new ( & mut self , level : Level , msg : & str , spans : Self :: MultiSpan ) -> Self :: Diagnostic {
615
615
let mut diag = Diagnostic :: new ( level, msg) ;
616
616
diag. spans = spans;
@@ -634,7 +634,7 @@ impl server::Diagnostic for Rustc {
634
634
}
635
635
}
636
636
637
- impl server:: Span for Rustc {
637
+ impl server:: Span for RustAnalyzer {
638
638
fn debug ( & mut self , span : Self :: Span ) -> String {
639
639
format ! ( "{:?}" , span. 0 )
640
640
}
@@ -706,7 +706,7 @@ impl server::Span for Rustc {
706
706
}
707
707
}
708
708
709
- impl server:: MultiSpan for Rustc {
709
+ impl server:: MultiSpan for RustAnalyzer {
710
710
fn new ( & mut self ) -> Self :: MultiSpan {
711
711
// FIXME handle span
712
712
vec ! [ ]
@@ -724,8 +724,8 @@ mod tests {
724
724
use super :: * ;
725
725
726
726
#[ test]
727
- fn test_rustc_server_literals ( ) {
728
- let mut srv = Rustc { ident_interner : IdentInterner :: default ( ) } ;
727
+ fn test_ra_server_literals ( ) {
728
+ let mut srv = RustAnalyzer { ident_interner : IdentInterner :: default ( ) } ;
729
729
assert_eq ! ( srv. integer( "1234" ) . text, "1234" ) ;
730
730
731
731
assert_eq ! ( srv. typed_integer( "12" , "u8" ) . text, "12u8" ) ;
@@ -761,7 +761,7 @@ mod tests {
761
761
}
762
762
763
763
#[ test]
764
- fn test_rustc_server_to_string ( ) {
764
+ fn test_ra_server_to_string ( ) {
765
765
let s = TokenStream {
766
766
token_trees : vec ! [
767
767
tt:: TokenTree :: Leaf ( tt:: Leaf :: Ident ( tt:: Ident {
@@ -786,7 +786,7 @@ mod tests {
786
786
}
787
787
788
788
#[ test]
789
- fn test_rustc_server_from_str ( ) {
789
+ fn test_ra_server_from_str ( ) {
790
790
use std:: str:: FromStr ;
791
791
let subtree_paren_a = tt:: TokenTree :: Subtree ( tt:: Subtree {
792
792
delimiter : Some ( tt:: Delimiter {
0 commit comments