For some reason Prettier breaks the line with comments moving everything after opened braŃket on new line. Here is before And here is after As you can see it makes kind of random formatting: at the 1st line it moves comments to a line above, then it breaks line by brackets, then again moves comments above. I found here How
Tag: visual-studio-code
VSCode not using test database for Django tests
I’ve got an issue where VSCode’s test feature uses the production database instead of creating a test database. tests.py I have previously created 1 instance of SomeModel, so if you do SomeModel.objects.all() in the shell, it returns a queryset with that one instance. If I run this test from vscode’s tester it will fail. And when I debug it, I
When I write python code in terminal it only prints older version of the file (VScode)
Just recently got into python and I’m having trouble understanding what’s going on. When I write print(“hello world”), I input python3 name.py in the terminal and it prints. However when I change the str to (e.g.) “bye”, and input the same thing in the terminal, it still prints hello world. Why isn’t it updating? Thanks Answer After you modify the
How to add the module path used by the python script in the Makefile?
I want to add command to run python script inside Makefile. Below is the directory structure. Among them, analyze_log.py uses the classes in tools/fileOp.py. I used the method below at first, but when I execute python analyse_log.py in the directory where analyse_log.py is, it is correct. But when I use the above Makefile to execute, then it doesn’t work. Of
VS Code indent or tabSize problem with error color
You can see in the image tab size problem or indent, why the red colour or error colour on the indent? How to fix the problem/error? you can see red color error Answer The problem is because you have the indent-rainbow extension installed, which makes multiple indents in your code highlighted in different colors. And the reason your indentation is
Outputting on multiple lines and I need each line to be assigned to its own variable
The code below takes dna_string2 and matches it within dna_string1. It then outputs the index location of the match or matches and then increments then return value by 1 to simulate “counting itself”. The problem I am facing is that I need the output values of 2, 4, and 10 to be assigned to their own variables. I cannot figure
How does the VS Code Python “justMyCode” debugger feature determine which code belongs to the user?
Visual Studio Code offers a debugger launch option called justMyCode which allows – if set to false – to step-into non-user written code when debugging. The documentation says: When omitted or set to true (the default), restricts debugging to user-written code only. Set to false to also enable debugging of standard library functions. But this doesn’t seem to include only
R not attached in VS Code on Win10
I am recently switching from RStudio to VS Code. I have installed R extension in VS Code, but when I open VS Code and R terminal, R cannot be loaded. I followed coip’s method but still cannot get R loaded: ############################################################################## I followed coip’s suggstion and R is successfully activated. In another of my laptop (Win), R could be activated
import cv2 not working in vscode but working in pycharm
I got import cv2 to work on pycharm but for some reason it does not work on my visual studio code despite doing the same thing I did with pycharm which was to pip install opencv-contrib-python on a virtual enviroment. I created a virtual enviroment in vscode and the file is part of my project file and I selected the
Vscode will not autofocus on integrated terminal while running code
When I run without debugging in python on vscode it no longer autofocuses on the terminal forcing me to click into the terminal everytime to input data. Is there any solution to cause vscode to autofocus when code is running? Answer Two Fixes/Workarounds I utilized. Autohotkey Script: Or Rebind: View: Toggle Terminal Originally (Ctrl + ~) to F5 so jumps