Closed rsese closed 6 years ago
trying to find the root cause of this...
NOTE: whenever we have question mark ?
in the tag it generates error
the following file has no error until adding a ?
in some tag
<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 https://github.com/atom/atom-languageclient/commit/aac3505dd5109809f6fe9a4bc025589e35dc23de
... try and deal with this inside atom-languageclient although the best solution is having language server itself fixed.
@damieng huge thanks for this workaround! 💯 Will upgrade atom-languageclient when this feature is released (probably v0.9.0)
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 :+1: Thanks @liuderchi :v:
LGTM. Will close this. Thank you guys 💯
Description
Reported in https://github.com/atom/ide-php/issues/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