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

Bug: Unhandled token error if angular pipe has a parameter #70

Closed
valera33 opened this issue Feb 10, 2020 · 5 comments · Fixed by #71
Closed

Bug: Unhandled token error if angular pipe has a parameter #70

valera33 opened this issue Feb 10, 2020 · 5 comments · Fixed by #71
Assignees
Labels
type: bug Functionality that does not work as intended/expected

Comments

@valera33
Copy link

Info

Tool Version
Plugin v1.1.6
Prettier v1.19.1
Node v13.6.0
OS linux

Input

div
  | {{'foo' | baz:bar}}

Output or Error

Error: Unhandled token: {"type":"text","loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":24}},"val":"{{'foo' | baz:bar}}"}
[error]     at PugPrinter.build (/home/valeri/workspaceA4/notices/node_modules/@prettier/plugin-pug/dist/printer.js:77:23)
[error]     at Object.print (/home/valeri/workspaceA4/notices/node_modules/@prettier/plugin-pug/dist/index.js:63:40)
[error]     at callPluginPrintFunction (/home/valeri/workspaceA4/notices/node_modules/prettier/bin-prettier.js:12988:18)
[error]     at /home/valeri/workspaceA4/notices/node_modules/prettier/bin-prettier.js:12939:16
[error]     at Object.printComments (/home/valeri/workspaceA4/notices/node_modules/prettier/bin-prettier.js:12660:17)
[error]     at printGenerically (/home/valeri/workspaceA4/notices/node_modules/prettier/bin-prettier.js:12938:22)
[error]     at printAstToDoc (/home/valeri/workspaceA4/notices/node_modules/prettier/bin-prettier.js:12950:13)
[error]     at coreFormat (/home/valeri/workspaceA4/notices/node_modules/prettier/bin-prettier.js:13271:13)
[error]     at format (/home/valeri/workspaceA4/notices/node_modules/prettier/bin-prettier.js:13516:73)
[error]     at formatWithCursor (/home/valeri/workspaceA4/notices/node_modules/prettier/bin-prettier.js:13532:12)

Expected Output

div
  | {{'foo' | baz:bar}}

Additional Context

@Shinigami92 Shinigami92 self-assigned this Feb 10, 2020
@Shinigami92 Shinigami92 added the type: bug Functionality that does not work as intended/expected label Feb 10, 2020
@Shinigami92
Copy link
Member

I will try my best, but let me tell you thats not that easy:

| {{ `"${`Jean ${'"John"'} d'Arc`.toUpperCase()}"` }}

😆

@Shinigami92
Copy link
Member

This fix needs a bit more brain... will target it on weekend

@Shinigami92
Copy link
Member

Referencing #9

@Shinigami92
Copy link
Member

Have released a v1.1.8
Please report me any issues if there are some
Otherwise I can close this issue

@valera33
Copy link
Author

Looks good, we can close the issue, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Functionality that does not work as intended/expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants