DEVSENSE / phptools-docs

PHP Tools public content
Apache License 2.0
77 stars 10 forks source link

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

Open php4fan opened 4 weeks ago

php4fan commented 4 weeks ago

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

jakubmisek commented 3 weeks ago

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

php4fan commented 3 weeks ago

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

image

jakubmisek commented 3 weeks ago

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