Skip to content

Non-module file does't offer import fixes #28831

@Venthe

Description

@Venthe
  • VSCode Version: 1.29.1; 1-30.0-insider (2018-11-30)
  • OS Version: Windows 10 1809

Steps to Reproduce:
Use this zip
callWithTimeout.zip
or

  1. Create new project through NPM
  2. npm init
  3. npm add --save-dev rxjs typescript
  4. Create tsconfig.json
{
    "compilerOptions": {
      "rootDir": "./",
      "target": "es6",
      "module": "commonjs",
      "declaration": true,
      "outDir": "./dist",
      "strict": true
    },
    "include": ["src"],
    "exclude": ["node_modules", "**/__tests__/*"],
  }
  1. create any file with .ts extension with content:
    let a: Observable<any>;
  2. Press ctrl+. with cursor on observable

Does this issue occur when all extensions are disabled?: Yes

Current behaviour: No actions available
Expected behaviour: import from...

What is worth noting, if I add empty import like so import {} from "rxjs" it will suggest to add to existing import
image
image

Metadata

Metadata

Assignees

Labels

Domain: LS: Quick FixesEditor-provided fixes, often called code actions.Working as IntendedThe behavior described is the intended behavior; this is not a bug

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions