Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: handle stable and nightly version installed together #13

Merged
merged 4 commits into from
Nov 20, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat: handle stable and nightly version installed together
nhedger committed Nov 19, 2023

Verified

This commit was signed with the committer’s verified signature.
nhedger Nicolas Hedger
commit c59aaf6423c12a0e71a8e4197c1e75d8834f7f48
13 changes: 13 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -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,
// we abort activation of the stable version.
if (context.extension.id === "biomejs.biome") {
const nightlyExtension = extensions.getExtension("biomejs.biome-nightly");
if (nightlyExtension) {
outputChannel.appendLine(
"Biome Nightly detected, disabling Biome extension",
);
return;
}
}

const requiresConfiguration = workspace
.getConfiguration("biome")
.get<boolean>("requireConfiguration");