-
Notifications
You must be signed in to change notification settings - Fork 235
Optional chaining not supported in embedded script #640
Optional chaining not supported in embedded script #640
Comments
The latest Stable version is 1.34.0; can you see if the issue occurs on that? |
@Aerijo I'm now on 1.34.0 and the issue still occurs. |
I understand that it is still just a proposal, but since it is now supported by Babel and more and more people are using it, it would be great that Atom supports it as well. Moreover, I am unfortunately not familiar with debugging Atom and I don't fully understand your explanation about TextMate grammar (how do you "inspect the tree"?). |
That PR was closed, not merged. Optional chaining is not supported yet. |
For other things in early stages, we've established that knowing what version of ECMAScript this would land in is our bar of inclusion e.g. see #588 (which was for a stage 3 proposal, looks like optional chaining is earlier at stage 1). Edit: this is also not parsed by Tree-sitter so https://github.com/tree-sitter/tree-sitter-javascript would also need to be updated |
Now Optional-Chaining is at Stage 4, TypeScript 3.7 has been officially added, and I hope to add support for him in the future |
Any updates? |
It has been over a year since this ticket was opened. Any updates or timeline yet? |
I agree, I'd love to see a resolution to this issue. |
bump |
Any updates? |
Do we have any updates here? |
Bumping for updates. Also is there a package that enables this in the meantime? |
Mostly I run into this issue when I'm styling a single file Vue component. After months of being annoyed it finally occurred to me that I can side step this issue by moving my |
@mattgrosso I've just overcome the issue by installing language-babel. This comes with the support of the latest ECMA features. |
Thank you! That did the trick. |
Using language-babel instead of language-javascript is not a solution of course and language-babel doesn't work with tree-sitter. |
I think #686 would theoretically work if you deselect "use tree sitters" in settings, and downgrade the tree-sitter version to 12. Currently the tree-sitter fixes don't work, but the non-tree-sitter parser does work. Currently the pr is blocked and I'm not working on it. |
Prerequisites
Description
Optional chaining is currently supported in Javascript files, but not in embedded script (
<script>
tag in HTML). It is currently treated as a ternary operator which breaks the detection of the closing tag</script>
since a colon is expected.I first reported the issue to
language-vue
to finally realized it was the case for all embedded scripts:hedefalk/atom-vue#97
Steps to Reproduce
<script>
tag, use the optional chaining operator (i.e.window.test?.something
)Expected behavior: Closing script tag detected
Actual behavior: Closing script tag not detected
Reproduces how often: Always
Versions
Atom:
1.32.2upgraded to 1.34.0OS: macOS Mojave version 10.14.3 (18D109)
The text was updated successfully, but these errors were encountered: