@angular/language-server 14.0.0-rc.0 → 14.1.0
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 +90 -76
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -40,7 +40,8 @@ var require_cmdline_utils = __commonJS({
|
|
|
40
40
|
tsProbeLocations: parseStringArray(argv, "--tsProbeLocations"),
|
|
41
41
|
includeAutomaticOptionalChainCompletions: hasArgument(argv, "--includeAutomaticOptionalChainCompletions"),
|
|
42
42
|
includeCompletionsWithSnippetText: hasArgument(argv, "--includeCompletionsWithSnippetText"),
|
|
43
|
-
forceStrictTemplates: hasArgument(argv, "--forceStrictTemplates")
|
|
43
|
+
forceStrictTemplates: hasArgument(argv, "--forceStrictTemplates"),
|
|
44
|
+
untrustedWorkspace: hasArgument(argv, "--untrustedWorkspace")
|
|
44
45
|
};
|
|
45
46
|
}
|
|
46
47
|
exports2.parseCommandLine = parseCommandLine;
|
|
@@ -76,9 +77,13 @@ var require_resolver = __commonJS({
|
|
|
76
77
|
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
77
78
|
if (k2 === void 0)
|
|
78
79
|
k2 = k;
|
|
79
|
-
Object.
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
81
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
82
|
+
desc = { enumerable: true, get: function() {
|
|
83
|
+
return m[k];
|
|
84
|
+
} };
|
|
85
|
+
}
|
|
86
|
+
Object.defineProperty(o, k2, desc);
|
|
82
87
|
} : function(o, m, k, k2) {
|
|
83
88
|
if (k2 === void 0)
|
|
84
89
|
k2 = k;
|
|
@@ -173,9 +178,13 @@ var require_version_provider = __commonJS({
|
|
|
173
178
|
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
174
179
|
if (k2 === void 0)
|
|
175
180
|
k2 = k;
|
|
176
|
-
Object.
|
|
177
|
-
|
|
178
|
-
|
|
181
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
182
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
183
|
+
desc = { enumerable: true, get: function() {
|
|
184
|
+
return m[k];
|
|
185
|
+
} };
|
|
186
|
+
}
|
|
187
|
+
Object.defineProperty(o, k2, desc);
|
|
179
188
|
} : function(o, m, k, k2) {
|
|
180
189
|
if (k2 === void 0)
|
|
181
190
|
k2 = k;
|
|
@@ -353,7 +362,8 @@ var require_cmdline_utils = __commonJS({
|
|
|
353
362
|
tsProbeLocations: parseStringArray(argv, "--tsProbeLocations"),
|
|
354
363
|
includeAutomaticOptionalChainCompletions: hasArgument(argv, "--includeAutomaticOptionalChainCompletions"),
|
|
355
364
|
includeCompletionsWithSnippetText: hasArgument(argv, "--includeCompletionsWithSnippetText"),
|
|
356
|
-
forceStrictTemplates: hasArgument(argv, "--forceStrictTemplates")
|
|
365
|
+
forceStrictTemplates: hasArgument(argv, "--forceStrictTemplates"),
|
|
366
|
+
untrustedWorkspace: hasArgument(argv, "--untrustedWorkspace")
|
|
357
367
|
};
|
|
358
368
|
}
|
|
359
369
|
exports2.parseCommandLine = parseCommandLine;
|
|
@@ -389,9 +399,13 @@ var require_logger = __commonJS({
|
|
|
389
399
|
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
390
400
|
if (k2 === void 0)
|
|
391
401
|
k2 = k;
|
|
392
|
-
Object.
|
|
393
|
-
|
|
394
|
-
|
|
402
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
403
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
404
|
+
desc = { enumerable: true, get: function() {
|
|
405
|
+
return m[k];
|
|
406
|
+
} };
|
|
407
|
+
}
|
|
408
|
+
Object.defineProperty(o, k2, desc);
|
|
395
409
|
} : function(o, m, k, k2) {
|
|
396
410
|
if (k2 === void 0)
|
|
397
411
|
k2 = k;
|
|
@@ -517,9 +531,13 @@ var require_server_host = __commonJS({
|
|
|
517
531
|
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
518
532
|
if (k2 === void 0)
|
|
519
533
|
k2 = k;
|
|
520
|
-
Object.
|
|
521
|
-
|
|
522
|
-
|
|
534
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
535
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
536
|
+
desc = { enumerable: true, get: function() {
|
|
537
|
+
return m[k];
|
|
538
|
+
} };
|
|
539
|
+
}
|
|
540
|
+
Object.defineProperty(o, k2, desc);
|
|
523
541
|
} : function(o, m, k, k2) {
|
|
524
542
|
if (k2 === void 0)
|
|
525
543
|
k2 = k;
|
|
@@ -3010,9 +3028,13 @@ var require_requests = __commonJS({
|
|
|
3010
3028
|
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
3011
3029
|
if (k2 === void 0)
|
|
3012
3030
|
k2 = k;
|
|
3013
|
-
Object.
|
|
3014
|
-
|
|
3015
|
-
|
|
3031
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
3032
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
3033
|
+
desc = { enumerable: true, get: function() {
|
|
3034
|
+
return m[k];
|
|
3035
|
+
} };
|
|
3036
|
+
}
|
|
3037
|
+
Object.defineProperty(o, k2, desc);
|
|
3016
3038
|
} : function(o, m, k, k2) {
|
|
3017
3039
|
if (k2 === void 0)
|
|
3018
3040
|
k2 = k;
|
|
@@ -3053,9 +3075,13 @@ var require_utils = __commonJS({
|
|
|
3053
3075
|
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
3054
3076
|
if (k2 === void 0)
|
|
3055
3077
|
k2 = k;
|
|
3056
|
-
Object.
|
|
3057
|
-
|
|
3058
|
-
|
|
3078
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
3079
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
3080
|
+
desc = { enumerable: true, get: function() {
|
|
3081
|
+
return m[k];
|
|
3082
|
+
} };
|
|
3083
|
+
}
|
|
3084
|
+
Object.defineProperty(o, k2, desc);
|
|
3059
3085
|
} : function(o, m, k, k2) {
|
|
3060
3086
|
if (k2 === void 0)
|
|
3061
3087
|
k2 = k;
|
|
@@ -3207,9 +3233,13 @@ var require_completion = __commonJS({
|
|
|
3207
3233
|
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
3208
3234
|
if (k2 === void 0)
|
|
3209
3235
|
k2 = k;
|
|
3210
|
-
Object.
|
|
3211
|
-
|
|
3212
|
-
|
|
3236
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
3237
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
3238
|
+
desc = { enumerable: true, get: function() {
|
|
3239
|
+
return m[k];
|
|
3240
|
+
} };
|
|
3241
|
+
}
|
|
3242
|
+
Object.defineProperty(o, k2, desc);
|
|
3213
3243
|
} : function(o, m, k, k2) {
|
|
3214
3244
|
if (k2 === void 0)
|
|
3215
3245
|
k2 = k;
|
|
@@ -3335,9 +3365,13 @@ var require_diagnostic = __commonJS({
|
|
|
3335
3365
|
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
3336
3366
|
if (k2 === void 0)
|
|
3337
3367
|
k2 = k;
|
|
3338
|
-
Object.
|
|
3339
|
-
|
|
3340
|
-
|
|
3368
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
3369
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
3370
|
+
desc = { enumerable: true, get: function() {
|
|
3371
|
+
return m[k];
|
|
3372
|
+
} };
|
|
3373
|
+
}
|
|
3374
|
+
Object.defineProperty(o, k2, desc);
|
|
3341
3375
|
} : function(o, m, k, k2) {
|
|
3342
3376
|
if (k2 === void 0)
|
|
3343
3377
|
k2 = k;
|
|
@@ -3396,9 +3430,13 @@ var require_resolver = __commonJS({
|
|
|
3396
3430
|
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
3397
3431
|
if (k2 === void 0)
|
|
3398
3432
|
k2 = k;
|
|
3399
|
-
Object.
|
|
3400
|
-
|
|
3401
|
-
|
|
3433
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
3434
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
3435
|
+
desc = { enumerable: true, get: function() {
|
|
3436
|
+
return m[k];
|
|
3437
|
+
} };
|
|
3438
|
+
}
|
|
3439
|
+
Object.defineProperty(o, k2, desc);
|
|
3402
3440
|
} : function(o, m, k, k2) {
|
|
3403
3441
|
if (k2 === void 0)
|
|
3404
3442
|
k2 = k;
|
|
@@ -3493,9 +3531,13 @@ var require_version_provider = __commonJS({
|
|
|
3493
3531
|
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
3494
3532
|
if (k2 === void 0)
|
|
3495
3533
|
k2 = k;
|
|
3496
|
-
Object.
|
|
3497
|
-
|
|
3498
|
-
|
|
3534
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
3535
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
3536
|
+
desc = { enumerable: true, get: function() {
|
|
3537
|
+
return m[k];
|
|
3538
|
+
} };
|
|
3539
|
+
}
|
|
3540
|
+
Object.defineProperty(o, k2, desc);
|
|
3499
3541
|
} : function(o, m, k, k2) {
|
|
3500
3542
|
if (k2 === void 0)
|
|
3501
3543
|
k2 = k;
|
|
@@ -3672,9 +3714,13 @@ var require_session = __commonJS({
|
|
|
3672
3714
|
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
3673
3715
|
if (k2 === void 0)
|
|
3674
3716
|
k2 = k;
|
|
3675
|
-
Object.
|
|
3676
|
-
|
|
3677
|
-
|
|
3717
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
3718
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
3719
|
+
desc = { enumerable: true, get: function() {
|
|
3720
|
+
return m[k];
|
|
3721
|
+
} };
|
|
3722
|
+
}
|
|
3723
|
+
Object.defineProperty(o, k2, desc);
|
|
3678
3724
|
} : function(o, m, k, k2) {
|
|
3679
3725
|
if (k2 === void 0)
|
|
3680
3726
|
k2 = k;
|
|
@@ -3722,7 +3768,6 @@ var require_session = __commonJS({
|
|
|
3722
3768
|
})(NgccErrorMessageAction || (NgccErrorMessageAction = {}));
|
|
3723
3769
|
var Session = class {
|
|
3724
3770
|
constructor(options) {
|
|
3725
|
-
this.configuredProjToExternalProj = /* @__PURE__ */ new Map();
|
|
3726
3771
|
this.openFiles = new utils_1.MruTracker();
|
|
3727
3772
|
this.projectNgccQueue = [];
|
|
3728
3773
|
this.diagnosticsTimeout = null;
|
|
@@ -3735,6 +3780,7 @@ var require_session = __commonJS({
|
|
|
3735
3780
|
this.ivy = options.ivy;
|
|
3736
3781
|
this.disableAutomaticNgcc = options.disableAutomaticNgcc;
|
|
3737
3782
|
this.logToConsole = options.logToConsole;
|
|
3783
|
+
this.untrustedWorkspace = options.untrustedWorkspace;
|
|
3738
3784
|
this.connection = lsp.createConnection({
|
|
3739
3785
|
cancelUndispatched(message) {
|
|
3740
3786
|
return {
|
|
@@ -3983,6 +4029,7 @@ var require_session = __commonJS({
|
|
|
3983
4029
|
this.info(`Enabling Ivy language service for ${projectName}.`);
|
|
3984
4030
|
this.handleCompilerOptionsDiagnostics(project);
|
|
3985
4031
|
this.runGlobalAnalysisForNewlyLoadedProject(project);
|
|
4032
|
+
project.refreshDiagnostics();
|
|
3986
4033
|
}
|
|
3987
4034
|
disableLanguageServiceForProject(project, reason) {
|
|
3988
4035
|
if (!project.languageServiceEnabled) {
|
|
@@ -4121,7 +4168,6 @@ var require_session = __commonJS({
|
|
|
4121
4168
|
scriptInfo.detachAllProjects();
|
|
4122
4169
|
scriptInfo.attachToProject(project);
|
|
4123
4170
|
}
|
|
4124
|
-
this.createExternalProject(project);
|
|
4125
4171
|
return project;
|
|
4126
4172
|
}
|
|
4127
4173
|
onInitialize(params) {
|
|
@@ -4190,18 +4236,6 @@ var require_session = __commonJS({
|
|
|
4190
4236
|
}
|
|
4191
4237
|
throw error;
|
|
4192
4238
|
}
|
|
4193
|
-
this.closeOrphanedExternalProjects();
|
|
4194
|
-
}
|
|
4195
|
-
createExternalProject(project) {
|
|
4196
|
-
if ((0, utils_1.isConfiguredProject)(project) && !this.configuredProjToExternalProj.has(project.projectName)) {
|
|
4197
|
-
const extProjectName = `${project.projectName}-external`;
|
|
4198
|
-
project.projectService.openExternalProject({
|
|
4199
|
-
projectFileName: extProjectName,
|
|
4200
|
-
rootFiles: [{ fileName: project.getConfigFilePath() }],
|
|
4201
|
-
options: {}
|
|
4202
|
-
});
|
|
4203
|
-
this.configuredProjToExternalProj.set(project.projectName, extProjectName);
|
|
4204
|
-
}
|
|
4205
4239
|
}
|
|
4206
4240
|
onDidCloseTextDocument(params) {
|
|
4207
4241
|
const { textDocument } = params;
|
|
@@ -4212,24 +4246,6 @@ var require_session = __commonJS({
|
|
|
4212
4246
|
this.openFiles.delete(filePath);
|
|
4213
4247
|
this.projectService.closeClientFile(filePath);
|
|
4214
4248
|
}
|
|
4215
|
-
closeOrphanedExternalProjects() {
|
|
4216
|
-
for (const [configuredProjName, externalProjName] of this.configuredProjToExternalProj) {
|
|
4217
|
-
const configuredProj = this.projectService.findProject(configuredProjName);
|
|
4218
|
-
if (!configuredProj || configuredProj.isClosed()) {
|
|
4219
|
-
this.projectService.closeExternalProject(externalProjName);
|
|
4220
|
-
this.configuredProjToExternalProj.delete(configuredProjName);
|
|
4221
|
-
continue;
|
|
4222
|
-
}
|
|
4223
|
-
const openFiles = toArray(this.projectService.openFiles.keys());
|
|
4224
|
-
if (!openFiles.some((file) => {
|
|
4225
|
-
const scriptInfo = this.projectService.getScriptInfo(file);
|
|
4226
|
-
return scriptInfo === null || scriptInfo === void 0 ? void 0 : scriptInfo.isAttached(configuredProj);
|
|
4227
|
-
})) {
|
|
4228
|
-
this.projectService.closeExternalProject(externalProjName);
|
|
4229
|
-
this.configuredProjToExternalProj.delete(configuredProjName);
|
|
4230
|
-
}
|
|
4231
|
-
}
|
|
4232
|
-
}
|
|
4233
4249
|
onDidChangeTextDocument(params) {
|
|
4234
4250
|
const { contentChanges, textDocument } = params;
|
|
4235
4251
|
const filePath = (0, utils_1.uriToFilePath)(textDocument.uri);
|
|
@@ -4542,6 +4558,10 @@ var require_session = __commonJS({
|
|
|
4542
4558
|
return angularCore !== null && angularCore !== void 0 ? angularCore : null;
|
|
4543
4559
|
}
|
|
4544
4560
|
async runNgcc(project) {
|
|
4561
|
+
if (this.untrustedWorkspace) {
|
|
4562
|
+
this.error("Cannot run ngcc in an untrusted workspace.");
|
|
4563
|
+
return;
|
|
4564
|
+
}
|
|
4545
4565
|
if (!(0, utils_1.isConfiguredProject)(project) || this.projectNgccQueue.some((p) => p.project === project)) {
|
|
4546
4566
|
return;
|
|
4547
4567
|
}
|
|
@@ -4584,13 +4604,6 @@ var require_session = __commonJS({
|
|
|
4584
4604
|
}
|
|
4585
4605
|
};
|
|
4586
4606
|
exports2.Session = Session;
|
|
4587
|
-
function toArray(it) {
|
|
4588
|
-
const results = [];
|
|
4589
|
-
for (let itResult = it.next(); !itResult.done; itResult = it.next()) {
|
|
4590
|
-
results.push(itResult.value);
|
|
4591
|
-
}
|
|
4592
|
-
return results;
|
|
4593
|
-
}
|
|
4594
4607
|
function isAngularCore(path) {
|
|
4595
4608
|
return isExternalAngularCore(path) || isInternalAngularCore(path);
|
|
4596
4609
|
}
|
|
@@ -4636,11 +4649,12 @@ function main() {
|
|
|
4636
4649
|
ngPlugin: "@angular/language-service",
|
|
4637
4650
|
resolvedNgLsPath: ng.resolvedPath,
|
|
4638
4651
|
ivy: isG3 ? true : options.ivy,
|
|
4639
|
-
disableAutomaticNgcc: options.disableAutomaticNgcc,
|
|
4652
|
+
disableAutomaticNgcc: options.disableAutomaticNgcc || options.untrustedWorkspace,
|
|
4640
4653
|
logToConsole: options.logToConsole,
|
|
4641
4654
|
includeAutomaticOptionalChainCompletions: options.includeAutomaticOptionalChainCompletions,
|
|
4642
4655
|
includeCompletionsWithSnippetText: options.includeCompletionsWithSnippetText,
|
|
4643
|
-
forceStrictTemplates: isG3 || options.forceStrictTemplates
|
|
4656
|
+
forceStrictTemplates: isG3 || options.forceStrictTemplates,
|
|
4657
|
+
untrustedWorkspace: options.untrustedWorkspace
|
|
4644
4658
|
});
|
|
4645
4659
|
session.info(`Angular language server process ID: ${process.pid}`);
|
|
4646
4660
|
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": "14.
|
|
4
|
+
"version": "14.1.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/angular/vscode-ng-language-service.git"
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"ngserver": "./bin/ngserver"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@angular/language-service": "14.
|
|
18
|
+
"@angular/language-service": "14.1.0",
|
|
19
19
|
"vscode-jsonrpc": "6.0.0",
|
|
20
20
|
"vscode-languageserver": "7.0.0",
|
|
21
21
|
"vscode-uri": "3.0.3"
|
|
@@ -23,4 +23,4 @@
|
|
|
23
23
|
"publishConfig": {
|
|
24
24
|
"registry": "https://wombat-dressing-room.appspot.com"
|
|
25
25
|
}
|
|
26
|
-
}
|
|
26
|
+
}
|