PTVS icon indicating copy to clipboard operation
PTVS copied to clipboard

Autocomplete after open brackets replaces entire line of code

Open vsfeedback opened this issue 3 years ago • 17 comments

This issue has been moved from a ticket on Developer Community.


[severity:It bothers me. A fix would be nice] [regression] [worked-in:Visual Studio 2019 v. 16.11.6] Visual Studio Community 2022 Current v. 17.0.0 (Windows) in conjunction with the Python extension contains the following bug: If auto-completion / IntelliSense is used after open brackets, not only the word is completed and inserted, but the entire line of code is deleted and overwritten with the word.

Simple example: testword = "This is a test." print (testw ... #use of IntelliSense leads to ==> testword

The bug does not occur in Visual Studio Community 2019 (Python) and Visual Studio Code (Python).


Original Comments

Feedback Bot on 11/15/2021, 00:17 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.


Original Solutions

(no solutions)

vsfeedback avatar Nov 16 '21 20:11 vsfeedback

I'm able to repro this in VS2022. The entire line doesn't get replaced, BUT the opening parens does, which is definitely a bug.

AdamYoblick avatar Nov 18 '21 23:11 AdamYoblick

So, after 3 months its still not fixed?

Stroichik avatar Feb 22 '22 21:02 Stroichik

Hi @Stroichik ! Unfortunately, our team has limited capacity at the moment, and we have to prioritize our backlog accordingly.

We appreciate your patience. We also welcome contributions fyi 😄

AdamYoblick avatar Feb 23 '22 00:02 AdamYoblick

Can't help you on that, since i`m just learning basics. Was very surprised when i found this bug in VS22, so had to switch to other IDE to continue learning Python without accidently erasing whole lines of code. So u dont really want someone like me to accidently commit on release branch :)

Stroichik avatar Feb 23 '22 03:02 Stroichik

H! Any news on this, it´s quite annoying and it makes you stay away from the intellisense/autocomplete (which it seems not like at all).

MartinLith avatar Mar 07 '22 21:03 MartinLith

No updates yet, as I’ve been working on python 3.10 support. Our capacity has been a little low lately, so bug fixes are taking longer than anticipated. My apologies.

This is the next bug I will look at once all the 3.10 kinks have been worked out. Thanks :)

AdamYoblick avatar Mar 07 '22 22:03 AdamYoblick

Hi Adam, thanks you for your answer!

No problem! i´m glad to hear that this is next up and i´m looking forward to a solution.

Martin

MartinLith avatar Mar 12 '22 21:03 MartinLith

I believe this is an LSP client bug in Visual Studio. I've created an internal bug to track this at https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1528198.

AdamYoblick avatar Apr 22 '22 19:04 AdamYoblick

Sorry my last comment wasn't clear. Reproing this bug is blocked by another bug which is preventing variables from showing up in the intellisense completion list. That bug doesn't belong our team, so we're waiting on a fix from the VS team before I can continue with this one. Apologies for the delay.

AdamYoblick avatar Apr 26 '22 21:04 AdamYoblick

I'm on version 17.1.3 and the completion lists populate no problem. The bug is still present, i.e. selecting an item from the list eats the closing bracket and the following operator, if there is one. See the attached video.

https://user-images.githubusercontent.com/51301749/165670452-10bf2208-4834-49ca-b014-29b6c48fc384.mp4

.

marcinchady avatar Apr 28 '22 03:04 marcinchady

After looking for workarounds I ended here, I have both of the problems presented by vsfeedback and marcinchady, when using autocomplete function inside a list, tuplet or set the end of the bracket get deleted if there are quotes or doubles quotes those get deleted too. As for inserting arguments in functions hitting autocomplete overwrite the previous characters. I hope your team can address this bug soon, at least now I know that is something I just have to bear with instead of a feature I didn't set up correctly.

VintageStep avatar May 04 '22 17:05 VintageStep

Thank you for the information everyone. I've spoken with the Visual Studio team and this is actually happening in some other languages as well, so we believe this is not a PTVS-specific bug. I'm going to create a bug for the VS team to look at. In the meantime, if this happens to anyone else, be sure to create a feedback ticket through VS. Thanks :)

