Vscode-intelephense: Problems running intelphense 1.3.11 with elementor extension on WSL-2 Ubuntu 18.04

Created on 1 Mar 2020  路  5Comments  路  Source: bmewburn/vscode-intelephense

I'm seeing some unexpected errors when using intelphense 1.3.11 with elementor extension on WSL-2 Ubuntu 18.04.

I'm creating a WP Elementor extension which I'm creating under namespace POSRTest I'm getting the message:

Undefined function 'is_null'.

from line:

            if ( \is_null( self::$_instance ) ) {
        self::$_instance = new self();
    }

Same issue for function version_compare, printf, sprintf.

I have tried it with & without the leading ""

Commenting out the namespace declaration does not appear to help!

Intelephense_issue_1

needs more info

Most helpful comment

@mwoodpatrick Checklist:

  • check that there are items in intelephense.stub setting - there should be 50+ names, mentioned functions are under standard
  • try to reindex workspace: Command palette (F1) -> Intelephense: Index workspace
  • Check if there is something weird in intelephense output: Toggle output Ctrl+Shift+U -> select: intelephense

@benyaminl https://www.php.net/manual/en/language.namespaces.global.php

All 5 comments

I'm seeing some unexpected errors when using intelphense 1.3.11 with elementor extension on WSL-2 Ubuntu 18.04.

I'm creating a WP Elementor extension which I'm creating under namespace POSRTest I'm getting the message:

Undefined function 'is_null'.

from line:

            if ( \is_null( self::$_instance ) ) {
      self::$_instance = new self();
  }

Same issue for function version_compare, printf, sprintf.

I have tried it with & without the leading ""

Commenting out the namespace declaration does not appear to help!

Intelephense_issue_1

try to remove the trailling back space, it should work. as far as I know. the is_* other function will result the same error when using trailling backslash

@mwoodpatrick Checklist:

  • check that there are items in intelephense.stub setting - there should be 50+ names, mentioned functions are under standard
  • try to reindex workspace: Command palette (F1) -> Intelephense: Index workspace
  • Check if there is something weird in intelephense output: Toggle output Ctrl+Shift+U -> select: intelephense

@benyaminl https://www.php.net/manual/en/language.namespaces.global.php

@mwoodpatrick Checklist:

  • check that there are items in intelephense.stub setting - there should be 50+ names, mentioned functions are under standard
  • try to reindex workspace: Command palette (F1) -> Intelephense: Index workspace
  • Check if there is something weird in intelephense output: Toggle output Ctrl+Shift+U -> select: intelephense

@benyaminl https://www.php.net/manual/en/language.namespaces.global.php

I know there's global names pace. But every time it will gone normally. I always remove the on built in isset, is_* for about 2 years using intelephense.

Will review above suggestions and report back

closing, needs further info before reopening

Was this page helpful?
0 / 5 - 0 ratings

Related issues

umpirsky picture umpirsky  路  4Comments

ghost picture ghost  路  3Comments

superadmini picture superadmini  路  4Comments

pseudoanime picture pseudoanime  路  3Comments

zlianon picture zlianon  路  3Comments