-
Notifications
You must be signed in to change notification settings - Fork 5
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
"TypeError: Cannot read property 'length' of undefined" error with PHP file #21
Comments
trying to find the root cause of this... NOTE: whenever we have question mark the following file has no error until adding a <html>
<head>
<title>Hello World</title>
</head>
<body>a
- <
+ <?
foo();
>
</body>
</html>
|
@liuderchi Looking at the payload that comes back it seems to be because the language server is returning an object for the final part (the <? inside the body) that does not have a name. According to the language server protocol at https://microsoft.github.io/language-server-protocol/specification the name is not optional and should always be returned. We could put code in to try and deal with this inside atom-languageclient although the best solution is having the language server itself fixed. |
Next version of atom-languageclient will filter out any document symbols that have a name missing atom/atom-languageclient@aac3505 |
@damieng huge thanks for this workaround! 💯 |
v0.9.0 is now out with much better autocomplete too |
Actually use v0.9.1 - 0.9.0 has a weird autocomplete bug. |
@damieng @rsese ide-html has just released v0.4.2 (along with latest atom-languageclient). Please upgrade ide-html to confirm that it solves this issue. |
I'm not getting any errors anymore. |
I updated and can also no longer reproduce 👍 Thanks @liuderchi ✌️ |
LGTM. Will close this. Thank you guys 💯 |
Description
Reported in atom/ide-php#63.
If you have a PHP file with a .html extension, the outline view doesn't work and you get this error in devtools console:
Full error:
Expected Behavior
No error or if PHP files with a
.html
extension isn't supported, maybe a notification/error/warning in the outline view that mentions this?Actual Behavior
You get the error mentioned above and the outline view is blank.
Possible Fix
Not sure! 🤔
Steps to Reproduce
test.html
with this content:Outline View: Toggle
Context
The person that reported the error to
ide-php
thought the error was coming fromide-php
but it was coming fromide-html
- it was confusing for us because we assumed the error was withide-php
as well but we couldn't reproduce.Your Environment
ide-html 0.4.1
macOS 10.12.6
n/a
The text was updated successfully, but these errors were encountered: