Skip to content

Commit

Permalink
fix: wrong check for whether jsx option is set (#1595)
Browse files Browse the repository at this point in the history
Co-authored-by: johnsoncodehk <johnsoncodehk@gmail.com>
  • Loading branch information
rchl and johnsoncodehk committed Jul 19, 2022
1 parent 662ee29 commit 834a866
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion docs/installation.md
Expand Up @@ -65,6 +65,7 @@ In order to support Vue 2 templates you need to edit your `tsconfig.json` file
```jsonc{6}
{
"compilerOptions": {
"jsx": "preserve",
// ...
},
"vueCompilerOptions": {
Expand Down Expand Up @@ -106,4 +107,4 @@ Check out the [Troubleshooting](troubleshooting.md) page
#### Additional features?

Check out additional Volar [Features](features.md)


4 changes: 2 additions & 2 deletions packages/vue-typescript/src/sourceFile.ts
Expand Up @@ -258,7 +258,7 @@ export function createSourceFile(
scriptSetupRanges,
scriptLang,
vueCompilerOptions,
!!vueCompilerOptions.experimentalDisableTemplateSupport || (compilerOptions.jsx ?? ts.JsxEmit.Preserve) !== ts.JsxEmit.Preserve,
!!vueCompilerOptions.experimentalDisableTemplateSupport || compilerOptions.jsx !== ts.JsxEmit.Preserve,
fileName.endsWith('.html') // petite-vue
),
];
Expand Down Expand Up @@ -529,7 +529,7 @@ export function createSourceFile(
getSfcRefSugarRanges: () => sfcRefSugarRanges.value,
getEmbeddeds: () => embeddeds.value,
getScriptSetupRanges: () => scriptSetupRanges.value,
isJsxMissing: () => !vueCompilerOptions.experimentalDisableTemplateSupport && (compilerOptions.jsx ?? ts.JsxEmit.Preserve) !== ts.JsxEmit.Preserve,
isJsxMissing: () => !vueCompilerOptions.experimentalDisableTemplateSupport && compilerOptions.jsx !== ts.JsxEmit.Preserve,

getAllEmbeddeds: () => allEmbeddeds.value,
getTeleports: () => teleports.value,
Expand Down

0 comments on commit 834a866

Please sign in to comment.