Open zzdywc opened 9 months ago
Hey @zzdywc , Could you please provide a more detailed example that covers the range of codes you want to comment out, your expected behavior, etc That will help me reproduce this issue, thanks!
code sample as shown:
x = []
for i in range(100):
print(i)
print(i/10)
x.append(i)
if(i == 10):
print("yes")
print("end")
normal comments like:
x = []
for i in range(100):
print(i)
'''
print(i/10)
x.append(i)
'''
if(i == 10):
print("yes")
print("end")
select code:
print(i/10)
x.append(i)
press shift+alt+A
, and will add comment symbol like this:
x = []
for i in range(100):
print(i)
"""
print(i/10)
x.append(i)
"""
if(i == 10):
print("yes")
print("end")
This code make if
work improperly.
It seems like comment will added one space before the starting position and The last space of the end position of which have been selected. though this logic work fine with orther language like c etc. but not work on language that relies on indentation.
I don't know what logic is the best, but in my opinion, add new line at the bothstart position and end postion of which have been selected, and than add comment symbol '''
at the new line with properly indentation will fix this problem.
Thanks for the issue, I can repro it
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
for
orwith
block code or any indented code. and the'''
will on the top of line witch is not correct.example figure.![image](https://github.com/microsoft/vscode/assets/50517455/be13e1e6-229d-4983-9b9a-2d4d70d2b4a6)