-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I edit the intelephense.stubs preference? #10
Comments
Use settings. {
"client" : {
// ...
// @see https://github.com/bmewburn/vscode-intelephense/blob/master/package.json
"settings": {
"stubs": [ /* ... */ ],
},
},
} |
This doesn't seem to work. Same configuration works on VSCode:
|
My test config (but it should work like yours 🤔 ) is as the following. {
"client" : {
"enabled": true,
"languages": [
{
"languageId": "php",
"scopes": ["source.php", "embedding.php"],
},
],
"initializationOptions": {
"clearCache": false,
"storagePath": "E:/_Data/intelephense",
"globalStoragePath": "E:/_Data/intelephense",
// To use the licenceKey,
// you can also write it to "YOUR_HOME_DIR/intelephense/licence.txt"
// and comment out the following property
"licenceKey": "${packages}/User/intelephense.sublime-license",
},
// @see https://github.com/bmewburn/vscode-intelephense/blob/master/package.json
"settings": {
"diagnostics": {
"undefinedSymbols": true,
},
"debug": {
"enable": false,
},
"files": {
"exclude": [
"**/branch-*/**",
],
},
"stubs": [
"apache",
"bcmath",
"bz2",
"calendar",
"com_dotnet",
"Core",
"ctype",
"curl",
"date",
"dba",
"dom",
"enchant",
"exif",
"FFI",
"fileinfo",
"filter",
"fpm",
"ftp",
"gd",
"gettext",
"gmp",
"hash",
"iconv",
"imap",
"intl",
"json",
"ldap",
"libxml",
"mbstring",
"meta",
"mysqli",
"oci8",
"odbc",
"openssl",
"pcntl",
"pcre",
"PDO",
"pdo_ibm",
"pdo_mysql",
"pdo_pgsql",
"pdo_sqlite",
"pgsql",
"Phar",
"posix",
"pspell",
"readline",
"Reflection",
"session",
"shmop",
"SimpleXML",
"snmp",
"soap",
"sockets",
"sodium",
"SPL",
"sqlite3",
"standard",
"superglobals",
"sysvmsg",
"sysvsem",
"sysvshm",
"tidy",
"tokenizer",
"xml",
"xmlreader",
"xmlrpc",
"xmlwriter",
"xsl",
"Zend OPcache",
"zip",
"zlib",
"gettext",
],
},
},
} Some possible reasons:
|
|
That's where it is configured. Wow, seems like I had configured too php-ls but it wans't triggering until now (I have no idea why). Anyway, glad you helped me where to find where to configure the stubs section. Thank you so much! |
Did stubs stopped working? A few months ago, the gettext issue came again, and I just can't resolve it. I've even deleted all the stubs and, for example, the mysqli functions/constants are not marked as undefined, which is pretty strange... |
{
// @see configuration in https://github.com/bmewburn/vscode-intelephense/blob/master/package.json
"settings": {
"intelephense": {
"stubs": [
// ...
],
},
},
} |
Ok, now it seems like it requires a new key called Old example{
"client" : {
"initializationOptions": {
"storagePath": "${temp_dir}/intelephense",
"globalStoragePath": "${temp_dir}/intelephense",
"licenceKey": "...",
},
"settings": {
"stubs": [
"apache",
"bcmath",
"bz2",
"calendar",
"com_dotnet",
"Core",
"ctype",
"curl",
"date",
"dba",
"dom",
"enchant",
"exif",
"FFI",
"fileinfo",
"filter",
"fpm",
"ftp",
"gd",
"gettext",
"gmp",
"hash",
"iconv",
"imap",
"intl",
"json",
"ldap",
"libxml",
"mbstring",
"meta",
"mysqli",
"oci8",
"odbc",
"openssl",
"pcntl",
"pcre",
"PDO",
"pdo_ibm",
"pdo_mysql",
"pdo_pgsql",
"pdo_sqlite",
"pgsql",
"Phar",
"posix",
"pspell",
"readline",
"Reflection",
"session",
"shmop",
"SimpleXML",
"snmp",
"soap",
"sockets",
"sodium",
"SPL",
"sqlite3",
"standard",
"superglobals",
"sysvmsg",
"sysvsem",
"sysvshm",
"tidy",
"tokenizer",
"xml",
"xmlreader",
"xmlrpc",
"xmlwriter",
"xsl",
"Zend OPcache",
"zip",
"zlib",
"gettext"
]
}
}
} New example{
"client" : {
"initializationOptions": {
"storagePath": "${temp_dir}/intelephense",
"globalStoragePath": "${temp_dir}/intelephense",
"licenceKey": "...",
},
"settings": {
"intelephense": {
"stubs": [
"apache",
"bcmath",
"bz2",
"calendar",
"com_dotnet",
"Core",
"ctype",
"curl",
"date",
"dba",
"dom",
"enchant",
"exif",
"FFI",
"fileinfo",
"filter",
"fpm",
"ftp",
"gd",
"gettext",
"gmp",
"hash",
"iconv",
"imap",
"intl",
"json",
"ldap",
"libxml",
"mbstring",
"meta",
"mysqli",
"oci8",
"odbc",
"openssl",
"pcntl",
"pcre",
"PDO",
"pdo_ibm",
"pdo_mysql",
"pdo_pgsql",
"pdo_sqlite",
"pgsql",
"Phar",
"posix",
"pspell",
"readline",
"Reflection",
"session",
"shmop",
"SimpleXML",
"snmp",
"soap",
"sockets",
"sodium",
"SPL",
"sqlite3",
"standard",
"superglobals",
"sysvmsg",
"sysvsem",
"sysvshm",
"tidy",
"tokenizer",
"xml",
"xmlreader",
"xmlrpc",
"xmlwriter",
"xsl",
"Zend OPcache",
"zip",
"zlib",
"gettext"
]
}
}
}
} |
There is no |
Where does |
(btw. no need for |
I see in bmewburn/vscode-intelephense#827 that I can modify a
intelephense.stubs
attribute to addgettext
and avoid wrong errors, but I can't find a way of doing it on LSP.The text was updated successfully, but these errors were encountered: