mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-27 18:26:19 +00:00
Merge pull request #19391 from Veykril/push-rnrskpqoltpl
chore: Clean up proc-macro-srv CI job
This commit is contained in:
commit
15d87419f1
4 changed files with 17 additions and 30 deletions
|
|
@ -1,2 +1 @@
|
|||
target/
|
||||
Cargo.lock
|
||||
|
|
|
|||
7
crates/proc-macro-srv/proc-macro-test/imp/Cargo.lock
generated
Normal file
7
crates/proc-macro-srv/proc-macro-test/imp/Cargo.lock
generated
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 4
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro-test-impl"
|
||||
version = "0.0.0"
|
||||
|
|
@ -1140,26 +1140,12 @@ fn root_contains_symlink_out_dirs_check() {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "sysroot-abi", rust_analyzer))]
|
||||
fn resolve_proc_macro() {
|
||||
use expect_test::expect;
|
||||
use vfs::AbsPathBuf;
|
||||
if skip_slow_tests() {
|
||||
return;
|
||||
}
|
||||
|
||||
let mut sysroot = project_model::Sysroot::discover(
|
||||
&AbsPathBuf::assert_utf8(std::env::current_dir().unwrap()),
|
||||
&Default::default(),
|
||||
);
|
||||
let loaded_sysroot =
|
||||
sysroot.load_workspace(&project_model::RustSourceWorkspaceConfig::default_cargo());
|
||||
if let Some(loaded_sysroot) = loaded_sysroot {
|
||||
sysroot.set_workspace(loaded_sysroot);
|
||||
}
|
||||
|
||||
let proc_macro_server_path = sysroot.discover_proc_macro_srv().unwrap();
|
||||
|
||||
let server = Project::with_fixture(
|
||||
r###"
|
||||
//- /foo/Cargo.toml
|
||||
|
|
@ -1171,12 +1157,8 @@ edition = "2021"
|
|||
bar = {path = "../bar"}
|
||||
|
||||
//- /foo/src/main.rs
|
||||
#![allow(internal_features)]
|
||||
#![feature(rustc_attrs, decl_macro)]
|
||||
use bar::Bar;
|
||||
|
||||
#[rustc_builtin_macro]
|
||||
macro derive($item:item) {}
|
||||
trait Bar {
|
||||
fn bar();
|
||||
}
|
||||
|
|
@ -1233,11 +1215,10 @@ pub fn foo(_input: TokenStream) -> TokenStream {
|
|||
"buildScripts": {
|
||||
"enable": true
|
||||
},
|
||||
"sysroot": null,
|
||||
"sysroot": "discover",
|
||||
},
|
||||
"procMacro": {
|
||||
"enable": true,
|
||||
"server": proc_macro_server_path.as_path().as_str(),
|
||||
}
|
||||
}))
|
||||
.root("foo")
|
||||
|
|
@ -1248,7 +1229,7 @@ pub fn foo(_input: TokenStream) -> TokenStream {
|
|||
let res = server.send_request::<HoverRequest>(HoverParams {
|
||||
text_document_position_params: TextDocumentPositionParams::new(
|
||||
server.doc_id("foo/src/main.rs"),
|
||||
Position::new(12, 9),
|
||||
Position::new(8, 9),
|
||||
),
|
||||
work_done_progress_params: Default::default(),
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue