@@ -87,7 +87,7 @@ describe('Angular Language Service', () => {
8787 * process. If the parent process is not alive then the server should
8888 * exit (see exit notification) its process.
8989 */
90- 'processId' : server . pid ,
90+ 'processId' : process . pid ,
9191 'rootUri' : `file://${ PROJECT_PATH } ` ,
9292 'capabilities' : { } ,
9393 /**
@@ -119,7 +119,7 @@ describe('Angular Language Service', () => {
119119 'id' : 0 ,
120120 'method' : 'initialize' ,
121121 'params' : {
122- 'processId' : server . pid ,
122+ 'processId' : process . pid ,
123123 'rootUri' : `file://${ PROJECT_PATH } ` ,
124124 'capabilities' : { } ,
125125 'trace' : 'off'
@@ -582,4 +582,53 @@ describe('Angular Language Service', () => {
582582 ]
583583 } ) ;
584584 } ) ;
585+
586+ it ( 'should work with external template' , async ( ) => {
587+ const r0 = await send ( {
588+ jsonrpc : '2.0' ,
589+ id : 0 ,
590+ method : 'initialize' ,
591+ params : {
592+ processId : process . pid ,
593+ rootUri : `file://${ PROJECT_PATH } ` ,
594+ capabilities : { } ,
595+ }
596+ } ) ;
597+ expect ( r0 ) . toBeDefined ( ) ;
598+ const n0 = await send ( {
599+ jsonrpc : '2.0' ,
600+ method : 'textDocument/didOpen' ,
601+ params : {
602+ textDocument : {
603+ uri : `file://${ PROJECT_PATH } /app/foo.component.html` ,
604+ languageId : 'typescript' ,
605+ version : 1 ,
606+ }
607+ }
608+ } ) ;
609+ expect ( n0 ) . toBe ( null ) ; // no response expected from notification
610+ const r1 = await send ( {
611+ jsonrpc : '2.0' ,
612+ id : 1 ,
613+ method : 'textDocument/hover' ,
614+ params : {
615+ textDocument : { uri : `file://${ PROJECT_PATH } /app/foo.component.html` } ,
616+ position : { line : 0 , character : 3 }
617+ }
618+ } ) ;
619+ expect ( r1 ) . toEqual ( {
620+ jsonrpc : '2.0' ,
621+ id : 1 ,
622+ result : {
623+ contents : [ {
624+ language : 'typescript' ,
625+ value : '(property) FooComponent.title' ,
626+ } ] ,
627+ range : {
628+ start : { line : 0 , character : 2 } ,
629+ end : { line : 0 , character : 7 } ,
630+ }
631+ }
632+ } ) ;
633+ } ) ;
585634} ) ;
0 commit comments