pdt icon indicating copy to clipboard operation
pdt copied to clipboard

Randomly completely messes up imports and class declaration

Open pounard opened this issue 4 years ago • 6 comments

Since as far as I can remember; when I type very fast lots of code, then hit CTRL+Shift+O to re-organise imports and auto-imports, it randomly removes everything at the top of the file, and leave incomplete and invalid PHP code with partial imports mixed with random code from lower in the file at the top, starting from where was the first modified import (untouched ones above remain, it's not the "you have invalid PHP so I remove all imports" bug).

It happens when I type code, hit CTRL+s then CTRL+Shift+o repeatedly and very close to each other.

How to reproduce ? Can't tell, this is very random, although it happens very often.

It does look like a lot like asynchronous/threaded code walking on each other kind of bug.

pounard avatar Jul 03 '20 07:07 pounard

Hum, I will copy/paste messed up code when it happens. It's so random, I cannot do it on-demand.

pounard avatar Jul 03 '20 07:07 pounard

Have you something in logs?

zulus avatar Jul 10 '20 11:07 zulus

I'll try to reproduce it and report back you once I succeeded.

Which log do I have to watch and copy/paste to you ?

pounard avatar Jul 10 '20 13:07 pounard

Window -> Show view -> Other -> error log

Exception reported during this operation (if any), this might be NPE :)

zulus avatar Jul 10 '20 13:07 zulus

I'm not using this feature because not working well with Doctrine plugin, but I'm afraid I'll be forced to rewrite it for new model.

zulus avatar Jul 10 '20 13:07 zulus

I'm using it a huge lot, I have a few tocs, such as pressing ctrl+s constantly, and I do use ctrl+shift+o a lot because it auto-imports all missing types, it's the feature I use the most I think.

pounard avatar Jul 11 '20 14:07 pounard