Page 1 of 1

Renaming file results in error

PostPosted: September 6th, 2018, 3:15 pm
by lvw
Hi,

When renaming a file through the Solution Explorer it asks to perform a rename in this project of all references to the code element.

When pressing Yes it always throws me an error:
Identifier does not match element at given position.
Parameter name: oldValue

Then pressing (the only option) OK, it doesn't actually update anything in code.

PHP Tools 1.29.10924.2017
VS Enterprise 2017 15.8.2

Re: Renaming file results in error

PostPosted: September 24th, 2018, 9:46 am
by Miloslav Beno
Hi,

Thanks for reporting this. I've just tried it and was unable to replicate. Does it happen to you regularly in all the files or just in some particular file?

Thanks!

Re: Renaming file results in error

PostPosted: September 24th, 2018, 10:24 am
by lvw
Thank for your reply, this happens when renaming files that contain a class or interface only, not when renaming files that contain loose scripts.

I think it tries to rename the class/interface name and the references in code to this class/interface but fails to do so. The actual file is renamed in the end.

See attachment for steps i take.

This also happens in other projects i have

Re: Renaming file results in error

PostPosted: September 24th, 2018, 12:12 pm
by Miloslav Beno
Thanks so much!

I've been able to reproduce. This happens when the class is in a namespace. We will fix that.

I will ping you once it's done.

Cheers,