diff --git a/src/main.ts b/src/main.ts index 80e9726f..100ccb30 100644 --- a/src/main.ts +++ b/src/main.ts @@ -8,6 +8,7 @@ import { TextEditor, Uri, commands, + extensions, languages, window, workspace, @@ -42,6 +43,18 @@ export async function activate(context: ExtensionContext) { const outputChannel = window.createOutputChannel("Biome"); const traceOutputChannel = window.createOutputChannel("Biome Trace"); + // If this extension is a stable version and a nightly version is installed + // and active, we abort activation of the stable version. + if (context.extension.id === "biomejs.biome") { + const nightlyExtension = extensions.getExtension("biomejs.biome-nightly"); + if (nightlyExtension?.isActive) { + outputChannel.appendLine( + "Biome Nightly detected, disabling Biome extension", + ); + return; + } + } + const requiresConfiguration = workspace .getConfiguration("biome") .get("requireConfiguration");