vscode-intelephense
vscode-intelephense copied to clipboard
Undefined pgsql types
Describe the bug Intelephense does not know the types of pgsql. It throws an undefined type (1009) error message when I am using pgsql types.
Note: I added pgsql to the Intelephense: Stubs list in the extension settings of intelephense.
To Reproduce I came across this when I wanted to create a simple class interface for my PG database. For reproducibility it is enough to declare a variable that has a type of pgsql. For example this line is causing the error:
public \PgSql\Connection|false $connection;
According to the documentation, pg_connect
returns the type PgSql\Connection|false
.
https://www.php.net/manual/en/function.pg-connect.php
Expected behavior Intelephense should know pgsql types so that I can benefit from the autocomplete in my IDE, for example.
Screenshots
Platform and version Win10, PHP 8.1.2, Intelephense 1.8.2, Visual Studio Code
I ran into this also. Can you please add the PgSql
types for postgres? Thank you.
Unable to repro in 1.10 . Adding pgsql
to stubs and setting intelephense.environment.phpVersion
to 8.1.0 or greater makes \PgSql\Connection
in my tests.