You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
on a new line inside a.ts and try to autocomplete the import of B to use it as a constructor.
Expected behaviour
VSCode changes the import of B from a type import to a value import.
(It would be a syntax error to add the value import while keeping the type import, so the type import of B has to be removed at the same time. In this particular example, I would expect the entire import type line to be removed and the import of B added to the same line as makeB.)
Observed behaviour:
VSCode offers an autocompletion dropdown, but the default choice does nothing. There is no choice that will result in a value import of B unless the existing type import is deleted.
Screencap:
Screen.Recording.2021-06-29.at.01.47.40.mov
This is a frustrating experience: If I "happen" to autocomplete something as a value in a given file before I complete it as a type the first time, then autocomplete works naturally and the code is fine. But if I autocomplete something as a type the first time, then VSCode is unable to autocomplete the value import. Even though I know the issue and can work around it every time, autocomplete feels subjectively unreliable.
This kind of situation can be common in a large codebase with importsNotUsedAsValues. In particular, I'm working on a project where it is common to use a particular class (Alg from cubing/alg) as a the type of a variable in a given file, only to need the constructor later on.
VS Code version: Code 1.57.1 (507ce72a4466fbb27b715c3722558bb15afa9f48, 2021-06-17T13:28:32.912Z)
OS version: Darwin x64 20.5.0
Restricted Mode: No
System Info
Item
Value
CPUs
Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz (12 x 2900)
Issue Type: Bug
Consider the following code:
Now type:
on a new line inside
a.tsand try to autocomplete the import ofBto use it as a constructor.Expected behaviour
VSCode changes the import of
Bfrom a type import to a value import.(It would be a syntax error to add the value import while keeping the type import, so the type import of
Bhas to be removed at the same time. In this particular example, I would expect the entireimport typeline to be removed and the import ofBadded to the same line asmakeB.)Observed behaviour:
VSCode offers an autocompletion dropdown, but the default choice does nothing. There is no choice that will result in a value import of B unless the existing type import is deleted.
Screencap:
Screen.Recording.2021-06-29.at.01.47.40.mov
This is a frustrating experience: If I "happen" to autocomplete something as a value in a given file before I complete it as a type the first time, then autocomplete works naturally and the code is fine. But if I autocomplete something as a type the first time, then VSCode is unable to autocomplete the value import. Even though I know the issue and can work around it every time, autocomplete feels subjectively unreliable.
This kind of situation can be common in a large codebase with
importsNotUsedAsValues. In particular, I'm working on a project where it is common to use a particular class (Algfromcubing/alg) as a the type of a variable in a given file, only to need the constructor later on.VS Code version: Code 1.57.1 (507ce72a4466fbb27b715c3722558bb15afa9f48, 2021-06-17T13:28:32.912Z)
OS version: Darwin x64 20.5.0
Restricted Mode: No
System Info
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled
A/B Experiments