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

"Darn, we've crahsed!" A bug ? #336

Closed
oknixus opened this issue Sep 17, 2017 · 10 comments
Closed

"Darn, we've crahsed!" A bug ? #336

oknixus opened this issue Sep 17, 2017 · 10 comments

Comments

@oknixus
Copy link

oknixus commented Sep 17, 2017

You've likely hit a bug. Feel free to report it on the bug tracker. If you do, please include the information printed below.

The server will attempt to restart itself.

→ Message 1
Either position (10, 0) is out of bounds in file '/Applications/MAMP/htdocs/sample.oknixus.com/resources/views/users/index.blade.php', or no namespace was returned for it. Every position in file must match a single namespace (files without explicit namespaces have an anonymous namespace).

→ Location 1
/Users/Nixus/.atom/packages/php-integrator-base/core/3.0.0/vendor/php-integrator/name-qualification-utilities/src/PositionalNamespaceDeterminer.php:44

→ Backtrace 1
#0 /Users/Nixus/.atom/packages/php-integrator-base/core/3.0.0/src/UserInterface/Command/DeduceTypesCommand.php(219): PhpIntegrator\NameQualificationUtilities\PositionalNamespaceDeterminer->determine(Object(PhpIntegrator\Common\FilePosition))
#1 /Users/Nixus/.atom/packages/php-integrator-base/core/3.0.0/src/UserInterface/Command/DeduceTypesCommand.php(200): PhpIntegrator\UserInterface\Command\DeduceTypesCommand->attachRelevantNamespaceToNode(Object(PhpParser\Node\Expr\Variable), Object(PhpIntegrator\Indexing\Structures\File), 10)
#2 /Users/Nixus/.atom/packages/php-integrator-base/core/3.0.0/src/UserInterface/Command/DeduceTypesCommand.php(164): PhpIntegrator\UserInterface\Command\DeduceTypesCommand->deduceTypesFromNode(Object(PhpIntegrator\Indexing\Structures\File), '@extends('layou...', Object(PhpParser\Node\Expr\Variable), 340)
#3 /Users/Nixus/.atom/packages/php-integrator-base/core/3.0.0/src/UserInterface/Command/DeduceTypesCommand.php(133): PhpIntegrator\UserInterface\Command\DeduceTypesCommand->deduceTypesFromExpression(Object(PhpIntegrator\Indexing\Structures\File), '@extends('layou...', '@extends('layou...', 340, true)
#4 /Users/Nixus/.atom/packages/php-integrator-base/core/3.0.0/src/UserInterface/Command/DeduceTypesCommand.php(111): PhpIntegrator\UserInterface\Command\DeduceTypesCommand->deduceTypes('/Applications/M...', '@extends('layou...', '@extends('layou...', 340, true)
#5 /Users/Nixus/.atom/packages/php-integrator-base/core/3.0.0/src/UserInterface/JsonRpcApplication.php(222): PhpIntegrator\UserInterface\Command\DeduceTypesCommand->execute(Object(ArrayObject))
#6 /Users/Nixus/.atom/packages/php-integrator-base/core/3.0.0/src/UserInterface/JsonRpcApplication.php(123): PhpIntegrator\UserInterface\JsonRpcApplication->handleRequest(Object(PhpIntegrator\Sockets\JsonRpcRequest), Object(PhpIntegrator\Sockets\JsonRpcConnectionHandler))
#7 /Users/Nixus/.atom/packages/php-integrator-base/core/3.0.0/src/Sockets/JsonRpcConnectionHandler.php(181): PhpIntegrator\UserInterface\JsonRpcApplication->handle(Object(PhpIntegrator\Sockets\JsonRpcRequest), Object(PhpIntegrator\Sockets\JsonRpcConnectionHandler))
#8 /Users/Nixus/.atom/packages/php-integrator-base/core/3.0.0/src/Sockets/JsonRpcConnectionHandler.php(153): PhpIntegrator\Sockets\JsonRpcConnectionHandler->getJsonRpcResponseForJsonRpcRequest(Object(PhpIntegrator\Sockets\JsonRpcRequest))
#9 /Users/Nixus/.atom/packages/php-integrator-base/core/3.0.0/src/Sockets/JsonRpcConnectionHandler.php(170): PhpIntegrator\Sockets\JsonRpcConnectionHandler->processData('{"jsonrpc":2,"i...')
#10 /Users/Nixus/.atom/packages/php-integrator-base/core/3.0.0/src/Sockets/JsonRpcConnectionHandler.php(170): PhpIntegrator\Sockets\JsonRpcConnectionHandler->processData('{"jsonrpc":2,"i...')
#11 /Users/Nixus/.atom/packages/php-integrator-base/core/3.0.0/src/Sockets/JsonRpcConnectionHandler.php(81): PhpIntegrator\Sockets\JsonRpcConnectionHandler->processData('\r\n{"jsonrpc":2,...')
#12 /Users/Nixus/.atom/packages/php-integrator-base/core/3.0.0/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(70): PhpIntegrator\Sockets\JsonRpcConnectionHandler->onDataReceived('Content-Length:...')
#13 /Users/Nixus/.atom/packages/php-integrator-base/core/3.0.0/vendor/react/stream/src/DuplexResourceStream.php(183): Evenement\EventEmitter->emit('data', Array)
#14 [internal function]: React\Stream\DuplexResourceStream->handleData(Resource id #235, Object(React\EventLoop\StreamSelectLoop))
#15 /Users/Nixus/.atom/packages/php-integrator-base/core/3.0.0/vendor/react/event-loop/src/StreamSelectLoop.php(236): call_user_func(Array, Resource id #235, Object(React\EventLoop\StreamSelectLoop))
#16 /Users/Nixus/.atom/packages/php-integrator-base/core/3.0.0/vendor/react/event-loop/src/StreamSelectLoop.php(205): React\EventLoop\StreamSelectLoop->waitForStreamActivity(NULL)
#17 /Users/Nixus/.atom/packages/php-integrator-base/core/3.0.0/src/UserInterface/JsonRpcApplication.php(72): React\EventLoop\StreamSelectLoop->run()
#18 /Users/Nixus/.atom/packages/php-integrator-base/core/3.0.0/src/Main.php(70): PhpIntegrator\UserInterface\JsonRpcApplication->run()
#19 {main}

