Gert-dev / php-ide-serenata

Atom IDE package that integrates the Serenata server to provide PHP code assistance
https://serenata.gitlab.io/
Other
275 stars 22 forks source link

Issue's on windows after installing latest version #494

Closed PublicWorksTim closed 4 years ago

PublicWorksTim commented 4 years ago

I wish I had never updated tot he latest version. It broke after installing it.

I've tried multiple things to fix and some give me partial functionality until I restart Atom and then nothing works anymore again.

I've reinstalled the plugin multiple times. Removed the generated files in the appdata folder a few times as well. Even tried installing a previous version. (Did not work for some reason as well) Scoured both this github issue list and the Serenata issue list for people having problems with the latest installation but no clue.

When I reinstall and reboot Atom the settings test works correctly. But once I install the server even before setting up the project it starts indexing. Then I have partial functionality when I hover/click/autocomplete. But after restarting Atom it stops working. Then I try setting up the project trough the new option and it restarts the indexing. But during and after the indexing I only get the following error and nothing works:

PHP (Serenata) rpc.sendRequest textDocument/hover threw ResponseError: Line 57 and character 28 are not in range of string at handleResponse (C:\Atom.atom\packages\php-ide-serenata\node_modules\vscode-jsonrpc\lib\main.js:436:48) at processMessageQueue (C:\Atom.atom\packages\php-ide-serenata\node_modules\vscode-jsonrpc\lib\main.js:263:17) at Immediate.setImmediate (C:\Atom.atom\packages\php-ide-serenata\node_modules\vscode-jsonrpc\lib\main.js:247:13) at runCallback (timers.js:696:18) at tryOnImmediate (timers.js:667:5) at processImmediate (timers.js:649:5)

Gert-dev commented 4 years ago

Hi.

The indexing starts happening before you set up a project since 5.0 as it tries to set up a configuration for your project automatically. This auto-configures the server so users wanting to quickly edit a PHP file don't need to set up an entire project explicitly. The index database is then stored inside your system's temporary folder.

If you set up the project explicitly, the existing indexing is cancelled and the index is stored inside your project's folder, along with a configuration file for the project. Since the temp folder can be pruned every so often, making an explicit configuration makes the database more permanent.

The error you posted can happen if the client is requesting info for locations in the file that the server doesn't know yet (i.e. because the file was changed client side and the server hasn't received the new contents yet). As such, it is a mostly spurious error and the server should correct itself as soon as you make a modification to the file (as then the new contents are explicitly sent and indexed).

Granted, this error should probably not even be sent to the client by the server, as this is an unavoidable situation as client side edits happen independently of the server, which is tracked in this ticket.

Does functionality repair itself if you make a modification to the file that spawned the error?

PublicWorksTim commented 4 years ago

It never fixes itself.

I just tried making a small test.php file with a simple class structure and trying to initialize that class. Clicking the class name in the initializing variable doesn't bring me to the class itself.

Below more messages and info regarding the messages I get with my main project loaded.

developerConsoleLog.txt indexing

I also tried to open a smaller project and doing what I did above as well. I noticed it trying to index the file but clearly it failed if I'm to believe the developer console log:

The PHP server has something to say: Starting server bound to socket on URI tcp://127.0.0.1:39170...
C:\Atom\.atom\packag…ld\lib\logger.js:12 PHP (Serenata) rpc.sendRequest initialize threw ResponseError: An exception occurred in driver: SQLSTATE[HY000] [14] unable to open database file
    at handleResponse (C:\Atom\.atom\packages\php-ide-serenata\node_modules\vscode-jsonrpc\lib\main.js:436:48)
    at processMessageQueue (C:\Atom\.atom\packages\php-ide-serenata\node_modules\vscode-jsonrpc\lib\main.js:263:17)
    at Immediate.setImmediate (C:\Atom\.atom\packages\php-ide-serenata\node_modules\vscode-jsonrpc\lib\main.js:247:13)
    at runCallback (timers.js:696:18)
    at tryOnImmediate (timers.js:667:5)
    at processImmediate (timers.js:649:5)
