-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c6e4a1b
commit 7259f69
Showing
3 changed files
with
37 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
import filesWatcher from './files' | ||
import { snippetsConfigWatcher, templatesConfigWatcher, piniaConfigWatcher } from './config' | ||
|
||
import { checkTakeOverMode} from './vscode' | ||
export { | ||
filesWatcher, | ||
snippetsConfigWatcher, | ||
templatesConfigWatcher, | ||
piniaConfigWatcher | ||
piniaConfigWatcher, | ||
checkTakeOverMode | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
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 } |