extension: Ensure that compiled extension provides at least one feature (#47715)

This PR adds a check during extension compilation to ensure that every
compiled extension provides at least one feature, as otherwise, the
extension is useless to have.

With this in, compiling an extension that does not provide anything will
fail.

Release Notes:

- N/A
This commit is contained in:
Finn Evers 2026-01-28 14:25:47 +01:00 committed by GitHub
parent e29522a1b7
commit 7cfa0fb876
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -78,6 +78,12 @@ async fn main() -> Result<()> {
.await
.context("failed to compile extension")?;
let extension_provides = extension_provides(&manifest);
if extension_provides.is_empty() {
bail!("extension does not provide any features");
}
let grammars = test_grammars(&manifest, &extension_path, &mut wasm_store)?;
test_languages(&manifest, &extension_path, &grammars)?;
test_themes(&manifest, &extension_path, fs.clone()).await?;
@ -102,8 +108,6 @@ async fn main() -> Result<()> {
);
}
let extension_provides = extension_provides(&manifest);
let manifest_json = serde_json::to_string(&rpc::ExtensionApiManifest {
name: manifest.name,
version: manifest.version,