vscode-phpactor icon indicating copy to clipboard operation
vscode-phpactor copied to clipboard

can we have a commnd to clear the project cache ?

Open ctf0 opened this issue 2 years ago • 7 comments

i dont think the reindex command actually re-index the whole project from scratch, rather it caches new files only.

this is helpfull incase u changed something from the config, ex. removing/adding from container.extension_classes

ctf0 avatar Jan 09 '23 10:01 ctf0

you can phpactor index:build --reset but adding a command to do that should be fairly simple:

https://github.com/phpactor/vscode-phpactor/blob/master/src/extension.ts#L118

adding a new command reindex (hard) or similar:

languageClient.sendRequest('indexer/reindex', {"soft": false});

dantleech avatar Jan 09 '23 10:01 dantleech

oh ok, i can make a PR with that logic if u want.

ctf0 avatar Jan 09 '23 10:01 ctf0

btw i think the LS should be restarted afterward, ex. changeing worse_reflection.stub_dir then runing the phpactor index:build --reset from the project root, doesnt update the LS until u restart the editor.

ctf0 avatar Jan 09 '23 10:01 ctf0

you don't have to restart the editor, Reload window from the command palette will restart the LSP server.

dantleech avatar Jan 09 '23 10:01 dantleech

Reload window from the command palette will restart the LSP server

ah yes thats what i meant, hopefully the new command can do that internally without the need to manually reload the window.

side question:

why its always 500 files only to be indexed ? Screen Shot 2023-01-09 at 12 37 29 PM

ctf0 avatar Jan 09 '23 10:01 ctf0

no, you will always need to restart the LSP after changing the config.

500 is the number of stub files - you'd see that if you were running index in a folder with no PHP files (or if it couldn't find any PHP files)

dantleech avatar Jan 09 '23 10:01 dantleech

no, you will always need to restart the LSP after changing the config

maybe we can add executeCommand('workbench.action.reloadWindow') after languageClient.sendRequest('indexer/reindex', {"soft": false}); has finished.

you'd see that if you were running index in a folder with no PHP files (or if it couldn't find any PHP files)

actually i see it all the time regardless, whether i ran Phpactor: Re-index workspace or phpactor index:build --reset from the project root path which has multiple php files ex._ide_helper.php

ctf0 avatar Jan 09 '23 10:01 ctf0