sublimelsp / LSP-intelephense

PHP support for Sublime's LSP plugin provided through intelephense.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stubs - Wordpress is possible?

andremacola opened this issue · comments

Is it possible to add wordpress stubs like in vscode? This is my LSP-intelephense settings but wordpress stubs is not loaded by the plugin.

{
	"initializationOptions":
	{
		"clearCache": true,
		"storagePath": null
	},
	"languages":
	[
		{
			"languageId": "php",
			"scopes":
			[
				"source.php"
			],
			"syntaxes":
			[
				"Packages/PHP/PHP.sublime-syntax"
			]
		}
	],
	"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",
			"wordpress"
		]
	}
}

Did you restart ST?


Sure it's possible but I wonder how you actually use intelephese, LSP or LSP-intelephense since your previous issue #21 (comment) indicates the you may use only LSP itself rather than LSP-intelephense.

The configure you post should work. What's the left-bottom text in the status bar? intlephense-ls or lsp-intelephense?

@jfcherng I tried both ways. I'm using LSP-intelephense right now. The NODE/NPM problem was solved by creating a symlink for node and npm inside the PATH that sublime can see.

Yes, I restarted ST3.

Captura de Tela 2020-03-28 às 18 01 38

Captura de Tela 2020-03-28 às 18 04 31

Hmm... I doubt that settings is not working as intended at this moment.

    // @see https://github.com/bmewburn/vscode-intelephense/blob/master/package.json
    "settings": {
        "diagnostics": {
            "undefinedFunctions": false,
        },
    },

This still gives undefined function errors 🤔

Rollback to 0.0.10 seem dose not help.

@andremacola the following is working

"settings": {
    "intelephense": {
        "stubs": [
            "wordpress",
            // default 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",
        ],
    },
},

image

Yep. This way fixed the problem. Thks.