LSP: How to add to intelephense.stubs

2,342 views
Skip to first unread message

Johan Sölve

unread,
Aug 25, 2021, 11:22:41 AM8/25/21
to BBEdit Talk

Language Server Protocol Support in BBEdit 14 is is a huge improvement! 

Intelephense have support for Wordpress function definitions by "adding wordpress to the intelephense.stubs array". Can this be done for BBEdit for example by adding something to Support/BBEdit/Language Servers/Configuration/intelephense/ ?

Source: 

Btw I added licence.txt to that folder and it seems to work as far as I can tell (not sure how to verify that the licence is activated though)

Rich Siegel

unread,
Aug 25, 2021, 11:27:13 AM8/25/21
to BBEdit Talk
On 25 Aug 2021, at 11:18, Johan Sölve wrote:

> Language Server Protocol Support in BBEdit 14 is is a huge
> improvement!
> Intelephense have support for Wordpress function definitions by
> "adding
> wordpress to the intelephense.stubs array". Can this be done for
> BBEdit for
> example by adding something to Support/BBEdit/Language
> Servers/Configuration/intelephense/ ?

I suspect you would add a custom workspace configuration. See
<https://www.barebones.com/support/bbedit/lsp-notes.html#advanced>.

I'm only guessing, but I suspect that the JSON would look something
like:

{
"initializationOptions":
{
// stuff goes here
}

"workspaceConfigurations":
{
"*":
{
"intelephense":
{
"stubs":
[...array of stubs, or whatever it is that intelephense expects...]
}
}
}
}

> Btw I added licence.txt to that folder and it seems to work as far as
> I can
> tell (not sure how to verify that the licence is activated though)

Intelephense enables certain features based on the presence of an active
license; their documentation gives a list, I think.

R.

--
Rich Siegel Bare Bones Software, Inc.
<sie...@barebones.com> <https://www.barebones.com/>

Someday I'll look back on all this and laugh... until they sedate me.

Johan Sölve

unread,
Aug 26, 2021, 11:22:26 AM8/26/21
to BBEdit Talk
Thanks, it got me a bit closer but I couldn't get the wordpress stub to be recognized. I tried all variants I could think of, including leaving out the "*" selector in workspaceConfigurations like this:

{
"initializationOptions": {
"licenceKey": "XXXXX"
},
"workspaceConfigurations": {
"intelephense": {
"stubs": [
"wordpress"
]
}
}
}

But the licence key definitely looks like it works there. Premium functions work.  

Rich Siegel

unread,
Aug 26, 2021, 11:38:53 AM8/26/21
to BBEdit Talk
On 26 Aug 2021, at 11:21, Johan Sölve wrote:

> Thanks, it got me a bit closer but I couldn't get the wordpress stub
> to be
> recognized. I tried all variants I could think of, including leaving
> out
> the "*" selector in workspaceConfigurations like this:

I'm afraid I don't have any more insights, except to say that leaving
out "*" will definitely not work.

Your `workspaceConfigurations` should look (at least) like:

"workspaceConfigurations": {
"*": {
"intelephense": {
"stubs": [
"wordpress"
]
}
}
}

but I don't know what Intelephense actually expects to find information
on "stubs", sorry.

Johan Sölve

unread,
Aug 27, 2021, 8:43:50 AM8/27/21
to BBEdit Talk
Thanks for clarifying that! 
Reply all
Reply to author
Forward
0 new messages