@@ -59,7 +59,10 @@ use std::collections::Spam;
59
59
"# ,
60
60
)
61
61
. with_config ( serde_json:: json!( {
62
- "cargo" : { "sysroot" : "discover" }
62
+ "cargo" : { "sysroot" : "discover" } ,
63
+ "procMacro" : {
64
+ "enable" : false ,
65
+ }
63
66
} ) )
64
67
. server ( )
65
68
. wait_until_workspace_is_loaded ( ) ;
@@ -508,7 +511,7 @@ fn main() {}
508
511
#[ test]
509
512
fn test_missing_module_code_action_in_json_project ( ) {
510
513
if skip_slow_tests ( ) {
511
- // return;
514
+ return ;
512
515
}
513
516
514
517
let tmp_dir = TestDir :: new ( ) ;
@@ -612,7 +615,10 @@ fn main() {{}}
612
615
"#
613
616
) )
614
617
. with_config ( serde_json:: json!( {
615
- "cargo" : { "sysroot" : "discover" }
618
+ "cargo" : { "sysroot" : "discover" } ,
619
+ "procMacro" : {
620
+ "enable" : false ,
621
+ }
616
622
} ) )
617
623
. server ( )
618
624
. wait_until_workspace_is_loaded ( ) ;
@@ -685,7 +691,7 @@ version = \"0.0.0\"
685
691
#[ test]
686
692
fn out_dirs_check ( ) {
687
693
if skip_slow_tests ( ) {
688
- // return;
694
+ return ;
689
695
}
690
696
691
697
let server = Project :: with_fixture (
@@ -711,10 +717,20 @@ fn main() {
711
717
println!("cargo:rerun-if-changed=build.rs");
712
718
}
713
719
//- /src/main.rs
714
- #[rustc_builtin_macro] macro_rules! include {}
715
- #[rustc_builtin_macro] macro_rules! include_str {}
716
- #[rustc_builtin_macro] macro_rules! concat {}
717
- #[rustc_builtin_macro] macro_rules! env {}
720
+ #![feature(rustc_attrs)]
721
+ #[rustc_builtin_macro] macro_rules! include {
722
+ ($file:expr $(,)?) => {{ /* compiler built-in */ }};
723
+ }
724
+ #[rustc_builtin_macro] macro_rules! include_str {
725
+ ($file:expr $(,)?) => {{ /* compiler built-in */ }};
726
+ }
727
+ #[rustc_builtin_macro] macro_rules! concat {
728
+ ($($e:ident),+ $(,)?) => {{ /* compiler built-in */ }};
729
+ }
730
+ #[rustc_builtin_macro] macro_rules! env {
731
+ ($name:expr $(,)?) => {{ /* compiler built-in */ }};
732
+ ($name:expr, $error_msg:expr $(,)?) => {{ /* compiler built-in */ }};
733
+ }
718
734
719
735
include!(concat!(env!("OUT_DIR"), "/hello.rs"));
720
736
@@ -749,7 +765,7 @@ fn main() {
749
765
let res = server. send_request :: < HoverRequest > ( HoverParams {
750
766
text_document_position_params : TextDocumentPositionParams :: new (
751
767
server. doc_id ( "src/main.rs" ) ,
752
- Position :: new ( 19 , 10 ) ,
768
+ Position :: new ( 29 , 10 ) ,
753
769
) ,
754
770
work_done_progress_params : Default :: default ( ) ,
755
771
} ) ;
@@ -758,7 +774,7 @@ fn main() {
758
774
let res = server. send_request :: < HoverRequest > ( HoverParams {
759
775
text_document_position_params : TextDocumentPositionParams :: new (
760
776
server. doc_id ( "src/main.rs" ) ,
761
- Position :: new ( 20 , 10 ) ,
777
+ Position :: new ( 30 , 10 ) ,
762
778
) ,
763
779
work_done_progress_params : Default :: default ( ) ,
764
780
} ) ;
@@ -768,23 +784,23 @@ fn main() {
768
784
GotoDefinitionParams {
769
785
text_document_position_params : TextDocumentPositionParams :: new (
770
786
server. doc_id ( "src/main.rs" ) ,
771
- Position :: new ( 17 , 9 ) ,
787
+ Position :: new ( 27 , 9 ) ,
772
788
) ,
773
789
work_done_progress_params : Default :: default ( ) ,
774
790
partial_result_params : Default :: default ( ) ,
775
791
} ,
776
792
json ! ( [ {
777
793
"originSelectionRange" : {
778
- "end" : { "character" : 10 , "line" : 17 } ,
779
- "start" : { "character" : 8 , "line" : 17 }
794
+ "end" : { "character" : 10 , "line" : 27 } ,
795
+ "start" : { "character" : 8 , "line" : 27 }
780
796
} ,
781
797
"targetRange" : {
782
- "end" : { "character" : 9 , "line" : 8 } ,
783
- "start" : { "character" : 0 , "line" : 7 }
798
+ "end" : { "character" : 9 , "line" : 18 } ,
799
+ "start" : { "character" : 0 , "line" : 17 }
784
800
} ,
785
801
"targetSelectionRange" : {
786
- "end" : { "character" : 8 , "line" : 8 } ,
787
- "start" : { "character" : 7 , "line" : 8 }
802
+ "end" : { "character" : 8 , "line" : 18 } ,
803
+ "start" : { "character" : 7 , "line" : 18 }
788
804
} ,
789
805
"targetUri" : "file:///[..]src/main.rs"
790
806
} ] ) ,
@@ -794,23 +810,23 @@ fn main() {
794
810
GotoDefinitionParams {
795
811
text_document_position_params : TextDocumentPositionParams :: new (
796
812
server. doc_id ( "src/main.rs" ) ,
797
- Position :: new ( 18 , 9 ) ,
813
+ Position :: new ( 28 , 9 ) ,
798
814
) ,
799
815
work_done_progress_params : Default :: default ( ) ,
800
816
partial_result_params : Default :: default ( ) ,
801
817
} ,
802
818
json ! ( [ {
803
819
"originSelectionRange" : {
804
- "end" : { "character" : 10 , "line" : 18 } ,
805
- "start" : { "character" : 8 , "line" : 18 }
820
+ "end" : { "character" : 10 , "line" : 28 } ,
821
+ "start" : { "character" : 8 , "line" : 28 }
806
822
} ,
807
823
"targetRange" : {
808
- "end" : { "character" : 9 , "line" : 12 } ,
809
- "start" : { "character" : 0 , "line" : 11 }
824
+ "end" : { "character" : 9 , "line" : 22 } ,
825
+ "start" : { "character" : 0 , "line" : 21 }
810
826
} ,
811
827
"targetSelectionRange" : {
812
- "end" : { "character" : 8 , "line" : 12 } ,
813
- "start" : { "character" : 7 , "line" : 12 }
828
+ "end" : { "character" : 8 , "line" : 22 } ,
829
+ "start" : { "character" : 7 , "line" : 22 }
814
830
} ,
815
831
"targetUri" : "file:///[..]src/main.rs"
816
832
} ] ) ,
@@ -836,6 +852,7 @@ edition = "2021"
836
852
bar = {path = "../bar"}
837
853
838
854
//- /foo/src/main.rs
855
+ #![feature(rustc_attrs, decl_macro)]
839
856
use bar::Bar;
840
857
841
858
#[rustc_builtin_macro]
@@ -912,7 +929,7 @@ pub fn foo(_input: TokenStream) -> TokenStream {
912
929
let res = server. send_request :: < HoverRequest > ( HoverParams {
913
930
text_document_position_params : TextDocumentPositionParams :: new (
914
931
server. doc_id ( "foo/src/main.rs" ) ,
915
- Position :: new ( 10 , 9 ) ,
932
+ Position :: new ( 11 , 9 ) ,
916
933
) ,
917
934
work_done_progress_params : Default :: default ( ) ,
918
935
} ) ;
0 commit comments