microsoft / vscode

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

"Restart TS server" is not possible when no Typescript-file is in view #201878

Closed birgersp closed 8 months ago

birgersp commented 8 months ago

Type: Bug

  1. Create or open a Typescript file: new file -> change language mode to Typescript
  2. Open the command palette and search for "Typescript: Restart TS server"
  3. Observe that the command is there
  4. Close the Typescript file, be careful not to have a Typescript file open
  5. Repeat step 2; search for the "Typescript: Restart TS server" command
  6. Observe that the command is gone (not selectable)

Why is this a problem?

The reason I want to restart the TS server, is that the "Problems" view can contain errors that the TS compiler picked up which are now resolved.

So, how can I "refresh" the "Problems" view? Answer; Restart TS server.

But I can't do that without a TS file opened, so now I am stuck with a bunch of "fake" problems in the "Problems" view that I can't get rid of.

Solution: Remove the "a TS server must be active" condition, allowing the "TS server" to be restarted from the command palette regardless

VS Code version: Code 1.85.1 (0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2, 2023-12-13T09:47:11.635Z) OS version: Linux x64 6.6.6-76060606-generic Modes:

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 9 5900HX with Radeon Graphics (16 x 4466)| |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
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|1, 1, 1| |Memory (System)|30.77GB (14.08GB free)| |Process Argv|be-services/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 (26) Extension|Author (truncated)|Version ---|---|--- tsco|alj|1.0.29 vscode-tailwindcss|bra|0.10.4 vscode-eslint|dba|2.4.2 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.144.0 copilot-chat|Git|0.11.1 git-graph|mhu|1.30.0 vscode-docker|ms-|1.28.0 python|ms-|2023.22.1 vscode-pylance|ms-|2023.12.1 remote-containers|ms-|0.327.0 remote-ssh|ms-|0.107.1 remote-ssh-edit|ms-|0.86.0 remote-wsl|ms-|0.81.8 vscode-remote-extensionpack|ms-|0.25.0 remote-explorer|ms-|0.4.1 remote-server|ms-|1.5.0 sqltools|mtx|0.28.1 sqltools-driver-pg|mtx|0.5.2 prisma|Pri|5.7.1 multi-command|ryu|1.6.0 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 vsreu685:30147344 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492cf:30256860 vslsvsres303:30308271 vshan820:30294714 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593cf:30376535 py29gd2263:30899288 vsclangdf:30486550 c4g48928:30535728 azure-dev_surveyone:30548225 89544117:30613380 962ge761:30917236 pythongtdpath:30769146 i26e3531:30792625 welcomedialogc:30910334 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2cf:30928864 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 h48ei257:30885898 pythontbext0:30879054 accentitlementst:30887150 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 aa_t_chat:30882232 dsvsc019cf:30917260 cp7184t3:30927821 ```
VSCodeTriageBot commented 8 months ago

The described behavior is how it is expected to work. If you disagree, please explain what is expected and what is not in more detail. See also our issue reporting guidelines.

Happy Coding!

mjbvz commented 8 months ago

bunch of "fake" problems

That's the real issue: #182126. You should not need to run restart as a normal part of your workflow

The behavior of the command itself is expected