MehediDracula / PHP-Namespace-Resolver

PHP Namespace Resolver - VSCode Extension
https://marketplace.visualstudio.com/items?itemName=MehediDracula.php-namespace-resolver
MIT License
124 stars 31 forks source link

Feature: Include external sources #31

Closed manix closed 6 years ago

manix commented 6 years ago

This is pretty nice, the only reason I've ever stayed away from other editors than Netbeans is that they never had such good auto-import functionality. Neither does VSCode yet but it could get there with this plug in!

One feature that is key is to be able to auto-resolve all referenced classes instead of having to point to a class and then alt+ctrl+i however I see this is already mentioned in another feature request.

What would be really useful is also to be able to add paths of other sources, for example now my PHP project includes files from a directory that is not part of the project (a common repository), when trying to resolve a class from there I get an error that the class is not found. In Netbeans this problem is resolved by specifying paths of external sources and scanning them as well.

Thanks in advance, awesome work!

MehediDracula commented 6 years ago

Internally this extension is using vscode's API for searching files which can only search inside the current workspace.

So, you can add the external repository in your current workspace from File -> Add Folder to Workspace. The extension should then find files from your external repository.

manix commented 6 years ago

Oh silly me, that's awesome, thanks!

After working a bit longer with the plugin I have some other recommendations but I'll just write them here to not spam with issues:

MehediDracula commented 6 years ago

You can use PHP Intelephense. It has all the features you've mentioned.