CodeIgniter Forums
Visual Studio Code - Intelphense vs Intellisense - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: Visual Studio Code - Intelphense vs Intellisense (/thread-78983.html)



Visual Studio Code - Intelphense vs Intellisense - Corsari - 04-05-2021

Hello to all of you

better to make an example before to ask my question

let's suppose I create an instance of the Email class

since it is a library , if I understood properly, the suggested way to invoke it should be

PHP Code:
$email service('email'); 

well

at that point it comes my question

so far I noticed that either Intelephense and Intellisense hovering on the service() method , will hint about it's definition

[Image: intelephense.png]

but nothing is shown hovering on the 'email' string or on the $email property

this happens also in others occasions

e.g. with database methods like in this case, I can't see the where() method of the query builder class

[Image: missing-where.png]

nevertheless it won't highlight mistypes , as you can see I have typed "fist" instead than "first" and no errors are in evidence

[Image: not-showing-mistype.png]

Does any of you has a valid setup to have this a bit enhanced?

Thank you for any
Robert


RE: Visual Studio Code - Intelphense vs Intellisense - atifriazmughal - 08-11-2021

Hi Corsari!
Have you setup extentions correclty? I have same issue please tell me solution if you found.

Thanks


RE: Visual Studio Code - Intelphense vs Intellisense - paliz - 08-12-2021

I m using php strom which is great ide it has lot of future


RE: Visual Studio Code - Intelphense vs Intellisense - Corsari - 08-31-2021

(08-12-2021, 01:07 AM)paliz Wrote: I m using php strom which is great ide it has lot of future

hello, sure, you are so kind, but here we are talking about Visual Studio Code :-)


RE: Visual Studio Code - Intelphense vs Intellisense - wdeda - 08-31-2021

For me it works without any problem, I don't use intellisense, only for CSS.
I have an additional question: what version of CodeIgniter do you use? It seems to be version 3, I'm using 4.


RE: Visual Studio Code - Intelphense vs Intellisense - Corsari - 08-31-2021

@wdeda it is 4.x


RE: Visual Studio Code - Intelphense vs Intellisense - InsiteFX - 09-01-2021

You need to find an extension for it to work the one that was around is no loger avaiable.


RE: Visual Studio Code - Intelphense vs Intellisense - wdeda - 09-01-2021

I don't know if that's the case, but after I installed the extensions, I noticed that some overlapped each other in some functions. In certain functions, document formatting, for example, the VS Code requested the choice of which should be used.
This happens, in a way, between Intelephense and Intellesense, not forgetting the native extensions of VS Code.
Allow me to suggest uninstalling one of the two to see how it works, until you are able to choose the one that most closely matches your needs.


RE: Visual Studio Code - Intelphense vs Intellisense - paulbalandan - 09-02-2021

1. For the service(), it has a documented return type of mixed so intelephense/intellisense cannot intelligently guess what specific object you are creating when you use that. I see 2 alternatives for that:

a. Inline annotate the variable $email
PHP Code:
/** var \CodeIgniter\Email\Email $email */
$email service('email'); 

b. Use the Services class to get specific documentation.
PHP Code:
use Config\Services;

$email Services::email(); 

2. For the Model/Builder, there exists a "@mixin" relationship for the two. The Model has a __call method that delegates unknown method calls to the Builder if the Builder has those methods defined. That's why you can call where(), a Builder method, in the context of a Model. Unfortunately, there's no straightforward way to make the 2 extensions understand this relationship. Support for this may be complex for them. What I can see as a possible solution (although not 100% spot on solution) is to use the "@method" annotation in the class docblock of Model. But as I said that solution is a patch not a cure.

I'm using VS Code so I am aware of these concerns. Smile