Welcome Guest, Not a member yet? Register   Sign In
Visual Studio Code - Intelphense vs Intellisense
#1

(This post was last modified: 04-05-2021, 03:56 AM by Corsari.)

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
Reply
#2

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

Thanks
Reply
#3

I m using php strom which is great ide it has lot of future
Enlightenment  Is  Freedom
Reply
#4

(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 :-)
Reply
#5
Photo 

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.
Reply
#6

@wdeda it is 4.x
Reply
#7

You need to find an extension for it to work the one that was around is no loger avaiable.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#8

(This post was last modified: 09-01-2021, 04:49 AM by wdeda.)

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.
Reply
#9

(This post was last modified: 09-02-2021, 07:24 AM by paulbalandan.)

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
Reply




Theme © iAndrew 2016 - Forum software by © MyBB