tustvold commented on PR #3580:
URL: 
https://github.com/apache/arrow-datafusion/pull/3580#issuecomment-1256432671

   > I wasn't aware of this action. I just updated to CLion 2022.2.3 and tried 
this out with the Ballista project but I still cannot "go to definition" for 
the generated code.
   
   I just did this and it worked correctly, although I note that the generated 
code it is finding is in `src/generated`. 
   
   To test this out I created a very basic project with the following code.
   
   main.rs
   ```
   include!(concat!(env!("OUT_DIR"), "/test.rs"));
   
   fn main() {
       Foo {};
       println!("Hello, world!");
   }
   ```
   
   build.rs
   ```
   use std::fs::File;
   use std::io::Write;
   use std::path::PathBuf;
   
   fn main() {
       let path = 
PathBuf::from(std::env::var_os("OUT_DIR").unwrap()).join("test.rs");
       let mut file = File::create(path).unwrap();
       writeln!(file, "struct Foo {{}}").unwrap();
   }
   ```
   
   I then compiled and ran the binary, code completion was not working at this 
point. Running "Refresh Cargo Projects" also didn't work, nor did "Invalidate 
Caches and Restart".
   
   Fortunately the fix is relatively straightforward:
   
   * Open Help > Find Action (CTRL + SHIFT + A)
   * Enter "Experimental" and select "Experimental Features"
   * Scroll down to "org.rust.cargo.evaluate/build.scripts" and enable it
   * File > Invalidate Caches
   
   On restart everything should be working. I used to have this turned on, I 
turned it off at some point and left it off because everything continued to 
work, but I suspect this was the result of some caching shenanigans. Either way 
I think the above should work, let me know
   
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to