vscode-intelephense icon indicating copy to clipboard operation
vscode-intelephense copied to clipboard

Undefined Types when using Phalcon framework

Open amsharma9 opened this issue 2 years ago • 1 comments

Describe the bug

Intelephense shows Undefined types for the most basic Phalcon framework classes even though Phalcon is installed as shown below in Screenshots section. This issue seems to be similar to #2288 for slim framework.

So I do have a basic question, how does Intelephense know a library (extension) is available? If I don't start Apache & Php then how does it look for the framework. Does it use CLI version of Php ? In my case the CLI version confirms that Phalcon is present so all it's classes should be available AFAIK.

To Reproduce Use Phalcon Micro framework class and invoke it. use \Phalcon\Mvc\Micro;

    /*
     * Starting the application
     * Assign service locator to the application
     */
    $app = new Micro($di);

Expected behavior No errors should show.

Screenshots

C:\>php --ri phalcon
phalcon

Phalcon is a full stack PHP framework, delivered as a PHP extension, offering lower resource consumption and high performance.
phalcon => enabled
Author => Phalcon Team and contributors
Version => 4.1.0
Build Date => Oct 31 2020 15:21:40
Powered by Zephir => Version 0.12.19-4345593

Directive => Local Value => Master Value
phalcon.db.escape_identifiers => On => On
phalcon.db.force_casting => Off => Off
phalcon.orm.case_insensitive_column_map => Off => Off
phalcon.orm.cast_last_insert_id_to_int => Off => Off
phalcon.orm.cast_on_hydrate => Off => Off
phalcon.orm.column_renaming => On => On
phalcon.orm.disable_assign_setters => Off => Off
phalcon.orm.enable_implicit_joins => On => On
phalcon.orm.enable_literals => On => On
phalcon.orm.events => On => On
phalcon.orm.exception_on_failed_save => Off => Off
phalcon.orm.exception_on_failed_metadata_save => On => On
phalcon.orm.ignore_unknown_columns => Off => Off
phalcon.orm.late_state_binding => Off => Off
phalcon.orm.not_null_validations => On => On
phalcon.orm.update_snapshot_on_save => On => On
phalcon.orm.virtual_foreign_keys => On => On
phalcon.warning.enable => On => On

IntelephenseErr

Platform and version Windows 10 Pro 21H2 Build 19044.1889 PHP Intelephense v1.8.2 VSCode Version: 1.70.2 (user setup) Commit: e4503b30fc78200f846c62cf8091b76ff5547662 Date: 2022-08-16T05:35:13.448Z Electron: 18.3.5 Chromium: 100.0.4896.160 Node.js: 16.13.2 V8: 10.0.139.17-electron.0 OS: Windows_NT x64 10.0.19044

amsharma9 avatar Aug 20 '22 05:08 amsharma9

Phalcon IDE-Stubs

piniol avatar Aug 21 '22 13:08 piniol

There are no plans to bundle Phalcon stubs with the extension. Please add the above stubs to your workspace to resolve this.

bmewburn avatar Dec 28 '22 04:12 bmewburn