Code Monkey home page Code Monkey logo

php-namespace-resolver's Introduction

PHP Namespace Resolver

Latest Release Installs Rating

PHP Namespace Resolver can import and expand your class. You can also sort your imported classes by line length or in alphabetical order.

Demo

Commands

Search these commands by the title on command palette.

[
    {
        "title": "Import Class",
        "command": "namespaceResolver.import"
    },
    {
        "title": "Import All Classes",
        "command": "namespaceResolver.importAll"
    },
    {
        "title": "Expand Class",
        "command": "namespaceResolver.expand"
    },
    {
        "title": "Sort Imports",
        "command": "namespaceResolver.sort"
    },
    {
        "title": "Highlight Not Imported Classes",
        "command": "namespaceResolver.highlightNotImported"
    },
    {
        "title": "Highlight Not Used Classes",
        "command": "namespaceResolver.highlightNotUsed"
    },
    {
        "title": "Generate namespace for this file",
        "command": "namespaceResolver.generateNamespace"
    }
]

Settings

You can override these default settings according to your needs.

{
    "namespaceResolver.exclude": "**/node_modules/**",  // Exclude glob pattern while finding files
    "namespaceResolver.showMessageOnStatusBar": false,  // Show message on status bar instead of notification box
    "namespaceResolver.autoSort": true,                 // Auto sort after imports
    "namespaceResolver.sortOnSave": false,              // Auto sort when a file is saved
    "namespaceResolver.sortAlphabetically": false,      // Sort imports in alphabetical order instead of line length
    "namespaceResolver.sortNatural": false,             // Sort imports using a 'natural order' algorithm
    "namespaceResolver.leadingSeparator": true,         // Expand class with leading namespace separator
    "namespaceResolver.highlightOnSave": false,         // Auto highlight not imported and not used when a file is saved
    "namespaceResolver.highlightOnOpen": false          // Auto highlight not imported and not used when a file is opened
}

Keybindings

You can override these default keybindings on your keybindings.json.

[
    {
        "command": "namespaceResolver.import",
        "key": "ctrl+alt+i",
        "when": "editorTextFocus"
    },
    {
        "command": "namespaceResolver.importAll",
        "key": "ctrl+alt+a",
        "when": "editorTextFocus"
    },
    {
        "command": "namespaceResolver.expand",
        "key": "ctrl+alt+e",
        "when": "editorTextFocus"
    },
    {
        "command": "namespaceResolver.sort",
        "key": "ctrl+alt+s",
        "when": "editorTextFocus"
    },
    {
        "command": "namespaceResolver.highlightNotImported",
        "key": "ctrl+alt+n",
        "when": "editorTextFocus"
    },
    {
        "command": "namespaceResolver.highlightNotUsed",
        "key": "ctrl+alt+u",
        "when": "editorTextFocus"
    },
    {
        "command": "namespaceResolver.generateNamespace",
        "key": "ctrl+alt+g",
        "when": "editorTextFocus"
    }
]

Author

License

MIT License.

Copyright (c) 2017 Mehedi Hassan

php-namespace-resolver's People

Contributors

binarious avatar chris-murat avatar crissi avatar ctf0 avatar dependabot[bot] avatar gayanhewa avatar josbeir avatar manuelcanepa avatar mehedidracula avatar patrickcarlohickman avatar rrd108 avatar santigarcor avatar ttrig avatar tyx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

php-namespace-resolver's Issues

"Nothing to sort" error

I have autoSort turned on, and I get "Nothing to sort" error everytime I save a file which does not contain any namespaces. I believe this warning or error is not needed. It not actionable.

If there is nothing to sort, then thats not an error :-)

Class not found error

When trying to import a class to create the use statement, I get the following error: Class App\User not found. I'm probably doing something wrong on my end. Any thoughts? Thanks!

function/const import behaviour

When I first import a function or const, it is usually placed in a separate block to the class imports, like so:

use Encase\Functional\Type;

use const Encase\Matching\Support\_;

use function Encase\Functional\map;
use function Encase\Matching\Support\_;
use function Encase\Matching\Support\match;
use function Encase\Matching\Support\pattern;

However, if I then use the "sort imports" feature, it sorts them, but doesn't make them one block, leading to an unexpected result:

use Encase\Functional\Type;

use function Encase\Functional\map;

use const Encase\Matching\Support\_;
use function Encase\Matching\Support\_;
use function Encase\Matching\Support\match;
use function Encase\Matching\Support\pattern;

The expected behaviour would be for "sort imports" to either close the blank lines between the blocks, or preserve each block and sort them independently to match the behaviour of "import class".

Feature suggestion: find unused imports

A feature I'd like to see and would find very useful would be the ability to scan a file for any imports that are unused, with options for either highlighting them (con: user has to manually remove them, pro: false positives caught by user) or optionally to auto-remove (con: potential for false positives).

Problem when highlightOnSave is enabled

Each time I save file new highlight is added on unused usings and not imported classes (highlight background gets less transparent and in hover new info item is added).

First save:
first_save

More "saves":
more_saves

Insert namespace

Hi,

this extension looks very promising! 👏

As almost every php project uses composer nowaday, and as psr-4 tends to be widely adopted too, should be cool to open composer.json to automatically implement the namespace of a newly created class, no?

I'm ok to help as I prefer by far this extension to bloated/complex extensions for php that we can found currently for VSCode.

Version 1.1.0 stopped working with update to VSCode 1.29.1

Technically it didn't stop working. It simply pegs out my i7-6700 processor for a few minutes for one search. My repo isn't THAT big. Also, even after the processor stops being pegged out it still doesn't kill the process (rg.exe) or come back with the imported class.

Here's my VS Code environment:
Version: 1.29.1 (system setup)
Commit: bc24f98b5f70467bc689abf41cc5550ca637088e
Date: 2018-11-15T19:13:36.375Z
Electron: 2.0.12
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
Architecture: x64

vscode complains when trying to save settings

"Unable to write to User Settings because namespaceResolver.exclude is not a registered configuration."
this happens with any of the settings.

edit: manually entering the settings into settings.json seems to work fine. Even the auto-complete

Invalid highlight

When highlightOnOpen or highlightOnSave is enabled and there is a type that is not imported then every text that matches type name is marked. Only that type should be highlighted.

error

Feature suggestion: Import missing namespaces

First of all, I love the plugin. It does everything I'm used to with a similar Sublime plugin, but there is one thing that I think could be extremely helpful.

Primary Use Case:
Refactoring.

Example:
Developer writes a function, or set of functions somewhere, and later realize it's time to refactor some of the functions into a new class for whatever reason (decoupling, etc.). Developer goes through the new class with the copied functions re-importing namespaces with PHP-Namespace-Resolver, but overlooks a namespace or two.

Suggestion:
Add a "Import Missing Namespaces" action which would essentially go through any class references in the file (e.g. new MyClass, MyClass::whatever) and run the Import Namespace command on each, prompting Developer to choose the correct namespace if it finds any class references that are ambiguous.

A similar "Expand Missing Namespaces" could be added as well, for completeness, though I think Import would be used more often.

Cannot read property 'document' of undefined

at context.subscriptions.push.vscode.window.onDidChangeActiveTextEditor (C:\Users\Road9-1\.vscode\extensions\mehedidracula.php-namespace-resolver-1.1.7\src\extension.js:66:19)
at u.fire (c:\Users\Road9-1\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:44:708)
at define.constructor._extHostDocumentsAndEditors.onDidChangeActiveTextEditor.e (c:\Users\Road9-1\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:575:305)
at u.fire (c:\Users\Road9-1\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:44:708)
at u.$acceptDocumentsAndEditorsDelta (c:\Users\Road9-1\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:522:159)
at d._doInvokeHandler (c:\Users\Road9-1\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:622:11)
at d._invokeHandler (c:\Users\Road9-1\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:621:716)
at d._receiveRequest (c:\Users\Road9-1\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:620:394)
at d._receiveOneMessage (c:\Users\Road9-1\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:619:141)
at define.constructor._protocol.onMessage.e (c:\Users\Road9-1\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:617:400)
at u.fire (c:\Users\Road9-1\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:44:708)
at e (c:\Users\Road9-1\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:40:460)
at u.fire (c:\Users\Road9-1\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:44:708)
at a (c:\Users\Road9-1\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:172:467)
at e (c:\Users\Road9-1\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:172:513)
at u.fire (c:\Users\Road9-1\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:44:708)
at y._receiveMessage (c:\Users\Road9-1\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:181:276)
at define.constructor._socketDisposables.push._socketReader.onMessage.e (c:\Users\Road9-1\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:178:415)
at u.fire (c:\Users\Road9-1\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:44:708)
at f.acceptChunk (c:\Users\Road9-1\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:175:35)
at define.constructor._register._socket.onData.e (c:\Users\Road9-1\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:174:410)
at Socket.t (c:\Users\Road9-1\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:182:689)
at Socket.emit (events.js:182:13)
at addChunk (_stream_readable.js:279:12)
at readableAddChunk (_stream_readable.js:264:11)
at Socket.Readable.push (_stream_readable.js:219:10)
at Pipe.onread (net.js:636:20)

