@angular/language-server 13.3.4 → 14.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +63 -84
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -32,13 +32,15 @@ var require_cmdline_utils = __commonJS({
|
|
|
32
32
|
return {
|
|
33
33
|
help: hasArgument(argv, "--help"),
|
|
34
34
|
ivy: !hasArgument(argv, "--viewEngine"),
|
|
35
|
+
disableAutomaticNgcc: hasArgument(argv, "--disableAutomaticNgcc"),
|
|
35
36
|
logFile: findArgument(argv, "--logFile"),
|
|
36
37
|
logVerbosity: findArgument(argv, "--logVerbosity"),
|
|
37
38
|
logToConsole: hasArgument(argv, "--logToConsole"),
|
|
38
39
|
ngProbeLocations: parseStringArray(argv, "--ngProbeLocations"),
|
|
39
40
|
tsProbeLocations: parseStringArray(argv, "--tsProbeLocations"),
|
|
40
41
|
includeAutomaticOptionalChainCompletions: hasArgument(argv, "--includeAutomaticOptionalChainCompletions"),
|
|
41
|
-
includeCompletionsWithSnippetText: hasArgument(argv, "--includeCompletionsWithSnippetText")
|
|
42
|
+
includeCompletionsWithSnippetText: hasArgument(argv, "--includeCompletionsWithSnippetText"),
|
|
43
|
+
forceStrictTemplates: hasArgument(argv, "--forceStrictTemplates")
|
|
42
44
|
};
|
|
43
45
|
}
|
|
44
46
|
exports2.parseCommandLine = parseCommandLine;
|
|
@@ -74,13 +76,9 @@ var require_resolver = __commonJS({
|
|
|
74
76
|
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
75
77
|
if (k2 === void 0)
|
|
76
78
|
k2 = k;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
return m[k];
|
|
81
|
-
} };
|
|
82
|
-
}
|
|
83
|
-
Object.defineProperty(o, k2, desc);
|
|
79
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() {
|
|
80
|
+
return m[k];
|
|
81
|
+
} });
|
|
84
82
|
} : function(o, m, k, k2) {
|
|
85
83
|
if (k2 === void 0)
|
|
86
84
|
k2 = k;
|
|
@@ -175,13 +173,9 @@ var require_version_provider = __commonJS({
|
|
|
175
173
|
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
176
174
|
if (k2 === void 0)
|
|
177
175
|
k2 = k;
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
return m[k];
|
|
182
|
-
} };
|
|
183
|
-
}
|
|
184
|
-
Object.defineProperty(o, k2, desc);
|
|
176
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() {
|
|
177
|
+
return m[k];
|
|
178
|
+
} });
|
|
185
179
|
} : function(o, m, k, k2) {
|
|
186
180
|
if (k2 === void 0)
|
|
187
181
|
k2 = k;
|
|
@@ -351,13 +345,15 @@ var require_cmdline_utils = __commonJS({
|
|
|
351
345
|
return {
|
|
352
346
|
help: hasArgument(argv, "--help"),
|
|
353
347
|
ivy: !hasArgument(argv, "--viewEngine"),
|
|
348
|
+
disableAutomaticNgcc: hasArgument(argv, "--disableAutomaticNgcc"),
|
|
354
349
|
logFile: findArgument(argv, "--logFile"),
|
|
355
350
|
logVerbosity: findArgument(argv, "--logVerbosity"),
|
|
356
351
|
logToConsole: hasArgument(argv, "--logToConsole"),
|
|
357
352
|
ngProbeLocations: parseStringArray(argv, "--ngProbeLocations"),
|
|
358
353
|
tsProbeLocations: parseStringArray(argv, "--tsProbeLocations"),
|
|
359
354
|
includeAutomaticOptionalChainCompletions: hasArgument(argv, "--includeAutomaticOptionalChainCompletions"),
|
|
360
|
-
includeCompletionsWithSnippetText: hasArgument(argv, "--includeCompletionsWithSnippetText")
|
|
355
|
+
includeCompletionsWithSnippetText: hasArgument(argv, "--includeCompletionsWithSnippetText"),
|
|
356
|
+
forceStrictTemplates: hasArgument(argv, "--forceStrictTemplates")
|
|
361
357
|
};
|
|
362
358
|
}
|
|
363
359
|
exports2.parseCommandLine = parseCommandLine;
|
|
@@ -393,13 +389,9 @@ var require_logger = __commonJS({
|
|
|
393
389
|
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
394
390
|
if (k2 === void 0)
|
|
395
391
|
k2 = k;
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
return m[k];
|
|
400
|
-
} };
|
|
401
|
-
}
|
|
402
|
-
Object.defineProperty(o, k2, desc);
|
|
392
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() {
|
|
393
|
+
return m[k];
|
|
394
|
+
} });
|
|
403
395
|
} : function(o, m, k, k2) {
|
|
404
396
|
if (k2 === void 0)
|
|
405
397
|
k2 = k;
|
|
@@ -525,13 +517,9 @@ var require_server_host = __commonJS({
|
|
|
525
517
|
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
526
518
|
if (k2 === void 0)
|
|
527
519
|
k2 = k;
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
return m[k];
|
|
532
|
-
} };
|
|
533
|
-
}
|
|
534
|
-
Object.defineProperty(o, k2, desc);
|
|
520
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() {
|
|
521
|
+
return m[k];
|
|
522
|
+
} });
|
|
535
523
|
} : function(o, m, k, k2) {
|
|
536
524
|
if (k2 === void 0)
|
|
537
525
|
k2 = k;
|
|
@@ -3022,13 +3010,9 @@ var require_requests = __commonJS({
|
|
|
3022
3010
|
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
3023
3011
|
if (k2 === void 0)
|
|
3024
3012
|
k2 = k;
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
return m[k];
|
|
3029
|
-
} };
|
|
3030
|
-
}
|
|
3031
|
-
Object.defineProperty(o, k2, desc);
|
|
3013
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() {
|
|
3014
|
+
return m[k];
|
|
3015
|
+
} });
|
|
3032
3016
|
} : function(o, m, k, k2) {
|
|
3033
3017
|
if (k2 === void 0)
|
|
3034
3018
|
k2 = k;
|
|
@@ -3052,11 +3036,12 @@ var require_requests = __commonJS({
|
|
|
3052
3036
|
return result;
|
|
3053
3037
|
};
|
|
3054
3038
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
3055
|
-
exports2.IsInAngularProject = exports2.GetTcbRequest = exports2.GetTemplateLocationForComponent = exports2.GetComponentsWithTemplateFile = void 0;
|
|
3039
|
+
exports2.IsInAngularProject = exports2.RunNgccRequest = exports2.GetTcbRequest = exports2.GetTemplateLocationForComponent = exports2.GetComponentsWithTemplateFile = void 0;
|
|
3056
3040
|
var lsp = __importStar(require_main2());
|
|
3057
3041
|
exports2.GetComponentsWithTemplateFile = new lsp.RequestType("angular/getComponentsWithTemplateFile");
|
|
3058
3042
|
exports2.GetTemplateLocationForComponent = new lsp.RequestType("angular/getTemplateLocationForComponent");
|
|
3059
3043
|
exports2.GetTcbRequest = new lsp.RequestType("angular/getTcb");
|
|
3044
|
+
exports2.RunNgccRequest = new lsp.RequestType("angular/runNgcc");
|
|
3060
3045
|
exports2.IsInAngularProject = new lsp.RequestType("angular/isAngularCoreInOwningProject");
|
|
3061
3046
|
}
|
|
3062
3047
|
});
|
|
@@ -3068,13 +3053,9 @@ var require_utils = __commonJS({
|
|
|
3068
3053
|
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
3069
3054
|
if (k2 === void 0)
|
|
3070
3055
|
k2 = k;
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
return m[k];
|
|
3075
|
-
} };
|
|
3076
|
-
}
|
|
3077
|
-
Object.defineProperty(o, k2, desc);
|
|
3056
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() {
|
|
3057
|
+
return m[k];
|
|
3058
|
+
} });
|
|
3078
3059
|
} : function(o, m, k, k2) {
|
|
3079
3060
|
if (k2 === void 0)
|
|
3080
3061
|
k2 = k;
|
|
@@ -3226,13 +3207,9 @@ var require_completion = __commonJS({
|
|
|
3226
3207
|
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
3227
3208
|
if (k2 === void 0)
|
|
3228
3209
|
k2 = k;
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
return m[k];
|
|
3233
|
-
} };
|
|
3234
|
-
}
|
|
3235
|
-
Object.defineProperty(o, k2, desc);
|
|
3210
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() {
|
|
3211
|
+
return m[k];
|
|
3212
|
+
} });
|
|
3236
3213
|
} : function(o, m, k, k2) {
|
|
3237
3214
|
if (k2 === void 0)
|
|
3238
3215
|
k2 = k;
|
|
@@ -3358,13 +3335,9 @@ var require_diagnostic = __commonJS({
|
|
|
3358
3335
|
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
3359
3336
|
if (k2 === void 0)
|
|
3360
3337
|
k2 = k;
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
return m[k];
|
|
3365
|
-
} };
|
|
3366
|
-
}
|
|
3367
|
-
Object.defineProperty(o, k2, desc);
|
|
3338
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() {
|
|
3339
|
+
return m[k];
|
|
3340
|
+
} });
|
|
3368
3341
|
} : function(o, m, k, k2) {
|
|
3369
3342
|
if (k2 === void 0)
|
|
3370
3343
|
k2 = k;
|
|
@@ -3423,13 +3396,9 @@ var require_resolver = __commonJS({
|
|
|
3423
3396
|
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
3424
3397
|
if (k2 === void 0)
|
|
3425
3398
|
k2 = k;
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
return m[k];
|
|
3430
|
-
} };
|
|
3431
|
-
}
|
|
3432
|
-
Object.defineProperty(o, k2, desc);
|
|
3399
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() {
|
|
3400
|
+
return m[k];
|
|
3401
|
+
} });
|
|
3433
3402
|
} : function(o, m, k, k2) {
|
|
3434
3403
|
if (k2 === void 0)
|
|
3435
3404
|
k2 = k;
|
|
@@ -3524,13 +3493,9 @@ var require_version_provider = __commonJS({
|
|
|
3524
3493
|
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
3525
3494
|
if (k2 === void 0)
|
|
3526
3495
|
k2 = k;
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
return m[k];
|
|
3531
|
-
} };
|
|
3532
|
-
}
|
|
3533
|
-
Object.defineProperty(o, k2, desc);
|
|
3496
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() {
|
|
3497
|
+
return m[k];
|
|
3498
|
+
} });
|
|
3534
3499
|
} : function(o, m, k, k2) {
|
|
3535
3500
|
if (k2 === void 0)
|
|
3536
3501
|
k2 = k;
|
|
@@ -3707,13 +3672,9 @@ var require_session = __commonJS({
|
|
|
3707
3672
|
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
3708
3673
|
if (k2 === void 0)
|
|
3709
3674
|
k2 = k;
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
return m[k];
|
|
3714
|
-
} };
|
|
3715
|
-
}
|
|
3716
|
-
Object.defineProperty(o, k2, desc);
|
|
3675
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() {
|
|
3676
|
+
return m[k];
|
|
3677
|
+
} });
|
|
3717
3678
|
} : function(o, m, k, k2) {
|
|
3718
3679
|
if (k2 === void 0)
|
|
3719
3680
|
k2 = k;
|
|
@@ -3772,6 +3733,7 @@ var require_session = __commonJS({
|
|
|
3772
3733
|
this.includeCompletionsWithSnippetText = options.includeCompletionsWithSnippetText;
|
|
3773
3734
|
this.logger = options.logger;
|
|
3774
3735
|
this.ivy = options.ivy;
|
|
3736
|
+
this.disableAutomaticNgcc = options.disableAutomaticNgcc;
|
|
3775
3737
|
this.logToConsole = options.logToConsole;
|
|
3776
3738
|
this.connection = lsp.createConnection({
|
|
3777
3739
|
cancelUndispatched(message) {
|
|
@@ -3821,9 +3783,11 @@ var require_session = __commonJS({
|
|
|
3821
3783
|
const pluginConfig = {
|
|
3822
3784
|
angularOnly: true
|
|
3823
3785
|
};
|
|
3786
|
+
if (options.forceStrictTemplates) {
|
|
3787
|
+
pluginConfig.forceStrictTemplates = true;
|
|
3788
|
+
}
|
|
3824
3789
|
if (options.host.isG3) {
|
|
3825
3790
|
options.ivy = true;
|
|
3826
|
-
pluginConfig.forceStrictTemplates = true;
|
|
3827
3791
|
}
|
|
3828
3792
|
projSvc.configurePlugin({
|
|
3829
3793
|
pluginName: options.ngPlugin,
|
|
@@ -3848,6 +3812,7 @@ var require_session = __commonJS({
|
|
|
3848
3812
|
conn.onRequest(requests_1.GetComponentsWithTemplateFile, (p) => this.onGetComponentsWithTemplateFile(p));
|
|
3849
3813
|
conn.onRequest(requests_1.GetTemplateLocationForComponent, (p) => this.onGetTemplateLocationForComponent(p));
|
|
3850
3814
|
conn.onRequest(requests_1.GetTcbRequest, (p) => this.onGetTcb(p));
|
|
3815
|
+
conn.onRequest(requests_1.RunNgccRequest, (p) => this.onRunNgcc(p));
|
|
3851
3816
|
conn.onRequest(requests_1.IsInAngularProject, (p) => this.isInAngularProject(p));
|
|
3852
3817
|
conn.onCodeLens((p) => this.onCodeLens(p));
|
|
3853
3818
|
conn.onCodeLensResolve((p) => this.onCodeLensResolve(p));
|
|
@@ -3891,6 +3856,17 @@ var require_session = __commonJS({
|
|
|
3891
3856
|
selections: response.selections.map((span) => (0, utils_1.tsTextSpanToLspRange)(tcfScriptInfo, span))
|
|
3892
3857
|
};
|
|
3893
3858
|
}
|
|
3859
|
+
onRunNgcc(params) {
|
|
3860
|
+
const lsInfo = this.getLSAndScriptInfo(params.textDocument);
|
|
3861
|
+
if (lsInfo === null) {
|
|
3862
|
+
return;
|
|
3863
|
+
}
|
|
3864
|
+
const project = this.getDefaultProjectForScriptInfo(lsInfo.scriptInfo);
|
|
3865
|
+
if (!project) {
|
|
3866
|
+
return;
|
|
3867
|
+
}
|
|
3868
|
+
this.runNgcc(project);
|
|
3869
|
+
}
|
|
3894
3870
|
onGetTemplateLocationForComponent(params) {
|
|
3895
3871
|
const lsInfo = this.getLSAndScriptInfo(params.textDocument);
|
|
3896
3872
|
if (lsInfo === null) {
|
|
@@ -4007,6 +3983,7 @@ var require_session = __commonJS({
|
|
|
4007
3983
|
this.info(`Enabling Ivy language service for ${projectName}.`);
|
|
4008
3984
|
this.handleCompilerOptionsDiagnostics(project);
|
|
4009
3985
|
this.runGlobalAnalysisForNewlyLoadedProject(project);
|
|
3986
|
+
project.refreshDiagnostics();
|
|
4010
3987
|
}
|
|
4011
3988
|
disableLanguageServiceForProject(project, reason) {
|
|
4012
3989
|
if (!project.languageServiceEnabled) {
|
|
@@ -4060,7 +4037,7 @@ var require_session = __commonJS({
|
|
|
4060
4037
|
const { project } = event.data;
|
|
4061
4038
|
const angularCore = this.findAngularCore(project);
|
|
4062
4039
|
if (angularCore) {
|
|
4063
|
-
if (this.ivy && isExternalAngularCore(angularCore)) {
|
|
4040
|
+
if (this.ivy && isExternalAngularCore(angularCore) && !this.disableAutomaticNgcc) {
|
|
4064
4041
|
this.runNgcc(project);
|
|
4065
4042
|
} else {
|
|
4066
4043
|
this.enableLanguageServiceForProject(project);
|
|
@@ -4566,7 +4543,7 @@ var require_session = __commonJS({
|
|
|
4566
4543
|
return angularCore !== null && angularCore !== void 0 ? angularCore : null;
|
|
4567
4544
|
}
|
|
4568
4545
|
async runNgcc(project) {
|
|
4569
|
-
if (!(0, utils_1.isConfiguredProject)(project)) {
|
|
4546
|
+
if (!(0, utils_1.isConfiguredProject)(project) || this.projectNgccQueue.some((p) => p.project === project)) {
|
|
4570
4547
|
return;
|
|
4571
4548
|
}
|
|
4572
4549
|
this.disableLanguageServiceForProject(project, "ngcc is running");
|
|
@@ -4660,9 +4637,11 @@ function main() {
|
|
|
4660
4637
|
ngPlugin: "@angular/language-service",
|
|
4661
4638
|
resolvedNgLsPath: ng.resolvedPath,
|
|
4662
4639
|
ivy: isG3 ? true : options.ivy,
|
|
4640
|
+
disableAutomaticNgcc: options.disableAutomaticNgcc,
|
|
4663
4641
|
logToConsole: options.logToConsole,
|
|
4664
4642
|
includeAutomaticOptionalChainCompletions: options.includeAutomaticOptionalChainCompletions,
|
|
4665
|
-
includeCompletionsWithSnippetText: options.includeCompletionsWithSnippetText
|
|
4643
|
+
includeCompletionsWithSnippetText: options.includeCompletionsWithSnippetText,
|
|
4644
|
+
forceStrictTemplates: isG3 || options.forceStrictTemplates
|
|
4666
4645
|
});
|
|
4667
4646
|
session.info(`Angular language server process ID: ${process.pid}`);
|
|
4668
4647
|
session.info(`Using ${ts.name} v${ts.version} from ${ts.resolvedPath}`);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/language-server",
|
|
3
3
|
"description": "LSP server for Angular Language Service",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "14.0.1",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/angular/vscode-ng-language-service.git"
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
"author": "Angular",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"engines": {
|
|
12
|
-
"node": "^
|
|
12
|
+
"node": "^14.15.0 || >=16.10.0"
|
|
13
13
|
},
|
|
14
14
|
"bin": {
|
|
15
15
|
"ngserver": "./bin/ngserver"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@angular/language-service": "
|
|
18
|
+
"@angular/language-service": "14.0.0",
|
|
19
19
|
"vscode-jsonrpc": "6.0.0",
|
|
20
20
|
"vscode-languageserver": "7.0.0",
|
|
21
21
|
"vscode-uri": "3.0.3"
|