@mdeboer
Copy link

mdeboer commented Sep 28, 2017

Same error here and it happens for no reason as it disappears when I change a few lines and I can't trigger it again. It seems really random but it happens multiple times a day for me (a few other errors as well). I have my finger at the escape button after every safe 😢

@mdeboer
Copy link

mdeboer commented Sep 28, 2017

Oh, apparently this is a known bug, see the issue tracked in the core repo:
https://gitlab.com/php-integrator/core/issues/126

@mkarnicki
Copy link

Wow, reported on gitlab 3 months ago and no activity whatsoever. Man, this bug is so frustrating, yet I can't see this fixed anytime soon 👎 :(

@Talv
Copy link

Talv commented Sep 28, 2017

Dude, it's open source. If you want it fixed now, just dive into the code. Or simply use v2 of php-core by installing legacy packages (although it has goto broken, if you use Atom never than 1.20).

It's worth to mention there's only one man behind this project, thus I think it's understandable there are some periods where development slows down.

@mkarnicki
Copy link

Thanks for chiming in, Talv. If I wanted it fixed now I would call Gert and tell him I'll pay for the fix. It's like I can't express being sad there's an outstanding bug in a project? Dude, I can wait.

You're right, I didn't know it's a one man thing. What's more, it was Gert who filed the bug, so clearly he's aware of it. It's a shame he didn't have time over last two months to fix this, but it's not like I don't understand. I've worked on open source nearly 6 years and I know what it entails. If you put a great product out there, there will be reactions, it's how it goes.

Lastly, if I was capable of fixing it myself, I wouldn't be wasting time commenting here. The fact a project is open source doesn't mean a bug reporter is capable of fixing it (man, that would be awesome). If I were, I'd send a PR instead, wouldn't I :)?

I think it's an awesome project and if I continue using it (I've been using Atom a couple months maybe), I'll happily contribute. Cheers.

@mdeboer
Copy link

mdeboer commented Sep 28, 2017

It's a bit confusing as the language server part is on Gitlab opposed to GitHub (I wonder why this hasn't been moved). But the bug involves a lot more than just a few lines, it most likely requires some rethinking and depends on other open issues.

Even without the needed experience I can imagine your input being helpful to find a good solution.

For the time being I think having an option to silence all errors that cause a restart would be very helpful and at least won't distract people from their work.

I'd be happy to help but I think since it's been a few months it'd be helpful to have a heads up from @Gert-dev to see where we're at and where we can help.

@Talv
Copy link

Talv commented Sep 29, 2017

