Skip to content

Auto-completions from global type definitions don't work without initial text #39454

@SnirBroshi

Description

@SnirBroshi

TS Template added by @mjbvz

TypeScript Version: 3.9.6

Search Terms

  • untitled
  • suggest / suggestions

I'm not sure if this is the right place to open the issue (I also don't know where the TS language server is on github), so if it isn't, move the issue to the right place please :)

Steps to Reproduce:

  1. Open a new untitled file
  2. Set the syntax to javascript
  3. Paste the following code:
    /**
     * @type {import('webpack').Configuration}
     */
    module.exports = {
    
    };
  4. Ctrl+click the word Configuration to jump to the type definitions file, and make sure it is the one that comes with VSCode (on Windows it's %LOCALAPPDATA%\Microsoft\TypeScript\3.9\node_modules\@types\webpack\index.d.ts).
  5. Go back to the untitled file, and place the cursor inside the braces of the exports object
  6. Trigger autocompletion popup using Ctrl+Space
  7. Only snippets and words from the current file are suggested, instead of members from the type definition.
  8. Close the popup using Escape
  9. Type m
  10. The completions for mode and module appear, from the type definition.

If you repeat this with a saved file inside a folder with @types/webpack installed in node_modules, the autocompletion will show all the members as expected.

  • VS Code Version: Code - Insiders 1.47.0-insider (376d9d9, 2020-07-03T10:27:06.804Z)
  • OS Version: Windows_NT x64 10.0.18363

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions