Skip to content

TypeScript: New class in second project is only recognized by intellisense after restart #37304

Closed

Description

Issue Type: Bug

  • Load a folder with multiple typescript projects
  • e.g.: folder structure:
    • projects
      • project1
      • project2
  • e.g.: project2 references project1 via project references in tsconfig
  • Add a new class in an new .ts file in project1
  • Try to use this class in project2
  • Intellisence does not know about this class and it is reported as error if you just type it.

Workaround:

  • Restart VSCode
  • After restart the new class is available via intellisense and not reported as error any more

Fix:

  • This should work without a restart...

VS Code version: Code 1.42.1 (c47d83b293181d9be64f27ff093689e8e7aed054, 2020-02-11T14:45:59.656Z)
OS version: Windows_NT x64 10.0.18363

System Info
Item Value
CPUs Intel(R) Core(TM) i7-7920HQ CPU @ 3.10GHz (8 x 3096)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: enabled
rasterization: enabled
skia_renderer: disabled_off
surface_control: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.85GB (15.66GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (2)
Extension Author (truncated) Version
formate Mik 1.1.4
team ms- 1.161.0
We have written the needed data into your clipboard because it was too large to send. Please paste.

Activity

  1. mjbvz commented on Mar 9, 2020

    @mjbvz

    @Hopfenspirger Does this reproduce in the latest VS Code insiders build, which includes TS 3.8?

    If so, can you please share a small example project that demonstrates this?

  2. mahop-net commented on Mar 10, 2020

    @mahop-net
    Author

    Matt Bierner (@mjbvz) yes, it reproduces in latest VS Code insiders build. See the following sample and follow the steps in ./Project2/src/class2.ts to reproduce the issue.

    VsCode.zip

  3. Griffork commented on Mar 10, 2020

    @Griffork

    @Hopfenspirger does it work after a full build?

  4. mahop-net commented on Mar 11, 2020

    @mahop-net
    Author

    What do you mean with full build?
    (starting a full tsc build from the command line is working... It's only a problem for intellisense...)

  5. sheetalkamat commented on Jul 24, 2020

    @sheetalkamat
    Member

    When project is opened, we do not watch for changes to referenced project's files (added or removed files) which results in this. Would need some change in how we watch the referenced project's wild card directories.

  6. Griffork commented on Jul 30, 2020

    @Griffork

    Sorry for the late reply but I've found that doing build->build solution sometimes refreshes intellisense, causing new files to be picked up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Experience EnhancementNoncontroversial enhancementsFix AvailableA PR has been opened for this issueNeeds InvestigationThis issue needs a team member to investigate its status.RescheduledThis issue was previously scheduled to an earlier milestone

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions