From 71cc74b7070e8ee2095ac6afa2fa3cd40cfcdc76 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Thu, 30 Jun 2022 11:10:29 +0800 Subject: [PATCH] feat(vscode): disable config --- packages/vscode/package.json | 5 +++++ packages/vscode/src/index.ts | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/packages/vscode/package.json b/packages/vscode/package.json index aa445f17e9..02a6ad290d 100644 --- a/packages/vscode/package.json +++ b/packages/vscode/package.json @@ -39,6 +39,11 @@ "type": "object", "title": "UnoCSS", "properties": { + "unocss.disable": { + "type": "boolean", + "default": false, + "description": "Disable the UnoCSS extension" + }, "unocss.root": { "type": "string", "description": "Project root that contains the UnoCSS configuration file" diff --git a/packages/vscode/src/index.ts b/packages/vscode/src/index.ts index 7831181ec6..bb3189f4a3 100644 --- a/packages/vscode/src/index.ts +++ b/packages/vscode/src/index.ts @@ -13,6 +13,10 @@ export async function activate(ext: ExtensionContext) { return const config = workspace.getConfiguration('unocss') + const disabled = config.get('disable', false) + if (disabled) + return + const root = config.get('root') const cwd = root ? path.resolve(projectPath, root) : projectPath