You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Class autocompletion doesn't work without 'use' keyword #59
That's something what is missing I think. When I have class like App\Entities\Order and I just type Order, I don't get anything unless I type 'use' keyword before. It wouldn't be a problem if I could do 'find use' and it would automatically add it to other use lines and leave 'Order' in current line. Is there a chance to enable that autocompletion without use keyword at least?
namespace App\Console\Commands;
class MyCommand
{
public function run()
{
ConnectorF // I expect to get hint with App\Entities\ConnectorFailedJob, but I don't get it
// although I can get it when typing
use ConnectorF // here it works, but of course it's pointless
// because I will get
use App\Entities\ConnectorFailedJob;
}
}
Of course again it wouldn't be a problem if, for istance, 'find use' command would automatically change that line to:
namespace App\Console\Commands;
use App\Entities\ConnectorFailedJob;
class MyCommand
{
public function run()
{
ConnectorFailedJob
// or even better, that I don't have to type 'use' in the middle of the code
// because would be great to have autocompletion of classes and FQCN anywhere
}
}
Thanks for the info, but I can't use master version.
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Can only install one of: react/http[dev-master, v0.4.1].
- Can only install one of: react/http[v0.4.1, dev-master].
- Can only install one of: react/http[dev-master, v0.4.1].
- don't install react/http dev-master|don't install react/react v0.4.1
- mkusher/padawan dev-master requires react/http dev-master -> satisfiable by react/http[dev-master].
- Installation request for mkusher/padawan master -> satisfiable by mkusher/padawan[dev-master].
- Installation request for react/http (locked at v0.4.1) -> satisfiable by react/http[v0.4.1], react/react[v0.4.1].
~/.composer$ composer global require mkusher/padawan:dev-master
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Can only install one of: react/http[dev-master, v0.4.1].
- Can only install one of: react/http[v0.4.1, dev-master].
- Can only install one of: react/http[dev-master, v0.4.1].
- mkusher/padawan dev-master requires react/http dev-master -> satisfiable by react/http[dev-master].
- Installation request for mkusher/padawan dev-master -> satisfiable by mkusher/padawan[dev-master].
- Installation request for react/http (locked at v0.4.1) -> satisfiable by react/http[v0.4.1].
Installation failed, reverting ./composer.json to its original content.
@golaod yeah, I've found the problem - wrong content-type header. I've already fixed it in padawan-php/padawan.sublime@46152ec
so can you update your padawan plugin for sublime(maybe I have to make new tag\release?)?
Thanks for fixing the header as I was able to use nc to send request.
nc 127.0.0.1 15155 < request.log
HTTP/1.1 200 OK
X-Powered-By: React/alpha
Content-Type: application/json
Transfer-Encoding: chunked
1e
{"completion":[],"context":[]}
0
Now what I found:
Generate index stopped working. I removed index completely and tried to generate it. Progress bar just goes very fast and nothing happens. When I call padawan generate from console then it works ok. After generation when I try again in sublime, progress bar is still lightning fast.
Autocompletion of anything still doesn't work.
Sorry to tell, but previous version, even though with missing features, was more stable :(
Please don't get me wrong with my last sentence, I was just referring to it, because I wanted to help with few missing features, but now if package doesn't work at all, it's just harder than I thought. I really appreciate your help and didn't want to judge your volunteer work
Sorry to tell, but previous version, even though with missing features, was more stable
yeah, that's why I haven't created new tag. 0.2 branch is quite stable and dev-master is development. Even with auto tests there are a lot of untested cases.
I tried completion in your file without an index and got completion for current file context(using dev-master both for sublime plugin and padawan). Not sure how to reproduce your situation :(
I also get completion for current file, but I think it should return more, like for instance inherited methods. Plus it still doesn't return completion for fqcns
@golaod just created new file and tried your case and it works. So something wrong with padawan install. Maybe you're using some virtualization or something? I mean maybe padawan couldn't find files or something like?
And can you start padawan-server from your terminal and copy it's output here for this case?
Exactly, because you pasted both classes into the same file. I gave you a simple case, but of course I was referring to a regular day scenario, where your classes extend other classes (from other files).
But as I wrote in my last comment: Everything depends on where you put those classes. If you have them both in the same class, then actually I don't need padawan to see test, test2 and debug, because sublime can handle it. Problem is when you put class A to file a.php and class B to file b.php, because padawan doesn't return methods from class A even though B extends A
Activity
mkusher commentedon Sep 8, 2016
@golaod can you provide more examples?
golaod commentedon Sep 8, 2016
Sure.
Let's say I have
App\Entities\ConnectorFailedJoband then somewhere in the code I type
Of course again it wouldn't be a problem if, for istance, 'find use' command would automatically change that line to:
mkusher commentedon Sep 8, 2016
@golaod are you using master version?
mkusher commentedon Sep 8, 2016
so, understood.
The fix could be quite easy: we just need to add classes to this map https://github.com/mkusher/padawan.php/blob/master/src/Padawan/Domain/Completer/GlobalFunctionsCompleter.pFix is really simple: this context should be added to class name completer canHandle
golaod commentedon Sep 8, 2016
Thanks for the info, but I can't use master version.
golaod commentedon Sep 9, 2016
Any suggestions?
mkusher commentedon Sep 9, 2016
@golaod why do you need global react/http v0.4.1?
golaod commentedon Sep 9, 2016
I don't need it. I just install your package with
composer global require mkusher/padawan:mastermkusher commentedon Sep 9, 2016
@golaod can you remove it completely and then install again?
$ composer global require mkusher/padawan:dev-mastergolaod commentedon Sep 9, 2016
mkusher commentedon Sep 9, 2016
@golaod can you show your global composer.json?
golaod commentedon Sep 9, 2016
mkusher commentedon Sep 9, 2016
@golaod please, try following:
golaod commentedon Sep 9, 2016
Thank you very much, that one helped. Now let me check, whether namespaces work in the middle of code.
golaod commentedon Sep 9, 2016
Nope, still doesn't autocomplete.
11 remaining items
golaod commentedon Sep 9, 2016
Nvm, I figured out to catch the request first and then send it over
golaod commentedon Sep 9, 2016
Request sent by sublime
As I couldn't use it to send it over to padawan-server through nc, so I built curl request
It gets me response
And padawan server throws an error
mkusher commentedon Sep 9, 2016
@golaod thx, will try to debug it later
mkusher commentedon Sep 9, 2016
@golaod yeah, I've found the problem - wrong content-type header. I've already fixed it in padawan-php/padawan.sublime@46152ec
so can you update your padawan plugin for sublime(maybe I have to make new tag\release?)?
golaod commentedon Sep 10, 2016
Thanks for fixing the header as I was able to use nc to send request.
Now what I found:
padawan generatefrom console then it works ok. After generation when I try again in sublime, progress bar is still lightning fast.Sorry to tell, but previous version, even though with missing features, was more stable :(
golaod commentedon Sep 10, 2016
Please don't get me wrong with my last sentence, I was just referring to it, because I wanted to help with few missing features, but now if package doesn't work at all, it's just harder than I thought. I really appreciate your help and didn't want to judge your volunteer work
mkusher commentedon Sep 10, 2016
yeah, that's why I haven't created new tag. 0.2 branch is quite stable and dev-master is development. Even with auto tests there are a lot of untested cases.
I tried completion in your file without an index and got completion for current file context(using dev-master both for sublime plugin and padawan). Not sure how to reproduce your situation :(
golaod commentedon Sep 10, 2016
I also get completion for current file, but I think it should return more, like for instance inherited methods. Plus it still doesn't return completion for fqcns
mkusher commentedon Sep 10, 2016
@golaod so does it return completions or it returns nothing?
golaod commentedon Sep 10, 2016
it doesn't return completions from padawan. In case
I see only 'debug' whereas should also see 'test' method
mkusher commentedon Sep 10, 2016
@golaod just created new file and tried your case and it works. So something wrong with padawan install. Maybe you're using some virtualization or something? I mean maybe padawan couldn't find files or something like?
And can you start
padawan-serverfrom your terminal and copy it's output here for this case?golaod commentedon Sep 10, 2016
Exactly, because you pasted both classes into the same file. I gave you a simple case, but of course I was referring to a regular day scenario, where your classes extend other classes (from other files).
mkusher commentedon Sep 10, 2016
@golaod oh, I just need to understand what's wrong.
in this case you should get
test,test2anddebug. So that will show whether padawan works at all or notgolaod commentedon Sep 10, 2016
But as I wrote in my last comment: Everything depends on where you put those classes. If you have them both in the same class, then actually I don't need padawan to see test, test2 and debug, because sublime can handle it. Problem is when you put class A to file a.php and class B to file b.php, because padawan doesn't return methods from class A even though B extends A
mkusher commentedon Sep 11, 2016
@golaod sublime couldn't understand private\protected and etc. And I need to understand what's wrong