microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.27k stars 28.57k forks source link

Selecting typescript version does not work in a npm workspace #208005

Closed birgersp closed 5 months ago

birgersp commented 5 months ago

Type: Bug

In a simple VSCode workspace, where the npm packages are also in a (npm) workspace...

Layout:

someproject/
    server/
        package.json
        src/
            main.ts
    package.json
    myworkspace.code-workspace
// someproject/package.json
{"workspaces":["client","server"], "private":true}
// someproject/server/package.json
{"name":"server","version":"0.0.1","devDependencies":{"typescript":"5.4.2"}}
// someproject/someproject.code-workspace
{
    "folders": [
        {
            "path": "server"
        }
    ],
}

I can't properly select the typescript version.

Initially, there is no choice for the "5.4.2" version that the "server" package uses:

image

That's fine, I'll add it to the settings:

image

Now it's there:

image

But still, VSCode doesn't actually use 5.4.2:

image

I suspect VSCode doesn't actually find the proper Typescript version, residing at "server/../node_modules/ ...", because it doesn't follow the path properly.

Please investigate.

VS Code version: Code 1.87.2 (863d2581ecda6849923a2118d93a088b0745d9d6, 2024-03-08T15:14:59.643Z) OS version: Linux x64 6.6.10-76060610-generic Modes:

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 9 5900HX with Radeon Graphics (16 x 4438)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
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: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|4, 2, 1| |Memory (System)|30.77GB (13.71GB free)| |Process Argv|common/workspace.code-workspace --crash-reporter-id 520cd888-4442-495f-b3df-0c75b54d903c| |Screen Reader|no| |VM|0%| |DESKTOP_SESSION|pop| |XDG_CURRENT_DESKTOP|Unity| |XDG_SESSION_DESKTOP|pop| |XDG_SESSION_TYPE|x11|
Extensions (29) Extension|Author (truncated)|Version ---|---|--- classdiagram-ts|Ale|0.1.67 tsco|alj|1.0.29 vscode-tailwindcss|bra|0.10.5 vscode-eslint|dba|2.4.4 yapf|eey|2023.12.104100706 relative-goto|Enk|0.5.4 prettier-vscode|esb|10.1.0 backticks|fra|1.7.0 copilot|Git|1.174.0 copilot-chat|Git|0.13.1 git-graph|mhu|1.30.0 vscode-docker|ms-|1.29.0 debugpy|ms-|2024.2.0 python|ms-|2024.2.1 vscode-pylance|ms-|2024.3.1 remote-containers|ms-|0.348.0 remote-ssh|ms-|0.109.0 remote-ssh-edit|ms-|0.86.0 remote-wsl|ms-|0.86.0 vscode-remote-extensionpack|ms-|0.25.0 remote-explorer|ms-|0.4.3 remote-server|ms-|1.5.1 sqltools|mtx|0.28.1 sqltools-driver-pg|mtx|0.5.2 prisma|Pri|5.11.0 multi-command|ryu|1.6.0 pretty-ts-errors|Yoa|0.5.3 go-to-next-error|yy0|1.0.7 sort-js-object-keys|zen|1.0.6 (1 theme extensions excluded)
A/B Experiments ``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492cf:30256860 vscod805:30301674 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:30899288 c4g48928:30535728 azure-dev_surveyone:30548225 962ge761:30959799 pythongtdpath:30769146 welcomedialogc:30910334 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30936856 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 2e7ec940:30986170 pythontbext0:30879054 accentitlementst:30887150 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 pydisww1:30991133 cppperfnew:30979542 d34g3935:30971562 fegfb526:30981948 bg6jg535:30979843 ccp2r6:30958158 dsvsc020:30976470 7ghi1836:30988842 ```
mjbvz commented 5 months ago

Did you select the workspace version in the version selector? The setting is needed to discover a server outside of the current workspace but we don't switch to it automatically

birgersp commented 5 months ago

Thanks for the follow-up. Sorry, it was an error on my end, my bad.