-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Linter Error "Classlike is not defined or imported anywhere." #314
Comments
Same issue for me on macOS 10.13 Beta (17A306f) |
same issue here too |
Do none of your classes work? Are there any errors showing up during an "Index Project" operation (either as notification or in the developer tools)? Does a simple, separate project work? |
A small simple project works fine. On my main project I deleted all three project-related
The linter error The table When I open, edit and save a file from that subtree and reload table My
|
Same issue for me on
|
@schipa If I understood correctly: if you edit a single file that is inside the subtree that is not indexed, it suddenly does show up in the In that case it is likely indexing of the files in the subfolder is skipped or broken off for some reason. File permissions seem unlikely as it does work when manually editing a file. That leaves indexing errors, which would be really strange since:
What you could try is opening up |
Correct! I added The dev tools console only states
The project path is |
This is getting stranger by the minute. Could you try commenting out the ModificationTimeFilterIterator, ExclusionFilterIterator, and ExtensionFilterIterator just above the loop? I don't expect this to be the issue (unless perhaps you have a filesystem without modification timestamps and the code is doing something weird with them as a result, instead), but it never hurts to rule out everything. This should leave just the MultiRecursivePathIterator, which does the actual path scanning and should be returning all files and folders in your project tree. If it still doesn't show up, it may be worth opening up MultiRecursivePathIterator (it is rather small) to see if it is the culprit. |
Still missing the subtree. I re-examined the I uncommented the three FilterIterators and replaced debugging in line 131 with Last two lines from the dev tools console:
So the iterator is in fact not missing the subtree but the process is dying beforehand. Strange that no error was given in that case.
Did this happen because of missing symlink handling or because I'm on Windows and Either way, adding this path to Maybe a symlink handling in MultiRecursivePathIterator.php#L48 could fix this!? |
Good to hear that we're getting closer. I don't know what kind of symlink/SFTP mounting you are using in Windows, but IIRC Windows does not have any sort of native SFTP mounting (it does have FTP, I believe?), so it is very well possible that the software you are using to do this doesn't actually expose "real" folders in the sense that they iterate in the same way as other folders. On Linux systems "special" filesystems or remote connections such as SFTP can be mounted transparantly using software such as gvfs, so it should work there at least. It could indeed also be related to symlinks, but if you look a couple of lines higher, symlinks are already followed when iterating the directory structure. The fact that the total also lists a high amount means that these files are actually included in the traversal. But I believe You can also try removing |
If I set I use SFTP Net Drive. I can open a symlink file and the code of the linked file is loaded but the dev tools state
|
Same issue for me, except I'm new to atom so I haven't upgraded from a previously working version. OS: Ubuntu 16.04 Trying to use Atom with a project I usually manage with PHPStorm. Basically the entire project flags up as "Classlike is not defined or imported anywhere". Followed the instructions here (https://php.earth/docs/interop/atom) for my setup. I've tried re-indexing/restarting etc. Console shows an unexpected php socket close at the end of indexing. This is quite an old issue, has someone found a workaround? UPDATE: After increasing the memory available to php-integrator-base from 1 to 2 GB in its settings and restarting Atom, my index completed successfully and classes resolved. Had a hunch after noticing in the integrator code that the PHP instance created seems to be being started with the same core.memoryLimit that was configured in integrator. Assumed PHP was running out of memory trying to index such a large project. Could be a total red herring but... I'm now working. |
@neobyteUK Glad to hear that fixed it for you! I haven't been able to reproduce the exact same issue, but there is a somewhat similar issue where everything works one moment, you then open a file with a class you are using in the previous flie, switch back to the previous file without making any modifications, and all of a sudden the class is flagged as "not found", even though you didn't modify the file that contains it. I've verified that the class disappears from the index (but not the file, strangely enough) and no index is supposedly happening, but I'm still figuring out how or why this is happening. |
I've fixed an issue in core 3.2.0 that caused files to disappear from the index sometimes. Could someone experiencing this problem verify that this still occurs? |
PHP-Integrator: 3.2.0 The indexer appears to be ignoring most things within my "vendor" directory, unless I edit a file. My vendor directory is in the root folder and also git ignored. It's a standard Lumen project (https://lumen.laravel.com/) with only modified & added files existing under the "app" directory. I've tried re-indexing and force re-indexing which haven't included the additional classes. |
@madrussa Unfortunately setting up a lumen project here via Does anything strange about your setup come to mind, such as having files on an (S)FTP server on Windows as previously described, or messages showing up in the developer tools console? Another thing you could try is following the instructions previously posted here about debugging the core - note that the file to go to has now changed to this one due to refactoring. |
We have a few large packages included which could be slowing things down. I noticed the indexer running continuously for two days now approx 14hrs. {
"php": ">=7.0",
"nesbot/carbon": "~1.22",
"laravel/lumen-framework": "5.4.*",
"vlucas/phpdotenv": "~2.2",
"guzzlehttp/guzzle": "^6.1",
"spomky-labs/otphp": "^6.0",
"appzcoder/lumen-routes-list": "^1.0",
"doctrine/dbal": "^2.5",
"squizlabs/php_codesniffer": "*",
"soapbox/laravel-formatter": "^2.0",
"php-amqplib/php-amqplib": "^2.6",
"goodby/csv": "*",
"filp/whoops": "^2.1",
"illuminate/mail": "v5.4.*",
"aws/aws-sdk-php": "^3.28",
"bramus/monolog-colored-line-formatter": "~2.0",
"astrogin/laravel-mysql-spatial": "^1.0",
"dusterio/laravel-plain-sqs": "^0.1.8",
"zendframework/zend-soap": "^2.6",
"symfony/psr-http-message-bridge": "^1.0",
"fideloper/proxy": "^3.3",
"phpoffice/phpspreadsheet": "^1.0",
"mpdf/mpdf": "^7.0",
"jpgraph/jpgraph": "^4.0",
"dompdf/dompdf": "^0.8.0"
} I'll implement the core bugging and let you know how I get on. |
Mac OS High Sierra Needed to index a large project (Magento 2.2.2 EE). I had to increase core memory to 8GB and then only indexing finished. Looks like it is still using the whole memory allotted. Possible memory management issue? I am able to see class hinting now. |
Windows 10 w/ WSL I had a fix by increasing memory to 4GB. The process now sits at 2.7GB after indexing, pretty hefty. The issue also occurs when using the new syntax use App{One, Two, Three, Four, Five}; It doesn't seems to understand multiple classes on the same line. If I split them into separate lines all of the errors go away. |
Just ran into this myself. namespace In2it\HelloWorld\Test;
use PHPUnit\Framework\TestCase as Foo;
class HelloTraitTest extends Foo\Framework\TestCase {} The docs say:
So, the above example |
@twifty You are correct (and the docs are too, of course), though it is likely that it is not that this isn't resolving correctly, but rather that for some reason the In other words, the example is supported and should work, but I have yet to figure out why on rare occasions the core bails the file out of the index 🤔 . |
…index Relates to https://gitlab.com/Serenata/Serenata/issues/183 . References #314 (though not the same issue)
I think I've (finally) identified what the problem is. (I don't know how this suddenly occurred to me, since I wasn't looking for it in particular.) Every time the core/server is updated, the version number changes (obviously). This version number is taken up into the path to the core as the folder it is in is named after the version. When a new project is set up, the built-in stubs are indexed first, but these are stored in the I've confirmed and fixed this issue. I still need to give it a bit of testing, but everything works fine, I'll release it soonish. I've also fixed another issue pertaining to user-defined classes sometimes disappearing when closing files after modifying them and before they had a chance to index, which was another pesky one that has been around for quite some time. |
Hi, Is this problem fixed? I have it on the latest version of Serenata and Atom... |
Yeah, I'm running into this as well. New version of Atom, new version of Serenata. |
It will definitely be in 5.0! |
After upgrading
php-integrator-base
from 2.1.13 with PHP 5.6.30 to 3.0.1 with PHP 7.1.7 all type annotations for self written classes show this linter error:Classlike is not defined or imported anywhere.
By now I reindexed the project and restarted atom multiple times.
Before upgrading everything worked fine.
System Info
OS: Win 10, x64
PHP: 7.1.7 x64
Atom: 1.18.0
The text was updated successfully, but these errors were encountered: