Vs code auto indenting not working for python - python

I’m new to visual studio code, just switched from sublime text 3. I was writing a simple if statement and when I write else: like that, on ST3 it would move the else to under if but this doesn’t happen with vscode. I’ve tried everything and looked everywhere but doesn’t seem to work. Any ideas of why? Or does vscode really lack this basic fundamental feature?

This is a known issue that requires a non-trivial implementation of a custom indentation provider.

Related

My VSCode word wrapper width is too small. Word wrapping too soon

For some reason my word wrapping has gotten messed up in VSCode. The word wrap occurs after saving. I do like this feature but I need it to stop wrapping so soon. There is plenty of space left on the right side still. I have prettier installed and it is set to the default 80 line width. I have changed this and restarted VSCode and the problem remains the same. I have even disabled prettier and it is still doing this. I have also gone into the word wrapper for VSCode and ensured it was off. Can anyone tell me what is causing this and how to resolve it?
This...
should look more like this..
And in VSCode I have changed these things with no luck...
Also, I think this problem only exists in this current project. Maybe I installed a python extension causing this??
Maybe these...
This is a function of formatting. You can turn it off in settings.
Tips:
Pylance is the integration of Python and Jupyter Notebook extensions, both of which are official extensions of Microsoft. There is no problem keeping them. :)
The image below is located in the settings. This resolves my issue.
Also found here...
VS Code Python Formatting: Change max line-length with autopep8 / yapf / black

Why is VS Code showing "windll Windows only: Creates ()" intellisense suggestions?

While writing Python code on VS Code, it is showing suggestions like:
windll Windows only: Creates ()
I have tried to see if this was coming from snippet extension I might have installed but I don't think I have any... can anyone shine a light on why I am getting his code completion nonsense?
I had this same issue, every time :, ., def, or if is typed, there's annoying suggestions that don't make sense. I found out it's the Python Extended extension that's responsible for this. It seems to be reported on it's GitHub issues page, but for now I would disable the extension as it doesn't seem to be working at all for me. I recommend PyLance as a replacement.
It's the extension problem.
You have installed the extension named: Python Extended inside your vs code and you will need to uninstall it.
It works well on my editor after uninstalling this extension.

Problems when writing in SublimeText3

I used Visual Studio (VS) community as my first IDE. However, I did not like how slow it was. So I switched to Sublime Text. It is very fast. But, the two problems are when writing in python, the autocomplete feature does not work, (sometimes it does and sometimes doesn't) and the second problem is when writing in C# Console.Write("hello world");, it recognises this line (or any line) as normal text even though I have saved it as a C# file.
Please provide any help or suggestion in the comments section, thanks!

VS Code Python Syntax Highlighting Only Half Working

I've been using both VS Code and Sublime for a while now. I mostly do my python coding in Sublime and I have recently decided to try out VS Code. One issue though.
The syntax highlighting for python is not functioning in the manner I would expect. Here is a .py file opened in both VS Code and Sublime for comparison:
Sublime Text:
VS Code:
When comparing the VS Code syntax highlighting to that of Sublime, it appears to only function half correctly.
Tons of stuff that I would expect to receive some form of colored formatting such as function calls, function parameters etc all just appear as white text.
After looking at loads of VS Code python tutorials online, it would definitely seem something is wrong with my setup as everyone else seems to receive function calls/function paramters/etc syntax highlighting.
Troubleshooting progress so far:
I have the VS Code python extension installed.
I've tried uninstalling and reinstalling VS Code.
I've tried uninstalling and reinstalling Python extension.
I've tried installing the magicPython
extension.
Ensuring I have both python2 and python3 installed on my machine
Color theme is currently Dark+, however this behavior occurs with all
color themes.
Made sure the file ends in .py
I'm running on a Mac, if that's relevant.
Any help would be greatly appreciated. Thank you!
i think you just need to change your theme
check this one out https://github.com/sobolevn/dotfiles

vscode docstrings not appearing properly

I have no idea why I am experiencing this issue. In past projects (On a different computer with a different OS) I have had no issues displaying docstrings. When I write a docstring, it should show something like this.
Instead, my docstrings are not being formatted properly, and I am getting the following.
Any idea why this is happening and how to fix it? I am using VScode, and don't think anything needs to be installed to solve this. Thanks!
If you changed your language server that will shift how the docstrings get rendered (e.g. went from Jedi to MPLS or vice-versa). You can 👍 the issue tracking improving docstring support to help prioritize that work to try and handle this sort of thing.

Categories