From af96f99d83c8ee0dfc1b880bd7a0a6d443b94627 Mon Sep 17 00:00:00 2001 From: Seth Moore Date: Wed, 6 Oct 2021 10:45:34 -0700 Subject: Include proc macro crates in rust-project.json These crates were skipped before, leaving dependencies missing in rust-project.json. Include them and mark them as `"is_proc_macro": true` so that rust-analyzer can process them. Fixes: 202290038 Test: SOONG_GEN_RUST_PROJECT=1 m nothing Change-Id: Ia80e6f5e2f56a76608ba057075600e6b4424281b --- rust/project_json.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'rust/project_json.go') diff --git a/rust/project_json.go b/rust/project_json.go index faa7db5f7..ae48312b5 100644 --- a/rust/project_json.go +++ b/rust/project_json.go @@ -51,6 +51,7 @@ type rustProjectCrate struct { Deps []rustProjectDep `json:"deps"` Cfg []string `json:"cfg"` Env map[string]string `json:"env"` + ProcMacro bool `json:"is_proc_macro"` } type rustProjectJson struct { @@ -208,6 +209,8 @@ func isModuleSupported(ctx android.SingletonContext, module android.Module) (*Mo comp = c.baseCompiler case *testDecorator: comp = c.binaryDecorator.baseCompiler + case *procMacroDecorator: + comp = c.baseCompiler default: return nil, nil, false } @@ -224,6 +227,8 @@ func (singleton *projectGeneratorSingleton) addCrate(ctx android.SingletonContex return 0, false } + _, procMacro := rModule.compiler.(*procMacroDecorator) + crate := rustProjectCrate{ DisplayName: rModule.Name(), RootModule: rootModule, @@ -231,6 +236,7 @@ func (singleton *projectGeneratorSingleton) addCrate(ctx android.SingletonContex Deps: make([]rustProjectDep, 0), Cfg: make([]string, 0), Env: make(map[string]string), + ProcMacro: procMacro, } if comp.CargoOutDir().Valid() { -- cgit v1.2.3-59-g8ed1b