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

docs: add clarity to doctor.ts text; fix typos #2043

Merged
merged 2 commits into from Oct 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 14 additions & 14 deletions extensions/vscode-vue-language-features/src/features/doctor.ts
Expand Up @@ -41,7 +41,7 @@ export async function register(context: vscode.ExtensionContext, client: BaseLan
}

content += '---\n\n';
content += `> Have question about the report message? You can see how it judge by inspecting the [source code](https://github.com/johnsoncodehk/volar/blob/master/extensions/vscode-vue-language-features/src/features/doctor.ts).\n\n`;
content += `> Have any questions about the report message? You can see how it is composed by inspecting the [source code](https://github.com/johnsoncodehk/volar/blob/master/extensions/vscode-vue-language-features/src/features/doctor.ts).\n\n`;

return content.trim();
}
Expand Down Expand Up @@ -100,7 +100,7 @@ export async function register(context: vscode.ExtensionContext, client: BaseLan
if (!vueMod) {
problems.push({
title: '`vue` module not found',
message: 'Vue module not found from workspace, you may have not install `node_modules` yet.',
message: 'Vue module not found from workspace, you may not have installed `node_modules` yet.',
});
}

Expand All @@ -109,7 +109,7 @@ export async function register(context: vscode.ExtensionContext, client: BaseLan
const vueVersionNumber = semver.gte(vueMod.json.version, '3.0.0') ? 3 : semver.gte(vueMod.json.version, '2.7.0') ? 2.7 : 2;
const targetVersionNumber = vueOptions?.target ?? 3;
const lines = [
`Target version not match, you can specify the target version in \`vueCompilerOptions.target\` in tsconfig.json / jsconfig.json. (expected \`"target": ${vueVersionNumber}\`)`,
`Target version mismatch. You can specify the target version in \`vueCompilerOptions.target\` in tsconfig.json / jsconfig.json. (Expected \`"target": ${vueVersionNumber}\`)`,
'',
'- vue version: ' + vueMod.json.version,
'- tsconfig target: ' + targetVersionNumber + (vueOptions?.target !== undefined ? '' : ' (default)'),
Expand All @@ -133,7 +133,7 @@ export async function register(context: vscode.ExtensionContext, client: BaseLan
problems.push({
title: '`@vue/compiler-dom` missing for Vue 2',
message: [
'Vue 2 do not have JSX types definition, so template type checkinng cannot working correctly, you can install `@vue/compiler-dom` by add it to `devDependencies` to resolve this problem.',
'Vue 2 does not have JSX types definitions, so template type checking will not work correctly. You can resolve this problem by installing `@vue/compiler-dom` and adding it to your project\'s `devDependencies`.',
'',
'- vue: ' + vueMod.path,
].join('\n'),
Expand All @@ -143,9 +143,9 @@ export async function register(context: vscode.ExtensionContext, client: BaseLan
// check vue version >= 2.7 and < 3 but installed @vue/compiler-dom
if (vueMod && semver.gte(vueMod.json.version, '2.7.0') && semver.lt(vueMod.json.version, '3.0.0') && domMod) {
problems.push({
title: 'Do not need `@vue/compiler-dom`',
title: 'Unnecessary `@vue/compiler-dom`',
message: [
'Vue 2.7 already included JSX types definition, you can remove `@vue/compiler-dom` depend from package.json.',
'Vue 2.7 already includes JSX type definitions. You can remove the `@vue/compiler-dom` dependency from package.json.',
'',
'- vue: ' + vueMod.path,
'- @vue/compiler-dom: ' + domMod.path,
Expand All @@ -157,9 +157,9 @@ export async function register(context: vscode.ExtensionContext, client: BaseLan
const vueTscMod = getWorkspacePackageJson(fileUri.fsPath, 'vue-tsc');
if (vueTscMod && vueTscMod.json.version !== context.extension.packageJSON.version) {
problems.push({
title: '`vue-tsc` version different',
title: 'Different `vue-tsc` version',
message: [
`The \`${context.extension.packageJSON.displayName}\` version is \`${context.extension.packageJSON.version}\`, but workspace \`vue-tsc\` version is \`${vueTscMod.json.version}\`, there may have different type checking behavior.`,
`The \`${context.extension.packageJSON.displayName}\`\'s version is \`${context.extension.packageJSON.version}\`, but the workspace\'s \`vue-tsc\` version is \`${vueTscMod.json.version}\`. This may produce different type checking behavior.`,
'',
'- vue-tsc: ' + vueTscMod.path,
].join('\n'),
Expand All @@ -170,9 +170,9 @@ export async function register(context: vscode.ExtensionContext, client: BaseLan
const typesNodeMod = getWorkspacePackageJson(fileUri.fsPath, '@types/node');
if (typesNodeMod && semver.gte(typesNodeMod.json.version, '18.8.1') && semver.lte(typesNodeMod.json.version, '18.11.0')) {
problems.push({
title: '`@types/node` version incompatible',
title: 'Incompatible `@types/node` version',
message: [
'`@types/node` version `' + typesNodeMod.json.version + '` is incompatible to Vue, it will cause DOM event type broken in template.',
'`@types/node`\'s version `' + typesNodeMod.json.version + '` is incompatible with Vue. It will cause broken DOM event types in template.',
'',
'You can update `@types/node` to `18.11.1` or later to resolve.',
'',
Expand All @@ -187,7 +187,7 @@ export async function register(context: vscode.ExtensionContext, client: BaseLan
if (vetur?.isActive) {
problems.push({
title: 'Use @volar-plugins/vetur instead of Vetur',
message: 'Detected Vetur enabled, you might consider disabling it and use [@volar-plugins/vetur](https://github.com/johnsoncodehk/volar-plugins/tree/master/packages/vetur) instead of.',
message: 'Detected Vetur enabled. Consider disabling Vetur and use [@volar-plugins/vetur](https://github.com/johnsoncodehk/volar-plugins/tree/master/packages/vetur) instead.',
});
}

Expand All @@ -199,7 +199,7 @@ export async function register(context: vscode.ExtensionContext, client: BaseLan
problems.push({
title: '`@volar/vue-language-plugin-pug` missing',
message: [
'For `<template lang="pug">`, you need add plugin via `$ npm install -D @volar/vue-language-plugin-pug` and add it to `vueCompilerOptions.plugins` to support TypeScript intellisense in Pug template.',
'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.',
'',
'- tsconfig.json / jsconfig.json',
'```jsonc',
Expand All @@ -225,8 +225,8 @@ export async function register(context: vscode.ExtensionContext, client: BaseLan
const someInstalled = validExts.some(ext => !!vscode.extensions.getExtension(ext));
if (!someInstalled) {
problems.push({
title: 'Syntax Highlight for ' + block.lang,
message: `Not found valid syntax highlight extension for ${block.lang} langauge block, you can choose to install one of the following:\n\n`
title: 'Syntax Highlighting for ' + block.lang,
message: `Did not find a valid syntax highlighter extension for ${block.lang} langauge block; you can choose to install one of the following:\n\n`
+ validExts.map(ext => `- [${ext}](https://marketplace.visualstudio.com/items?itemName=${ext})\n`),
});
}
Expand Down