Skip to content

Commit

Permalink
fix: cannot detect @volar/vue-language-plugin-pug installed
Browse files Browse the repository at this point in the history
close #2272
  • Loading branch information
johnsoncodehk committed Jan 4, 2023
1 parent f92e747 commit fcb1c6f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion vue-language-tools/vscode-vue/src/features/doctor.ts
Expand Up @@ -196,13 +196,18 @@ export async function register(context: vscode.ExtensionContext, client: BaseLan
// check using pug but don't install @volar/vue-language-plugin-pug
if (
sfc?.descriptor.template?.lang === 'pug'
&& !vueOptions?.plugins?.includes('@volar/vue-language-plugin-pug')
&& !vueOptions?.plugins?.some((pluginPath: string) => pluginPath.indexOf('vue-language-plugin-pug') >= 0)
) {
problems.push({
title: '`@volar/vue-language-plugin-pug` missing',
message: [
'For `<template lang="pug">`, the `@volar/vue-language-plugin-pug` plugin is required. Install it using `$ npm install -D @volar/vue-language-plugin-pug` and add it to `vueCompilerOptions.plugins` to support TypeScript intellisense in Pug templates.',
'',
'- package.json',
'```json',
JSON.stringify({ devDependencies: { "@volar/vue-language-plugin-pug": "latest" } }, undefined, 2),
'```',
'',
'- tsconfig.json / jsconfig.json',
'```jsonc',
JSON.stringify({ vueCompilerOptions: { plugins: ["@volar/vue-language-plugin-pug"] } }, undefined, 2),
Expand Down

0 comments on commit fcb1c6f

Please sign in to comment.