Skip to content

Auto-import removes everything after the insertion point #82491

@varadero

Description

@varadero

Related to #82466

  • VSCode Version:
    Version: 1.40.0-insider (user setup)
    Commit: a30e88a
    Date: 2019-10-14T05:42:51.751Z
    Electron: 6.0.12
    Chrome: 76.0.3809.146
    Node.js: 12.4.0
    V8: 7.6.303.31-electron.0
    OS: Windows_NT x64 10.0.18362

  • OS Version:
    Windows x64 10.0.18362

Steps to Reproduce:

See attached animated gif - as soon as the suggestion is accepted with ENTER key, everything after it is removed.

  1. Create new class definition
export class Test {
}
  1. Start defining constructor with a single parameter (notice that VSCode automatically adds closing bracket when you type the open bracket for the constructor and places the cursor inside the brackets)
constructor (private x: )
  1. Start typing the parameter type name and wait for suggestions to show
  2. Select something from the suggestion list

What happens:
Instead of ending up with something like this:

import { SomeType } from './somewhere';

export class Test {
  constructor(private x: SomeType)
}

You end up with this (notice the closing bracket is removed - this happens with everything after the auto-inserted type name)


export class Test {
  constructor(private x: SomeType
}

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

Animated gif:

vscode-auto-import-bug

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugsuggestIntelliSense, Auto CompleteverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions