Skip to content
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

Project Not Indexing #38

Closed
calebporzio opened this issue Nov 23, 2017 · 20 comments
Closed

Project Not Indexing #38

calebporzio opened this issue Nov 23, 2017 · 20 comments

Comments

@calebporzio
Copy link

It seems intelephense is only indexing ~20 files, or in many cases 0 files for my php projects. Auto complete, symbol search, and goto definition seem to now work until I open a file, then it gets indexed and works well.

screen shot 2017-11-22 at 10 42 33 pm

You can find my verbose output log HERE

  • Thanks for the help!
@bmewburn
Copy link
Owner

I'm not able to reproduce the issue. I created a fresh laravel project and it indexed around 4400 files. When editing the user model go to def, symbol search, completions all worked. Note that the extension will only index files in the open folder/workspace (and descendant folders). When a workspace has been previously indexed then only those files that have been modified outside of a vscode session will be reindexed. This is why it will quite often show 0 files indexed when reopening.

screenshot from 2017-11-25 22-09-27

@zorfling
Copy link

I had a similar issue, turned out I had

  "files.associations": {
    "*.inc": "php"
  }

And it was indexing only the *.inc files.

@bmewburn - is it correct that files.associations is meant to replace the file associations and so I would need to list *.php here too?

Anyway, can confirm either removing the files.associations or adding "*.php": "php" seems to fix this issue for me.

I wonder @calebporzio, does this solve your issue too?

@bmewburn
Copy link
Owner

@zorfling that's correct. It will use the php file association values when finding files and default to *.php if there are none.

@calebporzio
Copy link
Author

Boom! fixed! thanks @zorfling. I had my file associations set for .php_cs files:

"files.associations": {
        ".php_cs": "php",
        ".php_cs.dist": "php"
    },

Everything is indexing fine now, thanks!

@chrisatomix
Copy link

Thanks for posting that fix, I was getting either 0 files or 19 files indexed on a Laravel app, until I updated my settings to this:

    "files.associations": {
        ".php_cs": "php",
        "*.php": "php"
    },

Much better!
image

@bmewburn
Copy link
Owner

Next release I'll include *.php regardless of files.associations setting as this issue seems pretty common.

@zorfling
Copy link

Thanks @bmewburn

On further reading it seems like that might be how files.associations is supposed to work (an addition, not a replacement).

VS Code docs don't seem to suggest you need to add *.php in there as well.

Anyway, thanks very much! Loving Intelephense now it's indexing 👍

@la-jamesh
Copy link

la-jamesh commented May 21, 2018

I have added the following

"files.associations": {
        ".php_cs": "php",
        "*.php": "php"
    },

And I'm still seeing this when I try to index my laravel project.
screen shot 2018-05-21 at 4 26 59 pm

Anyone able to give me some more info?

EDIT: Turns out I needed to run the PHP Intelephense "Clear Cache and Reload" command.
screen shot 2018-05-23 at 1 50 34 pm

Then I was in business.

[Info  - 13:29:25] Initialising
[Info  - 13:29:30] Initialised in 4892 ms
[Info  - 13:29:30] Intelephense 0.8.6
[Info  - 13:29:30] Indexing started.
[Info  - 13:31:59] Indexing ended | 9630 files | 148.796 s

@lefrankleal
Copy link

I have added the following

"files.associations": {
        ".php_cs": "php",
        "*.php": "php"
    },

And I'm still seeing this when I try to index my laravel project.
screen shot 2018-05-21 at 4 26 59 pm

Anyone able to give me some more info?

EDIT: Turns out I needed to run the PHP Intelephense "Clear Cache and Reload" command.
screen shot 2018-05-23 at 1 50 34 pm

Then I was in business.

[Info  - 13:29:25] Initialising
[Info  - 13:29:30] Initialised in 4892 ms
[Info  - 13:29:30] Intelephense 0.8.6
[Info  - 13:29:30] Indexing started.
[Info  - 13:31:59] Indexing ended | 9630 files | 148.796 s

this worked for me, Clear Cache and Reload, thanks!

@msankhala
Copy link

The solution provided in the above comments was not working for me. I have to add the following settings in settings.json

"intelephense.files.associations": ["*.php", "*.phtml", "*.inc", "*.module", "*.install", "*.theme", ".engine", ".profile", ".info", ".test"]

@jmsosso
Copy link

jmsosso commented Mar 4, 2019

All the day trying to figure out why this morning Intelephense was not indexing all my files. Last week it was working fine.
@msankhala solution worked for my Drupal project.

@marioawad
Copy link

As of now only the solution provided by @msankhala works!
However, some of the extensions are preceded with *. and other with just .
Is there are reason for that? (I did normalize to *. on my end and things are working fine).

@ctf0
Copy link

ctf0 commented May 3, 2019

@bmewburn Clear Cache and Reload is not available anymore, if there away to force reindex the workspace ?

@bmewburn
Copy link
Owner

bmewburn commented May 3, 2019

@ctf0 it's now Index workspace

@ctf0
Copy link

ctf0 commented May 3, 2019

@bmewburn using the command doesnt force the reindex "the ext output remains the same", i think this is related to the smart indexing that u mentioned earlier.
but what i expected is that the ext will remove the cache and start reindexing

@bmewburn
Copy link
Owner

bmewburn commented May 3, 2019

@ctf0 what is the issue you are trying to solve? The command above will start the workspace indexing and overwrite the cache.

@ctf0
Copy link

ctf0 commented May 3, 2019

sometimes i can ctrl+click or get autocomplete for traits & the output i get always remains

[Info  - 1:26:36 AM] Initialising intelephense 1.0.14
[Info  - 1:26:36 AM] Reading state from c:\Users\abc\AppData\Roaming\Code\User\workspaceStorage\89758ba8bd8845fd29027fd75b534fb3\bmewburn.vscode-intelephense-client\72cba44c.
[Info  - 1:26:36 AM] Initialised in 161 ms
[Info  - 1:26:42 AM] Indexing started.
[Info  - 1:26:42 AM] Indexing ended. 3 files indexed in 0s.

so i thought using the command will clear all and give a different output

@bmewburn
Copy link
Owner

bmewburn commented May 3, 2019

The file count is just the number of files that needed to be indexed outside of what has already been indexed previously, not necessarily all files in the workspace. If it's not picking up all your files then make sure you have all the php file extensions that you use listed in the intelephense.files.associations setting. If you really want to make sure the cache is removed then you can manually delete the dir listed in the output.

@ctf0
Copy link

ctf0 commented May 3, 2019

  • intelephense.files.associations settings is the default
  • i've also set "search.useIgnoreFiles": false, to include the vendor folder into the global goto
  • and i've removed all the folders under workspaceStorage and the output is now
[Info  - 1:42:53 AM] Initialising intelephense 1.0.14
[Info  - 1:42:53 AM] Initialised in 11 ms
[Info  - 1:42:53 AM] Indexing started.
[Info  - 1:43:08 AM] Indexing ended. 194 files indexed in 15s.
[Info  - 1:43:08 AM] Writing state to c:\Users\abc\AppData\Roaming\Code\User\workspaceStorage\89758ba8bd8845fd29027fd75b534fb3\bmewburn.vscode-intelephense-client\72cba44c.
[Info  - 1:43:08 AM] Wrote state in 0.2s.

which is definitely incorrect.

if there is something i can offer to help debug, plz do tell

@bmewburn
Copy link
Owner

bmewburn commented May 3, 2019

I think it's best to open a new issue. Please add a code example and describe the actual problem.

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

10 participants