Comments (20)
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"]
from vscode-intelephense.
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.
from vscode-intelephense.
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!
from vscode-intelephense.
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.
Anyone able to give me some more info?
EDIT: Turns out I needed to run the PHP Intelephense "Clear Cache and Reload" command.
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
from vscode-intelephense.
I think it's best to open a new issue. Please add a code example and describe the actual problem.
from vscode-intelephense.
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.
from vscode-intelephense.
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?
from vscode-intelephense.
@zorfling that's correct. It will use the php file association values when finding files and default to *.php
if there are none.
from vscode-intelephense.
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"
},
from vscode-intelephense.
Next release I'll include *.php
regardless of files.associations
setting as this issue seems pretty common.
from vscode-intelephense.
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 👍
from vscode-intelephense.
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.
Anyone able to give me some more info?
EDIT: Turns out I needed to run the PHP Intelephense "Clear Cache and Reload" command.
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!
from vscode-intelephense.
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).
from vscode-intelephense.
@bmewburn Clear Cache and Reload
is not available anymore, if there away to force reindex the workspace ?
from vscode-intelephense.
@ctf0 it's now Index workspace
from vscode-intelephense.
@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
from vscode-intelephense.
@ctf0 what is the issue you are trying to solve? The command above will start the workspace indexing and overwrite the cache.
from vscode-intelephense.
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
from vscode-intelephense.
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.
from vscode-intelephense.
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
from vscode-intelephense.
Related Issues (20)
- Intelephense indicates PHP SSH2 functions and constant undefined HOT 1
- `autoload-dev` seems to be ignored when renaming namespaces
- Recognizing defined constants for being objects has still an another bug
- erroneous expect type 'string' found 'void' HOT 2
- Constant marked "Undefined" in if-clause which checks if constant is defined. HOT 1
- Navigate to classes from yaml files
- Wrong type on dynamic object with string|null
- Enhance type recognition for values in SplDoublyLinkedList
- assert diagnostics
- Syntax error with dynamic enum access in PHP 8.3
- Unexpected P1010 Undefined function error for oci_set_prefetch_lob
- Process Itelephense filters on folders
- Autocomplete functions and attributes of variables in debug console
- Invalid Namespace definition
- I can't go to the method definition HOT 2
- PHP open and close brackets always seem to be misaligned when with HTML HOT 1
- Undefined method 'createToken'. P1013 HOT 1
- Add references HOT 1
- Laravel No definition found for .... HOT 1
- intelephense indexing take too long time HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-intelephense.