phptools-docs icon indicating copy to clipboard operation
phptools-docs copied to clipboard

Autocomplete for variable deletes code that follows that is not selected, for no reason

Open php4fan opened this issue 1 year ago • 3 comments

This is an absolute disaster.

I have this code: image

My cursor, as can be seen, is right before the is_array() call in the first if condition.

I want to add another condition right before that, that is $fetchImageInfo &&, which is a variable that exists.

So, I start typing the variable and I get the expected autocomplete suggestion:

image

Then I hit Enter to accept it, and KABOOM!!

image

That DELETES the is_array that came after.

I think this is a regression

php4fan avatar Aug 22 '24 16:08 php4fan

I think this is handled by VSCode itself. It sees the entire character sequence as a single word, so it replaces it.

jakubmisek avatar Aug 23 '24 12:08 jakubmisek

I just tried an Extension bisect and I can't reproduce when the DEVSENSE extension is disabled.

image

php4fan avatar Aug 23 '24 14:08 php4fan

interesting :) let's see why we do that ... I guess we just replace the entire token on position (for legacy reasons)

jakubmisek avatar Aug 24 '24 15:08 jakubmisek

Friendly reminder that this issue still exists

php4fan avatar Oct 30 '24 16:10 php4fan

thank you @php4fan - getting there :)

jakubmisek avatar Nov 11 '24 14:11 jakubmisek

fixed! will be in the next update

jakubmisek avatar Nov 16 '24 17:11 jakubmisek