From ede42663c78020c95bb41175a28dd948d33af75e Mon Sep 17 00:00:00 2001 From: Adham Farrag Date: Wed, 24 Jan 2024 05:29:11 +0800 Subject: [PATCH] chore: revert takeover mode --- src/extension.ts | 7 ++----- src/watchers/index.ts | 9 +-------- src/watchers/vscode.ts | 29 ----------------------------- 3 files changed, 3 insertions(+), 42 deletions(-) delete mode 100644 src/watchers/vscode.ts diff --git a/src/extension.ts b/src/extension.ts index 4b7f7cf..687ab05 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,11 +1,11 @@ -import { window, ExtensionContext, commands, Uri, extensions } from 'vscode'; +import { window, ExtensionContext, commands, Uri } from 'vscode'; import nuxtrCommands from './commands' import { ModulesView } from './sideBar' import { logger, updateDependencies } from './utils'; import codelens from './codelens' import { statusBars, activateStatusBarIcons } from './statusBar' import { activateIntellisense } from './intellisense' -import { filesWatcher, checkTakeOverMode } from './watchers' +import { filesWatcher } from './watchers'; const extensionCommands = [ { command: 'nuxtr.createPage', function: nuxtrCommands.createPage }, @@ -96,9 +96,6 @@ export async function activateExtension(context: ExtensionContext) { // activate codelens codelens.activateCodelenses(context) - // checkTakeOverMode - checkTakeOverMode() - extensionCommands.forEach(({ command, function: commandFunction }) => { context.subscriptions.push(commands.registerCommand(command, commandFunction)); }); diff --git a/src/watchers/index.ts b/src/watchers/index.ts index f0144fd..508625f 100644 --- a/src/watchers/index.ts +++ b/src/watchers/index.ts @@ -1,11 +1,4 @@ import filesWatcher from './files' import { snippetsConfigWatcher, templatesConfigWatcher, piniaConfigWatcher } from './config' -import { checkTakeOverMode} from './vscode' -export { - filesWatcher, - snippetsConfigWatcher, - templatesConfigWatcher, - piniaConfigWatcher, - checkTakeOverMode -} +export { filesWatcher, snippetsConfigWatcher, templatesConfigWatcher, piniaConfigWatcher } diff --git a/src/watchers/vscode.ts b/src/watchers/vscode.ts deleted file mode 100644 index 7cf749e..0000000 --- a/src/watchers/vscode.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { extensions, window , commands} from "vscode"; -import { openExternalLink, isNuxtTwo } from "../utils"; - -const checkTakeOverMode = async () => { - const tsExtension = extensions.getExtension('vscode.typescript-language-features') - console.log('tsExtension', tsExtension); - - if (tsExtension !== undefined && !isNuxtTwo()) { - const message = await window.showWarningMessage( - `Volar's TakeOver mode is not enabled`, 'Enable', 'Learn More' - ) - - if (message === 'Learn More') { - openExternalLink('https://nuxt.com/docs/getting-started/installation#prerequisites') - } - - if (message === 'Enable') { - await commands.executeCommand('workbench.view.extensions'); - await commands.executeCommand('workbench.extensions.action.showExtensionsWithIds', ['vscode.typescript-language-features']); - await commands.executeCommand( - 'workbench.extensions.action.enableExtension', - 'vscode.typescript-language-features' - ) - } - } -} - - -export { checkTakeOverMode } \ No newline at end of file