deakjahn / vscode-php-allfactor

Comprehensive PHP refactoring (Visual Studio Code)
https://marketplace.visualstudio.com/items?itemName=tramontana.php-allfactor
1 stars 0 forks source link

Ability to disable some features #7

Closed AndreiOrmanji closed 1 year ago

AndreiOrmanji commented 1 year ago

Description: I would like to disable some features of the extension, if I have another one that does the same better (as rename feature for example). Is it possible to do so(at least for the time the extension is in early development period)?

deakjahn commented 1 year ago

If there are multiple providers for the same purpose, it's VS Code's job to present you a list so that you can select which one to use.

AndreiOrmanji commented 1 year ago

As far as I know currently there is no possibility to select it (correct me if I'm wrong please). It's a feature of kind "nice to have" can improve UX. If you do not see any profit of having such option, you can close this issue.

I meant something similar but for all features of the extension: image

deakjahn commented 1 year ago

Not much, to tell you frankly. :-) The functions are user initiated, if you don't refactor, they will not do anything. And in the case of renaming, where you could have more than one provider to fulfill your request (you probably have Intelephense premium, I suppose, in this case), VSC should ask you first time around which extension you want to use (and store it, and you can revoke that decision later any time). So, where this really counts, the IDE is supposed to handle the situation already.

If VSC doesn't do this, let's examine that situation.

AndreiOrmanji commented 1 year ago

you probably have Intelephense premium, I suppose, in this case

No, I'm using this and it works quite good https://marketplace.visualstudio.com/items?itemName=st-pham.php-refactor-tool

deakjahn commented 1 year ago

With this extension and scenario, I would definitely say no. This isn't a standalone extension, just a wrapper that calls the data collected and analyzed by Intelephense and uses that to provide its own operation on the surface. Which is, actually, something the developer of Intelephense explicitely forbids. When I started developing my extension, I had a short correspondence with him and I made it very clear that I had absolutely no intention to build my extension on his work, simply just profiting from what he had worked on for many years. Not only because he wouldn't like it but, equally, because I wouldn't consider it fair myself. This is why you can see in the changelog that I only presented the rename operation to users when the version with its own language server (in other words: fully functional, independent analysis of the PHP code) was ready and functioning.

In a technical sense, this is a waste of resources, of course. Because you have two extensions that provide the full experience among themselves (at least, that's my not-so-modest intention :-), I would really love to see Intelephense and my extension to be the combined solution that provide the full experience for PHP developers – Intelephense is excellent and already well established, I don't know whether mine would ever achieve any similar status or not), this means that both do more or less the same in the background, in parallel. But, unless all that functionality comes from the same developer, sharing the same background processes, this seems inevitable. Fortunately, the computers of today can keep up with the work required.

Just that you understand the underlying functionality, there's nothing particularly fancy about the renaming operation itself. You just give VS Code a list of files and positions to rename, VSC itself shows the preview and handles the renaming itself, with undo and everything else, automatically from the perspective of an extension. The trick is to tell it what to rename, not how to do it.

So, I am interested to hear what operation is that my extension doesn't provide correctly yet and will try to make it better but I'd like to stay within these confines.