Skip to content

Commit 9b40f81

Browse files
committed
feat: Add option to disable code actions
1 parent d94313b commit 9b40f81

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@
115115
"default": false,
116116
"markdownDescription": "Disable the step to automatically run ngcc. [ngcc](https://github.com/angular/angular/blob/master/packages/compiler/design/architecture.md#high-level-proposal) is required to run and gather metadata from libraries not published with Ivy instructions. This can be run outside of VSCode instead (for example, as part of the build/rebuild in the CLI). Note that ngcc needs to run not only at startup, but also whenever the dependencies change. Failing to run ngcc when required can result in incomplete information and spurious errors reported by the language service."
117117
},
118+
"angular.disableCodeActions": {
119+
"type": "boolean",
120+
"default": false,
121+
"markdownDescription": "Disable code actions in Angular contexts, including quick fixes in template files which add missing imports. Some code actions require global project analysis, so it may be desirable to disable them for performance reasons."
122+
},
118123
"angular.forceStrictTemplates": {
119124
"type": "boolean",
120125
"default": false,

src/client.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,11 @@ function constructArgs(
485485
args.push('--disableAutomaticNgcc');
486486
}
487487

488+
const disableCodeActions = config.get<boolean>('angular.disableCodeActions');
489+
if (disableCodeActions) {
490+
args.push('--disableCodeActions');
491+
}
492+
488493
const forceStrictTemplates = config.get<boolean>('angular.forceStrictTemplates');
489494
if (forceStrictTemplates) {
490495
args.push('--forceStrictTemplates');

0 commit comments

Comments
 (0)