Comments (8)
Hello, thanks for the bug report. This happens because of using hacked php-parser. It is unable to parse line like 'a' => $a->
from padawan.php.
hmmm ok, actually if i put it on one line , then it's able to parse it correctly
by the way, now that php7 has a AST (and a lib to access it) , would it make things easier ? (like the people from this project https://github.com/etsy/phan/ are doing)
from padawan.php.
more on the bug itself, do you think it would be hard to fix, i.e if i could try my hand on it ?
from padawan.php.
@allan-simon I haven't tried it yet, but I think at least it would be faster. What about fixing this bug, right now I have not enough time and would be able to fix it only after holidays.
The problem lives here https://github.com/mkusher/padawan.php/blob/master/src/Parser/ErrorFreePhpParser.php
but if it is possible to use https://github.com/nikic/PHP-Parser/blob/master/doc/component/Error.markdown then maybe it will be easy to solve
from padawan.php.
I've added some debug in ErrorFreePhpParser, and what I can see is that most of the time the exception which get returned is
Syntax error, unexpected EOF, expecting T_STRING or T_VARIABLE or '{' or '$' on line 1
even for [ 'a' => $a-> ]
(for which autocompletion works
but for
[
'a' => $a->
]
I got :
"Syntax error, unexpected T_DOUBLE_ARROW on line 1"
from padawan.php.
oh I see what you mean, as it handles on a line per line basis , hence why it works when the beginning of the array is on the same line, and for other type of multiline statement
from padawan.php.
Is there a chance to fix it?
from padawan.php.
@golaod there should be fix in a parser logic, I'm not sure how easy it is. Currently I'm working on https://github.com/mkusher/padawan.php/pulls
from padawan.php.
Related Issues (20)
- `update` command cause `File not found` error. HOT 3
- i can generate index , but cant't most is 0 function HOT 4
- Use it and look forward to perfecting it HOT 1
- Memory Leak HOT 1
- Padawan crashes when generating index for fzaninotto/faker HOT 5
- Are traits supported? HOT 2
- Cannot execute the command padawan in terminal HOT 3
- Use a folder as reference for everything HOT 12
- Fatal error HOT 2
- FQCN.php doesn't check if countable HOT 3
- No autocomplete when accessing method/property on new line
- Add --help text to padawan and padawan-server commands HOT 5
- Returns only completions being already used in this file HOT 23
- NodeTypeResolver failed to resolve correct variable type when it's surrounded by parenthesis
- No completion, connect to padawan-server timeout, possibly related with reactphp/http HOT 3
- php 7.1 HOT 7
- Error about nikic/php-parser when installing HOT 5
- Error when trying to use the master branch HOT 1
- Its not working with PHP7.1.2 HOT 6
- Fatal error occurs when send "kill" command HOT 1
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 padawan.php.