@mkarnicki
Well, I tend to be annoyed by meaningless complaints on issue tracker, such as the one you made above. Sure, you're free to express anything, but simply be nice and/or constructive when doing so. So that project can benefit from it.

Although I can understand your reaction better, if you say you've assumed the related issue on Gitlab was submitted by user, and not the author himself. What could look like it got no attention at all.

I got triggered, mostly because I find this project to be very well maintainted.

Anyway, I'm glad we're on the same page after all buddy ;)

In regards to reported issue some aspect of it was already adressed by implemententation event queue.
So one could guess it might soon be fixed. Especially as it is pined for release in 3.1.

This ticket is duplicate of #335, which is a duplicate of #332 ... #319 #318 😅

It's a bit confusing as the language server part is on Gitlab opposed to GitHub (I wonder why this hasn't been moved). But the bug involves a lot more than just a few lines, it most likely requires some rethinking and depends on other open issues.

Initially the core package was on Github. See: #297 (comment)

@mdeboer
Copy link

mdeboer commented Sep 29, 2017

@Talv I pity the choice as GitLab is down all the time. I used that before I switched to BitBucket ... but now I see GitHub is more than worth its money as a business, not to mention open source projects. Though it's completely offtopic, I still vote it should be on GitHub or be on GitLab, not both as you get duplicate tickets.

@Gert-dev
Copy link
Owner

I'll close this since it is indeed, as @Talv mentioned, a duplicate and a known issue.

About the GitHub - GitLab mix: I've grown rather fond of GitLab. In fact, I wanted to start out on GitLab, unfortunately Atom packages seem to have a hard requirement on being on GitHub. I'm not entirely sure of this (i.e. whether it's hardcoded in apm itself), but all the instructions on the Atom site seem to refer to GitHub. I don't blame Atom, since it's a project steered by GitHub itself and it requires an integration for authentication with the package registry, but it is a bit unfortunate.

In any case, in time all the other php-integrator GitHub repositories should disappear and only the base package will remain as more functionality is moved to the core :-).

As to where the current status is at: it is true that this is mostly a one-man project. This is not a complaint, I don't mind not having a lot of contributions; I started this to scratch a personal itch and I don't think I'll stop scratching anytime soon, at least not as I'm using this myself on a day-to-day basis. This does mean, as Talv mentioned, that there may be periods where development slows down or it may seem like I'm preferring specific issues over others. To be frank, that is probably actually the case, as I try to focus my time in areas that are either really buggy or affect me personally.

In any case, there are some annoying bugs remaining, such as this one, which has always been present, but has just been popping up an error because I added more logic checks in 3.0, but I regard PHP Integrator as mostly stable. Not in the sense that it's feature complete and I don't intend to add anything new, but more in the sense that it does what it needs to do reasonably well and supports most standard and somewhat more exotic PHP code bases.

In any case, if you wish to contribute in code, I'll welcome it with open arms (it may take some time to get around to reviewing it, though). Area's that can use improvement are mostly listed in the core issue tracker. I've also added a simple contribution guide to the core.

I understand that some people prefer to work on own projects, rather than someone else's project, especially if it is large. I'm open to replacing parts of the core's code with a dependency on someone else's project doing the same thing. For example, I contacted the phpstan devs [1] to see if the core's linter could somehow be hooked into phpstan, as its linting is much more advanced. This would not only be a major improvement for users, but could also reduce the scope of the core.

[1] phpstan/phpstan#420

@mdeboer
Copy link

mdeboer commented Oct 1, 2017

As for the linting part of the core, I wouldn't bother too much as we have plenty of great alternatives like PHPCS, PHPMD, PHAN and phpstan (that one is new to me, thanks!). Having these separate from the IDE is crucial so they can be run in CI.

However, autocompletion is the main reason I use the package (or well, packages). I've yet have to come across an editor that provides PHP autocompletion so well AND have a easy to use UI. It's this weird love and hate relationship I have with Atom. It can be slow and a pita but every day I get back to it and work on my code without it getting into my way and just being a fancy editor. So no pressure @Gert-dev but you have made an awesome PHP autocomplete package and I'm looking forward contributing one day 👍

Gert-dev added a commit that referenced this issue Jul 1, 2018
We fixed the issue that this resulted in empty contents being sent to
the server, but now any last changes are just ignored because
onDidStopChanging is not triggered anymore after the editor closes. This
change fixes that.

This coincidentally also fixes #336.

Relates to https://gitlab.com/Serenata/Serenata/issues/183

Fixes #336
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

5 participants