@@ -12,7 +12,7 @@ import {MessageConnection} from 'vscode-jsonrpc';
1212import * as lsp from 'vscode-languageserver-protocol' ;
1313import { URI } from 'vscode-uri' ;
1414
15- import { NgccProgressEnd , ProjectLanguageService , ProjectLanguageServiceParams , SuggestStrictMode , SuggestStrictModeParams } from '../../common/notifications' ;
15+ import { ProjectLanguageService , ProjectLanguageServiceParams , SuggestStrictMode , SuggestStrictModeParams } from '../../common/notifications' ;
1616import { GetComponentsWithTemplateFile , GetTcbRequest , GetTemplateLocationForComponent , IsInAngularProject } from '../../common/requests' ;
1717import { APP_COMPONENT , APP_COMPONENT_URI , FOO_COMPONENT , FOO_COMPONENT_URI , FOO_TEMPLATE , FOO_TEMPLATE_URI , IS_BAZEL , PROJECT_PATH , TSCONFIG } from '../test_constants' ;
1818
@@ -41,28 +41,8 @@ describe('Angular Ivy language server', () => {
4141 client . dispose ( ) ;
4242 } ) ;
4343
44- it ( 'should send ngcc progress after a project has finished loading' , async ( ) => {
45- openTextDocument ( client , APP_COMPONENT ) ;
46- const configFilePath = await onNgccProgress ( client ) ;
47- expect ( configFilePath . endsWith ( 'integration/project/tsconfig.json' ) ) . toBeTrue ( ) ;
48- } ) ;
49-
50- it ( 'should disable language service until ngcc has completed' , async ( ) => {
51- openTextDocument ( client , APP_COMPONENT ) ;
52- const languageServiceEnabled = await onLanguageServiceStateNotification ( client ) ;
53- expect ( languageServiceEnabled ) . toBeFalse ( ) ;
54- } ) ;
55-
56- it ( 'should re-enable language service once ngcc has completed' , async ( ) => {
57- openTextDocument ( client , APP_COMPONENT ) ;
58- const languageServiceEnabled = await waitForNgcc ( client ) ;
59- expect ( languageServiceEnabled ) . toBeTrue ( ) ;
60- } ) ;
61-
6244 it ( 'should handle hover on inline template' , async ( ) => {
6345 openTextDocument ( client , APP_COMPONENT ) ;
64- const languageServiceEnabled = await waitForNgcc ( client ) ;
65- expect ( languageServiceEnabled ) . toBeTrue ( ) ;
6646 const response = await client . sendRequest ( lsp . HoverRequest . type , {
6747 textDocument : {
6848 uri : APP_COMPONENT_URI ,
@@ -77,8 +57,6 @@ describe('Angular Ivy language server', () => {
7757
7858 it ( 'should show diagnostics for inline template on open' , async ( ) => {
7959 openTextDocument ( client , APP_COMPONENT ) ;
80- const languageServiceEnabled = await waitForNgcc ( client ) ;
81- expect ( languageServiceEnabled ) . toBeTrue ( ) ;
8260 const diagnostics = await getDiagnosticsForFile ( client , APP_COMPONENT ) ;
8361 expect ( diagnostics . length ) . toBe ( 0 ) ;
8462 } ) ;
@@ -92,8 +70,6 @@ describe('Angular Ivy language server', () => {
9270 text : `{{ doesnotexist }}` ,
9371 } ,
9472 } ) ;
95- const languageServiceEnabled = await waitForNgcc ( client ) ;
96- expect ( languageServiceEnabled ) . toBeTrue ( ) ;
9773 const diagnostics = await getDiagnosticsForFile ( client , FOO_TEMPLATE ) ;
9874 expect ( diagnostics . length ) . toBe ( 1 ) ;
9975 expect ( diagnostics [ 0 ] . message )
@@ -107,8 +83,6 @@ describe('Angular Ivy language server', () => {
10783
10884 it ( 'should support request cancellation' , async ( ) => {
10985 openTextDocument ( client , APP_COMPONENT ) ;
110- const languageServiceEnabled = await waitForNgcc ( client ) ;
111- expect ( languageServiceEnabled ) . toBeTrue ( ) ;
11286 // Send a request and immediately cancel it
11387 const promise = client . sendRequest ( lsp . HoverRequest . type , {
11488 textDocument : {
@@ -132,8 +106,6 @@ describe('Angular Ivy language server', () => {
132106 text : `<div *ngIf="false"></div>` ,
133107 } ,
134108 } ) ;
135- const languageServiceEnabled = await waitForNgcc ( client ) ;
136- expect ( languageServiceEnabled ) . toBeTrue ( ) ;
137109 const response = await client . sendRequest ( lsp . DefinitionRequest . type , {
138110 textDocument : {
139111 uri : FOO_TEMPLATE_URI ,
@@ -168,8 +140,6 @@ describe('Angular Ivy language server', () => {
168140 text : `<lib-post></lib-post>` ,
169141 } ,
170142 } ) ;
171- const languageServiceEnabled = await waitForNgcc ( client ) ;
172- expect ( languageServiceEnabled ) . toBeTrue ( ) ;
173143 const response = await client . sendRequest ( lsp . DefinitionRequest . type , {
174144 textDocument : {
175145 uri : FOO_TEMPLATE_URI ,
@@ -199,8 +169,6 @@ export class AppComponent {
199169 @Input() appInput = '';
200170 @Output() appOutput = new EventEmitter<string>();
201171}` ) ;
202- const languageServiceEnabled = await waitForNgcc ( client ) ;
203- expect ( languageServiceEnabled ) . toBeTrue ( ) ;
204172 const response = await client . sendRequest ( lsp . FoldingRangeRequest . type , {
205173 textDocument : {
206174 uri : APP_COMPONENT_URI ,
@@ -223,8 +191,6 @@ export class AppComponent {
223191 text : `{{ title.toString() }}` ,
224192 } ,
225193 } ) ;
226- const languageServiceEnabled = await waitForNgcc ( client ) ;
227- expect ( languageServiceEnabled ) . toBeTrue ( ) ;
228194 const response = ( await client . sendRequest ( lsp . SignatureHelpRequest . type , {
229195 textDocument : {
230196 uri : FOO_TEMPLATE_URI ,
@@ -245,8 +211,6 @@ export class AppComponent {
245211 text : `{{ title.substr(0, ) }}` ,
246212 } ,
247213 } ) ;
248- const languageServiceEnabled = await waitForNgcc ( client ) ;
249- expect ( languageServiceEnabled ) . toBeTrue ( ) ;
250214 const response = ( await client . sendRequest ( lsp . SignatureHelpRequest . type , {
251215 textDocument : {
252216 uri : FOO_TEMPLATE_URI ,
@@ -278,8 +242,6 @@ export class AppComponent {
278242
279243 it ( 'should retain typecheck files' , async ( ) => {
280244 openTextDocument ( client , APP_COMPONENT ) ;
281- const languageServiceEnabled = await waitForNgcc ( client ) ;
282- expect ( languageServiceEnabled ) . toBeTrue ( ) ;
283245 // Create a file in node_modules, this will trigger a project reload via
284246 // the directory watcher
285247 fs . writeFileSync ( dummy , '' ) ;
@@ -296,8 +258,6 @@ export class AppComponent {
296258 describe ( 'completions' , ( ) => {
297259 it ( 'for events' , async ( ) => {
298260 openTextDocument ( client , FOO_TEMPLATE , `<my-app ()></my-app>` ) ;
299- const languageServiceEnabled = await waitForNgcc ( client ) ;
300- expect ( languageServiceEnabled ) . toBeTrue ( ) ;
301261 const response = await client . sendRequest ( lsp . CompletionRequest . type , {
302262 textDocument : {
303263 uri : FOO_TEMPLATE_URI ,
@@ -316,8 +276,6 @@ export class AppComponent {
316276 describe ( 'from template files' , ( ) => {
317277 beforeEach ( async ( ) => {
318278 openTextDocument ( client , FOO_TEMPLATE ) ;
319- const languageServiceEnabled = await waitForNgcc ( client ) ;
320- expect ( languageServiceEnabled ) . toBeTrue ( ) ;
321279 } ) ;
322280
323281 it ( 'should handle prepare rename request for property read' , async ( ) => {
@@ -368,8 +326,6 @@ export class AppComponent {
368326 describe ( 'from typescript files' , ( ) => {
369327 beforeEach ( async ( ) => {
370328 openTextDocument ( client , APP_COMPONENT ) ;
371- const languageServiceEnabled = await waitForNgcc ( client ) ;
372- expect ( languageServiceEnabled ) . toBeTrue ( ) ;
373329 } ) ;
374330
375331 it ( 'should handle prepare rename request for inline template property read' , async ( ) => {
@@ -455,8 +411,6 @@ export class AppComponent {
455411 fs . writeFileSync ( TSCONFIG , JSON . stringify ( config , null , 2 ) ) ;
456412
457413 openTextDocument ( client , APP_COMPONENT ) ;
458- const languageServiceEnabled = await waitForNgcc ( client ) ;
459- expect ( languageServiceEnabled ) . toBeTrue ( ) ;
460414 } ) ;
461415
462416 it ( 'should suggest strict mode' , async ( ) => {
@@ -489,7 +443,6 @@ export class AppComponent {
489443
490444 it ( 'should handle getTcb request' , async ( ) => {
491445 openTextDocument ( client , FOO_TEMPLATE ) ;
492- await waitForNgcc ( client ) ;
493446 const response = await client . sendRequest ( GetTcbRequest , {
494447 textDocument : {
495448 uri : FOO_TEMPLATE_URI ,
@@ -501,7 +454,6 @@ export class AppComponent {
501454
502455 it ( 'should handle goToComponent request' , async ( ) => {
503456 openTextDocument ( client , FOO_TEMPLATE ) ;
504- await waitForNgcc ( client ) ;
505457 const response = await client . sendRequest ( GetComponentsWithTemplateFile , {
506458 textDocument : {
507459 uri : FOO_TEMPLATE_URI ,
@@ -512,7 +464,6 @@ export class AppComponent {
512464
513465 it ( 'should handle GetTemplateLocationForComponent request' , async ( ) => {
514466 openTextDocument ( client , FOO_TEMPLATE ) ;
515- await waitForNgcc ( client ) ;
516467 const response = await client . sendRequest ( GetTemplateLocationForComponent , {
517468 textDocument : {
518469 uri : FOO_COMPONENT_URI ,
@@ -525,7 +476,6 @@ export class AppComponent {
525476
526477 it ( 'should handle GetTemplateLocationForComponent request when not in component' , async ( ) => {
527478 openTextDocument ( client , FOO_TEMPLATE ) ;
528- await waitForNgcc ( client ) ;
529479 const response = await client . sendRequest ( GetTemplateLocationForComponent , {
530480 textDocument : {
531481 uri : FOO_COMPONENT_URI ,
@@ -537,7 +487,6 @@ export class AppComponent {
537487
538488 it ( 'should provide a "go to component" codelens' , async ( ) => {
539489 openTextDocument ( client , FOO_TEMPLATE ) ;
540- await waitForNgcc ( client ) ;
541490 const codeLensResponse = await client . sendRequest ( lsp . CodeLensRequest . type , {
542491 textDocument : {
543492 uri : FOO_TEMPLATE_URI ,
@@ -555,7 +504,6 @@ export class AppComponent {
555504
556505 it ( 'detects an Angular project' , async ( ) => {
557506 openTextDocument ( client , FOO_TEMPLATE ) ;
558- await waitForNgcc ( client ) ;
559507 const templateResponse = await client . sendRequest ( IsInAngularProject , {
560508 textDocument : {
561509 uri : FOO_TEMPLATE_URI ,
@@ -603,8 +551,6 @@ describe('auto-apply optional chaining', () => {
603551 }
604552 ` ) ;
605553 openTextDocument ( client , FOO_TEMPLATE , `{{ person.n }}` ) ;
606- const languageServiceEnabled = await waitForNgcc ( client ) ;
607- expect ( languageServiceEnabled ) . toBeTrue ( ) ;
608554 const response = await client . sendRequest ( lsp . CompletionRequest . type , {
609555 textDocument : {
610556 uri : FOO_TEMPLATE_URI ,
@@ -618,8 +564,6 @@ describe('auto-apply optional chaining', () => {
618564
619565 it ( 'should work on NonNullable symbol' , async ( ) => {
620566 openTextDocument ( client , FOO_TEMPLATE , `{{ title.substr }}` ) ;
621- const languageServiceEnabled = await waitForNgcc ( client ) ;
622- expect ( languageServiceEnabled ) . toBeTrue ( ) ;
623567 const response = await client . sendRequest ( lsp . CompletionRequest . type , {
624568 textDocument : {
625569 uri : FOO_TEMPLATE_URI ,
@@ -655,8 +599,6 @@ describe('insert snippet text', () => {
655599
656600 it ( 'should be able to complete for an attribute with the value is empty' , async ( ) => {
657601 openTextDocument ( client , FOO_TEMPLATE , `<my-app appOut></my-app>` ) ;
658- const languageServiceEnabled = await waitForNgcc ( client ) ;
659- expect ( languageServiceEnabled ) . toBeTrue ( ) ;
660602 const response = await client . sendRequest ( lsp . CompletionRequest . type , {
661603 textDocument : {
662604 uri : FOO_TEMPLATE_URI ,
@@ -671,8 +613,6 @@ describe('insert snippet text', () => {
671613
672614 it ( 'should not be included in the completion for an attribute with a value' , async ( ) => {
673615 openTextDocument ( client , FOO_TEMPLATE , `<my-app [appInput]="1"></my-app>` ) ;
674- const languageServiceEnabled = await waitForNgcc ( client ) ;
675- expect ( languageServiceEnabled ) . toBeTrue ( ) ;
676616 const response = await client . sendRequest ( lsp . CompletionRequest . type , {
677617 textDocument : {
678618 uri : FOO_TEMPLATE_URI ,
@@ -709,8 +649,6 @@ describe('code fixes', () => {
709649
710650 it ( 'should fix error when property does not exist on type' , async ( ) => {
711651 openTextDocument ( client , FOO_TEMPLATE , `{{titl}}` ) ;
712- const languageServiceEnabled = await waitForNgcc ( client ) ;
713- expect ( languageServiceEnabled ) . toBeTrue ( ) ;
714652 const diags = await getDiagnosticsForFile ( client , FOO_TEMPLATE ) ;
715653 const codeActions = await client . sendRequest ( lsp . CodeActionRequest . type , {
716654 textDocument : {
@@ -735,8 +673,6 @@ describe('code fixes', () => {
735673 it ( 'should fix error when the range the user selects is larger than the diagnostic' , async ( ) => {
736674 const template = `<span>{{titl}}</span>` ;
737675 openTextDocument ( client , FOO_TEMPLATE , template ) ;
738- const languageServiceEnabled = await waitForNgcc ( client ) ;
739- expect ( languageServiceEnabled ) . toBeTrue ( ) ;
740676 const diags = await getDiagnosticsForFile ( client , FOO_TEMPLATE ) ;
741677 const codeActions = await client . sendRequest ( lsp . CodeActionRequest . type , {
742678 textDocument : {
@@ -771,8 +707,6 @@ describe('code fixes', () => {
771707 banner = '';
772708 }
773709 ` ) ;
774- const languageServiceEnabled = await waitForNgcc ( client ) ;
775- expect ( languageServiceEnabled ) . toBeTrue ( ) ;
776710 } ) ;
777711
778712 it ( 'for "fixSpelling"' , async ( ) => {
@@ -838,14 +772,6 @@ describe('code fixes', () => {
838772 } ) ;
839773} ) ;
840774
841- function onNgccProgress ( client : MessageConnection ) : Promise < string > {
842- return new Promise ( resolve => {
843- client . onNotification ( NgccProgressEnd , ( params ) => {
844- resolve ( params . configFilePath ) ;
845- } ) ;
846- } ) ;
847- }
848-
849775function onSuggestStrictMode ( client : MessageConnection ) : Promise < string > {
850776 return new Promise ( resolve => {
851777 client . onNotification ( SuggestStrictMode , ( params : SuggestStrictModeParams ) => {
@@ -873,8 +799,3 @@ function getDiagnosticsForFile(
873799 } ) ;
874800 } ) ;
875801}
876-
877- async function waitForNgcc ( client : MessageConnection ) : Promise < boolean > {
878- await onNgccProgress ( client ) ;
879- return onLanguageServiceStateNotification ( client ) ;
880- }
0 commit comments