Skip to content

Commit 5ee496d

Browse files
kyliauKeen Yee Liau
authored andcommitted
feat: add configuration for enabling Ivy
This commit adds a new configuration, `experimental-ivy` to turn on the Ivy language service.
1 parent 5faa096 commit 5ee496d

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

client/src/extension.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ function constructArgs(ctx: vscode.ExtensionContext, debug: boolean): string[] {
123123
const ngProbeLocations = getProbeLocations(ngdk, ctx.asAbsolutePath('server'));
124124
args.push('--ngProbeLocations', ngProbeLocations.join(','));
125125

126+
const experimentalIvy: boolean = config.get('angular.experimental-ivy', false);
127+
if (experimentalIvy) {
128+
args.push('--experimental-ivy');
129+
}
130+
126131
const tsdk: string|null = config.get('typescript.tsdk', null);
127132
const tsProbeLocations = getProbeLocations(tsdk, ctx.extensionPath);
128133
args.push('--tsProbeLocations', tsProbeLocations.join(','));
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"angular.experimental-ivy": true
3+
}

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@
4646
],
4747
"default": "terse",
4848
"description": "Enables logging of the Angular server to a file. This log can be used to diagnose Angular Server issues. The log may contain file paths, source code, and other potentially sensitive information from your project."
49+
},
50+
"angular.experimental-ivy": {
51+
"type": "boolean",
52+
"default": false,
53+
"description": "This is an experimental feature that enables the Ivy language service. Please make sure ngcc is run before enabling this flag."
4954
}
5055
}
5156
},

server/src/cmdline_utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ export function parseCommandLine(argv: string[]): CommandLineOptions {
5151
}
5252

5353
export function generateHelpMessage(argv: string[]) {
54-
// Do not expose --experimental-ivy flag since it's only used for development.
5554
return `Angular Language Service that implements the Language Server Protocol (LSP).
5655
5756
Usage: ${argv[0]} ${argv[1]} [options]
5857
5958
Options:
6059
--help: Prints help message.
60+
--experimental-ivy: Enables the Ivy language service. Defaults to false.
6161
--logFile: Location to log messages. Logging is disabled if not provided.
6262
--logVerbosity: terse|normal|verbose|requestTime. See ts.server.LogLevel.
6363
--ngProbeLocations: Path of @angular/language-service. Required.

0 commit comments

Comments
 (0)