-
Notifications
You must be signed in to change notification settings - Fork 30.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wrong indentation detection for python #62464
Comments
(Experimental duplicate detection) |
The auto indentation rules come from the Python extension. Please file the issue there: https://github.com/Microsoft/vscode-python/issues. Thanks! |
This issue is caused by an extension, please file it with the repository (or contact) the extension has linked in its overview in VS Code or the marketplace for VS Code. See also our issue reporting guidelines. Happy Coding! |
i've tried disable all the extensions and reload the window, the problem still there. |
Same here. The detected indentation is wrong, regardless of the python extension being enabled or not. |
I'm encountering a very similar (probably the same) issue in markdown: #65043 |
I'm also encountering this issue.
import contextlib
@contextlib.contextmanager
def readonly_odb(odbpath):
import odbAccess
odb = odbAccess.openOdb(path=odbpath, readOnly=True)
try:
yield odb
finally:
odb.close()
def testodb(odbpath):
import odbAccess
with readonly_odb(odbpath) as odb:
pass
def main():
testodb(r"C:\temp\smalloutput\BF-K11_004-p03_d90_2019-03-10.odb")
pass |
This does not trigger the bug, it is detected as 4 spaces: class Foo:
def bar(self):
pass This does trigger the bug and is detected as 8 spaces: def foo():
for i in range(3):
print(i) All extensions are disabled. It is the parenthesis on the first line that makes the difference! If I remove the () from the "def foo():" then without changing anything else it would correctly detect it as 4 spaces! |
Can confirm. All my pytest files are quite annoying to deal with because of this. |
please fix this problem, it's really annoying...... :( |
on macOS 10.14.4/Ubuntu 17.04, vscode 1.33.1 def foo:
for i in range(3):
print(i) is wrong too |
I have the same problem (Win 10 1809) vscode 1.33.1 I'm pretty sure this worked correctly in the past. |
Just ran into this with 1.34.0 on Ubuntu 18.04.2. Quite annoying especially in Python. I disabled all extensions and it still happens. Version: 1.34.0 To reproduce create
Save, close and re-open
Workaround: Disable |
I can confirm the same behavior on my side. Version: 1.36.0 |
Close in favor of #62143, which is fixed in master already. |
Issue Type: Bug
open a file including these line:
vs code will detect the indentation as
Spaces: 8
, where the correct indentation setting should be 4 spaces.VS Code version: Code 1.28.2 (7f3ce96, 2018-10-17T00:20:56.183Z)
OS version: Linux x64 4.15.0-38-lowlatency
Extensions (13)
The text was updated successfully, but these errors were encountered: