felixfbecker / php-language-server

PHP Implementation of the VS Code Language Server Protocol 🆚↔🖥
ISC License
1.15k stars 185 forks source link

Cache project index, not just dependencies #578

Open geromueller opened 6 years ago

geromueller commented 6 years ago

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.

felixfbecker commented 6 years ago

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

geromueller commented 6 years ago

@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:

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 commented 6 years ago

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?

felixfbecker commented 6 years ago

What is your log output in the output panel?

geromueller commented 6 years ago

[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 commented 6 years ago

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

felixfbecker commented 6 years ago

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

geromueller commented 6 years ago

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

iBobik commented 5 years ago

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

Is there some workaround better than disabling intellisence?

klausi commented 5 years ago

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

ghost commented 5 years ago

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.