Sorting doesn't work as expected

Hello,

Found this extension today and it looks great, thanks! One thing I noticed is that sorting doesn't work the way I expect it to. Sorting is done only on the classname, it excludes the namespace. So I get this result:

use SilverStripe\Admin\ABCThing;
use SilverStripe\ORM\DataObject;
use SilverStripe\Admin\ModelAdmin;

but I expect this:

use SilverStripe\Admin\ABCThing;
use SilverStripe\Admin\ModelAdmin;
use SilverStripe\ORM\DataObject;

Extension issue

Screenshot from 2019-03-30 15-36-25

  • Issue Type: Bug
  • Extension Name: php-namespace-resolver
  • Extension Version: 1.1.7
  • OS Version: Linux x64 4.20.13-200.fc29.x86_64
  • VSCode version: 1.32.3

⚠️ We have written the needed data into your clipboard. Please paste! ⚠️

{
	"messages": [
		{
			"type": 1,
			"message": "Menu item references the same command as default and alt-command",
			"extensionId": {
				"value": "MehediDracula.php-namespace-resolver",
				"_lower": "mehedidracula.php-namespace-resolver"
			},
			"extensionPointId": "menus"
		},
		{
			"type": 1,
			"message": "Menu item references the same command as default and alt-command",
			"extensionId": {
				"value": "MehediDracula.php-namespace-resolver",
				"_lower": "mehedidracula.php-namespace-resolver"
			},
			"extensionPointId": "menus"
		},
		{
			"type": 1,
			"message": "Menu item references the same command as default and alt-command",
			"extensionId": {
				"value": "MehediDracula.php-namespace-resolver",
				"_lower": "mehedidracula.php-namespace-resolver"
			},
			"extensionPointId": "menus"
		},
		{
			"type": 1,
			"message": "Menu item references the same command as default and alt-command",
			"extensionId": {
				"value": "MehediDracula.php-namespace-resolver",
				"_lower": "mehedidracula.php-namespace-resolver"
			},
			"extensionPointId": "menus"
		},
		{
			"type": 1,
			"message": "Menu item references the same command as default and alt-command",
			"extensionId": {
				"value": "MehediDracula.php-namespace-resolver",
				"_lower": "mehedidracula.php-namespace-resolver"
			},
			"extensionPointId": "menus"
		},
		{
			"type": 1,
			"message": "Menu item references the same command as default and alt-command",
			"extensionId": {
				"value": "MehediDracula.php-namespace-resolver",
				"_lower": "mehedidracula.php-namespace-resolver"
			},
			"extensionPointId": "menus"
		},
		{
			"type": 1,
			"message": "Menu item references the same command as default and alt-command",
			"extensionId": {
				"value": "MehediDracula.php-namespace-resolver",
				"_lower": "mehedidracula.php-namespace-resolver"
			},
			"extensionPointId": "menus"
		}
	],
	"activationTimes": {
		"startup": false,
		"codeLoadingTime": 3,
		"activateCallTime": 0,
		"activateResolvedTime": 9,
		"activationEvent": "onLanguage:php"
	},
	"runtimeErrors": [
		{
			"name": "TypeError",
			"message": "Cannot read property 'document' of undefined"
		},
		{
			"name": "TypeError",
			"message": "Cannot read property 'document' of undefined"
		},
		{
			"name": "TypeError",
			"message": "Cannot read property 'document' of undefined"
		}
	]
}

Import Namespace Missing?

on the image "Demo" it has like Import namespace. where as on the latest version, it doesn't have..
screenshot_992

Js error when tabbing through open files in vscode.

I keep getting these errors over and over again as I tab through open documents using this extension.

TypeError: Cannot read property 'document' of undefined
	at context.subscriptions.push.vscode.window.onDidChangeActiveTextEditor (/home/samuel/.vscode/extensions/mehedidracula.php-namespace-resolver-1.1.4/src/extension.js:66)
	at e.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:44)
	at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:620
	at e.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:44)
	at e.$acceptDocumentsAndEditorsDelta (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:527)
	at t._doInvokeHandler (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:644)
	at t._invokeHandler (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:643)
	at t._receiveRequest (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:642)
	at t._receiveOneMessage (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:641)
	at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:638
	at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:38
	at e.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:44)
	at a (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:170)
	at Socket.f._socketDataListener (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:170)
	at Socket.emit (events.js:182)
	at addChunk (_stream_readable.js:279)
	at readableAddChunk (_stream_readable.js:264)
	at Socket.Readable.push (_stream_readable.js:219)
	at Pipe.onread (net.js:636)

