Conversation
|
What do you think about this approach? I started with yielding No unit tests are provided yet. |
| use Microsoft\PhpParser\ResolvedName; | ||
| use Phpactor\ClassMover\ClassMover; | ||
| use Phpactor\ClassMover\Domain\Name\QualifiedName; | ||
| use Phpactor\Extension\Core\Application\Helper\ClassFileNormalizer; |
There was a problem hiding this comment.
would be better not to couple to this class here (most anything here is legacy). Instead you can use/update the adapter in this package: ClassToFileUriToNameConverter
| public function __construct(TextDocumentUri $documentUri, TextEdit $textEdit, ?TextDocumentUri $newDocumentUri) | ||
| { | ||
| $this->documentUri = $documentUri; | ||
| $this->newDocumentUri = $newDocumentUri; |
There was a problem hiding this comment.
I think this is bending the resposibility of this class a bit...
|
Some other approaches:
Pros/cons:
|
- pass returned value from RenameHandler to LocatedTextEditConverter
|
Indeed, we don't need to modify Maybe |
| ) | ||
| ); | ||
| } | ||
| $documentEdits[] = new RenameFile( |
There was a problem hiding this comment.
this should be conditional i think, not all renames involve a file rename
There was a problem hiding this comment.
(if rename old URL != new URL?)
There was a problem hiding this comment.
Looking for this case I also added quick (currently silent i.e. no exception is thrown to catch by the handler and notify the client) return when the original name equals the new.
https://github.com/phpactor/phpactor/pull/1379/files#diff-44acedae8f3be2f84c97421b00bde9016131dd4a65c4909c475420683c235b52R85-R89
|
nice! are you happy to add tests? |
|
Please look at (currently anonymous) |
|
seems to work great, thanks! |
|
Thanks for support and merging! |
Closes #1366