internal/process/warning.js:18 (node:8528) [DEP0079] DeprecationWarning: Custom inspection function on Objects via .inspect() is deprecated
index.js:29 Unhandled promise rejection 
Promise
 with error: ResponseError: An exception occurred in driver: SQLSTATE[HY000] [14] unable to open database file
    at handleResponse (C:\Atom\.atom\packages\php-ide-serenata\node_modules\vscode-jsonrpc\lib\main.js:436:48)
    at processMessageQueue (C:\Atom\.atom\packages\php-ide-serenata\node_modules\vscode-jsonrpc\lib\main.js:263:17)
    at Immediate.setImmediate (C:\Atom\.atom\packages\php-ide-serenata\node_modules\vscode-jsonrpc\lib\main.js:247:13)
    at runCallback (timers.js:696:18)
    at tryOnImmediate (timers.js:667:5)
    at processImmediate (timers.js:649:5)
index.js:29 Unhandled promise rejection 
Promise
 with error: ResponseError: An exception occurred in driver: SQLSTATE[HY000] [14] unable to open database file
    at handleResponse (C:\Atom\.atom\packages\php-ide-serenata\node_modules\vscode-jsonrpc\lib\main.js:436:48)
    at processMessageQueue (C:\Atom\.atom\packages\php-ide-serenata\node_modules\vscode-jsonrpc\lib\main.js:263:17)
    at Immediate.setImmediate (C:\Atom\.atom\packages\php-ide-serenata\node_modules\vscode-jsonrpc\lib\main.js:247:13)
    at runCallback (timers.js:696:18)
    at tryOnImmediate (timers.js:667:5)
    at processImmediate (timers.js:649:5)
index.js:29 Unhandled promise rejection 
Promise
 with error: ResponseError: An exception occurred in driver: SQLSTATE[HY000] [14] unable to open database file
    at handleResponse (C:\Atom\.atom\packages\php-ide-serenata\node_modules\vscode-jsonrpc\lib\main.js:436:48)
    at processMessageQueue (C:\Atom\.atom\packages\php-ide-serenata\node_modules\vscode-jsonrpc\lib\main.js:263:17)
    at Immediate.setImmediate (C:\Atom\.atom\packages\php-ide-serenata\node_modules\vscode-jsonrpc\lib\main.js:247:13)
    at runCallback (timers.js:696:18)
    at tryOnImmediate (timers.js:667:5)
    at processImmediate (timers.js:649:5)
C:\Atom\.atom\packag…rpc\lib\main.js:436 Uncaught (in promise) ResponseError: An exception occurred in driver: SQLSTATE[HY000] [14] unable to open database file
    at handleResponse (C:\Atom\.atom\packages\php-ide-serenata\node_modules\vscode-jsonrpc\lib\main.js:436:48)
    at processMessageQueue (C:\Atom\.atom\packages\php-ide-serenata\node_modules\vscode-jsonrpc\lib\main.js:263:17)
    at Immediate.setImmediate (C:\Atom\.atom\packages\php-ide-serenata\node_modules\vscode-jsonrpc\lib\main.js:247:13)
    at runCallback (timers.js:696:18)
    at tryOnImmediate (timers.js:667:5)
    at processImmediate (timers.js:649:5)
2
C:\Atom\.atom\packag…tree-nav.coffee:138 clicked: Chan3
Gert-dev commented 4 years ago

You mentioned you tried removing the files in the AppData folder. Does this include removing the database itself?

If you didn't generate an explicit configuration, it is located in your system's temp folder. If you did, it is likely located inside the .serenata folder of your project (unless you reconfigured the location in the configuration file located in the same folder).

PublicWorksTim commented 4 years ago

Yes I've tried removing the whole folder in appdata and have also tried specifying a specific folder in another location.

Gert-dev commented 4 years ago

I spot from your screenshot that the URI that is being indexed file://C:/Workspace... doesn't seem to be a proper URI. This is not a valid URI - but is not something you can fix on your end.

Some investigating has already been done on Windows, and I believe the Atom languageclient sends proper URIs on Windows, which makes it likely that the handling of them whilst indexing in Serenata is faulty. I think we should move the discussion upstream to the Serenata server itself. There already is a ticket related to URI handling on Windows, which may be of interest.

I'll close this here since this is likely an upstream issue.