@@ -59,7 +59,10 @@ use std::collections::Spam;
5959"# ,
6060 )
6161 . with_config ( serde_json:: json!( {
62- "cargo" : { "sysroot" : "discover" }
62+ "cargo" : { "sysroot" : "discover" } ,
63+ "procMacro" : {
64+ "enable" : false ,
65+ }
6366 } ) )
6467 . server ( )
6568 . wait_until_workspace_is_loaded ( ) ;
@@ -508,7 +511,7 @@ fn main() {}
508511#[ test]
509512fn test_missing_module_code_action_in_json_project ( ) {
510513 if skip_slow_tests ( ) {
511- // return;
514+ return ;
512515 }
513516
514517 let tmp_dir = TestDir :: new ( ) ;
@@ -612,7 +615,10 @@ fn main() {{}}
612615"#
613616 ) )
614617 . with_config ( serde_json:: json!( {
615- "cargo" : { "sysroot" : "discover" }
618+ "cargo" : { "sysroot" : "discover" } ,
619+ "procMacro" : {
620+ "enable" : false ,
621+ }
616622 } ) )
617623 . server ( )
618624 . wait_until_workspace_is_loaded ( ) ;
@@ -685,7 +691,7 @@ version = \"0.0.0\"
685691#[ test]
686692fn out_dirs_check ( ) {
687693 if skip_slow_tests ( ) {
688- // return;
694+ return ;
689695 }
690696
691697 let server = Project :: with_fixture (
@@ -711,10 +717,20 @@ fn main() {
711717 println!("cargo:rerun-if-changed=build.rs");
712718}
713719//- /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+ }
718734
719735include!(concat!(env!("OUT_DIR"), "/hello.rs"));
720736
@@ -749,7 +765,7 @@ fn main() {
749765 let res = server. send_request :: < HoverRequest > ( HoverParams {
750766 text_document_position_params : TextDocumentPositionParams :: new (
751767 server. doc_id ( "src/main.rs" ) ,
752- Position :: new ( 19 , 10 ) ,
768+ Position :: new ( 29 , 10 ) ,
753769 ) ,
754770 work_done_progress_params : Default :: default ( ) ,
755771 } ) ;
@@ -758,7 +774,7 @@ fn main() {
758774 let res = server. send_request :: < HoverRequest > ( HoverParams {
759775 text_document_position_params : TextDocumentPositionParams :: new (
760776 server. doc_id ( "src/main.rs" ) ,
761- Position :: new ( 20 , 10 ) ,
777+ Position :: new ( 30 , 10 ) ,
762778 ) ,
763779 work_done_progress_params : Default :: default ( ) ,
764780 } ) ;
@@ -768,23 +784,23 @@ fn main() {
768784 GotoDefinitionParams {
769785 text_document_position_params : TextDocumentPositionParams :: new (
770786 server. doc_id ( "src/main.rs" ) ,
771- Position :: new ( 17 , 9 ) ,
787+ Position :: new ( 27 , 9 ) ,
772788 ) ,
773789 work_done_progress_params : Default :: default ( ) ,
774790 partial_result_params : Default :: default ( ) ,
775791 } ,
776792 json ! ( [ {
777793 "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 }
780796 } ,
781797 "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 }
784800 } ,
785801 "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 }
788804 } ,
789805 "targetUri" : "file:///[..]src/main.rs"
790806 } ] ) ,
@@ -794,23 +810,23 @@ fn main() {
794810 GotoDefinitionParams {
795811 text_document_position_params : TextDocumentPositionParams :: new (
796812 server. doc_id ( "src/main.rs" ) ,
797- Position :: new ( 18 , 9 ) ,
813+ Position :: new ( 28 , 9 ) ,
798814 ) ,
799815 work_done_progress_params : Default :: default ( ) ,
800816 partial_result_params : Default :: default ( ) ,
801817 } ,
802818 json ! ( [ {
803819 "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 }
806822 } ,
807823 "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 }
810826 } ,
811827 "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 }
814830 } ,
815831 "targetUri" : "file:///[..]src/main.rs"
816832 } ] ) ,
@@ -836,6 +852,7 @@ edition = "2021"
836852bar = {path = "../bar"}
837853
838854//- /foo/src/main.rs
855+ #![feature(rustc_attrs, decl_macro)]
839856use bar::Bar;
840857
841858#[rustc_builtin_macro]
@@ -912,7 +929,7 @@ pub fn foo(_input: TokenStream) -> TokenStream {
912929 let res = server. send_request :: < HoverRequest > ( HoverParams {
913930 text_document_position_params : TextDocumentPositionParams :: new (
914931 server. doc_id ( "foo/src/main.rs" ) ,
915- Position :: new ( 10 , 9 ) ,
932+ Position :: new ( 11 , 9 ) ,
916933 ) ,
917934 work_done_progress_params : Default :: default ( ) ,
918935 } ) ;
0 commit comments