-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Class autocompletion doesn't work without 'use' keyword #59
Comments
@golaod can you provide more examples? |
Sure. Let's say I have and 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:
|
@golaod are you using master version? |
so, understood. |
Thanks for the info, but I can't use master version.
|
Any suggestions? |
@golaod why do you need global react/http v0.4.1? |
I don't need it. I just install your package with |
@golaod can you remove it completely and then install again? |
|
@golaod can you show your global composer.json? |
|
@golaod please, try following: $ composer global remove react/react
$ composer global require mkusher/padawan:dev-master |
Thank you very much, that one helped. Now let me check, whether namespaces work in the middle of code. |
Nope, still doesn't autocomplete. |
I added it manually to your code, but right now with dev-master even use statement at the top of the file doesn't populate popup with classes |
And if you wanna ask whether padawan-server is working. It does, because doing $this-> inside a method populates the popup. |
Hm...during further tests I found out that $this-> is not populated by your module, but by sublime. In that case padawan stopped working at all :( |
I run padawan generate, I did the same in sublime, but it still doesn't autocomplete classes at the top of the file when writing along with 'use' keyword, doesn't autocomplete inherited methods on $this->, and #64 has a bug |
@golaod yeah, I see the bug. So, I should spend more time on it :( |
Yes I did and same thing as with padawan generate. Doesn't matter if I run it from the console or sublime. |
ooh, that's strange. Can you debug it with nc(show me request/response)? |
Any suggestion on how to debug it? |
Nvm, I figured out to catch the request first and then send it over |
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
|
@golaod thx, will try to debug it later |
@golaod yeah, I've found the problem - wrong content-type header. I've already fixed it in padawan-php/padawan.sublime@46152ec |
Thanks for fixing the header as I was able to use nc to send request.
Now what I found:
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 |
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 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 so does it return completions or it returns nothing? |
it doesn't return completions from padawan. In case
I see only 'debug' whereas should also see 'test' method |
@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? |
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). |
@golaod oh, I just need to understand what's wrong. <?php
class A
{
public function test() {}
protected function test2() {}
private function test3() {}
}
class B extends A
{
public function __construct()
{
$this->
}
public function debug() {}
} in this case you should get |
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 |
@golaod sublime couldn't understand private\protected and etc. And I need to understand what's wrong |
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?
The text was updated successfully, but these errors were encountered: