Skip to content

TypeScript code suggestions include inaccessible private fields from base classes #61462

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
yume-chan opened this issue Mar 21, 2025 · 1 comment
Labels
Bug A bug in TypeScript Help Wanted You can do this
Milestone

Comments

@yume-chan
Copy link
Contributor

yume-chan commented Mar 21, 2025

Type: Bug

For the following code:

class A {
    #v = 0;
}

class B extends A {
    f() {
        v // here
    }
}

Invoke "Trigger Suggestion" at comment position, it will include #v (this.#v), which is inaccessible in class B.

This issue doesn't happen in TypeScript playground, only in VSCode.

Image

VS Code version: Code - Insiders 1.99.0-insider (90dde06fb64726923ebef8121bd63836529b7d8b, 2025-03-20T07:42:45.872Z)
OS version: Windows_NT x64 10.0.26100
Modes:

System Info
Item Value
CPUs AMD Ryzen 7 8845HS w/ Radeon 780M Graphics (16 x 3793)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 31.29GB (15.45GB free)
Process Argv
Screen Reader no
VM 0%
Extensions disabled
@mjbvz mjbvz transferred this issue from microsoft/vscode Mar 21, 2025
@mjbvz mjbvz removed their assignment Mar 21, 2025
@RyanCavanaugh RyanCavanaugh added Bug A bug in TypeScript Help Wanted You can do this labels Mar 21, 2025
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Mar 21, 2025
@Arya-A-Nair
Copy link

@RyanCavanaugh would like to work on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

4 participants