Feature Suggestion: Generate Namespace For Current File

Hey, not sure if this has been suggested before but it might be useful if we could get a command to add the namespace declaration to the current file.

Say the working path were "App/Models/User.php" then the command would put "namespace App\Models;" at the top of the file.

I know PHPCompanion in Sublime supports that feature, granted I'm not sure how difficult that is to implement though. I personally just find it pretty useful and I'm sure some others would as well.

Thanks much.

Types in phpDocs are ignored

When highlightOnOpen or highlightOnSave is enabled, using for types used in phpDocs are marked as not used (if there is no other use of them in code).

error

cursor stays after namespaceResolver.expand command

When I write a class and execute namespaceResolver.expand, the cursor stays on its previous position (or rather is moved to its previous position, at least it looks that way), instead of at the end of the expanded class. Example:

namespace1

namespace2

Typically I want to continue writing at the end of the expanded class name. It would be nice if the cursor was not moved back to its original position after running namespaceResolver.expand :)

Feature: Include external sources

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!

[Bug] When importing reformat the line by collapse it

Hello,

First of all thanks for this very nice extension and made it available for us.

I would like to propose a litle improvment which will make life more easier for coders.

When typing in vscode \Symfony\Component\Console\Helper\SymfonyQuestionHelper, right click on the part SymfonyQuestionHelper and choosing "Import namespace" should import \Symfony\Component\Console\Helper\SymfonyQuestionHelper and reduce the line to SymfonyQuestionHelper.
If importing \Symfony\Component\Console\Helper, it should reduce it to Helper\SymfonyQuestionHelper.
You get the idea i think ; )

Actually we need to reduce it manually, it would be great if after import, line is reformated/collapsed.
Same with "Import all", it could parse the file, import all namespace and reduce/collapse everywhere they are called.

I hope it is a good idea.

Thanks.

Extension issue

  • Issue Type: Bug
  • Extension Name: php-namespace-resolver
  • Extension Version: 1.1.8
  • OS Version: Linux x64 5.3.0-19-generic
  • VSCode version: 1.39.2

⚠️ We have written the needed data into your clipboard. Please paste! ⚠️

Does not work with vendor classes on gitignore

Hey this is similar to #5.

On my end the hotkeys do not work with classes in the vendor folder, but works fine with classes in the current project. The issue, from what I found, is related to .gitignore - if I remove the vendor folder from it, then everything works fine. I tried replacing the intellisense plugin (tried PHP IntelliSense, IntelliSense-crane and Intelephense), without success.

Has this occurred in the past or is it resolvable with a specific configuration?

Version 1.24.0-insider
Commit 912fff91ac4ff1bff9695e8da69abd729f7ae956
Date 2018-05-18T05:11:07.195Z
Shell 1.7.12
Renderer 58.0.3029.110
Node 7.9.0
Architecture x64

Reconsider the default key bindings.

Please reconsider the default keybings this extension uses. For e.g. F1 is already bound to "Show All Commands" by default and it's not good overriding such a commonly used binding.

IMHO it would be better to use a key combination by default for all the commands this extension provides.

Replacing usestatements

I often change a namespace of one of my files and therefore need to update the use statement in the file that uses it.

Right now this is not possible with this plugin, because the class already has a use statement and will ask for an alias.

I am thinking that if you do not enter anything in the "Enter an alias"-box, it will instead replace the use statement.

The box could say "Enter an alias or leave it empty to replace"

I would gladly make a pullrequest if you accept this feature.

Does not work with vendor classes

I tried this package in my Symfony application and it does work for classes inside my app, but I can't import things from the vendor folder (e.g. Doctrine, Symfony, etc):

Class 'Request' not found.

Maybe similar to #5. I'm using PHP IntelliSense and already tried reinstalling it as mentioned in the other issue.

[Change] Sort namespace alphabetically instead of lenght by default.

Hello,

Namespace are sorted by lenght by default. I really think it is more usefull to do it alphabeticaly, as it is more meaningfull to have namespace grouped.
Is there any reason it is by lenght by default ?
If not, maybe it could be changed to alphabetically by default.

I know there is a settings, but i will prevent to have to have to edit the configuration each time it is installed on some computers.

Thanks.

Context menus

Hi,

I noticed the context menu entries were removed in b989314.

Are there any plans to bring this back as an option/provide an alternative?

Thanks!

EXTREMELY slow

It worked super fast but after updating to visual studio 1.29.1 x64 it takes up to 1 - 2 minutes to find the namespaces. I use windows 10 x64

Namespace incorrect with more than one autoload folder

This was working fine prior to the last VSCode update.

I have two autoload-folders:

        "psr-4": {
            "App\\": "app/",
            "Domain\\": "src/"
        },

Namespace had no issue figuring out what folder I was in and using the right namespace, but now, it only takes whatever the first in the list is. So if I'm working in src/foo/bar the namespace should be Domain\Foo\Bar what I actually get is App\src\Foo\Bar

And to confirm, I changed the order of my psr-4 json there and if I change the order still gets it wrong, just now with the other name first.

Maybe I messed something up? I did run composer du too hoping that would help pick things up, but something seems to be amiss. Let me know if you need other information.

Extension issue

  • Issue Type: Bug
  • Extension Name: php-namespace-resolver
  • Extension Version: 1.1.4
  • OS Version: Darwin x64 17.7.0
  • VSCode version: 1.32.0-insider
{
	"activationTimes": {
		"startup": false,
		"codeLoadingTime": 120,
		"activateCallTime": 6,
		"activateResolvedTime": 4,
		"activationEvent": "onLanguage:scss"
	},
	"runtimeErrors": [
		{
			"name": "Error",
			"message": "Language client is not ready yet"
		}
	]
}

Feature suggestions: trim and auto-determine

I would like to recommend two improvements that might streamline the use of the plugin:

  1. Automatically trim the namespace from the class name when importing, if it exists. For example
$test = new \App\User;
//should become, after import:
$test = new User;
  1. If the class already has the namespace preceding it, automatically capture that and use it to resolve which class to import, instead of providing the drop-down window to the user.

Thanks for listening, keep up the good work!
~Mike

Version 1.0.5 stopped working with update to VSCode 1.23.0

Brilliant extension. I use it a lot. However, with the recent upgrade to VS Code, it's stopped working: no errors, just doesn't do anything.

Here's my VS Code environment:
Version 1.23.0
Commit 7c7da59c2333a1306c41e6e7b68d7f0caa7b3d45
Date 2018-05-03T16:44:55.614Z
Shell 1.7.12
Renderer 58.0.3029.110
Node 7.9.0
Architecture x64

Any suggestions?

How can i stop remove model unused

for example

i store model User in variable

$model = 'User';

i pass $user to other page
and i want use lik this $model::all()
because the model it will be denamic
but the extention PHP-Namespace-Resolver
remove the model Because his name not on top
he don't now that model saved in variable $model how can i stop removing auto

Feature: import and prepend before class name

Sometimes we only have 1 reference to a class, and importing as a use statement can get large pretty quick

Can we have a shortcut to prepend the namespaces to the class, for example

before the append

public function index(User $user)
{

}

after prepend

public function index(App\Models\User $user)
{

}

Automatic use statements?

Hi, can this package create automatic use statements when adding classes from Intellisense? That is one of the features preventing me from moving from Atom to VS Code -- would love to find a way to have VSCode create use statements instead of resolving the class name inline.

Sorry if this is not what your package was designed to do, but I thought I would ask. :) Thanks!

Disable Messages

Is it possible to disable the messages after using this plugin?

image

Thanks!

Exclude Multiple Folders

Hi

Maybe I just don't understand glob matching that well but how do I exclude multiple folders?
Getting a VS Code settings error when I try the following

"namespaceResolver.exclude": [
        "**/node_modules/**",
        "**/vendor/{local package name}/vendor/**"
    ]

How to sort imports on save?

Hi, this package is great for sorting my imports using a keyboard shortcut. I’d like to sort imports on save as well.

I’ve tried adding this to my user settings:

"[php]": {
    "editor.codeActionsOnSave": {
        "namespaceResolver.sort": true
    }
}

But imports don’t sort on save as expected. Do I need to do anything else to get the namespaceResolver.sort command to run when a .php file is saved?

Extension is not working in v1.19.2

First I want to thank you for this extension it's awesome, but recently it stopped working. When I run the import class or expand class command nothing happens as you can see here:

peek 2018-01-17 07-56

Update: I debugged the extension and the problem seems to be in this line:

let namespaces = await this.findNamespaces(resolving, files);

after stopping the execution there, the debug console shows rejected promise not handled within 1 second.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.