Skip to content

Copying .ts files and renaming them confuses TypeScript #40616

@oliversalzburg

Description

@oliversalzburg

Issue Type: Bug

I encounter this in other circumstances, but the easiest way to reproduce this for me is in this small repro project I was building recently: https://github.com/oliversalzburg/mixin-mikro-orm

I would usually run a tsc --watch as a task in VSC, but in this project a yarn build:watch would achieve the same thing.

When I create copies of .ts files, like those in the entities folder, and then rename them (to create a similar entity), this will sooner or later trip up TypeScript in VSC. This manifests in an error in the problems panel:

File '/tmp/mixin-mikro-orm/src/entities/Other copy 2.ts' not found.

The error points to tsconfig.json line 1.

The file reported as missing does expectedly not exist and I need to reload the TS server to recover from this.

This is not a recent regression. It has been happening for me for a long time.

VS Code version: Code 1.48.1 (3dd905126b34dcd4de81fa624eb3a8cbe7485f13, 2020-08-19T17:12:13.244Z)
OS version: Windows_NT x64 10.0.19041
Remote OS version: Linux x64 4.19.104-microsoft-standard
Remote OS version: Linux x64 4.19.104-microsoft-standard

System Info
Item Value
CPUs Intel(R) Core(TM) i7-6850K CPU @ 3.60GHz (12 x 3592)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 63.87GB (34.26GB free)
Process Argv
Screen Reader no
VM 0%
Item Value
Remote WSL: Ubuntu
OS Linux x64 4.19.104-microsoft-standard
CPUs Intel(R) Core(TM) i7-6850K CPU @ 3.60GHz (12 x 3591)
Memory (System) 50.11GB (35.04GB free)
VM 0%
Item Value
Remote WSL: Ubuntu
OS Linux x64 4.19.104-microsoft-standard
CPUs Intel(R) Core(TM) i7-6850K CPU @ 3.60GHz (12 x 3591)
Memory (System) 50.11GB (35.04GB free)
VM 0%
Extensions (35)
Extension Author (truncated) Version
eslint-disable-snippets drK 1.2.0
output-colorizer IBM 0.1.2
vscode-docker ms- 1.5.0
remote-containers ms- 0.134.1
remote-ssh ms- 0.51.0
remote-ssh-edit ms- 0.51.0
remote-wsl ms- 0.44.4
vscode-remote-extensionpack ms- 0.20.0
vscode-icons vsc 10.2.0
vscode-zipfs arc 2.0.0
better-toml bun 0.3.2
vscode-eslint dba 2.1.8
xml Dot 2.5.1
eslint-disable-snippets drK 1.2.0
gitlens eam 10.2.2
EditorConfig Edi 0.15.1
prettier-vscode esb 5.1.3
generateuuid Fir 0.0.5
shell-format fox 7.0.1
terraform has 2.2.0
vscode-drawio hed 0.7.2
vscode-esformatter how 1.6.0
output-colorizer IBM 0.1.2
code-beautifier mic 2.3.3
vscode-lebab mrm 2.6.0
vscode-puglint mrm 2.3.0
vscode-docker ms- 1.5.0
csharp ms- 1.23.1
cpptools ms- 0.29.0
hexeditor ms- 1.2.1
js-debug-nightly ms- 2020.8.1917
vscode-paste-image mus 1.0.4
vscode-graphql Pri 0.2.35
vscode-yaml red 0.10.0
lit-plugin run 1.2.1

(2 theme extensions excluded)

Metadata

Metadata

Labels

Needs More InfoThe issue still hasn't been fully clarified

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions