1

Today I installed VS code to learn python. I installed Code Runner extension and some how I disabled the 'run' icon which is shown in the top right corner. I have been trying for several hours. How can I get it back again?

My Home page of VS

I tried to schange the settings. But the icon is not coming. I know that ctrl+alt+N runs the code.But I need the icon back.

JialeDu
  • 6,021
  • 2
  • 5
  • 24
  • Have you tried restarting vscode? Can you show your settings.json (ctrl+shift+p --> `Preferences: Open User Settings (JSON)`)? – JialeDu Nov 03 '22 at 06:05
  • Does the icon appear? Did my answer help you? – JialeDu Nov 04 '22 at 02:41
  • Thanks for your response. I am still stumbling. My settings.json: { "workbench.colorTheme": "Dracula", "tabnine.experimentalAutoImports": true, "editor.fontSize": 15, "gitlens.defaultDateLocale": "system", "gitlens.defaultDateFormat": null, "gitlens.defaultDateShortFormat": null, "gitlens.defaultTimeFormat": null, "code-runner.runInTerminal": true, "editor.minimap.size": "fit", "editor.minimap.showSlider": "always"} – Monon Rahman Nov 04 '22 at 10:42
  • `Ctrl + Shift + P --> Open Settings.` There are two settings.json file [here](https://i.imgur.com/MsB4ZYD.png) (workspace and user), can you show the content of these two files? – JialeDu Nov 07 '22 at 01:25

2 Answers2

0

Maybe you haven't installed Microsoft's official Python extension. It is officially recommended to use the python extension to run python code.

The Code Runner extension you install can also run multiple languages. After looking around I found such a setting that controls whether the "Run Code" icon is displayed in the editor header menu.

    "code-runner.showRunIconInEditorTitleMenu": true

enter image description here

Please check in your settings.json if this setting exists and it is set to false. If so, please modify the value to true. If not, add it and set it to true.

Finally, I still recommend that you download and use the Python extension. Code Runner can be used as an auxiliary.

JialeDu
  • 6,021
  • 2
  • 5
  • 24
  • I just checked that, the icon is showing for other windows except the python file. If the file is PHP or other extensions it is all right. – Monon Rahman Nov 04 '22 at 11:24
0

It was hidden in my case as well.

In the upper right corner of your editor you should see three dots. Click the dots, and select the option run or debug.

dot menu

You should now be able to see the code runner button in the titlebar.

Lewi Uberg
  • 1,055
  • 7
  • 14