Copy extension_api Rust files to OUT_DIR when building extension to work around rust-analyzer limitation (#16064)

Copies rust files from extension_api/wit to the OUT_DIR to allow
including them from within the crate, which is supported by
rust-analyzer. This allows rust-analyzer to deal with the included
files. It doesn't currently support files outside the crate.

Release Notes:

- N/A
This commit is contained in:
Nathan Sobo 2024-08-10 18:19:11 -06:00 committed by GitHub
parent 550e139b61
commit 6f104fecad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 45 additions and 2 deletions

View file

@ -23,7 +23,7 @@ wasmtime::component::bindgen!({
});
mod settings {
include!("../../../../extension_api/wit/since_v0.0.6/settings.rs");
include!(concat!(env!("OUT_DIR"), "/since_v0.0.6/settings.rs"));
}
pub type ExtensionWorktree = Arc<dyn LspAdapterDelegate>;

View file

@ -37,7 +37,7 @@ wasmtime::component::bindgen!({
pub use self::zed::extension::*;
mod settings {
include!("../../../../extension_api/wit/since_v0.0.7/settings.rs");
include!(concat!(env!("OUT_DIR"), "/since_v0.0.7/settings.rs"));
}
pub type ExtensionWorktree = Arc<dyn LspAdapterDelegate>;