AdamYoblick avatar May 05 '22 22:05 AdamYoblick

Any updates on this? This bug has still not been fixed and while I love Visual Studio, I have no choice but to change to another IDE where the autocomplete feature actually works

SpookyWookyMan avatar Jul 09 '22 21:07 SpookyWookyMan

Apologies, there was some confusion around where this bug actually is and who owns it. This is my current task and I will get it fixed one way or another 😄

AdamYoblick avatar Jul 13 '22 18:07 AdamYoblick

We looked into this further and the bug seems to be in an external team. We've spoken to the team and the bug now has proper ownership. I will stay on top of it to make sure it gets fixed.

AdamYoblick avatar Jul 14 '22 22:07 AdamYoblick

And..... This is not solved yet......?

az5078 avatar Sep 10 '22 03:09 az5078

Gotta say given that IME IntelliSense hasn't ever worked right with Python I'm not holding my breath :P At least this (new) IntelliSense problem is better than the old one. The old one could easily result in invalid variable names that you don't catch until the code fails, while this one is usually immediately obvious when the line changes drastically.

TheRealQuantam avatar Sep 10 '22 03:09 TheRealQuantam

I've been having this issue for a couple of weeks and i have been trying to solve the issue. This is the only information i can find online about this issue.. which still isn't fixed.....

JamieSimWin avatar Oct 20 '22 08:10 JamieSimWin

Hi all, this is a Visual Studio fix, not a PTVS one. Their team had some urgent fixes they had to make that had higher priority than this one. They will be working on this for a future release of Visual Studio. I will reply back when it gets fixed 😄

AdamYoblick avatar Oct 27 '22 22:10 AdamYoblick

Currently having this issue on a fresh install of Visual Studio 2022 in all languages, mostly just tried the C languages. I can't even edit anything without having to retype the entire line of code because everything gets typed over instead of shifted. Any updates when this might be fixed?

ReineWahrheit avatar Dec 20 '22 16:12 ReineWahrheit

The issue is still there. I am currently on a fresh install of VS 2022 and it is still happening.

bluehatgeek avatar Feb 06 '23 02:02 bluehatgeek

Hi everyone, I'm trying to reproduce this locally on the latest internal build of visual studio and I can't repro it anymore. It seems the visual studio team has fixed the issue. See below:

pythonAQutocomplete

The version of VS I'm on is 17.6 Preview 2. 17.6 will be available to the general public on 5/16.

AdamYoblick avatar Feb 06 '23 17:02 AdamYoblick

Checked in Visual Studio Preview 17.5 with ONLY the python development workload and tested it. Could not repro this issue.

Install Details,

Microsoft Visual Studio Community 2022 (64-bit) - Preview Version 17.5.0 Preview 6.0 VisualStudio.17.Preview/17.5.0-pre.6.0+33402.96

hitarthdoc avatar Feb 18 '23 17:02 hitarthdoc

@AdamYoblick Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.4.4 (Win) Python Autocomplete messes up constantly. Picks up variables to suggest from time to time only, removes pieces of code around. Here's a simple example:

https://github.com/microsoft/PTVS/assets/44836679/88bed1c6-7489-49c7-a213-3aa4c25aa113

CaligoLab avatar Oct 23 '23 05:10 CaligoLab

@CaligoLab Thank you for reporting this. I will try to repro with the latest version of VS again. 👍

AdamYoblick avatar Oct 26 '23 21:10 AdamYoblick

@CaligoLab The version you reported this issue in is 17.4.4. I tested previously in 17.6 and couldn't repro this. I just tested again in 17.9 and also couldn't repro it.

Someone else in the comments tested in 17.5 and also couldn't repro.

So I believe this issue is fixed. Can you please try to update your Visual Studio to at least 17.5 or 17.6 and try again?

AdamYoblick avatar Oct 26 '23 21:10 AdamYoblick

This issue was closed because it has been stalled for 30 days with no activity. If the issue still persists, please reopen with the information requested. Thanks.

github-actions[bot] avatar Nov 26 '23 00:11 github-actions[bot]