‘Import “Path.to.own.script” could not be resolved Pylance (reportMissingImports)’ in VS Code using Python 3.x on Ubuntu 20.04 LTS

Pylance, by default, includes the root path of your workspace. If you want to include other subdirectories as import resolution paths, you can add them using the python.analysis.extraPaths setting for the workspace. In VS Code press <ctrl> + <,> to open Settings. Type in python.analysis.extraPaths Select “Add Item” Type in the path to your library … Read more

How to exclude file extensions and languages from “format on save” in VSCode?

You can use language specific settings to enable it for a specific language only, e.g. JavaScript: “[javascript]”: { “editor.formatOnSave”: true } To disable it for a specific language, you could switch the global default to true and combine it with a language-specific false: “editor.formatOnSave”: true “[javascript]”: { “editor.formatOnSave”: false } Note that language specific settings … Read more

Visual studio code cmd error: Cannot be loaded because running scripts is disabled on this system

I found out here that you can add to your visual studio code settings the following and the problem will vanish: For visual studio code settings, go to File -> Preferences -> Settings -> Extensions -> Scroll down and find “Edit in settings.json”. Do not forget to restart the visual studio code “terminal.integrated.shellArgs.windows”: [“-ExecutionPolicy”, “Bypass”] … Read more

How can you disable Gutter Indicators in VS Code?

It is possible to change it in settings.json Ctrl+, “scm.diffDecorations”: “all” | “gutter” | “overview” | “none” Or you can make them transparent: “workbench.colorCustomizations”: { // Gutter indicators (left) “editorGutter.modifiedBackground”: “#0000”, “editorGutter.addedBackground”: “#0000”, “editorGutter.deletedBackground”: “#0000”, // Scrollbar indicators (right) “editorOverviewRuler.addedForeground”: “#0000”, “editorOverviewRuler.modifiedForeground”: “#0000”, “editorOverviewRuler.deletedForeground”: “#0000” }

Make a keybinding to run previous or last shell commands

With vscode v1.69 and shell integration enabled, there is now a built-in command to do this (for supported shells). Eanble the setting Terminal > Integrated > Shell Integration: Enabled Set a shortcut for the command Terminal: Run Recent Command from the Keyboard Shortcuts editor. You should end up with a keybinding like this (in your … Read more