Visual Studio Code: highlighted imports in python - python-3.x

I use Visual Studio Code both on my work Windows laptop, and on my Ubuntu PC at home.
There's a functionality that I can see from my Windows vscode that I'd like to have on my Ubuntu one as well, but can't find whether it's a setting, extension, or something else.
The functionality is this: python imports are highlighted in green, and if they are not used, they are dimmed.
Windows screenshot, how I want it to work:
Ubuntu screenshot, how it currently is:
Does anyone know where I should look? I'm using the same colour theme on both, Monokai.
Thanks!

You will get the linting warnings by pip installing flake8.
You also need to add this setting to your settings.json file:
"python.linting.flake8Enabled": true

I fixed it by installing the extension Settings Sync and syncing settings and extensions of my two installations.
If it was an extension indeed, it probably was fixed by removing the Python Extension Pack and installing Python for VSCode.

Related

Cannot change node version in VS Code terminal

I'm working on Mac and I cannot change node version from terminal window in VS Code
What's interesting, when I open iTerm I have no problems with switching versions. So the problem only seems to appear on VS Code.
Any idea why and how to solve it?
vscode has a shell integration, which you can configure. e.g. placing the following configuration in your vscode settings
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe"
or you can use the shell launcher plugin, which supports launch multiple shell configurations in the terminal.

How can I activate code folding in spyder 4.0.1 when there is no checkbox in preferences/editor to do so?

I use WSL on my windows laptop and am perfectly fine to use spyder via VcXsrv. Current version: 4.0.1 - if I try to update to a newer version it tells me that 'all requested packages are already installed'. Additionally, I updated anaconda as suggested. I use python 3.7.9
However, there is neither code folding happening in the editor, nor can I activate it via tools-> preferences-> editor, tab 'display' where it is supposed to be. Searching for an answer, I found that other people also seem to be missing this option.

Visual Studio Code with Python for Windows AND Anaconda

I'm trying to use Visual Studio Code with both Anaconda and Python for Windows.
I have both installed, and I have the visual studio code extensions for both.
But no matter what I do now the Conda Base gets activated -
(base) PS C:\Users
even though the Python for Windows is the selected version
or if I try to activate an environment I get a mix of both, the venv with python for windows and the conda base activated.
(venv_iocparser) (base) PS C:\Users\
The settings.json file in this folder only has python for windows in the 'python.pythonPath'; with no mention of conda, but still activates the conda base.
Does anyone know a good article that walks through setting VSCode up with both? With python for windows as the default?
Thank you!
Had a similar issue. Its most likely since you installed VS Code with Anaconda, for some reason or another it just assumes thats what env you want when starting it.
To get out of it just run $ conda deactivate and then activate whatever env you want after that. I fixed it by changing the PATH for the python to only point at the non-conda versions though. I also had uninstalled it all and reinstalled it all at one point though.

How to enable color logs in nodejs program running in git-bash v.2.8.2 for windows?

I had been using Git for Windows 1.9.5 (installed from Git-1.9.5-preview20150319.exe). There was colored output from my nodejs program (gulp) in git-bash terminal. But when I uninstalled 1.9.5 and then installed 2.8.2 (Git-2.8.2-64-bit.exe) all output became monochrome except git-bash prompt line. How to utilize colored output in this newer 2.8.2 version? Or may be there is other suitable 2.x.x version (Visual Studio Code recommends this)
Create a Windows environment variable FORCE_COLOR and set it's value to true or 1.
This solved my issue and all other team-members using Windows who had the same colors problem.
Looks like the reason is in the new default type of terminal: MinTTY (the default terminal of MSYS2). The decision is to utilize a little bit modified (with regard to paths) version of the Git Bash.vbs file from version 1.9.5.

How to use the Intellij Node.js plugin with PyCharm?

I'm running PyCharm 3.0 commercial and I'm trying to install the Node.js plugin (which is supposed to work with PyCharm). I've followed the several different directions to install the plugin but after I successfully install the plugin and restart PyCharm nothing appears next to the help button (as the install instructions say they should happen) and nothing referencing Node appears in Settings -> Javascript.
I am using the commercial version so that isn't the problem.
I'm using the newest version so that shouldn't be a problem.
I'm on MacOSX 10.8
NodeJS icon was removed from the toolbar in PyCharm 3.0 as NodeJS isn't a primary instrument for Python developers. It only about visual presentation. Node.js settings can be found in Settings | JavaScript | Node.js.

Resources