php-language-server icon indicating copy to clipboard operation
php-language-server copied to clipboard

Cache project index, not just dependencies

Open geromueller opened this issue 7 years ago • 11 comments

I work on a huge PHP project and indexing takes ~30minutes. Currently PHPLS uses the xcache caching, rendering the extension useless for me. FileSystemCache would make a better default I think, and only use xache on demand.

geromueller avatar Jan 17 '18 00:01 geromueller

@geromueller the LS uses FileSystemCache as default. Anything that indicates to you that it doesn't?

felixfbecker avatar Jan 17 '18 00:01 felixfbecker

@felixfbecker I replied via Email, but only to you, so here are more details:

Every time I open VSC it re-indexes, no cache directory present. What I tried:

  • create folders $HOME/.phpls $HOME/.cache/phpls
  • create workspace and add subporjects as folders
  • open only subproject folder

still no cached files..

The project consists of nested PHP projects (composer.json/.lock).. PHP 7.2.1, no xcache installed. Code OSS 1.19.2 PHP IS 2.2.5 ArchLinux (up to date)

geromueller avatar Feb 01 '18 00:02 geromueller

Bump! LS is still not caching anything. Ran strace on the Language Server process and it does not write to any file. How can I test fixes on the LS using VS Code?

geromueller avatar Feb 19 '18 00:02 geromueller

What is your log output in the output panel?

felixfbecker avatar Feb 19 '18 00:02 felixfbecker

[Info - 10:11:27] 9489 files total [Info - 10:11:27] Indexing project for definitions and static references Parsing file:///home/gmueller/.....php [Info - 10:17:59] 0 Packages [Info - 10:17:59] All 9489 PHP files parsed in 391 seconds. 294 MiB allocated.

geromueller avatar Feb 19 '18 00:02 geromueller

Have one workspace with 4 folders, each containing a composer project

geromueller avatar Feb 19 '18 00:02 geromueller

Only dependencies are cached because we know to invalidate the cache if the version changed. How would you invalidate the project cache? Any changes can happen between runs, like a git checkout

felixfbecker avatar Feb 19 '18 00:02 felixfbecker

On startup you could compare the ctime of the cache file and the source file. And during runtime use inotify?

geromueller avatar Feb 19 '18 00:02 geromueller

My usual Drupal project has 18766 files total which takes even longer.

Is there some workaround better than disabling intellisence?

iBobik avatar May 24 '19 14:05 iBobik

The current workaround is to use the intelephense extension https://marketplace.visualstudio.com/items?itemName=bmewburn.vscode-intelephense-client instead, which is also recommended by the drupal.org VSCode documentation at https://www.drupal.org/docs/develop/development-tools/configuring-visual-studio-code

klausi avatar May 27 '19 21:05 klausi

I can confirm that the project index is basically rebuilt every time things are restarted, which makes this project mostly worthless to me. Would be nice to have indexing saved.

ghost avatar Sep 23 '19 14:09 ghost