Skip to content

Commit

Permalink
fix: typescript onType format do not respect typescript.format.enable
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Sep 4, 2022
1 parent 2758510 commit 1116427
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/vue-language-service/src/plugins/typescript.ts
Expand Up @@ -253,8 +253,15 @@ export default function (options: {
}
},

formatOnType(document, position, key, options_2) {
async formatOnType(document, position, key, options_2) {
if (isTsDocument(document)) {

const enable = await useConfigurationHost()?.getConfiguration<boolean>(getConfigTitle(document) + '.format.enable', document.uri);

if (enable === false) {
return;
}

return options.getTsLs().doFormatting.onType(document.uri, options_2, position, key);
}
},
Expand Down

0 comments on commit 1116427

Please sign in to comment.