diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-12-29 21:07:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-29 21:07:09 +0100 |
commit | ef5f8cd265b4bf161832ee23abfbe10605cf5b67 (patch) | |
tree | 4ca4542fec2a89b59ccbf2d1aeb2398d493227e4 /cli/tests/lsp_tests.rs | |
parent | 65ea554afe1ce387ea1d663e6178079ebcf0904f (diff) |
fix(lsp): "Add all missing imports" uses correct specifiers (#17216)
This commit fixes "Add all missing imports" quick fix; before
it was replacing all occurrences with the same specifier. Now
every line returned from TSC is processed individually.
Diffstat (limited to 'cli/tests/lsp_tests.rs')
-rw-r--r-- | cli/tests/lsp_tests.rs | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/cli/tests/lsp_tests.rs b/cli/tests/lsp_tests.rs index 8ed6a67d7..1236b6c45 100644 --- a/cli/tests/lsp_tests.rs +++ b/cli/tests/lsp_tests.rs @@ -3390,7 +3390,16 @@ mod lsp { "uri": "file:///a/file00.ts", "languageId": "typescript", "version": 1, - "text": "export const abc = \"abc\";\nexport const def = \"def\";\n" + "text": r#"export interface MallardDuckConfigOptions extends DuckConfigOptions { + kind: "mallard"; +} + +export class MallardDuckConfig extends DuckConfig { + constructor(options: MallardDuckConfigOptions) { + super(options); + } +} +"# } })); session.did_open(json!({ @@ -3398,7 +3407,27 @@ mod lsp { "uri": "file:///a/file01.ts", "languageId": "typescript", "version": 1, - "text": "\nconsole.log(abc);\nconsole.log(def)\n" + "text": r#"import { DuckConfigOptions } from "./file02.ts"; + +export class DuckConfig { + readonly kind; + constructor(options: DuckConfigOptions) { + this.kind = options.kind; + } +} +"# + } + })); + session.did_open(json!({ + "textDocument": { + "uri": "file:///a/file02.ts", + "languageId": "typescript", + "version": 1, + "text": r#"export interface DuckConfigOptions { + kind: string; + quacks: boolean; +} +"# } })); |