Skip to content

Cache project index, not just dependencies #578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
geromueller opened this issue Jan 17, 2018 · 11 comments
Open

Cache project index, not just dependencies #578

geromueller opened this issue Jan 17, 2018 · 11 comments

Comments

@geromueller
Copy link

geromueller commented Jan 17, 2018

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
Copy link
Owner

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

@geromueller
Copy link
Author

@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
Copy link
Author

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
Copy link
Owner

What is your log output in the output panel?

@geromueller
Copy link
Author

[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
Copy link
Author

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

@felixfbecker
Copy link
Owner

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
Copy link
Author

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

@felixfbecker felixfbecker changed the title Use FileSystemCache as default or provide config Cache project index, not just dependencies Feb 20, 2018
@iBobik
Copy link

iBobik commented May 24, 2019

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

Is there some workaround better than disabling intellisence?

@klausi
Copy link

klausi commented May 27, 2019

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
Copy link

ghost commented Sep 23, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants