From d4fe90648e9fc417749343b9df018c0c7dc38d9b Mon Sep 17 00:00:00 2001 From: ivanwonder Date: Sun, 19 May 2024 12:06:51 +0800 Subject: [PATCH] fixup! feat: generate the import declaration for the completion item code actions --- integration/lsp/ivy_spec.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/integration/lsp/ivy_spec.ts b/integration/lsp/ivy_spec.ts index d1e22ed639..af0cea7096 100644 --- a/integration/lsp/ivy_spec.ts +++ b/integration/lsp/ivy_spec.ts @@ -603,10 +603,9 @@ export class AppComponent { {'start': {'line': 5, 'character': 45}, 'end': {'line': 5, 'character': 45}} }, { - 'newText': - '{\n declarations: [\n AppComponent,\n FooComponent,\n ],\n bootstrap: [AppComponent],\n imports: [\n CommonModule,\n PostModule,\n BarComponent\n ]\n}', + 'newText': 'imports: [\n CommonModule,\n PostModule,\n BarComponent\n]', 'range': - {'start': {'line': 7, 'character': 10}, 'end': {'line': 17, 'character': 1}} + {'start': {'line': 8, 'character': 2}, 'end': {'line': 11, 'character': 3}} } ] } @@ -626,9 +625,8 @@ export class AppComponent { const libPostResponse = response.find(res => res.label === 'baz-component')!; const detail = await client.sendRequest(lsp.CompletionResolveRequest.type, libPostResponse); expect(detail.additionalTextEdits).toEqual([{ - 'newText': - '{\n selector: \'bar-component\',\n template: `<`,\n standalone: true,\n imports: [BazComponent]\n}', - 'range': {'start': {'line': 11, 'character': 11}, 'end': {'line': 15, 'character': 1}} + 'newText': ',\n imports: [BazComponent]', + 'range': {'start': {'line': 14, 'character': 20}, 'end': {'line': 14, 'character': 20}} }]); }); });