Sublime Forum

PAckage to show native php function

#1

Hi there is a plugin to show the signature of php native function

for example if i write in_array it must show :

in_array(mixed $needle, array $haystack, bool $strict = false): bool

thank you

0 Likes

#2

LSP + LSP-intelephense should provide this functionality, but maybe in a different way you image.


image

0 Likes

#3

image

0 Likes

#4

Do you have node.js installed on your machine? Do you press “OK” or “Yes” if you are asked to install?

Also, may try to restart ST.

0 Likes

#5

Try installing node.js and also see the console, maybe take a screenshot of the console for more debuging feedback and output cause like this it may give you this particular error but at times it could be something different that is hidden.

0 Likes

#6

Node.js installed , this is console log https://pastebin.com/2FY6asa2

0 Likes

#7

May update to Package Control first by executing the following code in ST’s console.

from urllib.request import urlretrieve;urlretrieve(url="https://github.com/wbond/package_control/releases/latest/download/Package.Control.sublime-package", filename=sublime.installed_packages_path() + '/Package Control.sublime-package')
0 Likes

#8

Is this by yourself or ST (lsp_utils actually)? What’s its version?

0 Likes

#9

Installed from package control :

git: untracking working dir /home/stefano/localhost/gestionalefirenzeufficio
Unable to start subprocess for LSP-intelephense
Traceback (most recent call last):
File “/home/stefano/.config/sublime-text/Installed Packages/LSP.sublime-package/plugin/core/windows.py”, line 279, in start_async
transport = create_transport(transport_config, transport_cwd, session)
File “/home/stefano/.config/sublime-text/Installed Packages/LSP.sublime-package/plugin/core/transports.py”, line 265, in create_transport
process = start_subprocess()
File “/home/stefano/.config/sublime-text/Installed Packages/LSP.sublime-package/plugin/core/transports.py”, line 253, in start_subprocess
return _start_subprocess(config.command, stdin, stdout, subprocess.PIPE, startupinfo, config.env, cwd)
File “/home/stefano/.config/sublime-text/Installed Packages/LSP.sublime-package/plugin/core/transports.py”, line 332, in _start_subprocess
process = subprocess.Popen(
File “./python3.8/subprocess.py”, line 858, in init
File “./python3.8/subprocess.py”, line 1704, in _execute_child
FileNotFoundError: [Errno 2] No such file or directory: ‘intelephense’

0 Likes

#10

If you execute

from pathlib import Path; list((Path(sublime.cache_path())/'../Package Storage/lsp_utils/node-runtime').glob('*'))

in ST console, what’s the output?

0 Likes

#11

[PosixPath(’/home/stefano/.cache/sublime-text/Cache/…/Package Storage/lsp_utils/node-runtime/18.18.1’)]

0 Likes

#12

Is that folder empty or there is node executable in it?

0 Likes

#13

Seeing

Nodejs Plugin - INFO - 2024-04-22T19:01:31.522375 => Running `node_builddocs` to generate Node.js completions

in your console, I wonder “install package control” means you installed this… https://github.com/tanepiper/SublimeText-Nodejs No. That’s not required.

Though that doesn’t explain why FileNotFoundError: [Errno 2] No such file or directory: 'intelephense'. You didn’t change any plugin settings after installing LSP and LSP-intelephense right?

0 Likes

#14

Could you run troubleshooting LSP server for LSP-intelephense from the quick panel and paste the result here?
image

0 Likes

#15

Troubleshooting: LSP-intelephense

Version

  • LSP: 2.0.0
  • Sublime Text: 4169

Server Test Run

  • exit code: -1
  • output
[Errno 2] No such file or directory: 'intelephense'

Server Configuration

  • command
[
  "intelephense",
  "--stdio"
]
  • shell command
intelephense --stdio
  • selector
embedding.php
  • priority_selector
(source.php)
  • init_options
{
  "clearCache": false,
  "licenceKey": ""
}
  • settings
{}
  • env
{
  "PATH": "/home/stefano/.cache/sublime-text/Package Storage/lsp_utils/node-runtime/18.18.1/node/bin:/home/stefano/.cache/sublime-text/Package Storage/lsp_utils/node-runtime/18.18.1/node/bin:"
}

Active view

  • File name
/home/stefano/localhost/garanzieariete/app/Views/user/doa_righe_sparate/lista_doa_righe_sparate.php
  • Settings
{
  "auto_complete_selector": "meta.tag, source - comment - string.quoted.double.block - string.quoted.single.block - string.unquoted.heredoc",
  "lsp_active": null,
  "syntax": "Packages/PHP/PHP.sublime-syntax"
}
  • base scope
embedding.php

Project / Workspace

  • folders
[
  "/home/stefano/localhost/garanzieariete"
]
  • is project: False

LSP configuration

## System PATH - /usr/local/sbin - /usr/local/bin - /usr/sbin - /usr/bin - /sbin - /bin - /usr/games - /usr/local/games - /snap/bin
0 Likes

#16

This looks weird. You must have edited LSP-intelephense’s settings.

0 Likes

#17

I haven’t , how can i reset configuration ?

0 Likes

#18

0 Likes

#19

ok but wich is standard configuration ?

0 Likes

#20

left is default, right is yours. you can let the right side be just

{
}
0 Likes