yaegassy / coc-intelephense

intelephense (PHP language server) extension for coc.nvim. intelephense’s various LSP features and this extension's additional features are available.
https://www.npmjs.com/package/@yaegassy/coc-intelephense
MIT License
98 stars 4 forks source link

coc-intelephense reindex every files at each lauch #64

Closed shadowwa closed 1 year ago

shadowwa commented 1 year ago

I'm used to work on php project with coc-phpls extension and, after discovering coc-intelephense, tried to switch on this extension. I noticed a different behaviour concerning the indexing:

With coc-phpls extension, when launching vim in a projet for the first time it take a long time for intelephense to index every file but afterward when closing and launching again vim, intelephense only reindex files with a timestamp more recent than then cached file. But when using coc-intelephense, each time I launch vim on a project, every files got scanned like if the cached index was not used.

here are the output of :CocCommand workspace.showOutput :

vim with coc-phpls launch on a project for the first time or with coc-phpls-data deleted (indexed in 7s)

[Info  - 13:42:43.235] Initialising intelephense 1.9.5
[Info  - 13:42:43.244] Reading state from /home/shad/.config/coc/extensions/coc-phpls-data/268c77a5.
[Info  - 13:42:43.257] Initialised in 25 ms
[Info  - 13:42:43.388] Environment changed. Refreshing 1 in memory documents.
[Info  - 13:42:43.433] Searching file:///home/shad/.config/coc/extensions/node_modules/coc-phpls/node_modules/intelephense/lib/stub for files to index.
[Info  - 13:42:43.516] Searching file:///home/shad/Work/test for files to index.
[Info  - 13:42:43.981] Indexing started.
[Info  - 13:42:51.585] Indexing ended. 3789 files indexed in 7s.
[Info  - 13:42:51.586] Writing state to /home/shad/.config/coc/extensions/coc-phpls-data/268c77a5.
[Info  - 13:42:52.087] Wrote state in 0.5s.

vim with coc-phpls launch on the same project for the second time without modifying any file (indexed in 753ms)

Info  - 13:41:51.233] Initialising intelephense 1.9.5
[Info  - 13:41:51.239] Reading state from /home/shad/.config/coc/extensions/coc-phpls-data/268c77a5.
[Info  - 13:41:51.983] Initialised in 753 ms
[Info  - 13:41:52.141] Searching file:///home/shad/.config/coc/extensions/node_modules/coc-phpls/node_modules/intelephense/lib/stub for files to index.
[Info  - 13:41:52.230] Searching file:///home/shad/Work/test for files to index.

vim with coc-phpls launch on the same project for the second time after changing the timestamp of one php file in the project (indexed in 0s)

[Info  - 14:02:15.731] Reading state from /home/shad/.config/coc/extensions/coc-phpls-data/268c77a5.
[Info  - 14:02:16.304] Initialised in 586 ms
[Info  - 14:02:16.415] Searching file:///home/shad/.config/coc/extensions/node_modules/coc-phpls/node_modules/intelephense/lib/stub for files to index.
[Info  - 14:02:16.469] Searching file:///home/shad/Work/test for files to index.
[Info  - 14:02:16.973] Indexing started.
[Info  - 14:02:17.167] Indexing ended. 1 files indexed in 0s.
[Info  - 14:02:17.168] Writing state to /home/shad/.config/coc/extensions/coc-phpls-data/268c77a5.
[Info  - 14:02:17.666] Wrote state in 0.5s.

vim with coc-intelephense launch on a project for the first time or with @yaegassy/coc-intelephense-data deleted (indexed in 8s)

[Info  - 13:46:04.543] Initialising intelephense 1.9.5
[Info  - 13:46:04.557] Initialised in 17 ms
[Info  - 13:46:04.650] Environment changed. Refreshing 1 in memory documents.
[Info  - 13:46:04.675] Searching file:///home/shad/.config/coc/extensions/node_modules/%40yaegassy/coc-intelephense/node_modules/intelephense/lib/stub for files to index.
[Info  - 13:46:04.738] Searching file:///home/shad/Work/test for files to index.
[Info  - 13:46:05.198] Indexing started.
[Info  - 13:46:13.285] Indexing ended. 3789 files indexed in 8s.
[Info  - 13:46:13.287] Writing state to /home/shad/.config/coc/extensions/@yaegassy/coc-intelephense-data/d491580.
[Info  - 13:46:13.797] Wrote state in 0.5s.

vim with coc-intelephense launch on the same project for the second time without modifying any file or changing timestamp of only one php file (indexed in 7s)

[Info  - 13:40:32.849] Initialising intelephense 1.9.5
[Info  - 13:40:32.866] Initialised in 21 ms
[Info  - 13:40:32.958] Environment changed. Refreshing 1 in memory documents.
[Info  - 13:40:32.990] Searching file:///home/shad/.config/coc/extensions/node_modules/%40yaegassy/coc-intelephense/node_modules/intelephense/lib/stub for files to index.
[Info  - 13:40:33.057] Searching file:///home/shad/Work/test for files to index.
[Info  - 13:40:33.519] Indexing started.
[Info  - 13:40:40.772] Indexing ended. 3789 files indexed in 7s.
[Info  - 13:40:40.775] Writing state to /home/shad/.config/coc/extensions/@yaegassy/coc-intelephense-data/d491580.
[Info  - 13:40:41.279] Wrote state in 0.5s.
yaegassy commented 1 year ago

Thanks for the issue report. I will make the adjustment.

yaegassy commented 1 year ago

Adjustments have been completed. A new version has already been published to npm.

yaegassy commented 1 year ago

@shadowwa Some features added by coc-intelephense were found to work based on indexing completion events. Therefore, we have reverted to the original code.

We will find time to adjust it later.

yaegassy commented 1 year ago

The re-adjustment is complete. It has been published on npm. We will close this issue now.

shadowwa commented 1 year ago

Thanks!