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

The Markdown Typescript code parser is bailing on a very specific snippet containing generics and a lambda arrow #82400

Closed
ChristianIvicevic opened this issue Oct 11, 2019 · 3 comments
Assignees
Labels
markdown Markdown support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)

Comments

@ChristianIvicevic
Copy link

ChristianIvicevic commented Oct 11, 2019

  • VSCode Version: 1.39.1
  • OS Version: Windows x64 10.0.17763

Steps to Reproduce:

  1. Create a new Markdown file
  2. Add the following snippet
```typescript
const array = [1, 2, 3].reduce<number[]>((acc, next) => [...acc, next], []);
//                             ~~~~~~~~
// Type of the initial value, in our case making it an array of numbers.
```

Doing so will make the formatter bail and the comment below won't be recognized as a comment:

image

However when removing the arrowhead of the lambda it works as expected:

image

Does this issue occur when all extensions are disabled?: Yes

@mjbvz mjbvz self-assigned this Oct 13, 2019
@mjbvz
Copy link
Collaborator

mjbvz commented Oct 13, 2019

This is in the markdown preview, correct? The highlighter in the markdown preview uses highlightjs by default.

Please file an issue against that project: https://github.com/highlightjs/highlight.js

@mjbvz mjbvz closed this as completed Oct 13, 2019
@mjbvz mjbvz added markdown Markdown support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code) labels Oct 13, 2019
@ChristianIvicevic
Copy link
Author

@mjbvz Alright, thanks for pointing me in the right direction. On a slightly different "off"topic, I stumbled upon highlightjs myself yesterday since I am moving from Markdown to Asciidoc and noticed their Typescript highlighting isn't too advanced yet (only keywords, built ins, strings and numbers are highlighted, no members, function invocations, parameters or 3rd party types) in comparison to Githubs Markdown highlighting. Let's see whether I can contribute there to improve upon that a bit.

@ChristianIvicevic
Copy link
Author

Here is the new issue for anybody noticing the same problems: highlightjs/highlight.js#2189

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
markdown Markdown support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests

2 participants