Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Autocompletion does NOT removetype fromimport type when needed #62882

Open
Labels
Milestone
@Friend-LGA

Description

@Friend-LGA

We use TypeScript configuration"verbatimModuleSyntax": true intsconfig.json and so import statements can be specified etherimport module orimport type module.

Previously in the case when module was imported as a type likeimport type Test from 'test' and it needs to be imported without type likeimport Test from 'test' autocompletion will remove thetype part. With the new version this behaviour is broken andtype part is not being removed by autocompletion.

Before

// "type" will be removed hereimporttypeTestfrom'test';// -> import Test from 'test';// use autocompletion -> "type: being removed from aboveconsttest=newTest();

Now

// "type" stays at placeimporttypeTestfrom'test';// -> no changes// use autocompletion -> no changesconsttest=newTest();

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

  • VS Code Version: 1.106.3
  • OS Version: Linux x64 6.14.0-36-generic snap

Steps to Reproduce:

  1. Make new project
  2. Addtsconfig.json
  3. Specify"verbatimModuleSyntax": true in thetsconfig.json
  4. Add new filetest.ts
    exportclassTest{}
  5. Add new fileexample.ts
    consttest:Test;// use autocompletion on the "Test"
  6. Observe thatimport type has been added
    importtype{Test}from'test';consttest:Test;
  7. Try to create newTest instance
    importtype{Test}from'test';consttest:Test=newTest();
  8. Observe error
    `'Test' cannot be used as a value because it was imported using 'import type'.ts(1361)`
  9. Use autocomplete on theTest, observe thatimport type Test from 'test' has NOT been changed toimport Test from 'test'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp